|
@@ -13,12 +13,11 @@
|
|
|
<div class="right_btn" v-if="errorType !== 1">
|
|
<div class="right_btn" v-if="errorType !== 1">
|
|
|
<el-button size="medium" disabled
|
|
<el-button size="medium" disabled
|
|
|
@click="downloadDialogVisible = true; isVariation = 0">下载错题本</el-button>
|
|
@click="downloadDialogVisible = true; isVariation = 0">下载错题本</el-button>
|
|
|
- <el-button type="primary" size="medium"
|
|
|
|
|
- @click="downloadDialogVisible = true; isVariation = 1">下载个性化提升手册</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" size="medium" @click="downLoadPapers">下载个性化提升手册</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<Download :visible.sync="downloadDialogVisible" :examId="examId" :subjectCode="subjectCode"
|
|
<Download :visible.sync="downloadDialogVisible" :examId="examId" :subjectCode="subjectCode"
|
|
|
- :isVariation="isVariation" />
|
|
|
|
|
|
|
+ :isVariation="isVariation" :questionList="questionList" />
|
|
|
|
|
|
|
|
<template v-if="questionList.length > 0">
|
|
<template v-if="questionList.length > 0">
|
|
|
<div v-for="(question, index) in questionList" :key="question.questionId">
|
|
<div v-for="(question, index) in questionList" :key="question.questionId">
|
|
@@ -128,11 +127,19 @@
|
|
|
<div class="flex">
|
|
<div class="flex">
|
|
|
<div class="flex_left">【答 案】</div>
|
|
<div class="flex_left">【答 案】</div>
|
|
|
<div class="flex_right">
|
|
<div class="flex_right">
|
|
|
- <template v-if="question.questionData?.answer || question.answerImg">
|
|
|
|
|
- <Preview :type="question.sourceType"
|
|
|
|
|
- :content="question.questionData?.answer"
|
|
|
|
|
- :imgBase64="question.answerImg" />
|
|
|
|
|
|
|
+ <template
|
|
|
|
|
+ v-if="question.questionData?.answer || question.answerImg || question.answer">
|
|
|
|
|
+ <template v-if="question.isObjective === 1">
|
|
|
|
|
+ <div>{{ question.answer }}</div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
|
|
+ <template v-else>
|
|
|
|
|
+ <Preview :type="question.sourceType"
|
|
|
|
|
+ :content="question.questionData?.answer"
|
|
|
|
|
+ :imgBase64="question.answerImg" />
|
|
|
|
|
+ </template>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+
|
|
|
<template v-else>
|
|
<template v-else>
|
|
|
<div>暂无数据</div>
|
|
<div>暂无数据</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -154,16 +161,16 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <div class="content" v-if="question.answerShow && !question.parseShow">
|
|
|
|
|
- <template v-if="question.sourceType === 1 || question.sourceType === 2">
|
|
|
|
|
- <template v-if="question.studentAnswer || question.studentAnswerImg">
|
|
|
|
|
- <Preview :type="question.sourceType" :content="question.studentAnswer"
|
|
|
|
|
- :imgBase64="question.studentAnswerImg" />
|
|
|
|
|
- </template>
|
|
|
|
|
|
|
+ <div class="content" style="height: 300px;"
|
|
|
|
|
+ v-if="question.answerShow && !question.parseShow">
|
|
|
|
|
+ <template v-if="question.isObjective === 1">
|
|
|
|
|
+ <div v-if="question.studentAnswer">{{ question.studentAnswer }}</div>
|
|
|
|
|
+ <div v-else>暂无数据</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<template v-else>
|
|
<template v-else>
|
|
|
- <div>暂无数据</div>
|
|
|
|
|
|
|
+ <PaperImage :imageIndex="index" :scoreFontSize="20" :rtOrWrSize="10"
|
|
|
|
|
+ :paperImgUrl="picUrl" :drawData="questionVOS" />
|
|
|
</template>
|
|
</template>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -228,6 +235,7 @@ import {
|
|
|
queryStudentErrorQuestion,
|
|
queryStudentErrorQuestion,
|
|
|
markStudentErrorQuestion,
|
|
markStudentErrorQuestion,
|
|
|
downloadStudentErrorQuestion,
|
|
downloadStudentErrorQuestion,
|
|
|
|
|
+ findStudentCard
|
|
|
} from '../../../http/api/errorQuestion';
|
|
} from '../../../http/api/errorQuestion';
|
|
|
import Download from './Download.vue';
|
|
import Download from './Download.vue';
|
|
|
import { mergeImage } from './loadImg.js'
|
|
import { mergeImage } from './loadImg.js'
|
|
@@ -235,6 +243,8 @@ import { Loading } from 'element-ui';
|
|
|
import NoData from './NoData/NoData.vue';
|
|
import NoData from './NoData/NoData.vue';
|
|
|
import KnowledgePoint from './KnowledgePoint.vue';
|
|
import KnowledgePoint from './KnowledgePoint.vue';
|
|
|
import Preview from './Preview.vue';
|
|
import Preview from './Preview.vue';
|
|
|
|
|
+import PaperImage from '@/components/PaperImage.vue';
|
|
|
|
|
+import { confirm } from '../../../utils/common.js'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
@@ -242,6 +252,7 @@ export default {
|
|
|
NoData,
|
|
NoData,
|
|
|
KnowledgePoint,
|
|
KnowledgePoint,
|
|
|
Preview,
|
|
Preview,
|
|
|
|
|
+ PaperImage,
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -267,6 +278,9 @@ export default {
|
|
|
|
|
|
|
|
downloadDialogVisible: false,
|
|
downloadDialogVisible: false,
|
|
|
isVariation: 0,
|
|
isVariation: 0,
|
|
|
|
|
+ picUrl: null,
|
|
|
|
|
+ questionVOS: [],
|
|
|
|
|
+
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -336,8 +350,34 @@ export default {
|
|
|
|
|
|
|
|
ShowAnserAndParse(type, question) {
|
|
ShowAnserAndParse(type, question) {
|
|
|
if (type === 1) {
|
|
if (type === 1) {
|
|
|
- question.answerShow = !question.answerShow;
|
|
|
|
|
- question.parseShow = false
|
|
|
|
|
|
|
+ if (question.isObjective === 1) {
|
|
|
|
|
+ question.answerShow = !question.answerShow;
|
|
|
|
|
+ question.parseShow = false
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ findStudentCard({
|
|
|
|
|
+ examId: this.examId,
|
|
|
|
|
+ subjectCode: this.subjectCode,
|
|
|
|
|
+ questionId: question.questionId,
|
|
|
|
|
+ }).then(res => {
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
|
+ // question.studentAnswer = res.data.studentAnswer;
|
|
|
|
|
+ const data = res.data.pageVOS[0]
|
|
|
|
|
+ this.picUrl = data.picUrl;
|
|
|
|
|
+ this.questionVOS = data.questionVOS.map(item => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ samplingPosition: '{"x":195,"y":247,"page":1}'
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ console.log('questionVOS', this.questionVOS, this.picUrl);
|
|
|
|
|
+
|
|
|
|
|
+ question.answerShow = !question.answerShow;
|
|
|
|
|
+ question.parseShow = false
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (type === 2) {
|
|
if (type === 2) {
|
|
@@ -366,28 +406,23 @@ export default {
|
|
|
const processedQuestions = await Promise.all(questionList.map(async (q) => {
|
|
const processedQuestions = await Promise.all(questionList.map(async (q) => {
|
|
|
q.answerShow = false;
|
|
q.answerShow = false;
|
|
|
q.parseShow = false;
|
|
q.parseShow = false;
|
|
|
- const { sourceType, titleCoordinates, answerCoordinates, parseCoordinates, paintingPosition } = q;
|
|
|
|
|
|
|
+ const { sourceType, titleCoordinates, answerCoordinates, parseCoordinates } = q;
|
|
|
|
|
|
|
|
if (sourceType === 2) {
|
|
if (sourceType === 2) {
|
|
|
try {
|
|
try {
|
|
|
- const [questionImg, answerImg, parseImg, studentAnswerImg] = await Promise.all([
|
|
|
|
|
|
|
+ const [questionImg, answerImg, parseImg] = await Promise.all([
|
|
|
mergeImage(this.uploadPaperUrls, titleCoordinates),
|
|
mergeImage(this.uploadPaperUrls, titleCoordinates),
|
|
|
mergeImage(this.answerUrls, answerCoordinates),
|
|
mergeImage(this.answerUrls, answerCoordinates),
|
|
|
mergeImage(this.answerUrls, parseCoordinates),
|
|
mergeImage(this.answerUrls, parseCoordinates),
|
|
|
- mergeImage(this.answerUrls, paintingPosition),
|
|
|
|
|
]);
|
|
]);
|
|
|
-
|
|
|
|
|
q.questionImg = questionImg || '';
|
|
q.questionImg = questionImg || '';
|
|
|
q.answerImg = answerImg || '';
|
|
q.answerImg = answerImg || '';
|
|
|
q.parseImg = parseImg || '';
|
|
q.parseImg = parseImg || '';
|
|
|
- q.studentAnswerImg = studentAnswerImg || '';
|
|
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
// 如果合并过程中某张图失败,记录空字符串并继续,避免阻塞全部渲染
|
|
// 如果合并过程中某张图失败,记录空字符串并继续,避免阻塞全部渲染
|
|
|
q.questionImg = q.questionImg || '';
|
|
q.questionImg = q.questionImg || '';
|
|
|
q.answerImg = q.answerImg || '';
|
|
q.answerImg = q.answerImg || '';
|
|
|
q.parseImg = q.parseImg || '';
|
|
q.parseImg = q.parseImg || '';
|
|
|
- q.studentAnswerImg = q.studentAnswerImg || '';
|
|
|
|
|
- console.error('mergeImage error', e);
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -434,6 +469,30 @@ export default {
|
|
|
this.pageParam.pageNum = page;
|
|
this.pageParam.pageNum = page;
|
|
|
await this._queryStudentErrorQuestion();
|
|
await this._queryStudentErrorQuestion();
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
|
|
+ hasTuozhan() {
|
|
|
|
|
+ // 查看题目中第一个 变式题为空 的题目
|
|
|
|
|
+ const questionWithVariation = this.questionList.find(q => !q.variationQuestion);
|
|
|
|
|
+
|
|
|
|
|
+ if (questionWithVariation) {
|
|
|
|
|
+ return false; // 存在题目没有变式题
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return true; // 所有题目都有变式题
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ downLoadPapers() {
|
|
|
|
|
+ const hasVariation = this.hasTuozhan();
|
|
|
|
|
+ if (!hasVariation) {
|
|
|
|
|
+ confirm('教师还未确认变式题,是否继续下载?', () => {
|
|
|
|
|
+ this.downloadDialogVisible = true;
|
|
|
|
|
+ this.isVariation = 1;
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.downloadDialogVisible = true;
|
|
|
|
|
+ this.isVariation = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|