Updated the InteractiveSpeaking to also work with the session persistence
This commit is contained in:
@@ -181,8 +181,8 @@ export default function ExamPage({page}: Props) {
|
||||
id: solution.id || uuidv4(),
|
||||
timeSpent,
|
||||
session: sessionId,
|
||||
exam: solution.exam!,
|
||||
module: solution.module!,
|
||||
exam: exam!.id,
|
||||
module: exam!.module,
|
||||
user: user?.id || "",
|
||||
date: new Date().getTime(),
|
||||
...(assignment ? {assignment: assignment.id} : {}),
|
||||
@@ -328,6 +328,8 @@ export default function ExamPage({page}: Props) {
|
||||
};
|
||||
|
||||
answers.forEach((x) => {
|
||||
console.log({x});
|
||||
|
||||
scores[x.module!] = {
|
||||
total: scores[x.module!].total + x.score.total,
|
||||
correct: scores[x.module!].correct + x.score.correct,
|
||||
@@ -366,6 +368,8 @@ export default function ExamPage({page}: Props) {
|
||||
onViewResults={() => {
|
||||
setShowSolutions(true);
|
||||
setModuleIndex(0);
|
||||
setExerciseIndex(["reading", "listening"].includes(exams[0].module) ? -1 : 0);
|
||||
setPartIndex(exams[0].module === "listening" ? -1 : 0);
|
||||
setExam(exams[0]);
|
||||
}}
|
||||
scores={aggregateScoresByModule(userSolutions)}
|
||||
|
||||
Reference in New Issue
Block a user