diff --git a/src/components/ExamEditor/Exercises/Blanks/Letters/index.tsx b/src/components/ExamEditor/Exercises/Blanks/Letters/index.tsx index fbc85ae0..ef2fff68 100644 --- a/src/components/ExamEditor/Exercises/Blanks/Letters/index.tsx +++ b/src/components/ExamEditor/Exercises/Blanks/Letters/index.tsx @@ -106,7 +106,7 @@ const FillBlanksLetters: React.FC<{ exercise: FillBlanksExercise; sectionId: num onPractice: () => { const updatedExercise = { ...local, - //isPractice: !isPractice, + isPractice: !local.isPractice, }; const newState = { ...section }; newState.exercises = newState.exercises.map((ex) => @@ -242,8 +242,6 @@ const FillBlanksLetters: React.FC<{ exercise: FillBlanksExercise; sectionId: num // eslint-disable-next-line react-hooks/exhaustive-deps }, [answers, blanksState.blanks, blanksState.textMode]) - - useEffect(()=> { setEditingAlert(editing, setAlerts); }, [editing]) @@ -266,7 +264,7 @@ const FillBlanksLetters: React.FC<{ exercise: FillBlanksExercise; sectionId: num onDelete={handleDelete} setEditing={setEditing} onPractice={handlePractice} - isEvaluationEnabled={true}//local.isPractice} + isEvaluationEnabled={!local.isPractice} > <> {!blanksState.textMode && diff --git a/src/components/ExamEditor/Exercises/Blanks/MultipleChoice/index.tsx b/src/components/ExamEditor/Exercises/Blanks/MultipleChoice/index.tsx index b7189404..e83adcbc 100644 --- a/src/components/ExamEditor/Exercises/Blanks/MultipleChoice/index.tsx +++ b/src/components/ExamEditor/Exercises/Blanks/MultipleChoice/index.tsx @@ -266,7 +266,7 @@ const FillBlanksMC: React.FC<{ exercise: FillBlanksExercise; sectionId: number } onPractice={handlePractice} setEditing={setEditing} onBlankRemove={handleBlankRemove} - isEvaluationEnabled={true} + isEvaluationEnabled={!local.isPractice} > {!blanksState.textMode && selectedBlankId && ( diff --git a/src/components/ExamEditor/Exercises/Blanks/WriteBlankFill/index.tsx b/src/components/ExamEditor/Exercises/Blanks/WriteBlankFill/index.tsx index 5de584ae..9acf2018 100644 --- a/src/components/ExamEditor/Exercises/Blanks/WriteBlankFill/index.tsx +++ b/src/components/ExamEditor/Exercises/Blanks/WriteBlankFill/index.tsx @@ -173,7 +173,7 @@ const WriteBlanksFill: React.FC<{ exercise: WriteBlanksExercise; sectionId: numb onDelete={handleDelete} onPractice={handlePractice} setEditing={setEditing} - isEvaluationEnabled={true} + isEvaluationEnabled={!local.isPractice} > {!blanksState.textMode && ( diff --git a/src/components/ExamEditor/Exercises/Blanks/index.tsx b/src/components/ExamEditor/Exercises/Blanks/index.tsx index 3fc349ca..9b728a8b 100644 --- a/src/components/ExamEditor/Exercises/Blanks/index.tsx +++ b/src/components/ExamEditor/Exercises/Blanks/index.tsx @@ -38,7 +38,7 @@ interface Props { onDiscard: () => void; onDelete: () => void; onPractice: () => void; - isEvaluationEnabled: boolean; + isEvaluationEnabled?: boolean; children: ReactNode; } diff --git a/src/components/ExamEditor/Exercises/MatchSentences/index.tsx b/src/components/ExamEditor/Exercises/MatchSentences/index.tsx index 7f57b02f..a2f25889 100644 --- a/src/components/ExamEditor/Exercises/MatchSentences/index.tsx +++ b/src/components/ExamEditor/Exercises/MatchSentences/index.tsx @@ -156,7 +156,7 @@ const MatchSentences: React.FC<{ exercise: MatchSentencesExercise, sectionId: nu handleDelete={handleDelete} handleDiscard={handleDiscard} handlePractice={handlePractice} - isEvaluationEnabled={true} + isEvaluationEnabled={!local.isPractice} > )} - {handlePractice && + {handlePractice &&