ENCOA-312
This commit is contained in:
@@ -43,12 +43,14 @@ const ExerciseWizard: React.FC<Props> = ({
|
||||
const { difficulty } = useExamEditorStore(state => state.modules[currentModule]);
|
||||
|
||||
const randomDiff = difficulty.length === 1
|
||||
? capitalize(difficulty[0])
|
||||
: `Random (${difficulty.map(dif => capitalize(dif)).join(", ")})` as Difficulty;
|
||||
? capitalize(difficulty[0])
|
||||
: difficulty.length == 0 ?
|
||||
"Random" :
|
||||
`Selected (${difficulty.sort().map(dif => capitalize(dif)).join(", ")})` as Difficulty;
|
||||
|
||||
const DIFFICULTIES = difficulty.length === 1
|
||||
? ["A1", "A2", "B1", "B2", "C1", "C2"]
|
||||
: ["A1", "A2", "B1", "B2", "C1", "C2", randomDiff];
|
||||
? ["A1", "A2", "B1", "B2", "C1", "C2", "Random"]
|
||||
: ["A1", "A2", "B1", "B2", "C1", "C2", randomDiff, "Random"];
|
||||
|
||||
useEffect(() => {
|
||||
const initialConfigs = selectedExercises.map(exerciseType => {
|
||||
|
||||
@@ -69,7 +69,7 @@ const ExercisePicker: React.FC<ExercisePickerProps> = ({
|
||||
...(config.params.max_words !== undefined && {
|
||||
max_words: Number(config.params.max_words)
|
||||
}),
|
||||
...(DIFFICULTIES.includes(config.params.difficulty as string) && {
|
||||
...((DIFFICULTIES.includes(config.params.difficulty as string) || config.params.difficulty === "Random") && {
|
||||
difficulty: config.params.difficulty
|
||||
})
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user