mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 03:46:44 +08:00
课程考试的调整
This commit is contained in:
@@ -179,9 +179,14 @@ export default {
|
|||||||
this.loadExamInfo();
|
this.loadExamInfo();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
destroyed() {
|
||||||
|
if(this.timer){
|
||||||
|
window.clearInterval(this.timer);
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeTimer(){
|
changeTimer(){
|
||||||
if(this.timerValue==0){
|
if(this.timerValue<=0){
|
||||||
window.clearInterval(this.timer);
|
window.clearInterval(this.timer);
|
||||||
//系统自动提交
|
//系统自动提交
|
||||||
this.confirmStop();
|
this.confirmStop();
|
||||||
@@ -332,7 +337,7 @@ export default {
|
|||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.submitTest()
|
this.submitTest()
|
||||||
}).catch(()=>{
|
}).catch(()=>{
|
||||||
|
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
this.submitTest()
|
this.submitTest()
|
||||||
@@ -342,7 +347,8 @@ export default {
|
|||||||
//console.log(this.paper.items);
|
//console.log(this.paper.items);
|
||||||
let totalScore=0;
|
let totalScore=0;
|
||||||
this.paper.items.forEach(item => {
|
this.paper.items.forEach(item => {
|
||||||
totalScore+=item.score;//加到总分中
|
item.score=parseInt(item.score);
|
||||||
|
totalScore+=item.score;//加到总分中
|
||||||
if(item.type != 102){
|
if(item.type != 102){
|
||||||
item.userAnswer='';
|
item.userAnswer='';
|
||||||
item.options.forEach(opt => {
|
item.options.forEach(opt => {
|
||||||
@@ -397,6 +403,10 @@ export default {
|
|||||||
return this.lastScore;
|
return this.lastScore;
|
||||||
},
|
},
|
||||||
submitTest(){ //提交处理
|
submitTest(){ //提交处理
|
||||||
|
//清空提示
|
||||||
|
if(this.timer){
|
||||||
|
window.clearInterval(this.timer);
|
||||||
|
}
|
||||||
let now=new Date();
|
let now=new Date();
|
||||||
let testScore=this.countTest();
|
let testScore=this.countTest();
|
||||||
let postData={
|
let postData={
|
||||||
|
|||||||
Reference in New Issue
Block a user