|
@@ -16,7 +16,7 @@
|
|
style="background-color: #f0eff0; position: fixed;top: 20px;right: 20px;width: 20px;height: 20px;line-height:1;color: #000000;"
|
|
style="background-color: #f0eff0; position: fixed;top: 20px;right: 20px;width: 20px;height: 20px;line-height:1;color: #000000;"
|
|
@click="reload">҉</button>
|
|
@click="reload">҉</button>
|
|
<uni-row>
|
|
<uni-row>
|
|
- <uni-col :span="4" style="margin-top: 30px">
|
|
|
|
|
|
+ <uni-col :span="windowSize[0]" style="margin-top: 30px">
|
|
<uni-card style="height: 85vh;">
|
|
<uni-card style="height: 85vh;">
|
|
<l-divider color="#00a60d">
|
|
<l-divider color="#00a60d">
|
|
<view style="font-size: 2vmin;">考生信息</view>
|
|
<view style="font-size: 2vmin;">考生信息</view>
|
|
@@ -50,16 +50,14 @@
|
|
</uni-card>
|
|
</uni-card>
|
|
|
|
|
|
</uni-col>
|
|
</uni-col>
|
|
- <uni-col :span="16" style="margin-top: 30px">
|
|
|
|
|
|
+ <uni-col :span="windowSize[1]" style="margin-top: 30px">
|
|
<uni-card style="height: 85vh;">
|
|
<uni-card style="height: 85vh;">
|
|
<scroll-view scroll-y="true" scroll-x="true" class="scroll-Y">
|
|
<scroll-view scroll-y="true" scroll-x="true" class="scroll-Y">
|
|
<uni-section :title="scantron.questionIndex+'、'+scantron.questionTypeName" type="line" padding>
|
|
<uni-section :title="scantron.questionIndex+'、'+scantron.questionTypeName" type="line" padding>
|
|
- <view v-if="scantron.questionType!==7&&scantron.questionType!==8" id="scantronNodes"
|
|
|
|
- style="height: 45vh;">
|
|
|
|
- </view>
|
|
|
|
- <view v-if="scantron.questionType==7||scantron.questionType==8" id="scantronNodes"
|
|
|
|
- style="height: 5vh;">
|
|
|
|
|
|
+ <view id="scantronNodes"
|
|
|
|
+ >
|
|
</view>
|
|
</view>
|
|
|
|
+
|
|
<template v-if="scantron.questionType===1||scantron.questionType===3">
|
|
<template v-if="scantron.questionType===1||scantron.questionType===3">
|
|
|
|
|
|
<view>
|
|
<view>
|
|
@@ -281,11 +279,11 @@
|
|
|
|
|
|
<view>
|
|
<view>
|
|
<view
|
|
<view
|
|
- style="height: 600px;width: 800px;background-color: #8c8c8c;margin: auto;padding-top: 50px;">
|
|
|
|
|
|
+ style="height: 800px;width: 800px;background-color: #8c8c8c;margin: auto;padding-top: 50px;">
|
|
|
|
|
|
<movable-area
|
|
<movable-area
|
|
- style="height: 550px;width: 700px;background-color: #f6f6f6;margin: auto;">
|
|
|
|
- <canvas canvas-id="lineCanvas" style="width: 700px; height: 500px;">
|
|
|
|
|
|
+ style="height: 700px;width: 700px;background-color: #f6f6f6;margin: auto;">
|
|
|
|
+ <canvas canvas-id="lineCanvas" style="width: 700px; height: 750px;">
|
|
<template v-for="(item,index) in connectionHtml">
|
|
<template v-for="(item,index) in connectionHtml">
|
|
<view
|
|
<view
|
|
style="display: inline-block;margin-top: 30px;margin-left: 30px;margin-right: 70px;">
|
|
style="display: inline-block;margin-top: 30px;margin-left: 30px;margin-right: 70px;">
|
|
@@ -306,7 +304,7 @@
|
|
</scroll-view>
|
|
</scroll-view>
|
|
</uni-card>
|
|
</uni-card>
|
|
</uni-col>
|
|
</uni-col>
|
|
- <uni-col :span="4" style="margin-top: 30px">
|
|
|
|
|
|
+ <uni-col :span="windowSize[2]" style="margin-top: 30px">
|
|
<uni-card style="height: 85vh;">
|
|
<uni-card style="height: 85vh;">
|
|
|
|
|
|
<l-divider color="#8f960c" style="margin-top: 2%;">
|
|
<l-divider color="#8f960c" style="margin-top: 2%;">
|
|
@@ -388,6 +386,14 @@
|
|
</view>
|
|
</view>
|
|
</uni-popup-dialog>
|
|
</uni-popup-dialog>
|
|
</uni-popup>
|
|
</uni-popup>
|
|
|
|
+ <uni-popup ref="imgsss" type="dialog" >
|
|
|
|
+ <uni-popup-dialog ref="inputClose" title="图片放大" style="width: 80vh;">
|
|
|
|
+ <scroll-view style="height: 70vh;width: 80vh;" scroll-y="true" scroll-x="true" class="scroll-Y">
|
|
|
|
+
|
|
|
|
+ <img :src="imgsrc" style="height: 70vh;" alt="图片" />
|
|
|
|
+ </scroll-view>
|
|
|
|
+ </uni-popup-dialog>
|
|
|
|
+ </uni-popup>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
@@ -471,24 +477,16 @@
|
|
// 消息弹窗记录=================
|
|
// 消息弹窗记录=================
|
|
msgType: 'success',
|
|
msgType: 'success',
|
|
messageText: '这是一条成功提示',
|
|
messageText: '这是一条成功提示',
|
|
|
|
+ imgsrc: '',
|
|
|
|
+ dbclick: '',
|
|
|
|
+ // 屏幕大小
|
|
|
|
+ windowSize:[4,16,4]
|
|
};
|
|
};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
// 页面刷新
|
|
// 页面刷新
|
|
reload() {
|
|
reload() {
|
|
- cacheExamAnswer({
|
|
|
|
- 'examAnswers': this.userExamAnswers,
|
|
|
|
- 'userExamId': sessionStorage.getItem('examId'),
|
|
|
|
- 'leaveTime': this.windowCheat,
|
|
|
|
- 'paperId': this.userExamPaper.paperId,
|
|
|
|
- 'limitTime': this.userExamPaper.limitTime
|
|
|
|
- }).then(data => {
|
|
|
|
- console.log(data);
|
|
|
|
-
|
|
|
|
- window.location.reload()
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- })
|
|
|
|
|
|
+ this.cacheAnswer(0)
|
|
},
|
|
},
|
|
// 消息提示
|
|
// 消息提示
|
|
messageToggle(type, message) {
|
|
messageToggle(type, message) {
|
|
@@ -515,8 +513,12 @@
|
|
}).then(data => {
|
|
}).then(data => {
|
|
if (data.data.result !== null && data.data.success) {
|
|
if (data.data.result !== null && data.data.success) {
|
|
if (ins !== 0 && ins !== 'cheat') {
|
|
if (ins !== 0 && ins !== 'cheat') {
|
|
|
|
+ this.drag=[]
|
|
|
|
+ this.connectionInfo=[]
|
|
|
|
+ this.connectionContentALL=[]
|
|
this.messageToggle('success', "本试卷提交成功,即将开始下一张试卷······")
|
|
this.messageToggle('success', "本试卷提交成功,即将开始下一张试卷······")
|
|
}
|
|
}
|
|
|
|
+
|
|
this.userExamAnswers = []
|
|
this.userExamAnswers = []
|
|
clearInterval(this.intervalId);
|
|
clearInterval(this.intervalId);
|
|
this.examObject = data.data.result
|
|
this.examObject = data.data.result
|
|
@@ -529,6 +531,8 @@
|
|
this.papersTime = this.examPapersTime()
|
|
this.papersTime = this.examPapersTime()
|
|
this.intervalId = setInterval(this.updateCountDown, 1000);
|
|
this.intervalId = setInterval(this.updateCountDown, 1000);
|
|
this.examTime = this.paperTime
|
|
this.examTime = this.paperTime
|
|
|
|
+ this.radioScantron(this.scantron.questionIndex)
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
if (ins === 'cheat') {
|
|
if (ins === 'cheat') {
|
|
this.messageToggle('error', "多次切屏,考试强行终止")
|
|
this.messageToggle('error', "多次切屏,考试强行终止")
|
|
@@ -541,11 +545,14 @@
|
|
screenfull.exit();
|
|
screenfull.exit();
|
|
window.removeEventListener('blur', this.handleBlur);
|
|
window.removeEventListener('blur', this.handleBlur);
|
|
window.removeEventListener('focus', this.handleFocus);
|
|
window.removeEventListener('focus', this.handleFocus);
|
|
|
|
+ document.getElementById("body").removeEventListener('dblclick',this.dbclick)
|
|
|
|
+
|
|
exit()
|
|
exit()
|
|
}, 2000)
|
|
}, 2000)
|
|
}
|
|
}
|
|
if (data.data.result !== null && data.data.success && ins === 'cheat') {
|
|
if (data.data.result !== null && data.data.success && ins === 'cheat') {
|
|
- this.handleBlur(0)
|
|
|
|
|
|
+
|
|
|
|
+ this.handleFocus(0)
|
|
}
|
|
}
|
|
|
|
|
|
})
|
|
})
|
|
@@ -619,19 +626,19 @@
|
|
radioScantron(value) {
|
|
radioScantron(value) {
|
|
screenfull.request()
|
|
screenfull.request()
|
|
this.scantron = this.examObject.userExamQuestionList[value - 1]
|
|
this.scantron = this.examObject.userExamQuestionList[value - 1]
|
|
|
|
+ setTimeout(() => {
|
|
if (this.scantron.questionType !== 7 && this.scantron.questionType !== 8) {
|
|
if (this.scantron.questionType !== 7 && this.scantron.questionType !== 8) {
|
|
document.getElementById('scantronNodes').innerHTML = this.scantron.question.content
|
|
document.getElementById('scantronNodes').innerHTML = this.scantron.question.content
|
|
} else {
|
|
} else {
|
|
- console.log(this.scantron.question.content.split('%||||||||%')[0]);
|
|
|
|
document.getElementById('scantronNodes').innerHTML = this.scantron.question.content.split(
|
|
document.getElementById('scantronNodes').innerHTML = this.scantron.question.content.split(
|
|
'%||||||||%')[0]
|
|
'%||||||||%')[0]
|
|
}
|
|
}
|
|
|
|
+ }, 10)
|
|
|
|
|
|
let combination = setInterval(() => {
|
|
let combination = setInterval(() => {
|
|
if (this.scantron.questionType == 6) {
|
|
if (this.scantron.questionType == 6) {
|
|
for (var i = 0; i < this.scantron.subQuestionList.length; i++) {
|
|
for (var i = 0; i < this.scantron.subQuestionList.length; i++) {
|
|
if (document.getElementById('combinationItemNodes' + i) === null) {
|
|
if (document.getElementById('combinationItemNodes' + i) === null) {
|
|
- console.log("加载中");
|
|
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
document.getElementById('combinationItemNodes' + i).innerHTML = this.scantron
|
|
document.getElementById('combinationItemNodes' + i).innerHTML = this.scantron
|
|
@@ -640,19 +647,11 @@
|
|
clearInterval(combination);
|
|
clearInterval(combination);
|
|
}
|
|
}
|
|
}, 10)
|
|
}, 10)
|
|
- cacheExamAnswer({
|
|
|
|
- 'examAnswers': this.userExamAnswers,
|
|
|
|
- 'userExamId': sessionStorage.getItem('examId'),
|
|
|
|
- 'leaveTime': this.windowCheat,
|
|
|
|
- 'paperId': this.userExamPaper.paperId,
|
|
|
|
- 'limitTime': this.userExamPaper.limitTime
|
|
|
|
- })
|
|
|
|
|
|
+ this.cacheAnswer()
|
|
// 拖拽加载
|
|
// 拖拽加载
|
|
if (this.scantron.questionType == 7) {
|
|
if (this.scantron.questionType == 7) {
|
|
this.mbvShow = !this.mbvShow
|
|
this.mbvShow = !this.mbvShow
|
|
this.disabledDrag = true
|
|
this.disabledDrag = true
|
|
- console.log(this.drag[8]);
|
|
|
|
- console.log(this.scantron.questionIndex);
|
|
|
|
if (this.drag[Number(this.scantron.questionIndex)] !== undefined) {
|
|
if (this.drag[Number(this.scantron.questionIndex)] !== undefined) {
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
for (var i = 0; i < this.drag[this.scantron.questionIndex].option.length; i++) {
|
|
for (var i = 0; i < this.drag[this.scantron.questionIndex].option.length; i++) {
|
|
@@ -710,13 +709,14 @@
|
|
}
|
|
}
|
|
if (content.children[i].tagName === 'IMG') {
|
|
if (content.children[i].tagName === 'IMG') {
|
|
this.drag[this.scantron.questionIndex].background.url = content.children[i].src
|
|
this.drag[this.scantron.questionIndex].background.url = content.children[i].src
|
|
- this.drag[this.scantron.questionIndex].background.width = content.children[i].style.width.toString()
|
|
|
|
|
|
+ this.drag[this.scantron.questionIndex].background.width = content.children[i].style.width
|
|
|
|
+ .toString()
|
|
.replace("px", "")
|
|
.replace("px", "")
|
|
- this.drag[this.scantron.questionIndex].background.height = content.children[i].style.height.toString()
|
|
|
|
|
|
+ this.drag[this.scantron.questionIndex].background.height = content.children[i].style.height
|
|
|
|
+ .toString()
|
|
.replace("px", "")
|
|
.replace("px", "")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- console.log(this.drag[this.scantron.questionIndex].option.length);
|
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
for (var i = 0; i < this.drag[this.scantron.questionIndex].option.length; i++) {
|
|
for (var i = 0; i < this.drag[this.scantron.questionIndex].option.length; i++) {
|
|
let drags = this.drag[this.scantron.questionIndex].option[i]
|
|
let drags = this.drag[this.scantron.questionIndex].option[i]
|
|
@@ -737,7 +737,6 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
if (this.connectionContentALL[value] === undefined) {
|
|
if (this.connectionContentALL[value] === undefined) {
|
|
this.connectionContentALL[value] = []
|
|
this.connectionContentALL[value] = []
|
|
}
|
|
}
|
|
@@ -769,8 +768,9 @@
|
|
.offsetHeight / 2)
|
|
.offsetHeight / 2)
|
|
if (this.connectionInfo.length === this.connectionHtml.length &&
|
|
if (this.connectionInfo.length === this.connectionHtml.length &&
|
|
colId === 0) {
|
|
colId === 0) {
|
|
-
|
|
|
|
- this.connectionContentALL[this.scantron.questionIndex].push(this
|
|
|
|
|
|
+
|
|
|
|
+ this.connectionContentALL[this.scantron.questionIndex].push(
|
|
|
|
+ this
|
|
.connectionInfo)
|
|
.connectionInfo)
|
|
this.radioAdd(this.connectionInfo, this
|
|
this.radioAdd(this.connectionInfo, this
|
|
.connectionInfo[0].id.replace('option', '').split('-')[
|
|
.connectionInfo[0].id.replace('option', '').split('-')[
|
|
@@ -781,11 +781,14 @@
|
|
console.log(this.connectionContentALL);
|
|
console.log(this.connectionContentALL);
|
|
console.log(this.scantron.questionIndex);
|
|
console.log(this.scantron.questionIndex);
|
|
let arr = []
|
|
let arr = []
|
|
- for (var i = 0; i < this.connectionContentALL[this.scantron.questionIndex]
|
|
|
|
|
|
+ for (var i = 0; i < this.connectionContentALL[this.scantron
|
|
|
|
+ .questionIndex]
|
|
.length; i++) {
|
|
.length; i++) {
|
|
- let all = this.connectionContentALL[this.scantron.questionIndex][i]
|
|
|
|
|
|
+ let all = this.connectionContentALL[this.scantron
|
|
|
|
+ .questionIndex][i]
|
|
if (all[0].id !== id) {
|
|
if (all[0].id !== id) {
|
|
- arr.push(this.connectionContentALL[this.scantron.questionIndex][i])
|
|
|
|
|
|
+ arr.push(this.connectionContentALL[this.scantron
|
|
|
|
+ .questionIndex][i])
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.connectionContentALL[this.scantron.questionIndex] = arr
|
|
this.connectionContentALL[this.scantron.questionIndex] = arr
|
|
@@ -823,9 +826,11 @@
|
|
'-')[1]) === rowId &&
|
|
'-')[1]) === rowId &&
|
|
this.connectionInfo.length === this.connectionHtml
|
|
this.connectionInfo.length === this.connectionHtml
|
|
.length) {
|
|
.length) {
|
|
- this.connectionContentALL[this.scantron.questionIndex].push(
|
|
|
|
|
|
+ this.connectionContentALL[this.scantron
|
|
|
|
+ .questionIndex].push(
|
|
this.connectionInfo)
|
|
this.connectionInfo)
|
|
- console.log(this.connectionContentALL[this.scantron.questionIndex]);
|
|
|
|
|
|
+ console.log(this.connectionContentALL[this.scantron
|
|
|
|
+ .questionIndex]);
|
|
this.radioAdd(this.connectionInfo, this
|
|
this.radioAdd(this.connectionInfo, this
|
|
.connectionInfo[0].id.replace('option', '')
|
|
.connectionInfo[0].id.replace('option', '')
|
|
.split('-')[1], this.scantron)
|
|
.split('-')[1], this.scantron)
|
|
@@ -833,9 +838,10 @@
|
|
}
|
|
}
|
|
} else if (colId === this.connectionHtml.length - 1) {
|
|
} else if (colId === this.connectionHtml.length - 1) {
|
|
|
|
|
|
- this.connectionContentALL[this.scantron.questionIndex].push(
|
|
|
|
- this.connectionInfo)
|
|
|
|
-
|
|
|
|
|
|
+ this.connectionContentALL[this.scantron.questionIndex]
|
|
|
|
+ .push(
|
|
|
|
+ this.connectionInfo)
|
|
|
|
+
|
|
this.radioAdd(this.connectionInfo, this
|
|
this.radioAdd(this.connectionInfo, this
|
|
.connectionInfo[0].id.replace('option', '')
|
|
.connectionInfo[0].id.replace('option', '')
|
|
.split('-')[1], this.scantron)
|
|
.split('-')[1], this.scantron)
|
|
@@ -875,6 +881,8 @@
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
},
|
|
},
|
|
// 连线绘制
|
|
// 连线绘制
|
|
drawLine(x1, y1, x2, y2, index) {
|
|
drawLine(x1, y1, x2, y2, index) {
|
|
@@ -907,7 +915,7 @@
|
|
clearRect() {
|
|
clearRect() {
|
|
const canvas = uni.createCanvasContext('lineCanvas');
|
|
const canvas = uni.createCanvasContext('lineCanvas');
|
|
// 使用clearRect方法清空整个画布
|
|
// 使用clearRect方法清空整个画布
|
|
- canvas.clearRect(0, 0, 700, 500); // 这里的300x300是画布的宽高,应该与你的实际画布尺寸相匹配
|
|
|
|
|
|
+ canvas.clearRect(0, 0, 700, 700); // 这里的300x300是画布的宽高,应该与你的实际画布尺寸相匹配
|
|
canvas.draw(true); // 调用draw方法将清空操作应用到画布上
|
|
canvas.draw(true); // 调用draw方法将清空操作应用到画布上
|
|
},
|
|
},
|
|
// 阴影清理
|
|
// 阴影清理
|
|
@@ -980,8 +988,10 @@
|
|
tap(index, subX, subY) {
|
|
tap(index, subX, subY) {
|
|
let x = subX
|
|
let x = subX
|
|
let y = subY
|
|
let y = subY
|
|
- this.drag[this.scantron.questionIndex].option[index].x = this.drag[this.scantron.questionIndex].option[index].old.x
|
|
|
|
- this.drag[this.scantron.questionIndex].option[index].y = this.drag[this.scantron.questionIndex].option[index].old.y
|
|
|
|
|
|
+ this.drag[this.scantron.questionIndex].option[index].x = this.drag[this.scantron.questionIndex].option[
|
|
|
|
+ index].old.x
|
|
|
|
+ this.drag[this.scantron.questionIndex].option[index].y = this.drag[this.scantron.questionIndex].option[
|
|
|
|
+ index].old.y
|
|
this.$nextTick(function() {
|
|
this.$nextTick(function() {
|
|
this.drag[this.scantron.questionIndex].option[index].x = x
|
|
this.drag[this.scantron.questionIndex].option[index].x = x
|
|
this.drag[this.scantron.questionIndex].option[index].y = y
|
|
this.drag[this.scantron.questionIndex].option[index].y = y
|
|
@@ -989,7 +999,6 @@
|
|
},
|
|
},
|
|
// 鼠标按下
|
|
// 鼠标按下
|
|
onMousedown(item) {
|
|
onMousedown(item) {
|
|
- console.log(this.drag[this.scantron.questionIndex].option.length);
|
|
|
|
this.dragItem = item;
|
|
this.dragItem = item;
|
|
},
|
|
},
|
|
// 拖动监听
|
|
// 拖动监听
|
|
@@ -1020,25 +1029,32 @@
|
|
let x = drag.x
|
|
let x = drag.x
|
|
let y = drag.y
|
|
let y = drag.y
|
|
if (
|
|
if (
|
|
- (Number(this.drag[this.scantron.questionIndex].option[index].old.x) <= (Number(drag.x) + Number(
|
|
|
|
- drag
|
|
|
|
- .width))) &&
|
|
|
|
- (Number(this.drag[this.scantron.questionIndex].option[index].old.x) + Number(this.drag[this.scantron.questionIndex].option[index]
|
|
|
|
|
|
+ (Number(this.drag[this.scantron.questionIndex].option[index].old.x) <= (Number(drag
|
|
|
|
+ .x) + Number(
|
|
|
|
+ drag
|
|
|
|
+ .width))) &&
|
|
|
|
+ (Number(this.drag[this.scantron.questionIndex].option[index].old.x) + Number(this.drag[
|
|
|
|
+ this.scantron.questionIndex].option[index]
|
|
.width)) >= drag.x &&
|
|
.width)) >= drag.x &&
|
|
- (Number(this.drag[this.scantron.questionIndex].option[index].old.y) <= (Number(drag.y) + Number(
|
|
|
|
- drag
|
|
|
|
- .height))) &&
|
|
|
|
- (Number(this.drag[this.scantron.questionIndex].option[index].old.y) + Number(this.drag[this.scantron.questionIndex].option[index]
|
|
|
|
|
|
+ (Number(this.drag[this.scantron.questionIndex].option[index].old.y) <= (Number(drag
|
|
|
|
+ .y) + Number(
|
|
|
|
+ drag
|
|
|
|
+ .height))) &&
|
|
|
|
+ (Number(this.drag[this.scantron.questionIndex].option[index].old.y) + Number(this.drag[
|
|
|
|
+ this.scantron.questionIndex].option[index]
|
|
.height)) >= drag.y
|
|
.height)) >= drag.y
|
|
) {
|
|
) {
|
|
for (var p = 0; p < this.drag[this.scantron.questionIndex].answer.length; p++) {
|
|
for (var p = 0; p < this.drag[this.scantron.questionIndex].answer.length; p++) {
|
|
- if (this.drag[this.scantron.questionIndex].answer[p].op !== undefined && this.drag[this.scantron.questionIndex].answer[p].op === index) {
|
|
|
|
|
|
+ if (this.drag[this.scantron.questionIndex].answer[p].op !== undefined && this.drag[
|
|
|
|
+ this.scantron.questionIndex].answer[p].op === index) {
|
|
this.drag[this.scantron.questionIndex].answer[p].op = undefined
|
|
this.drag[this.scantron.questionIndex].answer[p].op = undefined
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (this.drag[this.scantron.questionIndex].answer[i].op !== undefined) {
|
|
if (this.drag[this.scantron.questionIndex].answer[i].op !== undefined) {
|
|
- this.tap(this.drag[this.scantron.questionIndex].answer[i].op, this.drag[this.scantron.questionIndex]
|
|
|
|
- .option[this.drag[this.scantron.questionIndex].answer[i].op].old.ax, this.drag[this.scantron.questionIndex]
|
|
|
|
|
|
+ this.tap(this.drag[this.scantron.questionIndex].answer[i].op, this.drag[this
|
|
|
|
+ .scantron.questionIndex]
|
|
|
|
+ .option[this.drag[this.scantron.questionIndex].answer[i].op].old.ax, this
|
|
|
|
+ .drag[this.scantron.questionIndex]
|
|
.option[this.drag[this.scantron.questionIndex].answer[i].op].old.by);
|
|
.option[this.drag[this.scantron.questionIndex].answer[i].op].old.by);
|
|
this.drag[this.scantron.questionIndex].answer[i].op = index
|
|
this.drag[this.scantron.questionIndex].answer[i].op = index
|
|
} else {
|
|
} else {
|
|
@@ -1052,7 +1068,8 @@
|
|
}
|
|
}
|
|
// console.log(this.drag[this.scantron.questionIndex].option[index]);
|
|
// console.log(this.drag[this.scantron.questionIndex].option[index]);
|
|
if (bxs) {
|
|
if (bxs) {
|
|
- this.tap(index, this.drag[this.scantron.questionIndex].option[index].old.ax, this.drag[this.scantron.questionIndex].option[index].old.by);
|
|
|
|
|
|
+ this.tap(index, this.drag[this.scantron.questionIndex].option[index].old.ax, this.drag[this
|
|
|
|
+ .scantron.questionIndex].option[index].old.by);
|
|
}
|
|
}
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
if (dragOne !== undefined) {
|
|
if (dragOne !== undefined) {
|
|
@@ -1061,7 +1078,6 @@
|
|
this.disabledDrag = true
|
|
this.disabledDrag = true
|
|
}, 700)
|
|
}, 700)
|
|
}
|
|
}
|
|
-
|
|
|
|
// if (this.drag[this.scantron.questionIndex].option[index].b) {
|
|
// if (this.drag[this.scantron.questionIndex].option[index].b) {
|
|
// this.drag[this.scantron.questionIndex].option[index].b = false
|
|
// this.drag[this.scantron.questionIndex].option[index].b = false
|
|
document.addEventListener('mouseup', asda);
|
|
document.addEventListener('mouseup', asda);
|
|
@@ -1072,7 +1088,6 @@
|
|
answerDisplay(data) {
|
|
answerDisplay(data) {
|
|
this.windowCheat = Number(data.leaveTime)
|
|
this.windowCheat = Number(data.leaveTime)
|
|
this.userExamAnswers = data.examAnswers
|
|
this.userExamAnswers = data.examAnswers
|
|
-
|
|
|
|
let examAnswers = data.examAnswers
|
|
let examAnswers = data.examAnswers
|
|
for (var i = 0; i < examAnswers.length; i++) {
|
|
for (var i = 0; i < examAnswers.length; i++) {
|
|
let scantron = examAnswers[i]
|
|
let scantron = examAnswers[i]
|
|
@@ -1082,9 +1097,6 @@
|
|
let childIndex = scantron.index.split('.')[1]
|
|
let childIndex = scantron.index.split('.')[1]
|
|
let childSubject = this.examObject.userExamQuestionList[parentIndex - 1].subQuestionList[
|
|
let childSubject = this.examObject.userExamQuestionList[parentIndex - 1].subQuestionList[
|
|
childIndex]
|
|
childIndex]
|
|
-
|
|
|
|
- console.log(childSubject);
|
|
|
|
-
|
|
|
|
} else if (scantron.questionType === 1 || scantron.questionType === 3) {
|
|
} else if (scantron.questionType === 1 || scantron.questionType === 3) {
|
|
console.log(this.examObject.userExamQuestionList[index - 1]);
|
|
console.log(this.examObject.userExamQuestionList[index - 1]);
|
|
this.examObject.userExamQuestionList[index - 1].question.isAnswer = true
|
|
this.examObject.userExamQuestionList[index - 1].question.isAnswer = true
|
|
@@ -1144,7 +1156,6 @@
|
|
}
|
|
}
|
|
this.connectionContentALL[index] = JSON.parse(scantron.coordinates)
|
|
this.connectionContentALL[index] = JSON.parse(scantron.coordinates)
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 题目做答
|
|
// 题目做答
|
|
@@ -1578,37 +1589,31 @@
|
|
this.userExamAnswers = arr
|
|
this.userExamAnswers = arr
|
|
},
|
|
},
|
|
// 失去焦点时的处理函数
|
|
// 失去焦点时的处理函数
|
|
- handleBlur(v) {
|
|
|
|
- console.log("作弊监听启动:"+this.examObject.leaveOn);
|
|
|
|
|
|
+ handleBlur() {
|
|
|
|
+ console.log("作弊监听启动:" + this.examObject.leaveOn);
|
|
if (this.examObject.leaveOn) {
|
|
if (this.examObject.leaveOn) {
|
|
- if (this.windowCheat < 2 && v !== 0) {
|
|
|
|
|
|
+ if (this.windowCheat < 2) {
|
|
this.$refs.cheat.open()
|
|
this.$refs.cheat.open()
|
|
}
|
|
}
|
|
- let leaveCount = this.examObject.totalLeaveTimes
|
|
|
|
let leaveTime = this.examObject.leaveTime
|
|
let leaveTime = this.examObject.leaveTime
|
|
-
|
|
|
|
this.cheat = setInterval(() => {
|
|
this.cheat = setInterval(() => {
|
|
this.windowCheat++
|
|
this.windowCheat++
|
|
- cacheExamAnswer({
|
|
|
|
- 'examAnswers': this.userExamAnswers,
|
|
|
|
- 'userExamId': sessionStorage.getItem('examId'),
|
|
|
|
- 'leaveTime': this.windowCheat,
|
|
|
|
- 'paperId': this.userExamPaper.paperId,
|
|
|
|
- 'limitTime': this.userExamPaper.limitTime
|
|
|
|
- })
|
|
|
|
|
|
+ this.cacheAnswer()
|
|
clearInterval(this.cheat)
|
|
clearInterval(this.cheat)
|
|
}, leaveTime * 1000)
|
|
}, leaveTime * 1000)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
// 获得焦点时的处理函数
|
|
// 获得焦点时的处理函数
|
|
- handleFocus() {
|
|
|
|
|
|
+ handleFocus(v) {
|
|
if (this.examObject.leaveOn) {
|
|
if (this.examObject.leaveOn) {
|
|
clearInterval(this.cheat)
|
|
clearInterval(this.cheat)
|
|
- if (this.windowCheat >= leaveCount) {
|
|
|
|
|
|
+ if (this.windowCheat >= this.examObject.totalLeaveTimes) {
|
|
this.submitExam('cheat')
|
|
this.submitExam('cheat')
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ }
|
|
|
|
+ if(v===0){
|
|
|
|
+ this.submitExam('cheat')
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 时间
|
|
// 时间
|
|
@@ -1667,25 +1672,47 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return time
|
|
return time
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ cacheAnswer(re) {
|
|
|
|
+ cacheExamAnswer({
|
|
|
|
+ 'examAnswers': this.userExamAnswers,
|
|
|
|
+ 'userExamId': sessionStorage.getItem('examId'),
|
|
|
|
+ 'leaveTime': this.windowCheat,
|
|
|
|
+ 'paperId': this.userExamPaper.paperId,
|
|
|
|
+ 'limitTime': this.userExamPaper.limitTime
|
|
|
|
+ }).then(data => {
|
|
|
|
+ console.log(data);
|
|
|
|
+ if (re == 0) {
|
|
|
|
+ window.location.reload()
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ },
|
|
},
|
|
},
|
|
|
|
+
|
|
mounted() {
|
|
mounted() {
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ var element=document.getElementById("body")
|
|
|
|
+ console.log(element);
|
|
|
|
+ var timeout;
|
|
|
|
+ this.dbclick= element.addEventListener('dblclick', (event)=> {
|
|
|
|
+ console.log(event.target.src);
|
|
|
|
+ console.log(event.target.tagName);
|
|
|
|
+ if(event.target.src!==undefined&&event.target.tagName==='IMG'){
|
|
|
|
+ clearTimeout(timeout); // 清除之前的定时器,防止连续点击过快导致多次执行
|
|
|
|
+ timeout = setTimeout(()=> {
|
|
|
|
+ this.imgsrc=event.target.src
|
|
|
|
+ this.$refs.imgsss.open()
|
|
|
|
+ // 执行你的代码
|
|
|
|
+ console.log('Element was double-clicked!');
|
|
|
|
+ }, 300); // 例如,设置300毫秒的延迟
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
window.addEventListener("unload", (e) => {
|
|
window.addEventListener("unload", (e) => {
|
|
e.preventDefault();
|
|
e.preventDefault();
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
- cacheExamAnswer({
|
|
|
|
- 'examAnswers': this.userExamAnswers,
|
|
|
|
- 'userExamId': sessionStorage.getItem('examId'),
|
|
|
|
- 'leaveTime': this.windowCheat,
|
|
|
|
- 'paperId': this.userExamPaper.paperId,
|
|
|
|
- 'limitTime': this.userExamPaper.limitTime
|
|
|
|
- }).then(data => {
|
|
|
|
- console.log(data);
|
|
|
|
- })
|
|
|
|
|
|
+ this.cacheAnswer()
|
|
}, 100)
|
|
}, 100)
|
|
});
|
|
});
|
|
|
|
|
|
@@ -1720,9 +1747,11 @@
|
|
if (answerData.data.result !== null) {
|
|
if (answerData.data.result !== null) {
|
|
this.answerDisplay(answerData.data.result)
|
|
this.answerDisplay(answerData.data.result)
|
|
}
|
|
}
|
|
|
|
+ this.radioScantron(this.scantron.questionIndex)
|
|
})
|
|
})
|
|
|
|
|
|
})
|
|
})
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|