mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-10 11:26:43 +08:00
在线课bug修改
This commit is contained in:
@@ -72,7 +72,7 @@
|
||||
</div>
|
||||
<div style="text-align: center; margin-bottom: 15px">
|
||||
<el-button :disabled="curIndex==0" type="primary" @click="prevSub()">上一题</el-button>
|
||||
<el-button type="success" icon="el-icon-check" @click="present()">提 交</el-button>
|
||||
<el-button type="success" icon="el-icon-check" @click="debouncedPresent">提 交</el-button>
|
||||
<el-button :disabled="curIndex>=(total-1)" type="primary" @click="nextSub()">下一题</el-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -408,24 +408,34 @@ export default {
|
||||
this.curIndex++;
|
||||
this.curItem=this.paper.items[this.curIndex];
|
||||
},
|
||||
debounce(func, delay) {
|
||||
let timerId;
|
||||
return function (...args) {
|
||||
if (timerId) clearTimeout(timerId);
|
||||
timerId = setTimeout(() => {
|
||||
func.apply(this, args);
|
||||
timerId = null;
|
||||
}, delay);
|
||||
};
|
||||
},
|
||||
present(){ //提交前处理
|
||||
let $this=this;
|
||||
let score=this.countTest();
|
||||
console.log('score='+score);
|
||||
if(this.noAnswers.length>0){
|
||||
this.$confirm('还有未答试题,您确定要提交吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
showClose:false,
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.submitTest(score);
|
||||
}).catch(()=>{
|
||||
// if(this.noAnswers.length>0){
|
||||
// this.$confirm('还有未答试题,您确定要提交吗?', '提示', {
|
||||
// confirmButtonText: '确定',
|
||||
// cancelButtonText: '取消',
|
||||
// showClose:false,
|
||||
// type: 'warning'
|
||||
// }).then(() => {
|
||||
// this.submitTest(score);
|
||||
// }).catch(()=>{
|
||||
|
||||
})
|
||||
}else{
|
||||
this.submitTest(score);
|
||||
}
|
||||
// })
|
||||
// }else{
|
||||
// this.submitTest(score);
|
||||
// }
|
||||
},
|
||||
countTest(){ //计算考试的分数
|
||||
//console.log(this.paper.items);
|
||||
@@ -588,7 +598,10 @@ export default {
|
||||
});
|
||||
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.debouncedPresent = this.debounce(this.present, 500);
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user