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