|
@@ -290,7 +290,7 @@
|
|
|
<view class="ans_input" v-if="!bank.ques[ansIndex]">
|
|
|
<view class="top flex">
|
|
|
<image class="icon" @click="chooseImgChild(bankIndex, ansIndex)" src="/static/08-10_032.jpg" mode=""></image>
|
|
|
- <view class="progress">0/4</view>
|
|
|
+ <view class="progress">{{ansItem.ansText.imageList.length}}/4</view>
|
|
|
<view class="submit" @click="submitAnsChild(bankIndex, ansIndex)">确认答案</view>
|
|
|
</view>
|
|
|
<view class="textarea"><textarea v-model="ansItem.ansText.text" placeholder="在此输入答案"></textarea></view>
|
|
@@ -636,7 +636,7 @@ export default {
|
|
|
* 立即离开并交卷
|
|
|
*/
|
|
|
leaveNow() {
|
|
|
- this.needBack = false;
|
|
|
+ this.isSubmit = true;
|
|
|
uni.navigateBack({
|
|
|
delta: 1
|
|
|
});
|
|
@@ -644,6 +644,7 @@ export default {
|
|
|
let reportStatus = 0;
|
|
|
let number = 0;
|
|
|
let passScore = 0;
|
|
|
+ let allScore = 0; //总分
|
|
|
this.questionList.forEach((item, index) => {
|
|
|
passScore = item.passScore
|
|
|
if (item.type == 1) {
|
|
@@ -653,8 +654,9 @@ export default {
|
|
|
number++;
|
|
|
} else {
|
|
|
|
|
|
- item.scoreResult = 0;
|
|
|
+ item.scoreResult = 0;
|
|
|
}
|
|
|
+ allScore += item.score;
|
|
|
} else if (item.type == 2) {
|
|
|
let isRight =
|
|
|
item.ques &&
|
|
@@ -668,8 +670,9 @@ export default {
|
|
|
number++;
|
|
|
} else {
|
|
|
|
|
|
- item.scoreResult = 0;
|
|
|
+ item.scoreResult = 0;
|
|
|
}
|
|
|
+ allScore += item.score;
|
|
|
} else if (item.type == 3) {
|
|
|
if (item.ques == item.ans) {
|
|
|
item.scoreResult = item.score;
|
|
@@ -679,6 +682,7 @@ export default {
|
|
|
|
|
|
item.scoreResult = 0;
|
|
|
}
|
|
|
+ allScore += item.score;
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -689,20 +693,21 @@ export default {
|
|
|
}
|
|
|
|
|
|
this.$api
|
|
|
- .bankRecord({
|
|
|
+ .bankRecordEdit({
|
|
|
chapterId:this.chapterId,
|
|
|
moduleId:this.moduleId,
|
|
|
examId: this.id,
|
|
|
goodsId: this.goodsId,
|
|
|
+ recordId:this.recordId,
|
|
|
reportStatus:reportStatus,
|
|
|
rightQuestionNum: number,
|
|
|
status: 1,
|
|
|
gradeId:this.gradeId,
|
|
|
performance: score,
|
|
|
totalScore: allScore,
|
|
|
- examTime: parseInt(this.allTimes),
|
|
|
- doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
|
|
|
- historyExamJson: JSON.stringify(this.questionList)
|
|
|
+ // examTime: parseInt(this.allTimes),
|
|
|
+ // doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
|
|
|
+ // historyExamJson: JSON.stringify(this.questionList)
|
|
|
})
|
|
|
.then(res => {});
|
|
|
},
|
|
@@ -773,16 +778,17 @@ export default {
|
|
|
}
|
|
|
|
|
|
this.$api
|
|
|
- .bankRecord({
|
|
|
+ .bankRecordEdit({
|
|
|
chapterId:this.chapterId,
|
|
|
moduleId:this.moduleId,
|
|
|
gradeId:this.gradeId,
|
|
|
examId: this.id,
|
|
|
goodsId: this.goodsId,
|
|
|
+ recordId:this.recordId,
|
|
|
performance:score,
|
|
|
reportStatus:reportStatus,
|
|
|
status: 1,
|
|
|
- historyExamJson: JSON.stringify(this.questionList)
|
|
|
+ // historyExamJson: JSON.stringify(this.questionList)
|
|
|
})
|
|
|
.then(res => {});
|
|
|
}
|
|
@@ -913,8 +919,39 @@ export default {
|
|
|
|
|
|
this.questionList = res.data.data;
|
|
|
this.lastCount = this.questionList.length;
|
|
|
+ this.examRecord();
|
|
|
});
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 记录总题数
|
|
|
+ * hasSpecial (是否包含简答和案例) true 包含 false 不包含
|
|
|
+ */
|
|
|
+ examRecord(hasSpecial) {
|
|
|
+ let questionList = 0;
|
|
|
+ if(!hasSpecial) {
|
|
|
+ this.questionList.forEach((item, index) => {
|
|
|
+ if(item.type == 1 || item.type == 2 || item.type == 3) {
|
|
|
+ questionList++;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ questionList = this.questionList.length;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$api
|
|
|
+ .bankRecord({
|
|
|
+ chapterExamId: this.chapterId || 0,
|
|
|
+ moduleExamId: this.moduleId || 0,
|
|
|
+ examId: this.id,
|
|
|
+ goodsId: this.goodsId,
|
|
|
+ gradeId:this.gradeId,
|
|
|
+ totalQuestionNum: questionList
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ this.recordId = res.data.data;
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
/**
|
|
|
* @param {Object} e单选点击
|
|
|
*/
|
|
@@ -1115,14 +1152,14 @@ export default {
|
|
|
|
|
|
//交卷
|
|
|
this.$api
|
|
|
- .bankRecord({
|
|
|
+ .bankRecordEdit({
|
|
|
moduleId:this.moduleId,
|
|
|
chapterId:this.chapterId,
|
|
|
gradeId:this.gradeId,
|
|
|
examId: this.id,
|
|
|
goodsId: this.goodsId,
|
|
|
reportStatus:reportStatus,
|
|
|
- // recordId: this.recordId,
|
|
|
+ recordId: this.recordId,
|
|
|
// rightQuestionNum: number,
|
|
|
status: 1,
|
|
|
// doQuestionIds:doQuestionIds.join(','),
|
|
@@ -1130,9 +1167,9 @@ export default {
|
|
|
// doQuestionNum: doQuestionNum,
|
|
|
performance: score,
|
|
|
totalScore: allScore,
|
|
|
- examTime: parseInt(this.allTimes),
|
|
|
- doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
|
|
|
- historyExamJson: JSON.stringify(this.questionList)
|
|
|
+ // examTime: parseInt(this.allTimes),
|
|
|
+ // doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
|
|
|
+ // historyExamJson: JSON.stringify(this.questionList)
|
|
|
})
|
|
|
.then(res => {
|
|
|
this.isSubmit = true;
|