- Added a new type of exercise
- Updated all solutions to solve a huge bug where after reviewing, it would reset the score
This commit is contained in:
@@ -4,6 +4,8 @@ import {
|
||||
MatchSentencesExercise,
|
||||
MultipleChoiceExercise,
|
||||
SpeakingExercise,
|
||||
TrueFalseExercise,
|
||||
UserSolution,
|
||||
WriteBlanksExercise,
|
||||
WritingExercise,
|
||||
} from "@/interfaces/exam";
|
||||
@@ -11,20 +13,23 @@ import dynamic from "next/dynamic";
|
||||
import FillBlanks from "./FillBlanks";
|
||||
import MultipleChoice from "./MultipleChoice";
|
||||
import Speaking from "./Speaking";
|
||||
import TrueFalseSolution from "./TrueFalse";
|
||||
import WriteBlanks from "./WriteBlanks";
|
||||
import Writing from "./Writing";
|
||||
|
||||
const MatchSentences = dynamic(() => import("@/components/Solutions/MatchSentences"), {ssr: false});
|
||||
|
||||
export interface CommonProps {
|
||||
onNext: () => void;
|
||||
onBack: () => void;
|
||||
onNext: (userSolutions: UserSolution) => void;
|
||||
onBack: (userSolutions: UserSolution) => void;
|
||||
}
|
||||
|
||||
export const renderSolution = (exercise: Exercise, onNext: () => void, onBack: () => void) => {
|
||||
switch (exercise.type) {
|
||||
case "fillBlanks":
|
||||
return <FillBlanks {...(exercise as FillBlanksExercise)} onNext={onNext} onBack={onBack} />;
|
||||
case "trueFalse":
|
||||
return <TrueFalseSolution {...(exercise as TrueFalseExercise)} onNext={onNext} onBack={onBack} />;
|
||||
case "matchSentences":
|
||||
return <MatchSentences {...(exercise as MatchSentencesExercise)} onNext={onNext} onBack={onBack} />;
|
||||
case "multipleChoice":
|
||||
|
||||
Reference in New Issue
Block a user