From 11fbb577737ee65f9446bfa60b6cf96954e2390c Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期二, 02 七月 2024 09:25:00 +0800 Subject: [PATCH] 阅卷 --- src/views/exam/exam/components/MarkPaperShow.vue | 77 ++++++++++++++++++++++++++++++-------- 1 files changed, 60 insertions(+), 17 deletions(-) diff --git a/src/views/exam/exam/components/MarkPaperShow.vue b/src/views/exam/exam/components/MarkPaperShow.vue index 456ec64..6b875da 100644 --- a/src/views/exam/exam/components/MarkPaperShow.vue +++ b/src/views/exam/exam/components/MarkPaperShow.vue @@ -7,7 +7,7 @@ <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"> + <el-radio class="custom-radio" v-for="item in question.questionItemList" :key="item.prefix" :label="item.prefix " disabled> <span class="question-prefix">{{ item.prefix }}.</span> <span v-html="item.content" class="q-item-span-content"></span> </el-radio> @@ -19,7 +19,7 @@ <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"> + <el-checkbox v-for="item in question.questionItemList" :label="item.prefix" :key="item.prefix" disabled> <span class="question-prefix">{{ item.prefix }}.</span> <span v-html="item.content" class="q-item-span-content"></span> </el-checkbox> @@ -28,10 +28,10 @@ </div> <!-- 鍒ゆ柇 --> <div v-else-if="qType == 3"> - <div class="q-title" v-html="question.title" style="display: inline;margin-right: 10px"/> + <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"> + <el-radio v-for="item in question.questionItemList" :key="item.prefix" :label="item.prefix " disabled> <span v-html="item.content" class="q-item-span-content"></span> </el-radio> </el-radio-group> @@ -41,9 +41,10 @@ <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" + <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-input v-model="question.answerList[item.prefix - 1]" disabled/> </el-form-item> </div> </div> @@ -51,7 +52,7 @@ <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> + <el-input v-model="question.answer" type="textarea" rows="5" ></el-input> </div> </div> <div class="question-answer-show-item" style="margin-top: 15px"> @@ -81,17 +82,15 @@ <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"/> + v-html="question.questionAnswer" 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> + <span v-if="qType == 4">{{ question.questionAnswer }}</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> + <span style="color:#ECAB3C;">{{ '鎵规敼锛�' }}</span> + <el-input-number size="mini" v-model="question.score" :precision="1" :min="0" + :max="parseInt(question.questionScore)" @change="updateRight"></el-input-number> </div> <div v-else> </div> @@ -112,9 +111,9 @@ } }, answer: { - type: Object, + type: Array, default: function () { - return { id: null, content: '', contentArray: [], right: false } + return {} } }, qLoading: { @@ -127,8 +126,16 @@ } }, methods: { + updateRight () { + // 褰搒core鍙樺寲鏃讹紝妫�鏌ュ畠鏄惁绛変簬questionScore + this.question.right = this.question.score === parseInt(this.question.questionScore) + const foundAnswer = this.answer.find(answer => answer.itemOrder === this.question.itemOrder) + if (foundAnswer) { + foundAnswer.right = this.question.right + } + }, trueFalseFormatter (question) { - return question.items.filter(d => d.prefix === question.questionAnswer)[0].content + return question.questionItemList.filter(d => d.prefix === question.questionAnswer)[0].content }, rightTagFormatter (status) { return this.enumFormat(this.rightTag, status) @@ -146,3 +153,39 @@ } } </script> + +<style scoped> + +/deep/ .el-checkbox__input.is-disabled + .el-checkbox__label { + color: #606266 +} + +/deep/ .el-checkbox__input.is-disabled.is-checked + .el-checkbox__label { + color: #606266 +} + +/deep/ .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner:after { + border-color: #606266 +} + +/deep/ .el-radio__input.is-disabled + span.el-radio__label { + color: #606266 +} + +/deep/ .el-radio__input.is-disabled.is-checked .el-radio__inner::after { + background-color: #606266; +} + +/deep/ .el-radio__input.is-disabled .el-radio__inner, .el-radio__input.is-disabled.is-checked .el-radio__inner { + border-color: #606266 +} + +/deep/ .el-input.is-disabled .el-input__inner, textarea:disabled { + color: #606266 +} + +/deep/ .el-range-editor.is-disabled input { + color: #606266 +} + +</style> -- Gitblit v1.8.0