ENCOA-315
This commit is contained in:
@@ -93,20 +93,11 @@ export const rootReducer = (
|
||||
};
|
||||
case 'FINALIZE_MODULE': {
|
||||
const { updateTimers } = action.payload;
|
||||
const solutions = state.userSolutions;
|
||||
const evaluated = state.evaluated;
|
||||
|
||||
const hasUnevaluatedSolutions = solutions.some(solution =>
|
||||
(solution.type === 'speaking' ||
|
||||
solution.type === 'writing' ||
|
||||
solution.type === 'interactiveSpeaking') &&
|
||||
!evaluated.some(evaluation => evaluation.exercise === solution.exercise)
|
||||
);
|
||||
|
||||
// To finalize a module first flag the timers to be updated
|
||||
if (updateTimers) {
|
||||
return {
|
||||
flags: { ...state.flags, finalizeModule: true, pendingEvaluation: hasUnevaluatedSolutions }
|
||||
flags: { ...state.flags, finalizeModule: true }
|
||||
}
|
||||
} else {
|
||||
// then check whether there are more modules in the exam, if there are
|
||||
@@ -118,7 +109,6 @@ export const rootReducer = (
|
||||
...state.flags,
|
||||
finalizeModule: false,
|
||||
finalizeExam: true,
|
||||
pendingEvaluation: hasUnevaluatedSolutions,
|
||||
}
|
||||
}
|
||||
} else if (state.moduleIndex < state.selectedModules.length - 1) {
|
||||
|
||||
Reference in New Issue
Block a user