import React from "react"; import Input from "@/components/Low/Input"; import { WriteBlanksExercise } from "@/interfaces/exam"; interface Props { exercise: WriteBlanksExercise; updateExercise: (data: any) => void; } const WriteBlankEdits = (props: Props) => { const { exercise, updateExercise } = props; return ( <> updateExercise({ prompt: value, }) } /> updateExercise({ text: value, }) } /> updateExercise({ maxWords: Number(value), }) } />

Solutions

{exercise.solutions.map((solution) => (
Solution ID: {solution.id} {/* TODO: Consider adding an add and delete button */}
{solution.solution.map((sol, solIndex) => ( updateExercise({ solutions: exercise.solutions.map((iSol) => iSol.id === solution.id ? { ...iSol, solution: iSol.solution.map((iiSol, iiIndex) => { if (iiIndex === solIndex) { return value; } return iiSol; }), } : iSol ), }) } className="sm:w-1/2 lg:w-1/4 px-2" /> ))}
))}
); }; export default WriteBlankEdits;