2023-11-16 16:41:25 +00:00
|
|
|
import { QuizQuestionVarImg } from "@model/questionTypes/varimg";
|
|
|
|
import UploadImage from "../UploadImage";
|
2023-03-30 18:39:59 +00:00
|
|
|
import HelpQuestions from "../helpQuestions";
|
2023-11-16 16:41:25 +00:00
|
|
|
import SettingOptionsAndPict from "./SettingOptionsAndPict";
|
|
|
|
|
2023-03-30 18:39:59 +00:00
|
|
|
interface Props {
|
2023-12-31 02:53:25 +00:00
|
|
|
switchState: string;
|
|
|
|
question: QuizQuestionVarImg;
|
2023-03-30 18:39:59 +00:00
|
|
|
}
|
|
|
|
|
2023-08-24 11:09:47 +00:00
|
|
|
export default function SwitchOptionsAndPict({
|
2023-12-31 02:53:25 +00:00
|
|
|
switchState = "setting",
|
|
|
|
question,
|
2023-08-24 11:09:47 +00:00
|
|
|
}: Props) {
|
2023-12-31 02:53:25 +00:00
|
|
|
switch (switchState) {
|
|
|
|
case "setting":
|
2024-02-29 11:23:52 +00:00
|
|
|
return (
|
|
|
|
<SettingOptionsAndPict
|
|
|
|
questionId={question.id}
|
|
|
|
replText={question.content.replText}
|
|
|
|
isRequired={question.content.required}
|
|
|
|
/>
|
|
|
|
);
|
2023-12-31 02:53:25 +00:00
|
|
|
case "help":
|
2024-02-29 11:23:52 +00:00
|
|
|
return (
|
|
|
|
<HelpQuestions
|
|
|
|
questionId={question.id}
|
|
|
|
hintText={question.content.hint.text}
|
|
|
|
hintVideo={question.content.hint.video}
|
|
|
|
/>
|
|
|
|
);
|
2023-12-31 02:53:25 +00:00
|
|
|
case "image":
|
2024-04-01 17:09:54 +00:00
|
|
|
return (
|
|
|
|
<UploadImage
|
|
|
|
question={question}
|
|
|
|
cropAspectRatio={{ width: 380, height: 300 }}
|
|
|
|
/>
|
|
|
|
);
|
2023-12-31 02:53:25 +00:00
|
|
|
default:
|
2024-02-29 11:23:52 +00:00
|
|
|
return null;
|
2023-12-31 02:53:25 +00:00
|
|
|
}
|
2023-08-24 11:09:47 +00:00
|
|
|
}
|