fix добавьте ответ & у varimg есть многострочн ответ

This commit is contained in:
Nastya 2024-09-13 19:33:46 +03:00
parent 3e10a41504
commit cb11510744
4 changed files with 27 additions and 15 deletions

@ -16,7 +16,7 @@ interface Props {
}
export default function DropDown({ question, openBranchingPage, setOpenBranchingPage }: Props) {
const onClickAddAnAnswer = useAddAnswer();
const {onClickAddAnAnswer} = useAddAnswer();
const [switchState, setSwitchState] = useState("setting");
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down(790));

@ -19,13 +19,13 @@ type SettingOptionsAndPictProps = {
const SettingOptionsAndPict = memo<SettingOptionsAndPictProps>(function ({ question, questionId, ownPlaceholder, isMulti, isLargeCheck, replText, isRequired, isOwn }) {
const theme = useTheme();
const {switchOwn} = useAddAnswer();
const { switchOwn } = useAddAnswer();
const isWrappColumn = useMediaQuery(theme.breakpoints.down(980));
const isFigmaTablte = useMediaQuery(theme.breakpoints.down(990));
const isTablet = useMediaQuery(theme.breakpoints.down(985));
const isMobile = useMediaQuery(theme.breakpoints.down(680));
const setReplText = (replText: string) => {
updateQuestion(questionId, (question) => {
@ -66,16 +66,27 @@ const SettingOptionsAndPict = memo<SettingOptionsAndPictProps>(function ({ quest
}}
>
Настройки ответов
</Typography>
<CustomCheckbox
dataCy="checkbox-own-answer"
sx={{ mr: isMobile ? "0px" : "16px" }}
label={'Вариант "свой ответ"'}
checked={isOwn}
handleChange={({ target }) => {
switchOwn({question, checked:target.checked})
}}
/>
</Typography>
<CustomCheckbox
dataCy="checkbox-own-answer"
sx={{ mr: isMobile ? "0px" : "16px" }}
label={'Вариант "свой ответ"'}
checked={isOwn}
handleChange={({ target }) => {
switchOwn({ question, checked: target.checked })
}}
/>
<CustomCheckbox
dataCy="checkbox-long-text-answer"
sx={{ mr: isMobile ? "0px" : "16px" }}
label={"Многострочный ответ"}
checked={isLargeCheck}
handleChange={({ target }) => {
updateQuestion<QuizQuestionVariant>(questionId, (question) => {
question.content.largeCheck = target.checked;
});
}}
/>
{!isWrappColumn && (
<Box sx={{ mt: isMobile ? "11px" : "6px", width: "100%" }}>
<Typography
@ -119,6 +130,7 @@ const SettingOptionsAndPict = memo<SettingOptionsAndPictProps>(function ({ quest
fontWeight: "500",
fontSize: "18px",
color: " #4D4D4D",
mt: isMobile ? "10px" : ""
}}
>
Настройки вопросов

@ -21,7 +21,7 @@ interface Props {
export default function OptionsPicture({ question, openBranchingPage, setOpenBranchingPage }: Props) {
const theme = useTheme();
const onClickAddAnAnswer = useAddAnswer();
const {onClickAddAnAnswer} = useAddAnswer();
const quizQid = useCurrentQuiz()?.qid;
const [pictureUploding, setPictureUploading] = useState<boolean>(false);
const [selectedVariantId, setSelectedVariantId] = useState<string | null>(null);

@ -15,7 +15,7 @@ interface Props {
}
export default function AnswerOptions({ question, openBranchingPage, setOpenBranchingPage }: Props) {
const onClickAddAnAnswer = useAddAnswer();
const {onClickAddAnAnswer} = useAddAnswer();
const [switchState, setSwitchState] = useState("setting");
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down(790));