理论考试缓存调整

This commit is contained in:
fan 2020-05-29 11:18:44 +08:00
parent f21751fcd3
commit 2abe815c87

View File

@ -52,7 +52,6 @@ export default {
passScore: 10
},
examQuestions: [],
theoryAnswers: [],
theoryAnswersMap: {},
countdownTime: '00:00:00',
theoryExamTime: 0,
@ -113,6 +112,7 @@ export default {
if (resp.data) {
this.examQuestions = resp.data.questions.map((el, i) => {
el.index = i;
el.answer = this.theoryAnswersMap[el.id];
return el;
});
this.theoryExamTime = resp.data.theoryExamTime * 60;
@ -175,9 +175,13 @@ export default {
}
},
doEnd() {
const theoryAnswers = [];
for (const key in this.theoryAnswersMap) {
theoryAnswers.push({questionId: key, answerOptionId: this.theoryAnswersMap[key]});
}
const params = {
competitionId: this.$route.query.raceId,
theoryAnswers: this.theoryAnswers
theoryAnswers: theoryAnswers
};
postCompetitionTheory(params).then(()=>{
this.$router.push({ path: `/jsxt/result`, query: { type: 'theory', raceId:this.$route.query.raceId } });