|
@@ -38,6 +38,49 @@
|
|
|
</li>
|
|
</li>
|
|
|
</ul>
|
|
</ul>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+
|
|
|
|
|
+ <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" />
|
|
|
|
|
+ <AnswerAnalysis
|
|
|
|
|
+ :visible.sync="visibleAnswerAnalysis"
|
|
|
|
|
+ :answer-list="data.answer_list"
|
|
|
|
|
+ :analysis-list="data.analysis_list"
|
|
|
|
|
+ @closeAnswerAnalysis="closeAnswerAnalysis"
|
|
|
|
|
+ >
|
|
|
|
|
+ <ul
|
|
|
|
|
+ slot="right-answer"
|
|
|
|
|
+ class="option-list"
|
|
|
|
|
+ :style="{ flexDirection: data.property.arrange_type === arrangeTypeList[0].value ? 'row' : 'column' }"
|
|
|
|
|
+ >
|
|
|
|
|
+ <li
|
|
|
|
|
+ v-for="({ content, mark, multilingual, paragraph_list }, i) in data.option_list"
|
|
|
|
|
+ :key="mark"
|
|
|
|
|
+ :style="{ cursor: disabled ? 'not-allowed' : 'pointer', borderColor: data.unified_attrib?.topic_color }"
|
|
|
|
|
+ :class="['option-item', { active: isAnswer(mark) }, ...computedAnswerClass(mark, 'answer-analysis')]"
|
|
|
|
|
+ @click="selectAnswer(mark)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <span :class="[isSingle ? 'radio' : 'checkbox']">
|
|
|
|
|
+ <SvgIcon icon-class="check-mark" width="10" height="7" />
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <span class="serial-number"> {{ computedOptionNumber(i) }}. </span>
|
|
|
|
|
+ <PinyinText
|
|
|
|
|
+ v-if="isEnable(data.property.view_pinyin)"
|
|
|
|
|
+ class="content"
|
|
|
|
|
+ :paragraph-list="paragraph_list"
|
|
|
|
|
+ :pinyin-position="data.property.pinyin_position"
|
|
|
|
|
+ :is-preview="true"
|
|
|
|
|
+ />
|
|
|
|
|
+ <span
|
|
|
|
|
+ v-else
|
|
|
|
|
+ class="content rich-text"
|
|
|
|
|
+ :style="{ fontSize: type === typeList[0] ? '12pt' : '' }"
|
|
|
|
|
+ v-html="convertText(sanitizeHTML(content))"
|
|
|
|
|
+ ></span>
|
|
|
|
|
+ <div v-if="showLang" class="lang">
|
|
|
|
|
+ {{ multilingual.find((item) => item.type === getLang())?.translation }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ </AnswerAnalysis>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -83,6 +126,10 @@ export default {
|
|
|
if (!type) return number + 1;
|
|
if (!type) return number + 1;
|
|
|
return computeOptionMethods[type](number);
|
|
return computeOptionMethods[type](number);
|
|
|
},
|
|
},
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 判断选项是否被选中
|
|
|
|
|
+ * @param {string} mark - 选项的标识
|
|
|
|
|
+ */
|
|
|
isAnswer(mark) {
|
|
isAnswer(mark) {
|
|
|
return this.answer.answer_list.includes(mark);
|
|
return this.answer.answer_list.includes(mark);
|
|
|
},
|
|
},
|
|
@@ -99,7 +146,13 @@ export default {
|
|
|
|
|
|
|
|
this.answer.answer_list = isSelected ? list.filter((item) => item !== mark) : list.concat(mark);
|
|
this.answer.answer_list = isSelected ? list.filter((item) => item !== mark) : list.concat(mark);
|
|
|
},
|
|
},
|
|
|
- computedAnswerClass(mark) {
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 计算选项的类名
|
|
|
|
|
+ * @param {string} mark - 选项的标识
|
|
|
|
|
+ * @param {string} type - 计算类名的类型,默认为 'default',可选值为 'answer-analysis'
|
|
|
|
|
+ * @returns {Array} - 选项的类名数组
|
|
|
|
|
+ */
|
|
|
|
|
+ computedAnswerClass(mark, type = 'default') {
|
|
|
if (!this.isJudgingRightWrong && !this.isShowRightAnswer) {
|
|
if (!this.isJudgingRightWrong && !this.isShowRightAnswer) {
|
|
|
return [];
|
|
return [];
|
|
|
}
|
|
}
|
|
@@ -107,7 +160,7 @@ export default {
|
|
|
let isRight = this.data.answer.answer_list.includes(mark); // 是否是正确答案
|
|
let isRight = this.data.answer.answer_list.includes(mark); // 是否是正确答案
|
|
|
|
|
|
|
|
let answerClass = [];
|
|
let answerClass = [];
|
|
|
- if (!isHas && this.isShowRightAnswer) {
|
|
|
|
|
|
|
+ if (!isHas && this.isShowRightAnswer && type === 'answer-analysis') {
|
|
|
answerClass = isRight ? ['answer-right'] : [];
|
|
answerClass = isRight ? ['answer-right'] : [];
|
|
|
}
|
|
}
|
|
|
// 判断是否是正确答案
|
|
// 判断是否是正确答案
|