提交课程考试中的一个bug修改

This commit is contained in:
daihh
2022-10-27 17:02:28 +08:00
parent af0c1058fc
commit 4720fe6753

View File

@@ -347,7 +347,8 @@ export default {
//console.log(this.paper.items);
let totalScore=0;
this.paper.items.forEach(item => {
totalScore+=item.score;//加到总分中
item.score=parseInt(item.score);
totalScore+=item.score;//加到总分中
if(item.type != 102){
item.userAnswer='';
item.options.forEach(opt => {
@@ -396,9 +397,11 @@ export default {
if(scoreNum === null)scoreNum=0;
this.lastScore=scoreNum;
//转化成百分制显示
//console.log(scoreNum,totalScore,'实际分和总分');
if(this.info.percentScore){
this.lastScore=parseInt(scoreNum*100/totalScore);
}
//console.log('本次得分='+this.lastScore);
return this.lastScore;
},
submitTest(){ //提交处理
@@ -408,6 +411,7 @@ export default {
}
let now=new Date();
let testScore=this.countTest();
let postData={
studyId:this.studyId,//
studyItemId:this.studyItemId,//前面已经给了
@@ -428,7 +432,7 @@ export default {
var dateDiff = now.getTime() - this.startTime.getTime();//时间差的毫秒数
var minutes=Math.floor(dateDiff/(1000))//计算相差秒数分钟记录的太大经常为0
postData.testDuration=minutes;
apiStudy.saveExam(postData).then(res=>{
if(res.status == 200) {
this.records.push(res.result);