|
@@ -165,36 +165,6 @@ const saveTaskToServer = async (unselective: boolean) => {
|
|
console.log("save inspect task to server");
|
|
console.log("save inspect task to server");
|
|
const mkey = "save_task_key";
|
|
const mkey = "save_task_key";
|
|
void message.loading({ content: "保存评卷任务...", key: mkey });
|
|
void message.loading({ content: "保存评卷任务...", key: mkey });
|
|
- type SubmitError = {
|
|
|
|
- question: Question;
|
|
|
|
- index: number;
|
|
|
|
- error: string;
|
|
|
|
- };
|
|
|
|
- const errors: SubmitError[] = [];
|
|
|
|
- markResult.scoreList.forEach((score, index) => {
|
|
|
|
- if (!store.currentTask) return;
|
|
|
|
- const question = store.currentTask.questionList[index];
|
|
|
|
- let error;
|
|
|
|
- if (!isNumber(score)) {
|
|
|
|
- error = `${question.mainNumber}-${question.subNumber} 没有赋分不能提交。`;
|
|
|
|
- } else if (isNumber(question.maxScore) && score > question.maxScore) {
|
|
|
|
- error = `${question.mainNumber}-${question.subNumber} 赋分大于最高分不能提交。`;
|
|
|
|
- } else if (isNumber(question.minScore) && score < question.minScore) {
|
|
|
|
- error = `${question.mainNumber}-${question.subNumber} 赋分小于最低分不能提交。`;
|
|
|
|
- }
|
|
|
|
- if (error) {
|
|
|
|
- errors.push({ question, index, error });
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- if (errors.length) {
|
|
|
|
- console.log(errors);
|
|
|
|
- const msg = errors.map((v) => h("div", `${v.error}`));
|
|
|
|
- return message.warning({
|
|
|
|
- content: h("span", ["校验失败", ...msg]),
|
|
|
|
- duration: 10,
|
|
|
|
- key: mkey,
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
let res;
|
|
let res;
|
|
if (unselective) {
|
|
if (unselective) {
|
|
res = await saveArbitrateTask(
|
|
res = await saveArbitrateTask(
|
|
@@ -205,6 +175,36 @@ const saveTaskToServer = async (unselective: boolean) => {
|
|
true
|
|
true
|
|
);
|
|
);
|
|
} else {
|
|
} else {
|
|
|
|
+ type SubmitError = {
|
|
|
|
+ question: Question;
|
|
|
|
+ index: number;
|
|
|
|
+ error: string;
|
|
|
|
+ };
|
|
|
|
+ const errors: SubmitError[] = [];
|
|
|
|
+ markResult.scoreList.forEach((score, index) => {
|
|
|
|
+ if (!store.currentTask) return;
|
|
|
|
+ const question = store.currentTask.questionList[index];
|
|
|
|
+ let error;
|
|
|
|
+ if (!isNumber(score)) {
|
|
|
|
+ error = `${question.mainNumber}-${question.subNumber} 没有赋分不能提交。`;
|
|
|
|
+ } else if (isNumber(question.maxScore) && score > question.maxScore) {
|
|
|
|
+ error = `${question.mainNumber}-${question.subNumber} 赋分大于最高分不能提交。`;
|
|
|
|
+ } else if (isNumber(question.minScore) && score < question.minScore) {
|
|
|
|
+ error = `${question.mainNumber}-${question.subNumber} 赋分小于最低分不能提交。`;
|
|
|
|
+ }
|
|
|
|
+ if (error) {
|
|
|
|
+ errors.push({ question, index, error });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ if (errors.length) {
|
|
|
|
+ console.log(errors);
|
|
|
|
+ const msg = errors.map((v) => h("div", `${v.error}`));
|
|
|
|
+ return message.warning({
|
|
|
|
+ content: h("span", ["校验失败", ...msg]),
|
|
|
|
+ duration: 10,
|
|
|
|
+ key: mkey,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
res = await saveArbitrateTask(
|
|
res = await saveArbitrateTask(
|
|
store.currentTask.libraryId + "",
|
|
store.currentTask.libraryId + "",
|
|
store.currentTask.studentId + "",
|
|
store.currentTask.studentId + "",
|