|
|
@ -169,15 +169,15 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
mounted() { |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
this.addLeaveEvent() |
|
|
|
this.addLeaveEvent()// 页面离开的时候询问是否离开 |
|
|
|
this.queryState() |
|
|
|
this.queryState()// 每秒钟调接口查询考试是否被强制交卷 |
|
|
|
}, |
|
|
|
}, |
|
|
|
beforeDestroy(){ |
|
|
|
beforeDestroy(){ |
|
|
|
clearInterval(this.timer) |
|
|
|
clearInterval(this.timer) |
|
|
|
clearInterval(this.queryStateTimer) |
|
|
|
clearInterval(this.queryStateTimer) |
|
|
|
window.onbeforeunload = null |
|
|
|
window.onbeforeunload = null |
|
|
|
window.updateProgress = null |
|
|
|
window.updateProgress = null |
|
|
|
this.addRecords() |
|
|
|
this.addRecords()// 页面离开前提交学生所做答案 |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
getData() { |
|
|
|
getData() { |
|
|
@ -351,8 +351,10 @@ export default { |
|
|
|
e.map((n,k) => { |
|
|
|
e.map((n,k) => { |
|
|
|
let userAnswer = '' |
|
|
|
let userAnswer = '' |
|
|
|
if(i == 1){ |
|
|
|
if(i == 1){ |
|
|
|
|
|
|
|
// 多选题 |
|
|
|
userAnswer = n.val.join('') |
|
|
|
userAnswer = n.val.join('') |
|
|
|
}else if(i == 3){ |
|
|
|
}else if(i == 3){ |
|
|
|
|
|
|
|
// 填空题收集每个空的答案 |
|
|
|
userAnswer = [...document.querySelectorAll(`.stem${i}${k} input`)].map(n => n.value).filter(n => n).join('<>') |
|
|
|
userAnswer = [...document.querySelectorAll(`.stem${i}${k} input`)].map(n => n.value).filter(n => n).join('<>') |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
userAnswer = n.val |
|
|
|
userAnswer = n.val |
|
|
|