|
@@ -46,27 +46,31 @@
|
|
|
<span class="button" @click="deleteFill">删除填空</span>
|
|
|
</div>
|
|
|
<el-button @click="identifyText">识别</el-button>
|
|
|
- <div v-if="data.answer.answer_list.length > 0" class="correct-answer">
|
|
|
+ <template v-if="data.answer.answer_list.length > 0 && isEnable(data.property.is_enable_word_select_fill)">
|
|
|
<div class="subtitle">正确答案</div>
|
|
|
- <el-input
|
|
|
- v-for="(item, i) in data.answer.answer_list.filter(({ type }) => type === 'any_one')"
|
|
|
- :key="item.mark"
|
|
|
- v-model="item.value"
|
|
|
- @blur="handleTone(item.value, i)"
|
|
|
- >
|
|
|
- <span slot="prefix">{{ i + 1 }}.</span>
|
|
|
- </el-input>
|
|
|
- </div>
|
|
|
+ <div class="correct-answer">
|
|
|
+ <el-input
|
|
|
+ v-for="(item, i) in data.answer.answer_list.filter(({ type }) => type === 'any_one')"
|
|
|
+ :key="item.mark"
|
|
|
+ v-model="item.value"
|
|
|
+ @blur="handleTone(item.value, i)"
|
|
|
+ >
|
|
|
+ <span slot="prefix">{{ i + 1 }}.</span>
|
|
|
+ </el-input>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
|
|
|
- <el-input
|
|
|
- v-if="!isEnable(data.property.is_enable_word_select_fill)"
|
|
|
- v-model="data.reference_answer"
|
|
|
- type="textarea"
|
|
|
- class="reference-answer"
|
|
|
- resize="none"
|
|
|
- :autosize="{ minRows: 3 }"
|
|
|
- placeholder="输入参考答案"
|
|
|
- />
|
|
|
+ <template v-if="!isEnable(data.property.is_enable_word_select_fill)">
|
|
|
+ <div class="reference-title">参考答案:</div>
|
|
|
+ <el-input
|
|
|
+ v-model="data.reference_answer"
|
|
|
+ type="textarea"
|
|
|
+ class="reference-answer"
|
|
|
+ resize="none"
|
|
|
+ :autosize="{ minRows: 3 }"
|
|
|
+ placeholder="输入参考答案"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -221,12 +225,14 @@ export default {
|
|
|
arr[arr.length - 1].mark = mark;
|
|
|
let content = arr[arr.length - 1].content;
|
|
|
// 设置答案数组
|
|
|
- let isUnderline = /^_{3,}$/.test(content);
|
|
|
- this.data.answer.answer_list.push({
|
|
|
- value: isUnderline ? '' : content,
|
|
|
- mark,
|
|
|
- type: isUnderline ? 'any_one' : 'only_one',
|
|
|
- });
|
|
|
+ if (this.isEnable(this.data.property.is_enable_word_select_fill)) {
|
|
|
+ let isUnderline = /^_{3,}$/.test(content);
|
|
|
+ this.data.answer.answer_list.push({
|
|
|
+ value: isUnderline ? '' : content,
|
|
|
+ mark,
|
|
|
+ type: isUnderline ? 'any_one' : 'only_one',
|
|
|
+ });
|
|
|
+ }
|
|
|
// 将 content 设置为空,为预览准备
|
|
|
arr[arr.length - 1].content = '';
|
|
|
}
|
|
@@ -284,13 +290,13 @@ export default {
|
|
|
margin-top: 8px;
|
|
|
}
|
|
|
|
|
|
- .correct-answer {
|
|
|
- .subtitle {
|
|
|
- margin: 8px 0;
|
|
|
- font-size: 14px;
|
|
|
- color: #4e5969;
|
|
|
- }
|
|
|
+ .subtitle {
|
|
|
+ margin: 8px 0;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #4e5969;
|
|
|
+ }
|
|
|
|
|
|
+ .correct-answer {
|
|
|
.el-input {
|
|
|
width: 180px;
|
|
|
|
|
@@ -329,6 +335,12 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ .reference-title {
|
|
|
+ margin-top: 8px;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #000;
|
|
|
+ }
|
|
|
+
|
|
|
.reference-answer {
|
|
|
margin-top: 8px;
|
|
|
}
|