fix: stop exam when click on homework
This commit is contained in:
@@ -703,9 +703,13 @@
|
||||
}
|
||||
var homeworkMode = stored.session.mode === "homework";
|
||||
var choice = EXAM_CHOICES.find(function (item) { return item.id === stored.session.choiceId; });
|
||||
var homeworkRequested = homeworkQuestionIds.length > 0;
|
||||
var homeworkMatches = homeworkMode && (allowHomeworkResult || (homeworkQuestionIds.length > 0 &&
|
||||
JSON.stringify(stored.session.homeworkIds) === JSON.stringify(homeworkQuestionIds)));
|
||||
var valid = (homeworkMatches || choice) && stored.session.parts.every(function (part) {
|
||||
var requestedSessionMatches = allowHomeworkResult
|
||||
? (homeworkMatches || choice)
|
||||
: (homeworkRequested ? homeworkMatches : (!homeworkMode && choice));
|
||||
var valid = requestedSessionMatches && stored.session.parts.every(function (part) {
|
||||
return Array.isArray(part.questions) && (homeworkMode || part.questions.length === QUESTION_COUNT) && part.questions.every(function (question) {
|
||||
return Boolean(catalog.value[question.id]);
|
||||
});
|
||||
|
||||
+2
-2
@@ -165,7 +165,7 @@ class Build:
|
||||
page_scripts=[
|
||||
"assets/vue.global.prod.js",
|
||||
"assets/question-catalog.js?ts=20260806",
|
||||
"assets/exam-simulator.js?ts=202608063",
|
||||
"assets/exam-simulator.js?ts=202608064",
|
||||
],
|
||||
)
|
||||
with (self.config.p_build / "simulation.html").open("w", encoding="utf-8") as file:
|
||||
@@ -180,7 +180,7 @@ class Build:
|
||||
page_scripts=[
|
||||
"assets/vue.global.prod.js",
|
||||
"assets/question-catalog.js?ts=20260806",
|
||||
"assets/exam-simulator.js?ts=202608063",
|
||||
"assets/exam-simulator.js?ts=202608064",
|
||||
],
|
||||
social_image=f"assets/images/{social_image.name}",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user