|
@@ -22,16 +22,12 @@
|
|
|
type="textarea"
|
|
|
placeholder="输入描述"
|
|
|
/>
|
|
|
-
|
|
|
- <UploadAudio
|
|
|
- v-show="data.property.is_enable_listening"
|
|
|
- :file-id="data.file_id_list?.[0]"
|
|
|
- @upload="upload"
|
|
|
- @deleteFile="deleteFile"
|
|
|
- />
|
|
|
</div>
|
|
|
|
|
|
- <div class="content"></div>
|
|
|
+ <div class="content">
|
|
|
+ <p class="title-little">题目:</p>
|
|
|
+ <el-input v-model="data.content" rows="3" resize="none" type="textarea" placeholder="输入汉字,用空格分开" />
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<template #property>
|
|
@@ -69,41 +65,29 @@
|
|
|
{{ label }}
|
|
|
</el-radio>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="选项">
|
|
|
+ <el-form-item label="分值">
|
|
|
<el-radio
|
|
|
- v-for="{ value, label } in selectTypeList"
|
|
|
+ v-for="{ value, label } in scoreTypeList"
|
|
|
:key="value"
|
|
|
- v-model="data.property.select_type"
|
|
|
+ v-model="data.property.score_type"
|
|
|
:label="value"
|
|
|
- @input="changeSelectType"
|
|
|
>
|
|
|
{{ label }}
|
|
|
</el-radio>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="听力">
|
|
|
- <el-radio
|
|
|
- v-for="{ value, label } in switchOption"
|
|
|
- :key="value"
|
|
|
- v-model="data.property.is_enable_listening"
|
|
|
- :label="value"
|
|
|
- >
|
|
|
- {{ label }}
|
|
|
- </el-radio>
|
|
|
+ <el-form-item label-width="45px">
|
|
|
+ <el-input v-model="data.property.score" type="number" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="分值">
|
|
|
+ <el-form-item label="类型">
|
|
|
<el-radio
|
|
|
- v-for="{ value, label } in scoreTypeList"
|
|
|
+ v-for="{ value, label } in learnTypeList"
|
|
|
:key="value"
|
|
|
- v-model="data.property.score_type"
|
|
|
+ v-model="data.property.learn_type"
|
|
|
:label="value"
|
|
|
- :disabled="scoreTypeList[1].value === value && data.property.select_type === selectTypeList[0].value"
|
|
|
>
|
|
|
{{ label }}
|
|
|
</el-radio>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label-width="45px">
|
|
|
- <el-input v-model="data.property.score" type="number" />
|
|
|
- </el-form-item>
|
|
|
</el-form>
|
|
|
</template>
|
|
|
</QuestionBase>
|
|
@@ -113,8 +97,8 @@
|
|
|
import UploadAudio from '../common/UploadAudio.vue';
|
|
|
import QuestionMixin from '../common/QuestionMixin.js';
|
|
|
|
|
|
-import { selectTypeList, scoreTypeList, changeOptionType } from '@/views/exercise_questions/data/common';
|
|
|
-import { selectData, getOption } from '@/views/exercise_questions/data/select';
|
|
|
+import { scoreTypeList, changeOptionType } from '@/views/exercise_questions/data/common';
|
|
|
+import { chineseData, getOption, learnTypeList } from '@/views/exercise_questions/data/chinese';
|
|
|
|
|
|
export default {
|
|
|
name: 'ChineseQuestion',
|
|
@@ -124,9 +108,9 @@ export default {
|
|
|
mixins: [QuestionMixin],
|
|
|
data() {
|
|
|
return {
|
|
|
- selectTypeList,
|
|
|
+ learnTypeList,
|
|
|
changeOptionType,
|
|
|
- data: JSON.parse(JSON.stringify(selectData)),
|
|
|
+ data: JSON.parse(JSON.stringify(chineseData)),
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -145,34 +129,6 @@ export default {
|
|
|
this.data.option_list = arr.slice(1).map((content) => getOption(content));
|
|
|
}
|
|
|
},
|
|
|
- changeSelectType(val) {
|
|
|
- if (val === selectTypeList[0].value && this.data.answer.select_list.length > 1) {
|
|
|
- this.data.answer.select_list = [this.data.answer.select_list[0]];
|
|
|
- }
|
|
|
- // 当多选题切换到单选题时,分值类型切换为总分
|
|
|
- if (val === selectTypeList[0].value && this.data.property.score_type === scoreTypeList[1].value) {
|
|
|
- this.data.property.score_type = scoreTypeList[0].value;
|
|
|
- }
|
|
|
- },
|
|
|
- isAnswer(mark) {
|
|
|
- return this.data.answer.select_list.indexOf(mark) !== -1;
|
|
|
- },
|
|
|
- selectAnswer(mark) {
|
|
|
- let index = this.data.answer.select_list.indexOf(mark);
|
|
|
- if (this.data.property.select_type === selectTypeList[0].value) {
|
|
|
- this.data.answer.select_list = [mark];
|
|
|
- }
|
|
|
- if (this.data.property.select_type === selectTypeList[1].value) {
|
|
|
- if (index === -1) {
|
|
|
- this.data.answer.select_list.push(mark);
|
|
|
- } else {
|
|
|
- this.data.answer.select_list.splice(index, 1);
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- addOption() {
|
|
|
- this.data.option_list.push(getOption());
|
|
|
- },
|
|
|
},
|
|
|
};
|
|
|
</script>
|