|
@@ -243,6 +243,7 @@ async function processImage() {
|
|
|
|
|
|
const images = [];
|
|
|
const urls = store.currentTask[origImageUrls] || [];
|
|
|
+ if (!urls.length) return;
|
|
|
for (const url of urls) {
|
|
|
const image = await loadImage(url);
|
|
|
images.push(image);
|
|
@@ -261,40 +262,6 @@ async function processImage() {
|
|
|
.flat();
|
|
|
store.setting.doubleTrack = trackLists.some((item) => item.isByMultMark);
|
|
|
|
|
|
- // 无答题卡,模式4
|
|
|
- if (!store.currentTask.cardData?.length) {
|
|
|
- // 只有单评才展示summary
|
|
|
- const summarys = store.setting.doubleTrack ? undefined : parseMode4Data();
|
|
|
- for (const url of urls) {
|
|
|
- const indexInSliceUrls = urls.indexOf(url) + 1;
|
|
|
- const image = images[indexInSliceUrls - 1];
|
|
|
- const thisImageTrackList = trackLists.filter(
|
|
|
- (t) => t.offsetIndex === indexInSliceUrls
|
|
|
- );
|
|
|
- const thisImageTagList = store.currentTask.headerTagList?.length
|
|
|
- ? addHeaderTrackColorAttr(
|
|
|
- (store.currentTask.headerTagList || []).filter(
|
|
|
- (t) => t.offsetIndex === indexInSliceUrls
|
|
|
- )
|
|
|
- )
|
|
|
- : addTagColorAttr(
|
|
|
- (store.currentTask.specialTagList || []).filter(
|
|
|
- (t) => t.offsetIndex === indexInSliceUrls
|
|
|
- )
|
|
|
- );
|
|
|
- sliceImagesWithTrackList.push({
|
|
|
- url,
|
|
|
- trackList: thisImageTrackList,
|
|
|
- tagList: thisImageTagList,
|
|
|
- originalImageWidth: image.naturalWidth,
|
|
|
- originalImageHeight: image.naturalHeight,
|
|
|
- width: (image.naturalWidth / maxImageWidth) * 100 + "%",
|
|
|
- summarys: indexInSliceUrls === 1 ? summarys : undefined,
|
|
|
- });
|
|
|
- }
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
// 解析各试题答题区域以及评分
|
|
|
const markDetailList = parseMarkDetailList();
|
|
|
// 解析客观题的得分情况,按大题统计
|
|
@@ -332,6 +299,15 @@ async function processImage() {
|
|
|
objectiveAnswerTags: objectiveAnswerTagList[indexInSliceUrls - 1],
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ // 无答题卡,模式4
|
|
|
+ if (!store.currentTask.cardData?.length) {
|
|
|
+ // 只有单评才展示summary
|
|
|
+ const summarys = store.setting.doubleTrack ? undefined : parseMode4Data();
|
|
|
+ if (summarys && summarys.length) {
|
|
|
+ sliceImagesWithTrackList[0].summarys = summarys;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 解析客观题答案展示位置
|
|
@@ -862,11 +838,23 @@ interface SummaryItem {
|
|
|
}
|
|
|
function parseMode4Data(): SummaryItem[] {
|
|
|
return (store.currentTask.questionList || []).map((q) => {
|
|
|
+ let markerName = "";
|
|
|
+ if (q.headerTrack && q.headerTrack.length) {
|
|
|
+ markerName = q.headerTrack[0].userName;
|
|
|
+ } else if (q.trackList && q.trackList.length) {
|
|
|
+ markerName = q.trackList[0].userName;
|
|
|
+ } else if (q.markerList && q.markerList.length) {
|
|
|
+ let markers = q.markerList.filter((marker) => marker.header);
|
|
|
+ if (!markers.length) {
|
|
|
+ markers = q.markerList.filter((marker) => !marker.header);
|
|
|
+ }
|
|
|
+ if (markers.length) markerName = markers[0].userName;
|
|
|
+ }
|
|
|
return {
|
|
|
mainNumber: q.mainNumber,
|
|
|
subNumber: q.subNumber,
|
|
|
score: q.score,
|
|
|
- markerName: q.trackList[0].userName,
|
|
|
+ markerName,
|
|
|
};
|
|
|
});
|
|
|
}
|