|
@@ -11,6 +11,7 @@ import {
|
|
Question,
|
|
Question,
|
|
MarkArea,
|
|
MarkArea,
|
|
SplitConfig,
|
|
SplitConfig,
|
|
|
|
+ StudentObjectiveInfo,
|
|
} from '@/api/types/task';
|
|
} from '@/api/types/task';
|
|
import { TrackConfigType } from '@/store/modules/app/types';
|
|
import { TrackConfigType } from '@/store/modules/app/types';
|
|
import { PictureTypeEnum, PICTURE_TYPE } from '@/constants/enumerate';
|
|
import { PictureTypeEnum, PICTURE_TYPE } from '@/constants/enumerate';
|
|
@@ -142,6 +143,7 @@ export default function useDraw(drawConfig: DrawConfig) {
|
|
let trackData = [] as TrackItemType[];
|
|
let trackData = [] as TrackItemType[];
|
|
let originImgs = [] as ImageItem[];
|
|
let originImgs = [] as ImageItem[];
|
|
let trackFiles = [] as ImageItem[];
|
|
let trackFiles = [] as ImageItem[];
|
|
|
|
+ const questionNoDict = {} as Record<string, string>;
|
|
let curStudentId = '';
|
|
let curStudentId = '';
|
|
const hasOrigin = trackConfig.pictureType.includes('origin');
|
|
const hasOrigin = trackConfig.pictureType.includes('origin');
|
|
const hasTrack = trackConfig.pictureType.includes('track');
|
|
const hasTrack = trackConfig.pictureType.includes('track');
|
|
@@ -257,6 +259,7 @@ export default function useDraw(drawConfig: DrawConfig) {
|
|
};
|
|
};
|
|
});
|
|
});
|
|
recogDatas = objectiveData.sheetUrls.map((item) => item.recogData);
|
|
recogDatas = objectiveData.sheetUrls.map((item) => item.recogData);
|
|
|
|
+ updateQuestionNoDict(objectiveData.answers, recogDatas);
|
|
});
|
|
});
|
|
|
|
|
|
funcs.push(async () => {
|
|
funcs.push(async () => {
|
|
@@ -339,6 +342,26 @@ export default function useDraw(drawConfig: DrawConfig) {
|
|
return images;
|
|
return images;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function updateQuestionNoDict(
|
|
|
|
+ answers: StudentObjectiveInfo['answers'],
|
|
|
|
+ recogs: string[]
|
|
|
|
+ ) {
|
|
|
|
+ const recogList = recogs.map(
|
|
|
|
+ (data) => JSON.parse(window.atob(data)) as PaperRecogData
|
|
|
|
+ );
|
|
|
|
+ let qindex = 0;
|
|
|
|
+ recogList.forEach((recog) => {
|
|
|
|
+ recog.question.forEach((question) => {
|
|
|
|
+ question.fill_result.forEach((result) => {
|
|
|
|
+ const qno = `${result.main_number}_${result.sub_number}`;
|
|
|
|
+ const { mainNumber, subNumber } = answers[qindex];
|
|
|
|
+ questionNoDict[qno] = `${mainNumber}_${subNumber}`;
|
|
|
|
+ qindex++;
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
async function parseDrawList() {
|
|
async function parseDrawList() {
|
|
trackData = [];
|
|
trackData = [];
|
|
|
|
|
|
@@ -822,9 +845,6 @@ export default function useDraw(drawConfig: DrawConfig) {
|
|
|
|
|
|
// 获取题型的评卷区
|
|
// 获取题型的评卷区
|
|
function parseQuestionAreas(questions: QuestionItem[]) {
|
|
function parseQuestionAreas(questions: QuestionItem[]) {
|
|
- if (!questions.length || !cardData?.length || !markAreaList.length)
|
|
|
|
- return [];
|
|
|
|
-
|
|
|
|
return cardData.length
|
|
return cardData.length
|
|
? parseCardQuestionAreas(questions)
|
|
? parseCardQuestionAreas(questions)
|
|
: parseMarkAreaQuestionAreas(questions);
|
|
: parseMarkAreaQuestionAreas(questions);
|
|
@@ -963,8 +983,9 @@ export default function useDraw(drawConfig: DrawConfig) {
|
|
offsetLt[0];
|
|
offsetLt[0];
|
|
const tagTop = fillPositions[0][1] - offsetLt[1];
|
|
const tagTop = fillPositions[0][1] - offsetLt[1];
|
|
|
|
|
|
- const { answer, isRight } =
|
|
|
|
- answerMap[`${result.main_number}_${result.sub_number}`] || {};
|
|
|
|
|
|
+ const answerQno =
|
|
|
|
+ questionNoDict[`${result.main_number}_${result.sub_number}`];
|
|
|
|
+ const { answer, isRight } = answerMap[answerQno] || {};
|
|
|
|
|
|
answerTags.push({
|
|
answerTags.push({
|
|
type: 'text',
|
|
type: 'text',
|