detailedAnswer multi
This commit is contained in:
parent
1b32719ef7
commit
ab1e221ada
@ -23,10 +23,12 @@ type SettingTextFieldProps = {
|
|||||||
questionId: string;
|
questionId: string;
|
||||||
isRequired: boolean;
|
isRequired: boolean;
|
||||||
isAutofill: boolean;
|
isAutofill: boolean;
|
||||||
|
multi: boolean;
|
||||||
|
detailedAnswer: boolean;
|
||||||
answerType: Answer;
|
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 theme = useTheme();
|
||||||
const isMobile = useMediaQuery(theme.breakpoints.down(790));
|
const isMobile = useMediaQuery(theme.breakpoints.down(790));
|
||||||
const isTablet = useMediaQuery(theme.breakpoints.down(900));
|
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>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
@ -17,6 +17,8 @@ export default function SwitchTextField({ switchState = "setting", question }: P
|
|||||||
isRequired={question.content.required}
|
isRequired={question.content.required}
|
||||||
isAutofill={question.content.autofill}
|
isAutofill={question.content.autofill}
|
||||||
answerType={question.content.answerType}
|
answerType={question.content.answerType}
|
||||||
|
detailedAnswer={Boolean(question.content?.detailedAnswer)}
|
||||||
|
multi={Boolean(question.content?.multi)}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
case "image":
|
case "image":
|
||||||
|
Loading…
Reference in New Issue
Block a user