|
@@ -185,6 +185,8 @@ async function updateTask() {
|
|
// ];
|
|
// ];
|
|
// 假数据模拟
|
|
// 假数据模拟
|
|
// rawTask.questionList[0].selective = true;
|
|
// rawTask.questionList[0].selective = true;
|
|
|
|
+ // rawTask.questionList[5].trackCount = 2;
|
|
|
|
+ // store.setting.trackCountPolicy = "LE";
|
|
|
|
|
|
const newTask = addFileServerPrefixToTask(rawTask);
|
|
const newTask = addFileServerPrefixToTask(rawTask);
|
|
|
|
|
|
@@ -279,7 +281,9 @@ const showRejectedReason = (task: Task) => {
|
|
// "reject-task-showed",
|
|
// "reject-task-showed",
|
|
// JSON.stringify(rejectShowedTasks)
|
|
// JSON.stringify(rejectShowedTasks)
|
|
// );
|
|
// );
|
|
- const [reasonType, reasonDesc] = task.rejectReason.split(":");
|
|
|
|
|
|
+ const conts = task.rejectReason.split(":");
|
|
|
|
+ const reasonType = conts[0];
|
|
|
|
+ const reasonDesc = conts.slice(1).join(":");
|
|
Modal.info({
|
|
Modal.info({
|
|
title: null,
|
|
title: null,
|
|
closable: false,
|
|
closable: false,
|
|
@@ -464,23 +468,39 @@ const saveTaskToServer = async () => {
|
|
error: string;
|
|
error: string;
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ const checkQuestionTrackCountUnvalid = (question: Question) => {
|
|
|
|
+ const tracks = (store.currentTask?.markResult?.trackList || []).filter(
|
|
|
|
+ (track: any) =>
|
|
|
|
+ track.mainNumber == question?.mainNumber &&
|
|
|
|
+ track.subNumber == question?.subNumber
|
|
|
|
+ );
|
|
|
|
+ const trackCount = Number(question?.trackCount) || 0;
|
|
|
|
+ const countValid =
|
|
|
|
+ store.setting.trackCountPolicy === "EQ"
|
|
|
|
+ ? tracks.length === trackCount
|
|
|
|
+ : tracks.length <= trackCount;
|
|
|
|
+
|
|
|
|
+ return store.isTrackMode && trackCount > 0 && !countValid;
|
|
|
|
+ };
|
|
|
|
+
|
|
const errors: SubmitError[] = [];
|
|
const errors: SubmitError[] = [];
|
|
markResult.scoreList.forEach((score, index) => {
|
|
markResult.scoreList.forEach((score, index) => {
|
|
if (!store.currentTask) return;
|
|
if (!store.currentTask) return;
|
|
const question = store.currentTask.questionList[index]!;
|
|
const question = store.currentTask.questionList[index]!;
|
|
|
|
+ const qno = `${question.mainNumber}-${question.subNumber}${
|
|
|
|
+ question.questionName ? "(" + question.questionName + ")" : ""
|
|
|
|
+ }`;
|
|
let error;
|
|
let error;
|
|
if (!isNumber(score) && !question.hasSetUnselective) {
|
|
if (!isNumber(score) && !question.hasSetUnselective) {
|
|
- error = `${question.mainNumber}-${question.subNumber}${
|
|
|
|
- question.questionName ? "(" + question.questionName + ")" : ""
|
|
|
|
- } 没有给分,不能提交。`;
|
|
|
|
|
|
+ error = `${qno} 没有给分,不能提交。`;
|
|
} else if (isNumber(question.maxScore) && score > question.maxScore) {
|
|
} else if (isNumber(question.maxScore) && score > question.maxScore) {
|
|
- error = `${question.mainNumber}-${question.subNumber}${
|
|
|
|
- question.questionName ? "(" + question.questionName + ")" : ""
|
|
|
|
- } 给分大于最高分不能提交。`;
|
|
|
|
|
|
+ error = `${qno} 给分大于最高分不能提交。`;
|
|
} else if (isNumber(question.minScore) && score < question.minScore) {
|
|
} else if (isNumber(question.minScore) && score < question.minScore) {
|
|
- error = `${question.mainNumber}-${question.subNumber}${
|
|
|
|
- question.questionName ? "(" + question.questionName + ")" : ""
|
|
|
|
- } 给分小于最低分不能提交。`;
|
|
|
|
|
|
+ error = `${qno} 给分小于最低分不能提交。`;
|
|
|
|
+ } else if (checkQuestionTrackCountUnvalid(question)) {
|
|
|
|
+ const policyName =
|
|
|
|
+ store.setting.trackCountPolicy === "EQ" ? "等于" : "小于等于";
|
|
|
|
+ error = `${qno} 限制轨迹数量${policyName}${question.trackCount}个,不能提交。`;
|
|
}
|
|
}
|
|
if (error) {
|
|
if (error) {
|
|
errors.push({ question, index, error });
|
|
errors.push({ question, index, error });
|
|
@@ -527,10 +547,16 @@ const saveTaskToServer = async () => {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ // 强制标记校验
|
|
if (store.setting.forceSpecialTag) {
|
|
if (store.setting.forceSpecialTag) {
|
|
|
|
+ // 是否全部未选做
|
|
|
|
+ const allUnselective = store.currentTask.questionList.every(
|
|
|
|
+ (item) => item.hasSetUnselective
|
|
|
|
+ );
|
|
if (
|
|
if (
|
|
markResult.trackList.length === 0 &&
|
|
markResult.trackList.length === 0 &&
|
|
- markResult.specialTagList.length === 0
|
|
|
|
|
|
+ markResult.specialTagList.length === 0 &&
|
|
|
|
+ !allUnselective
|
|
) {
|
|
) {
|
|
void message.error({
|
|
void message.error({
|
|
content: "强制标记已开启,请至少使用一个标记。",
|
|
content: "强制标记已开启,请至少使用一个标记。",
|