|
@@ -44,7 +44,7 @@
|
|
|
<view class="text-xs text-gray">错误</view>
|
|
<view class="text-xs text-gray">错误</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="stat-item">
|
|
<view class="stat-item">
|
|
|
- <view class="stat-num text-blue">{{ detail.accuracy }}</view>
|
|
|
|
|
|
|
+ <view class="stat-num text-blue">{{ detail.accuracy }}%</view>
|
|
|
<view class="text-xs text-gray">正确率</view>
|
|
<view class="text-xs text-gray">正确率</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -55,7 +55,7 @@
|
|
|
<view class="detail-panel">
|
|
<view class="detail-panel">
|
|
|
<view class="detail-title">
|
|
<view class="detail-title">
|
|
|
答题详情
|
|
答题详情
|
|
|
- <text class="text-gray detail-title-sub">(共{{ detail.totalQuestionNum || 0 }}题)</text>
|
|
|
|
|
|
|
+ <text class="text-gray detail-title-sub">(共{{ total || 0 }}题)</text>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view v-for="(item, index) in answerList" :key="index" class="question-card">
|
|
<view v-for="(item, index) in answerList" :key="index" class="question-card">
|
|
@@ -69,17 +69,23 @@
|
|
|
{{ isCorrect(item) ? '答对' : '答错' }}
|
|
{{ isCorrect(item) ? '答对' : '答错' }}
|
|
|
</text>
|
|
</text>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="q-content">{{ item.questionContent }}</view>
|
|
|
|
|
|
|
+ <view class="q-content">
|
|
|
|
|
+ <rich-text :nodes="item.questionContent || ''"></rich-text>
|
|
|
|
|
+ </view>
|
|
|
<view class="answer-box" :class="isCorrect(item) ? 'answer-box-correct' : 'answer-box-wrong'">
|
|
<view class="answer-box" :class="isCorrect(item) ? 'answer-box-correct' : 'answer-box-wrong'">
|
|
|
<view class="mb4">
|
|
<view class="mb4">
|
|
|
<text class="text-xs text-gray">我的答案:</text>
|
|
<text class="text-xs text-gray">我的答案:</text>
|
|
|
- <text class="text-xs fw500" :class="isCorrect(item) ? 'text-green' : 'text-red'">
|
|
|
|
|
- {{ item.userAnswer }}{{ answerSuffix(item) }}
|
|
|
|
|
|
|
+ <text v-if="item.answerTags[0]" class="text-xs fw500" :class="isCorrect(item) ? 'text-green' : 'text-red'">
|
|
|
|
|
+ <!-- {{ item.answerTags }}{{ answerSuffix(item) }} -->
|
|
|
|
|
+ {{ item.answerTags }}
|
|
|
|
|
+ </text>
|
|
|
|
|
+ <text v-if="!item.answerTags[0]" class="text-xs fw500" :class="isCorrect(item) ? 'text-green' : 'text-red'">
|
|
|
|
|
+ 未作答
|
|
|
</text>
|
|
</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view>
|
|
<view>
|
|
|
<text class="text-xs text-gray">正确答案:</text>
|
|
<text class="text-xs text-gray">正确答案:</text>
|
|
|
- <text class="text-xs text-green fw500">{{ item.correctAnswer }}</text>
|
|
|
|
|
|
|
+ <text class="text-xs text-green fw500">{{ item.correctAnswerTags }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view v-if="item.analysis" class="analysis-box">解析:{{ item.analysis }}</view>
|
|
<view v-if="item.analysis" class="analysis-box">解析:{{ item.analysis }}</view>
|
|
@@ -94,6 +100,13 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+ import {
|
|
|
|
|
+ parseTime
|
|
|
|
|
+ } from '@/component/public.js'
|
|
|
|
|
+ import {
|
|
|
|
|
+ examElExamUserResultMyScoreDetail,
|
|
|
|
|
+ examElExamAttemptPaperQuestionPage
|
|
|
|
|
+ } from '@/pages_safetyEducationExamination/api/index.js'
|
|
|
// 题型映射:1-单选题,2-多选题,3-判断题
|
|
// 题型映射:1-单选题,2-多选题,3-判断题
|
|
|
const QUESTION_TYPE_MAP = {
|
|
const QUESTION_TYPE_MAP = {
|
|
|
1: '单选题',
|
|
1: '单选题',
|
|
@@ -180,27 +193,30 @@
|
|
|
// 上部分:考试概况(独立详情接口)
|
|
// 上部分:考试概况(独立详情接口)
|
|
|
async loadExamDetail() {
|
|
async loadExamDetail() {
|
|
|
try {
|
|
try {
|
|
|
- // TODO 后台接口未提供,先占位;接口就绪后放开以下代码
|
|
|
|
|
- // const { data } = await examElExamAttemptAnswerDetail({ attemptId: this.attemptId });
|
|
|
|
|
- // if (data.code === 200 && data.data) {
|
|
|
|
|
- // const d = data.data;
|
|
|
|
|
- // this.detail = {
|
|
|
|
|
- // examTypeName: d.examTypeName || '',
|
|
|
|
|
- // examName: d.examName || '',
|
|
|
|
|
- // isPass: d.examStatus === 1,
|
|
|
|
|
- // examTime: parseTime(d.startTime, '{y}-{m}-{d}'),
|
|
|
|
|
- // usedTime: d.myDuration || '-',
|
|
|
|
|
- // totalScore: d.totalScore || 0,
|
|
|
|
|
- // passScore: d.passScore || 0,
|
|
|
|
|
- // attemptCount: d.attemptCount || 0,
|
|
|
|
|
- // attemptLimit: d.attemptLimit || 0,
|
|
|
|
|
- // bestScore: d.bestScore || 0,
|
|
|
|
|
- // totalQuestionNum: d.totalQuestionNum || 0,
|
|
|
|
|
- // correctCount: d.correctCount || 0,
|
|
|
|
|
- // wrongCount: d.wrongCount || 0,
|
|
|
|
|
- // accuracy: d.accuracy || '-',
|
|
|
|
|
- // };
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ let obj = {
|
|
|
|
|
+ examId:this.examId,
|
|
|
|
|
+ examScene:1,
|
|
|
|
|
+ }
|
|
|
|
|
+ const { data } = await examElExamUserResultMyScoreDetail(obj);
|
|
|
|
|
+ if (data.code === 200 && data.data) {
|
|
|
|
|
+ const d = data.data;
|
|
|
|
|
+ this.detail = {
|
|
|
|
|
+ examTypeName: d.examTypeName || '',
|
|
|
|
|
+ examName: d.examName || '',
|
|
|
|
|
+ isPass: d.examStatus === 1,
|
|
|
|
|
+ examTime: parseTime(d.startTime, '{y}-{m}-{d}'),
|
|
|
|
|
+ usedTime: d.myDuration || '-',
|
|
|
|
|
+ totalScore: d.totalScore || 0,
|
|
|
|
|
+ passScore: d.passScore || 0,
|
|
|
|
|
+ attemptCount: d.attemptCount || 0,
|
|
|
|
|
+ attemptLimit: d.attemptLimit || 0,
|
|
|
|
|
+ bestScore: d.bestScore || 0,
|
|
|
|
|
+ totalQuestionNum: d.totalQuestionNum || 0,
|
|
|
|
|
+ correctCount: d.correctCount || 0,
|
|
|
|
|
+ wrongCount: d.wrongCount || 0,
|
|
|
|
|
+ accuracy: d.accuracy || '-',
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
console.error('获取考试详情失败', e);
|
|
console.error('获取考试详情失败', e);
|
|
|
}
|
|
}
|
|
@@ -216,23 +232,22 @@
|
|
|
if (this.listLoading || this.noMore) return;
|
|
if (this.listLoading || this.noMore) return;
|
|
|
this.listLoading = true;
|
|
this.listLoading = true;
|
|
|
try {
|
|
try {
|
|
|
- // TODO 后台接口未提供,先占位;接口就绪后放开以下代码
|
|
|
|
|
- // const { data } = await examElExamAttemptAnswerAttemptAnswer({
|
|
|
|
|
- // page: this.page,
|
|
|
|
|
- // pageSize: this.pageSize,
|
|
|
|
|
- // attemptId: this.attemptId,
|
|
|
|
|
- // });
|
|
|
|
|
- // if (data.code === 200) {
|
|
|
|
|
- // const records = data.data.records || [];
|
|
|
|
|
- // const newList = this.page === 1 ? records : [...this.answerList, ...records];
|
|
|
|
|
- // this.$set(this, 'answerList', newList);
|
|
|
|
|
- // this.total = data.data.total;
|
|
|
|
|
- // if (newList.length >= this.total) {
|
|
|
|
|
- // this.noMore = true;
|
|
|
|
|
- // } else {
|
|
|
|
|
- // this.page++;
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ const { data } = await examElExamAttemptPaperQuestionPage({
|
|
|
|
|
+ page: this.page,
|
|
|
|
|
+ pageSize: this.pageSize,
|
|
|
|
|
+ attemptId: this.attemptId,
|
|
|
|
|
+ });
|
|
|
|
|
+ if (data.code === 200) {
|
|
|
|
|
+ const records = data.data.records || [];
|
|
|
|
|
+ const newList = this.page === 1 ? records : [...this.answerList, ...records];
|
|
|
|
|
+ this.$set(this, 'answerList', newList);
|
|
|
|
|
+ this.total = data.data.total;
|
|
|
|
|
+ if (newList.length >= this.total) {
|
|
|
|
|
+ this.noMore = true;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.page++;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
console.error('获取答题详情失败', e);
|
|
console.error('获取答题详情失败', e);
|
|
|
} finally {
|
|
} finally {
|
|
@@ -349,15 +364,15 @@
|
|
|
border-color #b7eb8f
|
|
border-color #b7eb8f
|
|
|
|
|
|
|
|
.diff-normal
|
|
.diff-normal
|
|
|
- background #e6f4ff
|
|
|
|
|
- color #1677ff
|
|
|
|
|
- border-color #91caff
|
|
|
|
|
-
|
|
|
|
|
- .diff-hard
|
|
|
|
|
background #fff7e6
|
|
background #fff7e6
|
|
|
color #fa8c16
|
|
color #fa8c16
|
|
|
border-color #ffd591
|
|
border-color #ffd591
|
|
|
|
|
|
|
|
|
|
+ .diff-hard
|
|
|
|
|
+ background #fff2f0
|
|
|
|
|
+ color #f5222d
|
|
|
|
|
+ border-color #ffccc7
|
|
|
|
|
+
|
|
|
.diff-extreme
|
|
.diff-extreme
|
|
|
background #f9f0ff
|
|
background #f9f0ff
|
|
|
color #722ed1
|
|
color #722ed1
|