|
@@ -28,14 +28,12 @@
|
|
|
<el-input v-model="data.dialogue" :autosize="{ minRows: 3 }" type="textarea" placeholder="输入对话" />
|
|
|
</div>
|
|
|
|
|
|
- <div v-if="isEnable(data.property.is_enable_reference_answer)" class="content">
|
|
|
- <span class="subtitle">参考答案:</span>
|
|
|
- <el-input
|
|
|
- v-model="data.reference_answer"
|
|
|
- :autosize="{ minRows: 3 }"
|
|
|
- type="textarea"
|
|
|
- placeholder="输入参考答案"
|
|
|
- />
|
|
|
+ <el-button @click="identifyText">识别</el-button>
|
|
|
+ <div v-if="data.answer.answer_list.length > 0" class="correct-answer">
|
|
|
+ <div class="subtitle">正确答案</div>
|
|
|
+ <el-input v-for="(item, i) in data.answer.answer_list" :key="item.mark" v-model="item.value">
|
|
|
+ <span slot="prefix">{{ i + 1 }}.</span>
|
|
|
+ </el-input>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -97,16 +95,6 @@
|
|
|
{{ 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_reference_answer"
|
|
|
- :label="value"
|
|
|
- >
|
|
|
- {{ label }}
|
|
|
- </el-radio>
|
|
|
- </el-form-item>
|
|
|
</el-form>
|
|
|
</template>
|
|
|
</QuestionBase>
|
|
@@ -172,6 +160,7 @@ export default {
|
|
|
content: isFill ? fillList : content,
|
|
|
direction,
|
|
|
audio_file_id: '',
|
|
|
+ mark: isFill ? getRandomNumber() : '',
|
|
|
type: isFill ? 'input' : 'text',
|
|
|
};
|
|
|
}
|
|
@@ -180,7 +169,23 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
},
|
|
|
- methods: {},
|
|
|
+ methods: {
|
|
|
+ identifyText() {
|
|
|
+ this.data.answer.answer_list = this.data.option_list
|
|
|
+ .filter(({ type }) => type === 'input')
|
|
|
+ .map(({ content }) => {
|
|
|
+ return content
|
|
|
+ .filter(({ type }) => type === 'input')
|
|
|
+ .map(({ content, ...data }) => {
|
|
|
+ return {
|
|
|
+ value: content,
|
|
|
+ ...data,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .flat();
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
|
|
@@ -189,6 +194,9 @@ export default {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
row-gap: 8px;
|
|
|
+ padding-bottom: 8px;
|
|
|
+ margin-bottom: 8px;
|
|
|
+ border-bottom: $border;
|
|
|
|
|
|
.subtitle {
|
|
|
font-size: 14px;
|
|
@@ -200,4 +208,26 @@ export default {
|
|
|
border-top: $border;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+.correct-answer {
|
|
|
+ .subtitle {
|
|
|
+ margin: 8px 0;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #4e5969;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-input {
|
|
|
+ width: 180px;
|
|
|
+
|
|
|
+ :deep &__prefix {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ color: $text-color;
|
|
|
+ }
|
|
|
+
|
|
|
+ + .el-input {
|
|
|
+ margin-left: 8px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|