Wasn't staged :/
This commit is contained in:
@@ -102,7 +102,7 @@ const FillBlanksMC: React.FC<{ exercise: FillBlanksExercise; sectionId: number }
|
|||||||
onPractice: () => {
|
onPractice: () => {
|
||||||
const updatedExercise = {
|
const updatedExercise = {
|
||||||
...local,
|
...local,
|
||||||
//isPractice: !isPractice,
|
isPractice: !local.isPractice
|
||||||
};
|
};
|
||||||
const newState = { ...section };
|
const newState = { ...section };
|
||||||
newState.exercises = newState.exercises.map((ex) =>
|
newState.exercises = newState.exercises.map((ex) =>
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ const WriteBlanksFill: React.FC<{ exercise: WriteBlanksExercise; sectionId: numb
|
|||||||
onPractice: () => {
|
onPractice: () => {
|
||||||
const updatedExercise = {
|
const updatedExercise = {
|
||||||
...local,
|
...local,
|
||||||
isPractice: true,
|
isPractice: !local.isPractice
|
||||||
};
|
};
|
||||||
const newState = { ...section };
|
const newState = { ...section };
|
||||||
newState.exercises = newState.exercises.map((ex) =>
|
newState.exercises = newState.exercises.map((ex) =>
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ const MatchSentences: React.FC<{ exercise: MatchSentencesExercise, sectionId: nu
|
|||||||
onPractice: () => {
|
onPractice: () => {
|
||||||
const updatedExercise = {
|
const updatedExercise = {
|
||||||
...local,
|
...local,
|
||||||
//isPractice: !isPractice,
|
isPractice: !local.isPractice
|
||||||
};
|
};
|
||||||
const newState = { ...section };
|
const newState = { ...section };
|
||||||
newState.exercises = newState.exercises.map((ex) =>
|
newState.exercises = newState.exercises.map((ex) =>
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ const UnderlineMultipleChoice: React.FC<{exercise: MultipleChoiceExercise, secti
|
|||||||
onPractice: () => {
|
onPractice: () => {
|
||||||
const updatedExercise = {
|
const updatedExercise = {
|
||||||
...local,
|
...local,
|
||||||
//isPractice: !isPractice,
|
isPractice: !local.isPractice
|
||||||
};
|
};
|
||||||
const newState = { ...section };
|
const newState = { ...section };
|
||||||
newState.exercises = newState.exercises.map((ex) =>
|
newState.exercises = newState.exercises.map((ex) =>
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ const MultipleChoice: React.FC<MultipleChoiceProps> = ({ exercise, sectionId, op
|
|||||||
onPractice: () => {
|
onPractice: () => {
|
||||||
const updatedExercise = {
|
const updatedExercise = {
|
||||||
...local,
|
...local,
|
||||||
//isPractice: !isPractice,
|
isPractice: !local.isPractice
|
||||||
};
|
};
|
||||||
const newState = { ...section };
|
const newState = { ...section };
|
||||||
newState.exercises = newState.exercises.map((ex) =>
|
newState.exercises = newState.exercises.map((ex) =>
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ const InteractiveSpeaking: React.FC<Props> = ({ sectionId, exercise, module = "s
|
|||||||
onPractice: () => {
|
onPractice: () => {
|
||||||
const updatedExercise = {
|
const updatedExercise = {
|
||||||
...state,
|
...state,
|
||||||
//isPractice: !isPractice,
|
isPractice: !local.isPractice
|
||||||
};
|
};
|
||||||
dispatch({ type: 'UPDATE_SECTION_STATE', payload: { sectionId, update: updatedExercise, module: module } });
|
dispatch({ type: 'UPDATE_SECTION_STATE', payload: { sectionId, update: updatedExercise, module: module } });
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ const Speaking1: React.FC<Props> = ({ sectionId, exercise, module = "speaking" }
|
|||||||
onPractice: () => {
|
onPractice: () => {
|
||||||
const updatedExercise = {
|
const updatedExercise = {
|
||||||
...state,
|
...state,
|
||||||
//isPractice: !isPractice,
|
isPractice: !local.isPractice
|
||||||
};
|
};
|
||||||
dispatch({ type: 'UPDATE_SECTION_STATE', payload: { sectionId, update: updatedExercise, module: module } });
|
dispatch({ type: 'UPDATE_SECTION_STATE', payload: { sectionId, update: updatedExercise, module: module } });
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ const Speaking2: React.FC<Props> = ({ sectionId, exercise, module = "speaking" }
|
|||||||
onPractice: () => {
|
onPractice: () => {
|
||||||
const updatedExercise = {
|
const updatedExercise = {
|
||||||
...state,
|
...state,
|
||||||
//isPractice: !isPractice,
|
isPractice: !local.isPractice
|
||||||
};
|
};
|
||||||
dispatch({ type: 'UPDATE_SECTION_STATE', payload: { sectionId, update: updatedExercise, module: module } });
|
dispatch({ type: 'UPDATE_SECTION_STATE', payload: { sectionId, update: updatedExercise, module: module } });
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ const TrueFalse: React.FC<{ exercise: TrueFalseExercise, sectionId: number }> =
|
|||||||
onPractice: () => {
|
onPractice: () => {
|
||||||
const updatedExercise = {
|
const updatedExercise = {
|
||||||
...local,
|
...local,
|
||||||
//isPractice: !isPractice,
|
isPractice: !local.isPractice
|
||||||
};
|
};
|
||||||
const newState = { ...section };
|
const newState = { ...section };
|
||||||
newState.exercises = newState.exercises.map((ex) =>
|
newState.exercises = newState.exercises.map((ex) =>
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ const WriteBlanks: React.FC<{ sectionId: number; exercise: WriteBlanksExercise;
|
|||||||
onPractice: () => {
|
onPractice: () => {
|
||||||
const updatedExercise = {
|
const updatedExercise = {
|
||||||
...local,
|
...local,
|
||||||
//isPractice: !isPractice,
|
isPractice: !local.isPractice
|
||||||
};
|
};
|
||||||
const newState = { ...section };
|
const newState = { ...section };
|
||||||
newState.exercises = newState.exercises.map((ex) =>
|
newState.exercises = newState.exercises.map((ex) =>
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ const WriteBlanksForm: React.FC<{ sectionId: number; exercise: WriteBlanksExerci
|
|||||||
onPractice: () => {
|
onPractice: () => {
|
||||||
const updatedExercise = {
|
const updatedExercise = {
|
||||||
...local,
|
...local,
|
||||||
//isPractice: !isPractice,
|
isPractice: !local.isPractice
|
||||||
};
|
};
|
||||||
const newState = { ...section };
|
const newState = { ...section };
|
||||||
newState.exercises = newState.exercises.map((ex) =>
|
newState.exercises = newState.exercises.map((ex) =>
|
||||||
|
|||||||
@@ -63,11 +63,10 @@ const Writing: React.FC<Props> = ({ sectionId, exercise, module, index }) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onEdit: ()=> {},
|
|
||||||
onPractice: () => {
|
onPractice: () => {
|
||||||
const newState = {
|
const newState = {
|
||||||
...state,
|
...state,
|
||||||
//isPractice: !isPractice,
|
isPractice: !local.isPractice
|
||||||
};
|
};
|
||||||
dispatch({ type: 'UPDATE_SECTION_STATE', payload: { sectionId, update: newState, module: currentModule } });
|
dispatch({ type: 'UPDATE_SECTION_STATE', payload: { sectionId, update: newState, module: currentModule } });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ const useSettingsState = <T extends SectionSettings>(
|
|||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
return debouncedFn;
|
return debouncedFn;
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [dispatch, sectionId]);
|
}, [dispatch, sectionId]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ const SectionExercises: React.FC<{ sectionId: number; }> = ({ sectionId }) => {
|
|||||||
|
|
||||||
updates.forEach(update => dispatch(update));
|
updates.forEach(update => dispatch(update));
|
||||||
}
|
}
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [levelGenResults, sectionState, levelGenerating, sectionId, currentModule]);
|
}, [levelGenResults, sectionState, levelGenerating, sectionId, currentModule]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -152,6 +153,7 @@ const SectionExercises: React.FC<{ sectionId: number; }> = ({ sectionId }) => {
|
|||||||
|
|
||||||
updates.forEach(update => dispatch(update));
|
updates.forEach(update => dispatch(update));
|
||||||
}
|
}
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [levelGenResults, sectionState, levelGenerating, sectionId, currentModule]);
|
}, [levelGenResults, sectionState, levelGenerating, sectionId, currentModule]);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user