Only hooked up the section state had forgot to plugin into Header's isEvaluationEnabled
This commit is contained in:
@@ -17,7 +17,6 @@ export const rootReducer = (
|
||||
state: ExamEditorStore,
|
||||
action: Action
|
||||
): Partial<ExamEditorStore> => {
|
||||
console.log(action);
|
||||
if (MODULE_ACTIONS.includes(action.type as any)) {
|
||||
if (action.type === "REORDER_EXERCISES") {
|
||||
const updatedState = sectionReducer(state, action as SectionActions);
|
||||
|
||||
@@ -51,7 +51,6 @@ export const moduleReducer = (
|
||||
|
||||
case 'TOGGLE_SECTION':
|
||||
const { sectionId } = action.payload;
|
||||
console.log("TOGGLE SECTION TRIGGERED");
|
||||
|
||||
const prev = currentModuleState.sections;
|
||||
const updatedSections = prev.some(section => section.sectionId === sectionId)
|
||||
|
||||
@@ -23,7 +23,6 @@ export const sectionReducer = (
|
||||
switch (action.type) {
|
||||
case 'UPDATE_SECTION_SINGLE_FIELD':{
|
||||
const { module, field, value, sectionId } = action.payload;
|
||||
console.log(`Updating ${module}-${sectionId} ${field} to ${value}`);
|
||||
return {
|
||||
modules: {
|
||||
...state.modules,
|
||||
|
||||
@@ -172,7 +172,6 @@ const reorderSection = (exercises: Exercise[], startId: number): { exercises: Ex
|
||||
currentId += 1;
|
||||
return exercise;
|
||||
default:
|
||||
console.log("HERE IT IS");
|
||||
return exercise;
|
||||
}
|
||||
});
|
||||
@@ -188,7 +187,6 @@ const reorderModule = (moduleState: ModuleState) => {
|
||||
let currentId = 1;
|
||||
let reorderedSections = moduleState.sections.map(section => {
|
||||
let currentSection = section.state as ReadingPart | ListeningPart | LevelPart;
|
||||
console.log(currentSection.exercises);
|
||||
let result = reorderSection(currentSection.exercises, currentId);
|
||||
currentId = result.lastId;
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user