detailedAnswer multi
This commit is contained in:
parent
1b32719ef7
commit
ab1e221ada
@ -23,10 +23,12 @@ type SettingTextFieldProps = {
|
||||
questionId: string;
|
||||
isRequired: boolean;
|
||||
isAutofill: boolean;
|
||||
multi: boolean;
|
||||
detailedAnswer: boolean;
|
||||
answerType: Answer;
|
||||
};
|
||||
|
||||
const SettingTextField = memo<SettingTextFieldProps>(function ({ questionId, isRequired, isAutofill, answerType }) {
|
||||
const SettingTextField = memo<SettingTextFieldProps>(function ({ questionId, isRequired, detailedAnswer, multi, isAutofill, answerType }) {
|
||||
const theme = useTheme();
|
||||
const isMobile = useMediaQuery(theme.breakpoints.down(790));
|
||||
const isTablet = useMediaQuery(theme.breakpoints.down(900));
|
||||
@ -145,6 +147,36 @@ const SettingTextField = memo<SettingTextFieldProps>(function ({ questionId, isR
|
||||
});
|
||||
}}
|
||||
/>
|
||||
<CustomCheckbox
|
||||
dataCy="checkbox-optional-question"
|
||||
sx={{
|
||||
display: isMobile ? "flex" : "block",
|
||||
mr: isMobile ? "0px" : "16px",
|
||||
alignItems: isMobile ? "flex-end" : "center",
|
||||
}}
|
||||
label={"Развёрнутый ответ"}
|
||||
checked={!detailedAnswer}
|
||||
handleChange={(e) => {
|
||||
updateQuestion<QuizQuestionText>(questionId, (question) => {
|
||||
question.content.detailedAnswer = !e.target.checked;
|
||||
});
|
||||
}}
|
||||
/>
|
||||
<CustomCheckbox
|
||||
dataCy="checkbox-optional-question"
|
||||
sx={{
|
||||
display: isMobile ? "flex" : "block",
|
||||
mr: isMobile ? "0px" : "16px",
|
||||
alignItems: isMobile ? "flex-end" : "center",
|
||||
}}
|
||||
label={"Многострочный ответ"}
|
||||
checked={!multi}
|
||||
handleChange={(e) => {
|
||||
updateQuestion<QuizQuestionText>(questionId, (question) => {
|
||||
question.content.multi = !e.target.checked;
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
|
@ -17,6 +17,8 @@ export default function SwitchTextField({ switchState = "setting", question }: P
|
||||
isRequired={question.content.required}
|
||||
isAutofill={question.content.autofill}
|
||||
answerType={question.content.answerType}
|
||||
detailedAnswer={Boolean(question.content?.detailedAnswer)}
|
||||
multi={Boolean(question.content?.multi)}
|
||||
/>
|
||||
);
|
||||
case "image":
|
||||
|
Loading…
Reference in New Issue
Block a user