diff --git a/src/views/jsxt/competition/theory/quiz/index.vue b/src/views/jsxt/competition/theory/quiz/index.vue index a3b7d0718..210023695 100644 --- a/src/views/jsxt/competition/theory/quiz/index.vue +++ b/src/views/jsxt/competition/theory/quiz/index.vue @@ -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 } });