diff --git a/src/components/Generation/match.sentences.edit.tsx b/src/components/Generation/match.sentences.edit.tsx index a4027a2e..78ab3a95 100644 --- a/src/components/Generation/match.sentences.edit.tsx +++ b/src/components/Generation/match.sentences.edit.tsx @@ -1,7 +1,133 @@ -import React from 'react'; +import React from "react"; +import { MatchSentencesExercise } from "@/interfaces/exam"; +import Input from "@/components/Low/Input"; +import Select from "@/components/Low/Select"; -const MatchSentencesEdit = () => { - return null; +interface Props { + exercise: MatchSentencesExercise; + updateExercise: (data: any) => void; } +const MatchSentencesEdit = (props: Props) => { + const { exercise, updateExercise } = props; -export default MatchSentencesEdit; \ No newline at end of file + const selectOptions = exercise.options.map((option) => ({ + value: option.id, + label: option.id, + })); + + return ( + <> + + updateExercise({ + prompt: value, + }) + } + /> +

Solutions

+
+ {exercise.sentences.map((sentence, index) => ( +
+
+ + updateExercise({ + sentences: exercise.sentences.map((iSol) => + iSol.id === sentence.id + ? { + ...iSol, + sentence: { + ...iSol.sentence, + heading: value, + }, + } + : iSol + ), + }) + } + className="px-2" + /> +
+ + updateExercise({ + options: exercise.options.map((iSol) => + iSol.id === option.id + ? { + ...iSol, + sentence: value, + } + : iSol + ), + }) + } + className="px-2" + /> +
+