diff --git a/src/components/quiz/question-form.tsx b/src/components/quiz/question-form.tsx index 8aa7a99..c9e2523 100644 --- a/src/components/quiz/question-form.tsx +++ b/src/components/quiz/question-form.tsx @@ -5,22 +5,23 @@ import { Checkbox } from "@/components/ui/checkbox"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; +import { Switch } from "@/components/ui/switch"; import { Textarea } from "@/components/ui/textarea"; import type { Answer, Question } from "@/types/quiz.ts"; -interface questionFormProps { - question: Question; - onUpdate: (updatedQuestion: Question) => void; +interface QuestionFormProps { + question: Question & { advanced?: boolean }; + onUpdate: (updatedQuestion: Question & { advanced?: boolean }) => void; onRemove: (id: number) => void; - advancedMode?: boolean; } export function QuestionForm({ question, onUpdate, onRemove, - advancedMode = false, -}: questionFormProps) { +}: QuestionFormProps) { + const isAdvanced = Boolean(question.advanced); + const handleTextChange = (text: string) => { onUpdate({ ...question, question: text }); }; @@ -95,16 +96,30 @@ export function QuestionForm({ > Pytanie {question.id} - +
+
+ { + onUpdate({ ...question, advanced: checked }); + }} + /> + + Zaawansowane + +
+ +