From 54730b188630e71ac9ee4044a4b9be160072d0d1 Mon Sep 17 00:00:00 2001
From: 龚焕茏 <2842157468@qq.com>
Date: 星期二, 02 七月 2024 10:59:22 +0800
Subject: [PATCH] feat:新增考试记录题目查看
---
src/views/answer/components/QuestionAnswerShow.vue | 126 ++++++---
src/views/answer/detail.vue | 430 +++++++++-----------------------
src/views/answer/info.vue | 2
src/views/answer/MarkPaperShow.vue | 191 ++++++++++++++
4 files changed, 402 insertions(+), 347 deletions(-)
diff --git a/src/views/answer/MarkPaperShow.vue b/src/views/answer/MarkPaperShow.vue
new file mode 100644
index 0000000..6b875da
--- /dev/null
+++ b/src/views/answer/MarkPaperShow.vue
@@ -0,0 +1,191 @@
+<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 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>
+ </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" disabled>
+ <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 " disabled>
+ <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]" disabled/>
+ </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.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.questionAnswer }}</span>
+ </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>
+ </div>
+
+</template>
+
+<script>
+import { mapState, mapGetters } from 'vuex'
+
+export default {
+ name: 'QuestionShow',
+ props: {
+ question: {
+ type: Object,
+ default: function () {
+ return {}
+ }
+ },
+ answer: {
+ type: Array,
+ default: function () {
+ return {}
+ }
+ },
+ qLoading: {
+ type: Boolean,
+ default: false
+ },
+ qType: {
+ type: Number,
+ default: 0
+ }
+ },
+ 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.questionItemList.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>
+
+<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>
diff --git a/src/views/answer/components/QuestionAnswerShow.vue b/src/views/answer/components/QuestionAnswerShow.vue
index f94f3ad..613bdf1 100644
--- a/src/views/answer/components/QuestionAnswerShow.vue
+++ b/src/views/answer/components/QuestionAnswerShow.vue
@@ -1,12 +1,13 @@
<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 == 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-title" v-html="question.title"/>
<div class="q-content">
- <el-radio-group v-model="answer.content">
- <el-radio v-for="item in question.items" :key="item.prefix" :label="item.prefix">
+ <el-radio-group v-model="question.answer">
+ <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>
@@ -15,10 +16,10 @@
</div>
<!-- 澶氶�� -->
<div v-else-if="qType == 2">
- <div class="q-title" v-html="question.title" />
+ <div class="q-title" v-html="question.title"/>
<div class="q-content">
- <el-checkbox-group v-model="answer.contentArray">
- <el-checkbox v-for="item in question.items" :label="item.prefix" :key="item.prefix">
+ <el-checkbox-group v-model="question.answerList">
+ <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>
@@ -29,8 +30,8 @@
<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="answer.content">
- <el-radio v-for="item in question.items" :key="item.prefix" :label="item.prefix">
+ <el-radio-group v-model="question.answer">
+ <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>
@@ -38,52 +39,54 @@
</div>
<!-- 濉┖ -->
<div v-else-if="qType == 4">
- <div class="q-title" v-html="question.title" />
- <div v-if="answer.contentArray !== null">
- <el-form-item :label="item.prefix" :key="item.prefix" v-for="item in question.items" label-width="50px"
- style="margin-top: 10px;margin-bottom: 10px;">
- <el-input v-model="answer.contentArray[item.prefix - 1]" />
+ <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]" disabled/>
</el-form-item>
</div>
</div>
<!-- 绠�绛斻�佽绠椼�佸垎鏋� -->
<div v-else-if="qType == 5 || qType == 7 || qType == 8">
- <div class="q-title" v-html="question.title" />
+ <div class="q-title" v-html="question.title"/>
<div>
- <el-input v-model="answer.content" 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">
<span class="question-show-item">缁撴灉锛�</span>
- <el-tag :type="doRightTagFormatter(answer.doRight)">
- {{ doRightTextFormatter(answer.doRight) }}
+ <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 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 />
+ <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" />
+ <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.correct" class="q-item-span-content" />
+ <span v-if="qType == 1 || qType == 2 || qType == 5 || qType == 6 || qType == 7 || qType == 8"
+ 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 == 3" v-html="trueFalseFormatter(question)" class="q-item-span-content"/>
<!-- 濉┖ -->
- <span v-if="qType == 4">{{ question.correctArray }}</span>
- </div>
- <div v-if = "answer.doRight == null">
- <span style="color:#ECAB3C;">{{'鎵规敼锛�'}}</span>
- <el-input-number size="mini" v-model="answer.score" :precision="1" :min="0" :max="parseInt(question.score)" ></el-input-number>
+ <span v-if="qType == 4">{{ question.questionAnswer }}</span>
</div>
</div>
<div v-else>
@@ -94,6 +97,7 @@
<script>
import { mapState, mapGetters } from 'vuex'
+
export default {
name: 'QuestionShow',
props: {
@@ -104,9 +108,9 @@
}
},
answer: {
- type: Object,
+ type: Array,
default: function () {
- return { id: null, content: '', contentArray: [], doRight: false }
+ return {}
}
},
qLoading: {
@@ -119,22 +123,66 @@
}
},
methods: {
- trueFalseFormatter(question) {
- return question.items.filter(d => d.prefix === question.correct)[0].content
+ 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
+ }
},
- doRightTagFormatter(status) {
- return this.enumFormat(this.doRightTag, status)
+ trueFalseFormatter (question) {
+ return question.questionItemList.filter(d => d.prefix === question.questionAnswer)[0].content
},
- doRightTextFormatter(status) {
- return this.enumFormat(this.doRightEnum, status)
+ rightTagFormatter (status) {
+ return this.enumFormat(this.rightTag, status)
+ },
+ rightTextFormatter (status) {
+ return this.enumFormat(this.rightEnum, status)
}
},
computed: {
...mapGetters('enumItem', ['enumFormat']),
...mapState('enumItem', {
- doRightEnum: state => state.exam.question.answer.doRightEnum,
- doRightTag: state => state.exam.question.answer.doRightTag
+ rightEnum: state => state.exam.question.answer.doRightEnum,
+ rightTag: state => state.exam.question.answer.doRightTag
})
}
}
</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>
diff --git a/src/views/answer/detail.vue b/src/views/answer/detail.vue
index 84773ca..3c1a44b 100644
--- a/src/views/answer/detail.vue
+++ b/src/views/answer/detail.vue
@@ -1,322 +1,127 @@
<template>
- <div style="background-color: #FFFFFF; padding-top: 50px;min-height: 900px;">
- <el-row class="do-exam-title" style="background-color: #F5F5DC">
- <el-col :span="24">
- <span :key="item.itemOrder" v-for="item in answer.answerItems">
- <el-tag :type="questionDoRightTag(item.doRight)" class="do-exam-title-tag"
+ <div class="paper-container">
+ <div class="paper-card" v-loading="formLoading">
+ <el-card style="height: 100vh">
+ <el-row style="text-align: left; margin-bottom : 20px; font-size: 20px">璇枃鑰冭瘯</el-row>
+ <el-row>
+ <el-col class="info">
+ <span class="exam-info">瀛﹀憳濮撳悕锛�</span>
+ <span class="exam-info">{{ form.userName }}</span>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col class="info">
+ <span class="exam-info">浜ゅ嵎鏃堕棿锛�</span>
+ <span class="exam-info">{{ form.submitTime }}</span>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col class="info">
+ <span class="exam-info">瀹屾垚鑰楁椂锛�</span>
+ <span class="exam-info">{{ formattedDoTime }}</span>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col class="info">
+ <span class="exam-info">寰楀垎锛�</span>
+ <span class="exam-info">{{ form.score + ' / ' + form.totalScore }}</span>
+ </el-col>
+ </el-row>
+ <el-divider></el-divider>
+ <el-row class="do-exam-title">
+ <el-col :span="24">
+ <span :key="item.itemOrder" v-for="item in form.navbar">
+ <el-tag :type="questionDoRightTag(item.right)" class="do-exam-title-tag"
@click="goAnchor('#question-' + item.itemOrder)">{{ item.itemOrder }}</el-tag>
</span>
- </el-col>
- </el-row>
- <el-container class="app-item-contain">
- <el-header class="align-center">
- <h1>{{ form.name }}</h1>
- <div>
- <span class="question-title-padding">璇曞嵎寰楀垎锛歿{ answer.score }}</span>
- <span class="question-title-padding">璇曞嵎鑰楁椂锛歿{ formatSeconds(answer.doTime) }}</span>
- </div>
- </el-header>
- <el-main>
- <el-form :model="form" ref="form" v-loading="formLoading" label-width="100px">
- <el-row :key="index" v-for="(titleItem, index) in form.titleItems">
- <h3>{{ titleItem.name }}</h3>
- <el-card class="exampaper-item-box" v-if="titleItem.questionItems.length !== 0">
- <el-form-item :key="questionItem.itemOrder" :label="questionItem.itemOrder + '.'"
- v-for="questionItem in titleItem.questionItems" class="exam-question-item"
- label-width="50px" :id="'question-' + questionItem.itemOrder">
- <QuestionAnswerShow :qType="questionItem.questionType" :question="questionItem"
- :answer="answer.answerItems[questionItem.itemOrder - 1]"/>
- </el-form-item>
- </el-card>
- </el-row>
- </el-form>
- </el-main>
- </el-container>
+ </el-col>
+ </el-row>
+ </el-card>
+ </div>
+ <div class="paper-form">
+ <el-form :model="form" ref="form" v-loading="formLoading" label-width="100px">
+ <el-row :key="index" v-for="(titleItem, index) in form.titleItems">
+ <h3>{{ titleItem.title }}</h3>
+ <el-card class="exampaper-item-box" v-if="titleItem.questionList.length !== 0">
+ <el-form-item :key="questionItem.itemOrder" :label="questionItem.itemOrder + '.'"
+ v-for="questionItem in titleItem.questionList" class="exam-question-item"
+ label-width="50px" :id="'question-' + questionItem.itemOrder">
+ <MarkPaperShow :qType="questionItem.questionType" :question="questionItem" :answer="form.navbar"/>
+ </el-form-item>
+ </el-card>
+ </el-row>
+ </el-form>
+ </div>
</div>
</template>
<script>
-import { mapState, mapGetters } from 'vuex'
-import QuestionAnswerShow from './components/QuestionAnswerShow'
import examPaperAnswerApi from '@/api/examPaperAnswer'
+import MarkPaperShow from '@/views/answer/components/QuestionAnswerShow'
+import { mapGetters, mapState } from 'vuex'
export default {
- components: { QuestionAnswerShow },
- data () {
- return {
- form: {},
- formLoading: false,
- answer: {
- id: null,
- score: 0,
- doTime: 0,
- answerItems: [],
- doRight: false
- }
- }
- },
- created () {
+ name: 'MarkPaperDetail',
+ components: { MarkPaperShow },
+ mounted () {
let id = this.$route.query.id
- let _this = this
if (id && parseInt(id) !== 0) {
- _this.formLoading = true
+ this.formLoading = true
examPaperAnswerApi.read(id).then(re => {
- re = {
- 'code': 1, 'message': '鎴愬姛', 'data': {
- 'paper': {
- 'id': 30,
- 'level': 1,
- 'subjectId': 4,
- 'paperType': 7,
- 'name': '杩欐槸涓�涓祴璇曡瘯鍗�',
- 'suggestTime': 12,
- 'limitDateTime': null,
- 'titleItems': [{
- 'name': '鍗曢�夐',
- 'questionItems': [{
- 'id': 25,
- 'questionType': 1,
- 'subjectId': 4,
- 'title': '涓崕鍥涘ぇ鍚嶈憲閮芥湁鍝簺锛屼笅鍒楁纭殑鏄�',
- 'gradeLevel': 1,
- 'items': [{ 'prefix': 'A', 'content': '绾㈡ゼ姊�', 'score': null, 'itemUuid': null }, {
- 'prefix': 'B',
- 'content': '鐧芥ゼ姊�',
- 'score': null,
- 'itemUuid': null
- }, { 'prefix': 'C', 'content': '闈掓ゼ姊�', 'score': null, 'itemUuid': null }, {
- 'prefix': 'D',
- 'content': '缁挎ゼ姊�',
- 'score': null,
- 'itemUuid': null
- }],
- 'analyze': '棰樼洰姣旇緝绠�鍗曪紝鑷鍒嗘瀽',
- 'correctArray': null,
- 'correct': 'A',
- 'score': '2.5',
- 'difficult': 3,
- 'itemOrder': 1,
- 'knowledgeIdList': [8, 9]
- }, {
- 'id': 30,
- 'questionType': 1,
- 'subjectId': 4,
- 'title': '涓崕鍥涘ぇ鍚嶈憲閮芥湁鍝簺锛屼笅鍒楁纭殑鏄�',
- 'gradeLevel': 1,
- 'items': [{ 'prefix': 'A', 'content': '绾㈡ゼ姊�', 'score': null, 'itemUuid': null }, {
- 'prefix': 'B',
- 'content': '鐧芥ゼ姊�',
- 'score': null,
- 'itemUuid': null
- }, { 'prefix': 'C', 'content': '闈掓ゼ姊�', 'score': null, 'itemUuid': null }, {
- 'prefix': 'D',
- 'content': '缁挎ゼ姊�',
- 'score': null,
- 'itemUuid': null
- }],
- 'analyze': '棰樼洰姣旇緝绠�鍗曪紝鑷鍒嗘瀽',
- 'correctArray': null,
- 'correct': 'A',
- 'score': '2.5',
- 'difficult': 3,
- 'itemOrder': 2,
- 'knowledgeIdList': [8, 9]
- }]
- }, {
- 'name': '澶氶�夐',
- 'questionItems': [{
- 'id': 26,
- 'questionType': 2,
- 'subjectId': 4,
- 'title': '涓崕鍥涘ぇ鍚嶈憲閮芥湁鍝簺锛屼笅鍒楁纭殑鏄�',
- 'gradeLevel': 1,
- 'items': [{ 'prefix': 'A', 'content': '绾㈡ゼ姊�', 'score': null, 'itemUuid': null }, {
- 'prefix': 'B',
- 'content': '鐧芥ゼ姊�',
- 'score': null,
- 'itemUuid': null
- }, { 'prefix': 'C', 'content': '闈掓ゼ姊�', 'score': null, 'itemUuid': null }, {
- 'prefix': 'D',
- 'content': '缁挎ゼ姊�',
- 'score': null,
- 'itemUuid': null
- }],
- 'analyze': '棰樼洰姣旇緝绠�鍗曪紝鑷鍒嗘瀽',
- 'correctArray': ['A', 'C'],
- 'correct': 'A,C',
- 'score': '2.5',
- 'difficult': 3,
- 'itemOrder': 3,
- 'knowledgeIdList': [8, 9]
- }, {
- 'id': 31,
- 'questionType': 2,
- 'subjectId': 4,
- 'title': '涓崕鍥涘ぇ鍚嶈憲閮芥湁鍝簺锛屼笅鍒楁纭殑鏄�',
- 'gradeLevel': 1,
- 'items': [{ 'prefix': 'A', 'content': '绾㈡ゼ姊�', 'score': null, 'itemUuid': null }, {
- 'prefix': 'B',
- 'content': '鐧芥ゼ姊�',
- 'score': null,
- 'itemUuid': null
- }, { 'prefix': 'C', 'content': '闈掓ゼ姊�', 'score': null, 'itemUuid': null }, {
- 'prefix': 'D',
- 'content': '缁挎ゼ姊�',
- 'score': null,
- 'itemUuid': null
- }],
- 'analyze': '棰樼洰姣旇緝绠�鍗曪紝鑷鍒嗘瀽',
- 'correctArray': ['A', 'C'],
- 'correct': 'A,C',
- 'score': '2.5',
- 'difficult': 3,
- 'itemOrder': 4,
- 'knowledgeIdList': [8, 9]
- }]
- }, {
- 'name': '鍒ゆ柇棰�',
- 'questionItems': [{
- 'id': 27,
- 'questionType': 3,
- 'subjectId': 4,
- 'title': '涓崕鍥涘ぇ鍚嶈憲閮芥湁鍝簺锛屼笅鍒楄鏄庢纭悧',
- 'gradeLevel': 1,
- 'items': [{ 'prefix': 'A', 'content': '姝g‘', 'score': null, 'itemUuid': null }, {
- 'prefix': 'B',
- 'content': '閿欒',
- 'score': null,
- 'itemUuid': null
- }],
- 'analyze': '棰樼洰姣旇緝绠�鍗曪紝鑷鍒嗘瀽',
- 'correctArray': null,
- 'correct': 'A',
- 'score': '2.5',
- 'difficult': 3,
- 'itemOrder': 5,
- 'knowledgeIdList': [8, 9]
- }, {
- 'id': 32,
- 'questionType': 3,
- 'subjectId': 4,
- 'title': '涓崕鍥涘ぇ鍚嶈憲閮芥湁鍝簺锛屼笅鍒楄鏄庢纭悧',
- 'gradeLevel': 1,
- 'items': [{ 'prefix': 'A', 'content': '姝g‘', 'score': null, 'itemUuid': null }, {
- 'prefix': 'B',
- 'content': '閿欒',
- 'score': null,
- 'itemUuid': null
- }],
- 'analyze': '棰樼洰姣旇緝绠�鍗曪紝鑷鍒嗘瀽',
- 'correctArray': null,
- 'correct': 'A',
- 'score': '2.5',
- 'difficult': 3,
- 'itemOrder': 6,
- 'knowledgeIdList': [8, 9]
- }]
- }],
- 'score': '15',
- 'classes': null
- },
- 'answer': {
- 'id': 9,
- 'doTime': 26,
- 'score': '100',
- 'createUser': null,
- 'answerItems': [{
- 'id': 25,
- 'questionId': 25,
- 'doRight': true,
- 'content': 'A',
- 'itemOrder': 1,
- 'contentArray': null,
- 'score': '2.5',
- 'questionScore': '2.5'
- }, {
- 'id': 26,
- 'questionId': 30,
- 'doRight': false,
- 'content': 'C',
- 'itemOrder': 2,
- 'contentArray': null,
- 'score': '0',
- 'questionScore': '2.5'
- }, {
- 'id': 27,
- 'questionId': 26,
- 'doRight': false,
- 'content': '',
- 'itemOrder': 3,
- 'contentArray': [''],
- 'score': '0',
- 'questionScore': '2.5'
- }, {
- 'id': 28,
- 'questionId': 31,
- 'doRight': false,
- 'content': 'C,D',
- 'itemOrder': 4,
- 'contentArray': ['C', 'D'],
- 'score': '0',
- 'questionScore': '2.5'
- }, {
- 'id': 29,
- 'questionId': 27,
- 'doRight': true,
- 'content': 'A',
- 'itemOrder': 5,
- 'contentArray': null,
- 'score': '2.5',
- 'questionScore': '2.5'
- }, {
- 'id': 30,
- 'questionId': 32,
- 'doRight': true,
- 'content': 'A',
- 'itemOrder': 6,
- 'contentArray': null,
- 'score': '2.5',
- 'questionScore': '2.5'
- }],
- 'doTimeStr': '26绉�'
- }
- }
- }
- _this.form = re.data.paper
- _this.answer = re.data.answer
- _this.formLoading = false
+ this.formLoading = true
+ this.form = re.data
+ console.log('this.form', this.form);
+ this.formLoading = false
})
}
},
+ data () {
+ return {
+ paperQuestionList: [],
+ form: {},
+ formLoading: false,
+ userId: null,
+ userName: '寮犱笁',
+ questionLoading: false
+ }
+ },
methods: {
- formatSeconds (theTime) {
- let theTime1 = 0
- let theTime2 = 0
- if (theTime > 60) {
- theTime1 = parseInt(theTime / 60)
- theTime = parseInt(theTime % 60)
- if (theTime1 > 60) {
- theTime2 = parseInt(theTime1 / 60)
- theTime1 = parseInt(theTime1 % 60)
- }
- }
- let result = '' + parseInt(theTime) + '绉�'
- if (theTime1 > 0) {
- result = '' + parseInt(theTime1) + '鍒�' + result
- }
- if (theTime2 > 0) {
- result = '' + parseInt(theTime2) + '灏忔椂' + result
- }
- return result
+ open () {
+ this.$confirm('纭鏄惁鎻愪氦鎴愮哗鎵规敼?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ submitMark(this.form).then(re => {
+ if (re.data.code === 1) {
+ console.log('1111111')
+ this.$message.success('鎻愪氦鎴愬姛')
+ this.$router.back()
+ } else {
+ this.$message.error(re.message)
+ }
+ })
+ })
+ },
+ goAnchor (selector) {
+ this.$el.querySelector(selector).scrollIntoView({ behavior: 'instant', block: 'center', inline: 'nearest' })
},
questionDoRightTag (status) {
return this.enumFormat(this.doRightTag, status)
},
- goAnchor (selector) {
- this.$el.querySelector(selector).scrollIntoView({ behavior: 'instant', block: 'center', inline: 'nearest' })
+ getStudentPaper () {
+ getStudentExam(this.examInfo.examId, this.userId).then(res => {
+ this.examInfo = res.data.data
+ })
}
},
computed: {
+ formattedDoTime () {
+ const totalSeconds = this.form.doTime
+ const minutes = Math.floor(totalSeconds / 60)
+ const seconds = totalSeconds % 60
+ return `${minutes}鍒�${seconds < 10 ? '0' + seconds : seconds}绉抈
+ },
...mapGetters('enumItem', ['enumFormat']),
...mapState('enumItem', {
doRightTag: state => state.exam.question.answer.doRightTag
@@ -325,21 +130,32 @@
}
</script>
-<style lang="scss" scoped>
-.align-center {
- text-align: center
+<style scoped>
+
+.paper-container {
+ display: flex;
+ flex-direction: row;
+ height: 100%;
+ padding: 20px;
+ min-height: 100%;
}
-.exam-question-item {
- padding: 10px;
-
- .el-form-item__label {
- font-size: 15px !important;
- }
+.paper-card {
+ position: fixed;
+ width: 270px;
}
-.question-title-padding {
- padding-left: 25px;
- padding-right: 25px;
+.paper-form {
+ flex: 1; /* 鍗犳嵁鍓╀綑绌洪棿 */
+ margin-left: 300px;
}
+
+.info {
+ display: flex;
+ flex-direction: row;
+ justify-content: left;
+ font-size: 14px;
+ margin-top: 10px;
+}
+
</style>
diff --git a/src/views/answer/info.vue b/src/views/answer/info.vue
index 5541c42..23ba2dc 100644
--- a/src/views/answer/info.vue
+++ b/src/views/answer/info.vue
@@ -103,7 +103,7 @@
var url = window.URL.createObjectURL(x.response);
var a = document.createElement("a");
a.href = url;
- a.download = that.tableData[0].paperName + '.xlsx';
+ a.download = that.tableData[0].examName + '.xlsx';
a.click();
};
x.send();
--
Gitblit v1.8.0