|
@@ -138,9 +138,14 @@ import type {
|
|
|
Question,
|
|
|
} from "@/types";
|
|
|
import { useTimers } from "@/setups/useTimers";
|
|
|
-import { loadImage, addHeaderTrackColorAttr, calcSum } from "@/utils/utils";
|
|
|
+import {
|
|
|
+ loadImage,
|
|
|
+ addHeaderTrackColorAttr,
|
|
|
+ calcSumPrecision,
|
|
|
+ maxNum,
|
|
|
+ toPrecision,
|
|
|
+} from "@/utils/utils";
|
|
|
import { dragImage } from "@/features/mark/use/draggable";
|
|
|
-import { maxNum } from "@/utils/utils";
|
|
|
|
|
|
interface SliceImage {
|
|
|
url: string;
|
|
@@ -179,7 +184,7 @@ const objectiveScore = $computed(() => {
|
|
|
return store.currentTask?.objectiveScore || 0;
|
|
|
});
|
|
|
const subjectiveScore = $computed(() => {
|
|
|
- return totalScore - objectiveScore;
|
|
|
+ return toPrecision(totalScore - objectiveScore);
|
|
|
});
|
|
|
|
|
|
let sliceImagesWithTrackList: SliceImage[] = reactive([]);
|
|
@@ -625,12 +630,16 @@ function parseMarkDetailList(): Array<MarkDetailItem[]> {
|
|
|
return {
|
|
|
...user,
|
|
|
prename,
|
|
|
- score: calcSum(user.scores.map((s) => s.score)),
|
|
|
+ score: calcSumPrecision(user.scores.map((s) => s.score)),
|
|
|
};
|
|
|
});
|
|
|
|
|
|
- const score = calcSum(groupQuestions.map((item) => item.score || 0));
|
|
|
- const maxScore = calcSum(groupQuestions.map((item) => item.maxScore));
|
|
|
+ const score = calcSumPrecision(
|
|
|
+ groupQuestions.map((item) => item.score || 0)
|
|
|
+ );
|
|
|
+ const maxScore = calcSumPrecision(
|
|
|
+ groupQuestions.map((item) => item.maxScore)
|
|
|
+ );
|
|
|
|
|
|
dataList[imgIndex].push({
|
|
|
mainNumber: groupQuestions[0].mainNumber,
|
|
@@ -693,7 +702,7 @@ function parseMarkDetailList(): Array<MarkDetailItem[]> {
|
|
|
return {
|
|
|
...user,
|
|
|
prename,
|
|
|
- score: calcSum(user.scores.map((s) => s.score)),
|
|
|
+ score: calcSumPrecision(user.scores.map((s) => s.score)),
|
|
|
};
|
|
|
});
|
|
|
|
|
@@ -816,8 +825,10 @@ function parseObjectiveAnswerTags() {
|
|
|
};
|
|
|
}
|
|
|
|
|
|
- oaTagItem.score = calcSum(questions.map((q) => q.score || 0));
|
|
|
- oaTagItem.totalScore = calcSum(questions.map((q) => q.totalScore || 0));
|
|
|
+ oaTagItem.score = calcSumPrecision(questions.map((q) => q.score || 0));
|
|
|
+ oaTagItem.totalScore = calcSumPrecision(
|
|
|
+ questions.map((q) => q.totalScore || 0)
|
|
|
+ );
|
|
|
|
|
|
objectiveAnswerTags[pindex].push(oaTagItem);
|
|
|
});
|