|
@@ -2,23 +2,19 @@
|
|
|
<el-container>
|
|
<el-container>
|
|
|
<el-header height="150">
|
|
<el-header height="150">
|
|
|
<el-card style="height: 150px">
|
|
<el-card style="height: 150px">
|
|
|
- <span class="examName">{{ examInfo.examName }}</span>
|
|
|
|
|
|
|
+ <span class="examName">{{ examRecord.examName }}</span>
|
|
|
<span class="examTime">{{ examRecord.examTime }}</span>
|
|
<span class="examTime">{{ examRecord.examTime }}</span>
|
|
|
-
|
|
|
|
|
<el-row style="margin-top: 55px;">
|
|
<el-row style="margin-top: 55px;">
|
|
|
- <el-tooltip class="item" effect="dark" content="包括(单选,多选,判断题)" placement="top-start">
|
|
|
|
|
|
|
+ <el-tooltip class="item" effect="dark" content="包括选择题和判断题" placement="top-start">
|
|
|
<span style="font-weight: 800;font-size: 17px">
|
|
<span style="font-weight: 800;font-size: 17px">
|
|
|
- 逻辑题得分: {{ examRecord.logicScore }}分</span>
|
|
|
|
|
|
|
+ 客观题得分: {{ examRecord.logicScore }}分</span>
|
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
|
-
|
|
|
|
|
<el-tooltip class="item" effect="dark" content="简答题与逻辑题" placement="top-start">
|
|
<el-tooltip class="item" effect="dark" content="简答题与逻辑题" placement="top-start">
|
|
|
<span style="float: right;font-weight: 800;font-size: 17px">
|
|
<span style="float: right;font-weight: 800;font-size: 17px">
|
|
|
- 总分: {{ examInfo.totalScore }}分</span>
|
|
|
|
|
|
|
+ 试卷总分: {{ examRecord.totalScore }}分</span>
|
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
-
|
|
|
|
|
</el-card>
|
|
</el-card>
|
|
|
-
|
|
|
|
|
</el-header>
|
|
</el-header>
|
|
|
|
|
|
|
|
<el-main>
|
|
<el-main>
|
|
@@ -29,11 +25,15 @@
|
|
|
<i class="num">{{ index + 1 }}</i>
|
|
<i class="num">{{ index + 1 }}</i>
|
|
|
<span v-if="item.questionType === 1">【单选题】</span>
|
|
<span v-if="item.questionType === 1">【单选题】</span>
|
|
|
<span v-else-if="item.questionType === 2">【多选题】</span>
|
|
<span v-else-if="item.questionType === 2">【多选题】</span>
|
|
|
- <span v-else-if="item.questionType === 3">【判断题】</span>
|
|
|
|
|
- <span v-else>【简答题】</span>
|
|
|
|
|
|
|
+ <span v-else-if="item.questionType === 3">【不定项选择题】</span>
|
|
|
|
|
+ <span v-else-if="item.questionType === 4">【判断题】</span>
|
|
|
|
|
+ <span v-else-if="item.questionType === 5">【填空题】</span>
|
|
|
|
|
+ <span v-else-if="item.questionType === 6">【问答题】</span>
|
|
|
|
|
+ <span v-else-if="item.questionType === 7">【理解题】</span>
|
|
|
|
|
+ <span v-else>【综合题】</span>
|
|
|
<span>{{ item.questionContent }}:</span>
|
|
<span>{{ item.questionContent }}:</span>
|
|
|
<span style="color: red;font-style: italic;font-weight: 400;"> {{
|
|
<span style="color: red;font-style: italic;font-weight: 400;"> {{
|
|
|
- questionScore.get(String(item.questionId))
|
|
|
|
|
|
|
+ item.score
|
|
|
}}分</span>
|
|
}}分</span>
|
|
|
</div>
|
|
</div>
|
|
|
<!--题目中的配图-->
|
|
<!--题目中的配图-->
|
|
@@ -46,9 +46,9 @@
|
|
|
@click="showBigImg(url)"
|
|
@click="showBigImg(url)"
|
|
|
>
|
|
>
|
|
|
|
|
|
|
|
- <!--单选 和 判断 的答案列表-->
|
|
|
|
|
|
|
+ <!-- 单选和判断题候选答案列表 -->
|
|
|
<div
|
|
<div
|
|
|
- v-show="item.questionType === 1 || item.questionType === 3"
|
|
|
|
|
|
|
+ v-show="item.questionType === 1 || item.questionType === 4"
|
|
|
style="margin-top: 25px"
|
|
style="margin-top: 25px"
|
|
|
>
|
|
>
|
|
|
<div class="el-radio-group">
|
|
<div class="el-radio-group">
|
|
@@ -73,8 +73,11 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <!--多选的答案列表-->
|
|
|
|
|
- <div v-show="item.questionType === 2" style="margin-top: 25px">
|
|
|
|
|
|
|
+ <!-- 多选和不定项选择题的候选答案列表 -->
|
|
|
|
|
+ <div
|
|
|
|
|
+ v-show="item.questionType === 2 || item.questionType === 3"
|
|
|
|
|
+ style="margin-top: 25px"
|
|
|
|
|
+ >
|
|
|
<div class="el-radio-group">
|
|
<div class="el-radio-group">
|
|
|
<label
|
|
<label
|
|
|
v-for="(i2,index2) in item.answer"
|
|
v-for="(i2,index2) in item.answer"
|
|
@@ -97,16 +100,17 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <!--简答题的答案-->
|
|
|
|
|
- <div v-show="item.questionType === 4" style="margin-top: 25px">
|
|
|
|
|
|
|
+ <!-- 填空题和问答题的回答区 -->
|
|
|
|
|
+ <div
|
|
|
|
|
+ v-show="item.questionType === 5 || item.questionType === 6"
|
|
|
|
|
+ style="margin-top: 25px"
|
|
|
|
|
+ >
|
|
|
<div class="ques-analysis">
|
|
<div class="ques-analysis">
|
|
|
<h3 style="font-weight: 400">我的回答:</h3>
|
|
<h3 style="font-weight: 400">我的回答:</h3>
|
|
|
<p style="font-weight: 400;color: orange"> {{ userAnswer[index] }} </p>
|
|
<p style="font-weight: 400;color: orange"> {{ userAnswer[index] }} </p>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
</el-card>
|
|
</el-card>
|
|
|
</el-main>
|
|
</el-main>
|
|
|
|
|
|
|
@@ -118,7 +122,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import { getExamInfoById, getExamPaperScore, getExamResult, getQuestionByIds } from '@/api/exam'
|
|
|
|
|
|
|
+import { getExamResult, getQuestionByIds, getQuestionByPaperId } from '@/api/exam'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'ExamResult',
|
|
name: 'ExamResult',
|
|
@@ -148,12 +152,12 @@ export default {
|
|
|
document.title = '考试结果'
|
|
document.title = '考试结果'
|
|
|
this.getExamRecord()
|
|
this.getExamRecord()
|
|
|
// 页面数据加载的等待状态栏
|
|
// 页面数据加载的等待状态栏
|
|
|
- /* this.loading = this.$Loading.service({
|
|
|
|
|
|
|
+ this.loading = this.$loading({
|
|
|
body: true,
|
|
body: true,
|
|
|
lock: true,
|
|
lock: true,
|
|
|
text: '数据拼命加载中,(*╹▽╹*)',
|
|
text: '数据拼命加载中,(*╹▽╹*)',
|
|
|
spinner: 'el-icon-loading'
|
|
spinner: 'el-icon-loading'
|
|
|
- })*/
|
|
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
// 查询用户当时考试的信息
|
|
// 查询用户当时考试的信息
|
|
@@ -162,23 +166,15 @@ export default {
|
|
|
await getExamResult(examId).then((resp) => {
|
|
await getExamResult(examId).then((resp) => {
|
|
|
if (resp.code === 0) {
|
|
if (resp.code === 0) {
|
|
|
this.examRecord = resp.data
|
|
this.examRecord = resp.data
|
|
|
- this.getExamInfoById(resp.data.examId)
|
|
|
|
|
- this.userAnswer = resp.data.userAnswers.split('-')
|
|
|
|
|
- // 获取单题的分值
|
|
|
|
|
- this.getQuestionScore(resp.data.examId)
|
|
|
|
|
- // 获取所有题目信息
|
|
|
|
|
- this.getQuestionInfoByIds(resp.data.questionIds)
|
|
|
|
|
|
|
+ // this.userAnswer = resp.data.userAnswers.split('-')
|
|
|
|
|
+ this.userAnswer = resp.data.userAnswers.split(',')
|
|
|
|
|
+ const paperId = resp.data.examId
|
|
|
|
|
+ this.getPaperQuestions(paperId)
|
|
|
// 数据加载完毕
|
|
// 数据加载完毕
|
|
|
- // this.loading.close()
|
|
|
|
|
|
|
+ this.loading.close()
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- // 根据考试id查询考试信息
|
|
|
|
|
- getExamInfoById(examId) {
|
|
|
|
|
- getExamInfoById(examId).then((resp) => {
|
|
|
|
|
- if (resp.code === 0) this.examInfo = resp.data
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
// 根据ids查询题目信息
|
|
// 根据ids查询题目信息
|
|
|
async getQuestionInfoByIds(questionIds) {
|
|
async getQuestionInfoByIds(questionIds) {
|
|
|
await getQuestionByIds({ ids: questionIds }).then((resp) => {
|
|
await getQuestionByIds({ ids: questionIds }).then((resp) => {
|
|
@@ -191,6 +187,17 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ async getPaperQuestions(paperId) {
|
|
|
|
|
+ await getQuestionByPaperId(paperId).then((resp) => {
|
|
|
|
|
+ if (resp.code === 0) {
|
|
|
|
|
+ this.questionInfo = resp.data || []
|
|
|
|
|
+ // 重置问题的顺序 单选 多选 判断 简答
|
|
|
|
|
+ this.questionInfo = this.questionInfo.sort(function(a, b) {
|
|
|
|
|
+ return a.questionType - b.questionType
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
// 点击展示高清大图
|
|
// 点击展示高清大图
|
|
|
showBigImg(url) {
|
|
showBigImg(url) {
|
|
|
this.bigImgUrl = url
|
|
this.bigImgUrl = url
|
|
@@ -198,16 +205,6 @@ export default {
|
|
|
},
|
|
},
|
|
|
// 根据考试id查询考试中每一题的分数
|
|
// 根据考试id查询考试中每一题的分数
|
|
|
async getQuestionScore(examId) {
|
|
async getQuestionScore(examId) {
|
|
|
- await getExamPaperScore(examId).then((resp) => {
|
|
|
|
|
- if (resp.code === 0) {
|
|
|
|
|
- // 设置单题分值给map
|
|
|
|
|
- const scores = resp.data.scores.split(',')
|
|
|
|
|
- resp.data.questionIds.split(',').forEach((item, index) => {
|
|
|
|
|
- // this.$set(this.questionScore, item, scores[index])
|
|
|
|
|
- this.questionScore.set(item, scores[index])
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|