import React from "react"; import { TrueFalseExercise } from "@/interfaces/exam"; import Input from "@/components/Low/Input"; import Select from "@/components/Low/Select"; interface Props { exercise: TrueFalseExercise; updateExercise: (data: any) => void; } const options = [ { value: "true", label: "True" }, { value: "false", label: "False" }, { value: "not_given", label: "Not Given" }, ]; const TrueFalseEdit = (props: Props) => { const { exercise, updateExercise } = props; return ( <> updateExercise({ prompt: value, }) } />

Questions

{exercise.questions.map((question, index) => (
updateExercise({ questions: exercise.questions.map((sol) => sol.id === question.id ? { ...sol, prompt: value } : sol ), }) } />