Skip to content

Commit

Permalink
fix(script): 修复智慧树答题时题库缓存未正确存储的BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
ennnncy committed Mar 27, 2024
1 parent 2fd9a72 commit 978d927
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/scripts/src/projects/zhs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -886,11 +886,16 @@ function gxkWorkAndExam(
}
},
/** 完成答题后 */
onResultsUpdate(curr, _, res) {
onResultsUpdate(curr, index, res) {
CommonProject.scripts.workResults.methods.setResults(simplifyWorkResult(res, titleTransform));

if (curr.result?.finish) {
CommonProject.scripts.apps.methods.addQuestionCacheFromWorkResult(simplifyWorkResult([curr], titleTransform));
const title = allExamParts[index]?.name;
if (title) {
CommonProject.scripts.apps.methods.addQuestionCacheFromWorkResult(
simplifyWorkResult([curr], (_: any, __: number) => title)
);
}
}
CommonProject.scripts.workResults.methods.updateWorkStateByResults(res);
}
Expand Down

0 comments on commit 978d927

Please sign in to comment.