From 632e609a88161923c64170cbd0c41437eeca5af5 Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期五, 28 六月 2024 11:35:29 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev --- src/views/exam/exam/components/MarkPaperShow.vue | 148 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 148 insertions(+), 0 deletions(-) diff --git a/src/views/exam/exam/components/MarkPaperShow.vue b/src/views/exam/exam/components/MarkPaperShow.vue new file mode 100644 index 0000000..456ec64 --- /dev/null +++ b/src/views/exam/exam/components/MarkPaperShow.vue @@ -0,0 +1,148 @@ +<template> + <div v-loading="qLoading" style="line-height:1.8"> + <div + v-if="qType == 1 || qType == 2 || qType == 3 || qType == 4 || qType == 5 || qType == 6 || qType == 7 || qType == 8"> + <!-- 閫夋嫨鎴栬闊� --> + <div v-if="qType == 1 || qType == 6"> + <div class="q-title" v-html="question.title"/> + <div class="q-content"> + <el-radio-group v-model="question.answer"> + <el-radio v-for="item in question.questionItemList" :key="item.prefix" :label="item.prefix"> + <span class="question-prefix">{{ item.prefix }}.</span> + <span v-html="item.content" class="q-item-span-content"></span> + </el-radio> + </el-radio-group> + </div> + </div> + <!-- 澶氶�� --> + <div v-else-if="qType == 2"> + <div class="q-title" v-html="question.title"/> + <div class="q-content"> + <el-checkbox-group v-model="question.answerList"> + <el-checkbox v-for="item in question.questionItemList" :label="item.prefix" :key="item.prefix"> + <span class="question-prefix">{{ item.prefix }}.</span> + <span v-html="item.content" class="q-item-span-content"></span> + </el-checkbox> + </el-checkbox-group> + </div> + </div> + <!-- 鍒ゆ柇 --> + <div v-else-if="qType == 3"> + <div class="q-title" v-html="question.title" style="display: inline;margin-right: 10px"/> + <span style="padding-right: 10px;">(</span> + <el-radio-group v-model="question.answer"> + <el-radio v-for="item in question.questionItemList" :key="item.prefix" :label="item.prefix"> + <span v-html="item.content" class="q-item-span-content"></span> + </el-radio> + </el-radio-group> + <span style="padding-left: 10px;">)</span> + </div> + <!-- 濉┖ --> + <div v-else-if="qType == 4"> + <div class="q-title" v-html="question.title"/> + <div v-if="question.answerList !== null"> + <el-form-item :label="item.prefix" :key="item.prefix" v-for="item in question.questionItemList" label-width="50px" + style="margin-top: 10px;margin-bottom: 10px;"> + <el-input v-model="question.answerList[item.prefix - 1]"/> + </el-form-item> + </div> + </div> + <!-- 绠�绛斻�佽绠椼�佸垎鏋� --> + <div v-else-if="qType == 5 || qType == 7 || qType == 8"> + <div class="q-title" v-html="question.title"/> + <div> + <el-input v-model="question.answer" type="textarea" rows="5"></el-input> + </div> + </div> + <div class="question-answer-show-item" style="margin-top: 15px"> + <span class="question-show-item">缁撴灉锛�</span> + <el-tag :type="rightTagFormatter(question.right)"> + {{ rightTextFormatter(question.right) }} + </el-tag> + </div> + <div class="question-answer-show-item"> + <span class="question-show-item">鎬诲垎锛�</span> + <span>{{ question.questionScore }}</span> + </div> + <div class="question-answer-show-item"> + <span class="question-show-item">寰楀垎锛�</span> + <span>{{ question.score }}</span> + </div> + <div class="question-answer-show-item"> + <span class="question-show-item">闅惧害锛�</span> + <el-rate disabled v-model="question.difficult" class="question-show-item"></el-rate> + </div> + <br/> + <div class="question-answer-show-item" style="line-height: 1.8"> + <span class="question-show-item">瑙f瀽锛�</span> + <span v-html="question.analyze" class="q-item-span-content"/> + </div> + <div class="question-answer-show-item"> + <span class="question-show-item">姝g‘绛旀锛�</span> + <!-- 閫夋嫨銆佸閫夈�佺畝绛斻�佽闊炽�佽绠椼�佸垎鏋� --> + <span v-if="qType == 1 || qType == 2 || qType == 5 || qType == 6 || qType == 7 || qType == 8" + v-html="question.qustionAnswer" class="q-item-span-content"/> + <!-- 鍒ゆ柇 --> + <span v-if="qType == 3" v-html="trueFalseFormatter(question)" class="q-item-span-content"/> + <!-- 濉┖ --> + <span v-if="qType == 4">{{ question.qustionAnswer }}</span> + </div> + <div v-if="question.right == null"> + <span style="color:#ECAB3C;">{{ '鎵规敼锛�' }}</span> + <el-input-number size="mini" v-model="question.score" :precision="1" :min="0" + :max="parseInt(question.questionScore)"></el-input-number> + </div> + </div> + <div v-else> + </div> + </div> + +</template> + +<script> +import { mapState, mapGetters } from 'vuex' + +export default { + name: 'QuestionShow', + props: { + question: { + type: Object, + default: function () { + return {} + } + }, + answer: { + type: Object, + default: function () { + return { id: null, content: '', contentArray: [], right: false } + } + }, + qLoading: { + type: Boolean, + default: false + }, + qType: { + type: Number, + default: 0 + } + }, + methods: { + trueFalseFormatter (question) { + return question.items.filter(d => d.prefix === question.questionAnswer)[0].content + }, + rightTagFormatter (status) { + return this.enumFormat(this.rightTag, status) + }, + rightTextFormatter (status) { + return this.enumFormat(this.rightEnum, status) + } + }, + computed: { + ...mapGetters('enumItem', ['enumFormat']), + ...mapState('enumItem', { + rightEnum: state => state.exam.question.answer.doRightEnum, + rightTag: state => state.exam.question.answer.doRightTag + }) + } +} +</script> -- Gitblit v1.8.0