|
|
@@ -9,13 +9,19 @@
|
|
|
<v-card-title v-if="question.type === 'choice'"
|
|
|
>单选题<v-icon>mdi-radiobox-marked</v-icon></v-card-title
|
|
|
>
|
|
|
- <v-card-title v-else
|
|
|
+ <v-card-title v-else-if="question.type === 'multi_choice'"
|
|
|
>多选题<v-icon>mdi-checkbox-marked</v-icon></v-card-title
|
|
|
>
|
|
|
+ <v-card-title v-else>
|
|
|
+ 判断题<v-icon>mdi-list-status</v-icon>
|
|
|
+ </v-card-title>
|
|
|
</div>
|
|
|
<markdown-text :raw="question.stem" class="pa-10"></markdown-text>
|
|
|
<v-list class="px-10 flex" v-if="!loading">
|
|
|
- <v-list-item-group v-if="question.type === 'choice'" v-model="answer">
|
|
|
+ <v-list-item-group
|
|
|
+ v-if="question.type === 'choice' || question.type === 'true_false'"
|
|
|
+ v-model="answer"
|
|
|
+ >
|
|
|
<v-divider></v-divider>
|
|
|
<template v-for="choice in options">
|
|
|
<v-list-item :key="choice.label" :value="choice.label">
|
|
|
@@ -87,7 +93,7 @@ export default Vue.extend({
|
|
|
return ''
|
|
|
}
|
|
|
|
|
|
- if (this.question.type === 'choice') {
|
|
|
+ if (this.question.type !== 'multi_choice') {
|
|
|
return this.answer[0]
|
|
|
} else {
|
|
|
const sorted = clone(this.answer).sort()
|
|
|
@@ -106,6 +112,11 @@ export default Vue.extend({
|
|
|
},
|
|
|
methods: {
|
|
|
init() {
|
|
|
+ if (this.question.type === 'true_false') {
|
|
|
+ this.question.options?.set('true', '')
|
|
|
+ this.question.options?.set('false', '')
|
|
|
+ }
|
|
|
+
|
|
|
let keys = Object.keys(this.question.options ?? {})
|
|
|
let values = Object.values(this.question.options ?? {})
|
|
|
this.options = []
|
|
|
@@ -114,7 +125,7 @@ export default Vue.extend({
|
|
|
this.options.push({
|
|
|
label: keys[i],
|
|
|
text: values[i],
|
|
|
- labelText: keys[i] + ' : ' + values[i]
|
|
|
+ labelText: keys[i] + '. ' + values[i]
|
|
|
})
|
|
|
}
|
|
|
this.answer = []
|