From 2abe815c87c2cf14ab906a7830b043aad06cfd65 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Fri, 29 May 2020 11:18:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=90=86=E8=AE=BA=E8=80=83=E8=AF=95=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/jsxt/competition/theory/quiz/index.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 } });