|
|
@@ -1,87 +1,66 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <v-app-bar dense app>
|
|
|
- <v-row>
|
|
|
- <v-col>
|
|
|
- <span class="display-1">{{ examInfo.title }}</span>
|
|
|
- </v-col>
|
|
|
- <v-col class="d-inline-flex justify-end">
|
|
|
- <count-down
|
|
|
- class="align-self-center"
|
|
|
- :current-time="currentTime"
|
|
|
- :end-time="endTime"
|
|
|
- @timesUp="onTimesUp"
|
|
|
- ></count-down>
|
|
|
- </v-col>
|
|
|
- </v-row>
|
|
|
- </v-app-bar>
|
|
|
- <v-navigation-drawer app permanent right class="elevation-5">
|
|
|
- <div class="flex-column d-flex" style="height: 100vh">
|
|
|
+ <v-navigation-drawer
|
|
|
+ app
|
|
|
+ permanent
|
|
|
+ right
|
|
|
+ class="elevation-5"
|
|
|
+ v-if="examInfo"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ class="flex-column d-flex justify-space-between"
|
|
|
+ style="height: 100vh"
|
|
|
+ >
|
|
|
<div class="flex-shrink-0">
|
|
|
<div class="pa-4">
|
|
|
<div
|
|
|
style="height: 40px; width: 100%"
|
|
|
class="indigo lighten-3 rounded-lg justify-center d-flex "
|
|
|
>
|
|
|
- <h1 class="align-self-center">答题卡</h1>
|
|
|
+ <h2 class="align-self-center">{{ examInfo.examName }}</h2>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div
|
|
|
+ v-if="examInfo"
|
|
|
+ class="flex-shrink-0 flex-column d-flex justify-space-between align-center"
|
|
|
+ >
|
|
|
+ <count-down
|
|
|
+ :current-time="currentTime"
|
|
|
+ :end-time="endTime"
|
|
|
+ @timesUp="onTimesUp"
|
|
|
+ ></count-down>
|
|
|
+ </div>
|
|
|
+
|
|
|
<div
|
|
|
class="overflow-auto flex-grow-1 pa-4 d-flex flex-column justify-space-around"
|
|
|
style="box-sizing: border-box;"
|
|
|
>
|
|
|
<div class="justify-space-between">
|
|
|
<div class="d-flex justify-center">
|
|
|
- <h2>单选题</h2>
|
|
|
+ <h2>客观题</h2>
|
|
|
</div>
|
|
|
- <v-btn
|
|
|
- v-for="i in answerStatus.slice(0, singleChoiceNum)"
|
|
|
- :key="i.index"
|
|
|
- class="ml-2 mt-2 pa-0 d-inline"
|
|
|
- x-small
|
|
|
- :disabled="currentQuestionIndex + 1 !== i.index && i.answered"
|
|
|
- :color="currentQuestionIndex + 1 === i.index ? 'secondary' : ''"
|
|
|
- @click="onSelectQuestion(i.index)"
|
|
|
- >
|
|
|
- {{ i.index }}
|
|
|
- </v-btn>
|
|
|
- </div>
|
|
|
- <div class="justify-space-between d-inline">
|
|
|
- <div class="d-flex justify-center">
|
|
|
- <h2>多选题</h2>
|
|
|
+ <div class="d-flex justify-space-around">
|
|
|
+ <v-chip label>
|
|
|
+ {{ currentQuestionIndex + 1 }} / {{ totalQuestionNum }}</v-chip
|
|
|
+ >
|
|
|
</div>
|
|
|
- <v-btn
|
|
|
- v-for="i in answerStatus.slice(
|
|
|
- singleChoiceNum,
|
|
|
- choiceQuestionNum
|
|
|
- )"
|
|
|
- :key="i.index"
|
|
|
- class="ml-2 mt-2 pa-0 d-inline"
|
|
|
- x-small
|
|
|
- :disabled="currentQuestionIndex + 1 !== i.index && i.answered"
|
|
|
- :color="currentQuestionIndex + 1 === i.index ? 'secondary' : ''"
|
|
|
- @click="onSelectQuestion(i.index)"
|
|
|
- >
|
|
|
- {{ i.index }}
|
|
|
- </v-btn>
|
|
|
+ <v-progress-linear
|
|
|
+ :value="(currentQuestionIndex / totalQuestionNum) * 100"
|
|
|
+ :buffer-value="
|
|
|
+ ((currentQuestionIndex + 1) / totalQuestionNum) * 100
|
|
|
+ "
|
|
|
+ ></v-progress-linear>
|
|
|
</div>
|
|
|
<div class="justify-space-between">
|
|
|
<div class="d-flex justify-center">
|
|
|
<h2>代码题</h2>
|
|
|
</div>
|
|
|
- <v-btn
|
|
|
- v-for="i in answerStatus.slice(choiceQuestionNum)"
|
|
|
- :key="i.index"
|
|
|
- class="ml-2 mt-2 pa-0 d-inline"
|
|
|
- x-small
|
|
|
- :color="currentQuestionIndex + 1 === i.index ? 'secondary' : ''"
|
|
|
- @click="onSelectQuestion(i.index)"
|
|
|
- >
|
|
|
- {{ i.index }}
|
|
|
- </v-btn>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div style="height: 20vh;width: 80%" class="align-self-center">
|
|
|
+ <!-- 预留给反作弊-->
|
|
|
+ </div>
|
|
|
<div class="flex-shrink-0">
|
|
|
<div class="pa-2 px-6 text--secondary justify-space-between d-flex">
|
|
|
<v-dialog v-model="exitDialog" persistent max-width="290">
|
|
|
@@ -138,32 +117,68 @@
|
|
|
</div>
|
|
|
</v-navigation-drawer>
|
|
|
<v-main class="indigo lighten-5 pa-0">
|
|
|
- <v-container fluid class="pa-2" v-if="currentQuestionIndex >= 0">
|
|
|
- <choice-pane
|
|
|
- v-show="isChoiceProblem"
|
|
|
- @nextQuestion="nextQuestion"
|
|
|
- @saveChoiceAnswer="saveChoiceAnswer"
|
|
|
- :total-question-num="curTypeQuestionNum"
|
|
|
- :question="curChoiceQuestion"
|
|
|
- ></choice-pane>
|
|
|
+ <v-container fluid class="pa-2">
|
|
|
+ <v-card class="questionCard">
|
|
|
+ <div v-if="!fetchingStem">
|
|
|
+ <blank-pane
|
|
|
+ v-if="questionType() === 'blank'"
|
|
|
+ :question="currentQuestion"
|
|
|
+ @saveAnswer="saveObjectiveAnswer"
|
|
|
+ >
|
|
|
+ <template #index>
|
|
|
+ <v-chip class="align-self-center"
|
|
|
+ >{{ currentQuestionIndex + 1 }} /
|
|
|
+ {{ totalQuestionNum }}</v-chip
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </blank-pane>
|
|
|
+ <choice-pane
|
|
|
+ v-else-if="
|
|
|
+ questionType() === 'choice' || questionType() === 'multi_choice'
|
|
|
+ "
|
|
|
+ :question="currentQuestion"
|
|
|
+ @saveAnswer="saveObjectiveAnswer"
|
|
|
+ >
|
|
|
+ <template #index>
|
|
|
+ <v-chip class="align-self-center"
|
|
|
+ >{{ currentQuestionIndex + 1 }} /
|
|
|
+ {{ totalQuestionNum }}</v-chip
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </choice-pane>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div
|
|
|
+ v-if="!fetchingStem"
|
|
|
+ class="d-flex justify-space-around px-10 py-10"
|
|
|
+ >
|
|
|
+ <v-btn color="info" @click="nextQuestion">下一题</v-btn>
|
|
|
+ </div>
|
|
|
+ </v-card>
|
|
|
+
|
|
|
+ <code-pane v-if="isCodeQuestion && questionType() === 'code'">
|
|
|
+ <v-chip class="align-self-center"
|
|
|
+ >{{ currentQuestionIndex + 1 }} / {{ totalQuestionNum }}</v-chip
|
|
|
+ >
|
|
|
+ </code-pane>
|
|
|
<!-- 先用v-if(codeIndex只在初始为负数),再用v-show。只用v-show的时候,会出现第一个代码题editor无法渲染的问题,原因未知-->
|
|
|
- <v-window
|
|
|
- :value="codeIndex"
|
|
|
- v-if="codeIndex >= 0"
|
|
|
- v-show="!isChoiceProblem"
|
|
|
- >
|
|
|
- <v-window-item v-for="i in codeQuestionNum" :key="i">
|
|
|
- <code-pane
|
|
|
- :question="codeQuestions[i - 1]"
|
|
|
- :total-question-num="curTypeQuestionNum"
|
|
|
- @nextQuestion="nextQuestion"
|
|
|
- @submitCode="saveSubmittedCode"
|
|
|
- ></code-pane>
|
|
|
- </v-window-item>
|
|
|
- </v-window>
|
|
|
+ <!-- <v-window-->
|
|
|
+ <!-- :value="codeIndex"-->
|
|
|
+ <!-- v-if="codeIndex >= 0"-->
|
|
|
+ <!-- v-show="!isChoiceProblem"-->
|
|
|
+ <!-- >-->
|
|
|
+ <!-- <v-window-item v-for="i in codeQuestionNum" :key="i">-->
|
|
|
+ <!-- <code-pane-->
|
|
|
+ <!-- :question="codeQuestions[i - 1]"-->
|
|
|
+ <!-- :total-question-num="curTypeQuestionNum"-->
|
|
|
+ <!-- @nextQuestion="nextQuestion"-->
|
|
|
+ <!-- @submitCode="saveSubmittedCode"-->
|
|
|
+ <!-- ></code-pane>-->
|
|
|
+ <!-- </v-window-item>-->
|
|
|
+ <!-- </v-window>-->
|
|
|
</v-container>
|
|
|
- <v-snackbar v-model="noticeUnfinished">
|
|
|
- 还有题目未作答
|
|
|
+ <v-snackbar v-model="finished" absolute>
|
|
|
+ 已到最后一题
|
|
|
</v-snackbar>
|
|
|
</v-main>
|
|
|
</div>
|
|
|
@@ -174,232 +189,148 @@ import Vue from 'vue'
|
|
|
import CodePane from '@/views/exam/components/CodePane.vue'
|
|
|
import ChoicePane from '@/views/exam/components/ChoicePane.vue'
|
|
|
import CountDown from '@/views/exam/components/CountDown.vue'
|
|
|
+import BlankPane from '@/views/exam/components/BlankPane.vue'
|
|
|
import {
|
|
|
- ChoiceQuestionSerializer,
|
|
|
- CodeQuestionSerializer,
|
|
|
ExamQuestionSerializer,
|
|
|
ExamSerializer,
|
|
|
- QuestionSerializer
|
|
|
+ ID,
|
|
|
+ QuestionStemSerializer,
|
|
|
+ QuestionType
|
|
|
} from '@/api/types'
|
|
|
import { getExamById, getExamQuestions } from '@/api/exam'
|
|
|
+import { getQuestionStem } from '@/api/question'
|
|
|
+import { objectiveJudge } from '@/api/judge'
|
|
|
|
|
|
export default Vue.extend({
|
|
|
name: 'ExamPane',
|
|
|
components: {
|
|
|
CountDown,
|
|
|
CodePane,
|
|
|
- ChoicePane
|
|
|
+ ChoicePane,
|
|
|
+ BlankPane
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ fetchingStem: true,
|
|
|
exitDialog: false,
|
|
|
submitDialog: false,
|
|
|
submitted: false,
|
|
|
currentTime: 0,
|
|
|
- examInfo: {} as ExamSerializer,
|
|
|
+ examInfo: (null as unknown) as ExamSerializer,
|
|
|
endTime: 0,
|
|
|
- choiceAnswers: [] as Array<{ index: number; answer: string }>,
|
|
|
- examId: 0,
|
|
|
- singleChoiceQuestions: [] as Array<ChoiceQuestionSerializer>,
|
|
|
- multiChoiceQuestions: [] as Array<ChoiceQuestionSerializer>,
|
|
|
- codeQuestions: [] as Array<CodeQuestionSerializer>,
|
|
|
- answeredChoices: [] as Array<{ index: number; answered: boolean }>,
|
|
|
- answeredCodes: [] as Array<{ index: number; answered: boolean }>,
|
|
|
- answerStatus: [] as Array<{ index: number; answered: boolean }>,
|
|
|
+ examQuestions: (null as unknown) as ExamQuestionSerializer,
|
|
|
+
|
|
|
+ currentQuestion: (null as unknown) as QuestionStemSerializer,
|
|
|
currentQuestionIndex: -1,
|
|
|
- codeIndex: -1,
|
|
|
- noticeUnfinished: false
|
|
|
+ objectiveAnswers: [] as Array<string>,
|
|
|
+ questionIds: [] as Array<string>,
|
|
|
+
|
|
|
+ examId: 0,
|
|
|
+ // codeQuestions: [] as Array<CodeQuestionSerializer>,
|
|
|
+ // codeIndex: -1
|
|
|
+
|
|
|
+ submitting: false,
|
|
|
+ finished: false
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- curTypeQuestionNum(): number {
|
|
|
- return this.isChoiceProblem
|
|
|
- ? this.isSingleChoice
|
|
|
- ? this.singleChoiceNum
|
|
|
- : this.multiChoiceNum
|
|
|
- : this.codeQuestionNum
|
|
|
- },
|
|
|
- isChoiceProblem(): boolean {
|
|
|
- return this.currentQuestionIndex < this.choiceQuestionNum
|
|
|
- },
|
|
|
- isSingleChoice(): boolean {
|
|
|
- return this.currentQuestionIndex < this.singleChoiceNum
|
|
|
- },
|
|
|
- singleChoiceNum(): number {
|
|
|
- return this.singleChoiceQuestions.length
|
|
|
- },
|
|
|
- multiChoiceNum(): number {
|
|
|
- return this.multiChoiceQuestions.length
|
|
|
+ isCodeQuestion(): boolean {
|
|
|
+ return false
|
|
|
},
|
|
|
- codeQuestionNum(): number {
|
|
|
- return this.codeQuestions.length
|
|
|
- },
|
|
|
- choiceQuestionNum(): number {
|
|
|
- return this.singleChoiceNum + this.multiChoiceNum
|
|
|
- },
|
|
|
- totalQuestionNum(): number {
|
|
|
- return this.choiceQuestionNum + this.codeQuestionNum
|
|
|
- },
|
|
|
- curChoiceQuestion(): ChoiceQuestionSerializer {
|
|
|
- if (!this.isChoiceProblem) {
|
|
|
- return {} as ChoiceQuestionSerializer
|
|
|
- }
|
|
|
- if (this.isSingleChoice) {
|
|
|
- return this.singleChoiceQuestions[this.currentQuestionIndex]
|
|
|
- } else {
|
|
|
- return this.multiChoiceQuestions[
|
|
|
- this.currentQuestionIndex - this.singleChoiceNum
|
|
|
- ]
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- watch: {
|
|
|
- choiceAnswers: {
|
|
|
- deep: true,
|
|
|
- handler: function(val: Array<{ index: number; answer: string }>) {
|
|
|
- this.answeredChoices = val
|
|
|
- .slice(0, this.singleChoiceNum + this.multiChoiceNum)
|
|
|
- .map((value) => {
|
|
|
- return { index: value.index, answered: value.answer !== '' }
|
|
|
- })
|
|
|
+ // codeQuestionNum(): number {
|
|
|
+ // return this.codeQuestions.length
|
|
|
+ // },
|
|
|
+ objectiveQuestionNum(): number {
|
|
|
+ if (this.examQuestions) {
|
|
|
+ return Object.keys(this.examQuestions.questionAndScore).length
|
|
|
}
|
|
|
+ return 0
|
|
|
},
|
|
|
- currentQuestionIndex(val) {
|
|
|
- console.log('before ' + this.codeIndex)
|
|
|
- if (val >= this.choiceQuestionNum) {
|
|
|
- this.codeIndex = val - this.choiceQuestionNum
|
|
|
- }
|
|
|
- console.log(this.codeIndex)
|
|
|
+ totalQuestionNum(): number {
|
|
|
+ return this.objectiveQuestionNum
|
|
|
+ // return this.objectiveQuestionNum + this.codeQuestionNum
|
|
|
}
|
|
|
},
|
|
|
+ watch: {},
|
|
|
methods: {
|
|
|
- onTimesUp() {
|
|
|
- this.submitAnswer()
|
|
|
+ questionType(): QuestionType {
|
|
|
+ return this.currentQuestion.type
|
|
|
},
|
|
|
- saveSubmittedCode(code: string, lang: string) {
|
|
|
- const changedCodeQuestion = this.codeQuestions[this.codeIndex]
|
|
|
- const changedCodeTuple =
|
|
|
- changedCodeQuestion.lastCommitCodes?.find((val) => {
|
|
|
- return val.lang === lang
|
|
|
- }) ?? {}
|
|
|
- changedCodeTuple.code = code
|
|
|
+ fetchQuestionStem(index: number) {
|
|
|
+ this.fetchingStem = true
|
|
|
+ console.log(this.questionIds)
|
|
|
+ console.log(this.questionIds[index])
|
|
|
+ getQuestionStem(this.questionIds[index])
|
|
|
+ .then(({ data }) => {
|
|
|
+ this.currentQuestion = data.result
|
|
|
+ this.fetchingStem = false
|
|
|
+ })
|
|
|
+ .catch((err) => {})
|
|
|
},
|
|
|
- saveChoiceAnswer(answer: string | undefined) {
|
|
|
- if (this.currentQuestionIndex >= this.choiceQuestionNum) {
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- if (answer === undefined) {
|
|
|
- return
|
|
|
- }
|
|
|
- this.choiceAnswers[this.currentQuestionIndex].answer = answer
|
|
|
|
|
|
- if (answer !== '') {
|
|
|
- this.answerStatus[this.currentQuestionIndex].answered = true
|
|
|
- } else {
|
|
|
- this.answerStatus[this.currentQuestionIndex].answered = false
|
|
|
- }
|
|
|
+ onTimesUp() {
|
|
|
+ this.submitAnswer()
|
|
|
},
|
|
|
- onSelectQuestion(target: number) {
|
|
|
- this.currentQuestionIndex = target - 1
|
|
|
+ // saveSubmittedCode(code: string, lang: string) {
|
|
|
+ // const changedCodeQuestion = this.codeQuestions[this.codeIndex]
|
|
|
+ // const changedCodeTuple =
|
|
|
+ // changedCodeQuestion.lastCommitCodes?.find((val) => {
|
|
|
+ // return val.lang === lang
|
|
|
+ // }) ?? {}
|
|
|
+ // changedCodeTuple.code = code
|
|
|
+ // },
|
|
|
+ saveObjectiveAnswer(answer: string) {
|
|
|
+ this.objectiveAnswers[this.currentQuestionIndex] = answer
|
|
|
+ console.log(answer)
|
|
|
},
|
|
|
+ // onSelectQuestion(target: number) {
|
|
|
+ // this.currentQuestionIndex = target - 1
|
|
|
+ // },
|
|
|
leaveExam() {
|
|
|
this.exitDialog = false
|
|
|
this.$router.back()
|
|
|
},
|
|
|
submitAnswer() {
|
|
|
- this.submitDialog = false
|
|
|
+ //TODO code
|
|
|
+ this.submitting = true
|
|
|
|
|
|
- // if (
|
|
|
- // this.answerStatus.find((value) => {
|
|
|
- // return !value.answered
|
|
|
- // }) !== undefined
|
|
|
- // ) {
|
|
|
- // this.noticeUnfinished = true
|
|
|
- // return
|
|
|
- // }
|
|
|
-
|
|
|
- const answers = [
|
|
|
- ...this.choiceAnswers.map((value) => {
|
|
|
- return value.answer
|
|
|
- })
|
|
|
- ]
|
|
|
+ console.log(this.objectiveAnswers)
|
|
|
+ console.log(this.questionIds)
|
|
|
|
|
|
- const codes = this.codeQuestions.map((value) => {
|
|
|
- const tuples = value.lastCommitCodes ?? []
|
|
|
- return JSON.stringify(tuples)
|
|
|
+ objectiveJudge(this.objectiveAnswers, this.questionIds).then(() => {
|
|
|
+ this.submitting = false
|
|
|
+ this.submitDialog = false
|
|
|
+ this.$router.push({ name: 'home' })
|
|
|
})
|
|
|
-
|
|
|
- // TODO post
|
|
|
- console.log(answers)
|
|
|
- console.log(codes)
|
|
|
- this.$router.back()
|
|
|
- },
|
|
|
- prevQuestion() {
|
|
|
- do {
|
|
|
- this.currentQuestionIndex =
|
|
|
- (--this.currentQuestionIndex + this.totalQuestionNum) %
|
|
|
- this.totalQuestionNum
|
|
|
- } while (this.answerStatus[this.currentQuestionIndex].answered)
|
|
|
},
|
|
|
nextQuestion() {
|
|
|
- do {
|
|
|
- this.currentQuestionIndex =
|
|
|
- (this.currentQuestionIndex + 1) % this.totalQuestionNum
|
|
|
- } while (this.answerStatus[this.currentQuestionIndex].answered)
|
|
|
+ if (this.currentQuestionIndex < this.totalQuestionNum - 1) {
|
|
|
+ if (this.objectiveAnswers[this.currentQuestionIndex] === '') {
|
|
|
+ }
|
|
|
+
|
|
|
+ this.currentQuestionIndex++
|
|
|
+ this.fetchQuestionStem(this.currentQuestionIndex)
|
|
|
+ } else {
|
|
|
+ this.finished = true
|
|
|
+ }
|
|
|
},
|
|
|
fetchData() {
|
|
|
this.examId = parseInt(this.$route.params.id)
|
|
|
|
|
|
getExamById(this.examId).then(({ data }) => {
|
|
|
- this.examInfo = data.res ?? {}
|
|
|
- this.endTime = new Date().getTime() + 100
|
|
|
- // this.endTime = Date.parse(this.examInfo.endAt ?? '')
|
|
|
+ this.examInfo = data.result
|
|
|
+ this.endTime = new Date().getTime() + 1000
|
|
|
+ // this.endTime = Date.parse(this.examInfo.endTime ?? '')
|
|
|
this.currentTime = new Date().getTime()
|
|
|
})
|
|
|
|
|
|
- getExamQuestions(this.examId)
|
|
|
- .then(({ data }) => {
|
|
|
- const examQuestionsObject: ExamQuestionSerializer = data.res ?? {}
|
|
|
-
|
|
|
- this.singleChoiceQuestions =
|
|
|
- examQuestionsObject.singleChoiceQuestions?.map((value, index) => {
|
|
|
- return { ...value, index: index + 1 }
|
|
|
- }) ?? []
|
|
|
- this.multiChoiceQuestions =
|
|
|
- examQuestionsObject.multiChoiceQuestions?.map((value, index) => {
|
|
|
- return { ...value, index: index + 1 }
|
|
|
- }) ?? []
|
|
|
- this.codeQuestions =
|
|
|
- examQuestionsObject.codeQuestions?.map((value, index) => {
|
|
|
- return { ...value, index: index + 1 }
|
|
|
- }) ?? []
|
|
|
-
|
|
|
- const allQuestions = [
|
|
|
- ...this.singleChoiceQuestions,
|
|
|
- ...this.multiChoiceQuestions,
|
|
|
- ...this.codeQuestions
|
|
|
- ]
|
|
|
- this.choiceAnswers = [
|
|
|
- ...this.singleChoiceQuestions,
|
|
|
- ...this.multiChoiceQuestions
|
|
|
- ].map((value, index) => {
|
|
|
- return { index: index + 1, answer: '' }
|
|
|
- })
|
|
|
+ getExamQuestions(this.examId).then(({ data }) => {
|
|
|
+ this.examQuestions = data.result
|
|
|
+ this.questionIds = Object.keys(this.examQuestions.questionAndScore)
|
|
|
|
|
|
- this.answerStatus = allQuestions.map((value, index) => {
|
|
|
- return {
|
|
|
- index: index + 1,
|
|
|
- answered: false
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- this.currentQuestionIndex = 0 // 表示数据初始化完成
|
|
|
- console.log(this.codeIndex)
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- console.log('No data')
|
|
|
- })
|
|
|
+ this.currentQuestionIndex = 0
|
|
|
+ this.fetchQuestionStem(0)
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
@@ -408,4 +339,13 @@ export default Vue.extend({
|
|
|
})
|
|
|
</script>
|
|
|
|
|
|
-<style scoped></style>
|
|
|
+<style scoped>
|
|
|
+.questionCard {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin: 5vh 10vw;
|
|
|
+ min-height: 90vh;
|
|
|
+ padding: 10px;
|
|
|
+}
|
|
|
+</style>
|