disable start quiz button when question count is 0
This commit is contained in:
parent
9a8df75a69
commit
51fb9c765e
@ -23,7 +23,7 @@ import { DESIGN_LIST } from "@/utils/designList";
|
||||
|
||||
export const StartPageViewPublication = () => {
|
||||
const theme = useTheme();
|
||||
const { settings, show_badge, quizId } = useQuizData();
|
||||
const { settings, show_badge, quizId, questions } = useQuizData();
|
||||
const { isMobileDevice } = useUADevice();
|
||||
const setCurrentQuizStep = useQuizViewStore(state => state.setCurrentQuizStep);
|
||||
|
||||
@ -82,6 +82,8 @@ export const StartPageViewPublication = () => {
|
||||
) : null
|
||||
) : null;
|
||||
|
||||
const realQuestionsCount = questions.filter((question) => question.type !== null && question.type !== "result").length;
|
||||
|
||||
return (
|
||||
<Paper
|
||||
className="settings-preview-draghandle"
|
||||
@ -213,6 +215,7 @@ export const StartPageViewPublication = () => {
|
||||
>
|
||||
<Button
|
||||
variant="contained"
|
||||
disabled={realQuestionsCount === 0}
|
||||
sx={{
|
||||
fontSize: "18px",
|
||||
padding: "10px 30px",
|
||||
|
Loading…
Reference in New Issue
Block a user