Commit 696063c7 by 陈超

A

parent 62fc461b
......@@ -327,7 +327,7 @@
<div class="testPaperTop box">
<p class="testPaperTop_time flex1">00:09:54</p>
<span class="testPaperTop_da">答题卡</span>
<img class="testPaperTop_pau" src="__THEME__/img/pau.png">
<img @click="onCounting" class="testPaperTop_pau" :src="counting ? '__THEME__/img/pau.png' : '__THEME__/img/right_arrow.png'">
</div>
<div class="testPaperBotm">
<div class="box">
......@@ -369,21 +369,21 @@
</div>
</div>
<!-- 交卷 -->
<div class="mask" style="display: none;">
<div class="mask" v-if="showFinish">
<div class="popUp">
<p class="popUp_title">提示</p>
<div class="popUp_content">是否交卷并退出考试?</div>
<div class="popUp_btns box">
<span class="popUp_btn popUp_btn0 flex1">取消</span>
<span class="popUp_btn popUp_btn1 flex1">确定</span>
<span @click="onCancel" class="popUp_btn popUp_btn0 flex1">取消</span>
<span @click="onSure" class="popUp_btn popUp_btn1 flex1">确定</span>
</div>
</div>
</div>
<!-- 暂停 -->
<div class="mask" style="display: none;">
<div class="mask" v-if="showPause">
<div class="stopBox">
<span class="stopBtn stopBtn_on">继续</span>
<span class="stopBtn stopBtn_out">退出</span>
<span @click="onContinue" class="stopBtn stopBtn_on">继续</span>
<span @click="onQuit" class="stopBtn stopBtn_out">退出</span>
</div>
</div>
......@@ -400,8 +400,12 @@
temp: {},
current: 1,
paperOptions: {},
counting: true,
countDown: "00:00:00",
timeConsumed: 0,
expand: false,
showPause: false,
showFinish: false,
//选项
currentOptions: [],
finished: []
......@@ -521,17 +525,29 @@
recordData: function() {
return {
paperId: this.info.exams_paper_id,
timeConsumed: 1,
timeConsumed: this.timeConsumed,
questionIndex: this.current,
finished: this.finished
}
},
countDown: function() {
let time = 1
let hours = Math.floor(time / 3600)
let minutes = Math.floor((time % 3600) / 60)
let seconds = Math.round(time % 60)
doCountDown: function() {
if(!this.counting) {
return
}
if(this.info.reply_time) {
let time = this.info.reply_time * 60 - this.timeConsumed
if(time <= 0) {
} else {
let hours = Math.floor(time / 3600)
let minutes = Math.floor((time % 3600) / 60)
let seconds = Math.round(time % 60)
this.countDown = hours + ":" + minutes + ":" + seconds
setTimeout(this.doCountDown, 1000)
}
} else {
this.countDown = "不限时"
}
},
onCollect: function(collect) {
let that = this
......@@ -552,6 +568,31 @@
})
}
},
onCounting: function() {
if(this.counting) {
this.counting = false
this.showPause = true
} else {
this.counting = true
this.doCountDown()
}
},
onContinue: function() {
this.showPause = false
this.onCounting()
},
onQuit: function() {
this.showPause = false
this.saveProgress()
},
onCancel: function() {
this.showFinish = false
window.history.back()
},
onSure: function() {
this.showFinish = false
this.submitPaper()
},
onNextQuestion: function() {
if(this.current < this.totalQuestion) {
this.cacheQuestion()
......@@ -594,6 +635,13 @@
break
}
}
},
//Request
saveProgress: function() {
},
submitPaper: function() {
}
}
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment