|
@@ -18,59 +18,65 @@ export default function useTaskWatch() {
|
|
|
if (task.previous && task.markResult) {
|
|
|
task.markResult = undefined;
|
|
|
}
|
|
|
- if (!task.markResult) {
|
|
|
- // 管理后台可能不设置 questionList, 而且它不用 markResult
|
|
|
- if (!task.questionList) {
|
|
|
- task.questionList = [];
|
|
|
- // return;
|
|
|
+ if (task.markResult) return;
|
|
|
+ // 管理后台可能不设置 questionList, 而且它不用 markResult
|
|
|
+ if (!task.questionList) {
|
|
|
+ task.questionList = [];
|
|
|
+ // return;
|
|
|
+ }
|
|
|
+ // 初始化 __index
|
|
|
+ task.questionList.forEach((q, i) => {
|
|
|
+ q.__index = i;
|
|
|
+ // 回评的时候,如果是自己标记问题卷的题目,则转成非自己标记问题卷的题目
|
|
|
+ // 这样一来,就不能编辑问题卷,但是依旧可以编辑新设置未提交的问题卷
|
|
|
+ if (markStore.historyOpen && q.problem && q.selfMark) {
|
|
|
+ q.selfMark = false;
|
|
|
}
|
|
|
- // 初始化 __index
|
|
|
- task.questionList.forEach((q, i, ar) => (ar[i].__index = i));
|
|
|
+ });
|
|
|
|
|
|
- task.__markStartTime = Date.now();
|
|
|
- const statusValue = markStore.setting.statusValue;
|
|
|
- const { examId, studentId, paperNumber } = task;
|
|
|
+ task.__markStartTime = Date.now();
|
|
|
+ const statusValue = markStore.setting.statusValue;
|
|
|
+ const { examId, studentId, paperNumber } = task;
|
|
|
|
|
|
- const selfQuestions = task.questionList.filter(
|
|
|
- (q) => q.selfMark && !isArbitrated(q)
|
|
|
- );
|
|
|
- task.markResult = {
|
|
|
- examId,
|
|
|
- paperNumber,
|
|
|
- studentId,
|
|
|
- spent: 0,
|
|
|
- statusValue,
|
|
|
- questionList: task.questionList,
|
|
|
- markedQuestionId: "",
|
|
|
- markerTrackList: selfQuestions
|
|
|
- .map((q) => {
|
|
|
- const trackList =
|
|
|
- q.headerTrackList && q.headerTrackList.length
|
|
|
- ? q.headerTrackList
|
|
|
- : q.markerTrackList;
|
|
|
- return trackList || [];
|
|
|
- })
|
|
|
- .flat(),
|
|
|
- markerTagList: selfQuestions
|
|
|
- .map((q) => {
|
|
|
- const tagList =
|
|
|
- q.headerTagList && q.headerTagList.length
|
|
|
- ? q.headerTagList
|
|
|
- : q.markerTagList;
|
|
|
- return tagList || [];
|
|
|
- })
|
|
|
- .flat(),
|
|
|
- scoreList: task.questionList.map((q) =>
|
|
|
- q.selfMark && !isArbitrated(q) ? q.markerScore : null
|
|
|
- ),
|
|
|
- markerScore: 0, // 后期通过 scoreList 自动更新
|
|
|
- };
|
|
|
- task.markResult.markerTrackList.forEach((t) => {
|
|
|
- if (t.unanswered) {
|
|
|
- t.score = -0;
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ const selfQuestions = task.questionList.filter(
|
|
|
+ (q) => q.selfMark && !isArbitrated(q)
|
|
|
+ );
|
|
|
+ task.markResult = {
|
|
|
+ examId,
|
|
|
+ paperNumber,
|
|
|
+ studentId,
|
|
|
+ spent: 0,
|
|
|
+ statusValue,
|
|
|
+ questionList: task.questionList,
|
|
|
+ markedQuestionId: "",
|
|
|
+ markerTrackList: selfQuestions
|
|
|
+ .map((q) => {
|
|
|
+ const trackList =
|
|
|
+ q.headerTrackList && q.headerTrackList.length
|
|
|
+ ? q.headerTrackList
|
|
|
+ : q.markerTrackList;
|
|
|
+ return trackList || [];
|
|
|
+ })
|
|
|
+ .flat(),
|
|
|
+ markerTagList: selfQuestions
|
|
|
+ .map((q) => {
|
|
|
+ const tagList =
|
|
|
+ q.headerTagList && q.headerTagList.length
|
|
|
+ ? q.headerTagList
|
|
|
+ : q.markerTagList;
|
|
|
+ return tagList || [];
|
|
|
+ })
|
|
|
+ .flat(),
|
|
|
+ scoreList: task.questionList.map((q) =>
|
|
|
+ q.selfMark && !isArbitrated(q) ? q.markerScore : null
|
|
|
+ ),
|
|
|
+ markerScore: 0, // 后期通过 scoreList 自动更新
|
|
|
+ };
|
|
|
+ task.markResult.markerTrackList.forEach((t) => {
|
|
|
+ if (t.unanswered) {
|
|
|
+ t.score = -0;
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
);
|
|
|
|