@cuemath/leap 3.3.10-j2 → 3.3.11-guru.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar.js +4 -4
- package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar.js.map +1 -1
- package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide.js +2 -2
- package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide.js.map +1 -1
- package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-summary/question-overview.js +19 -18
- package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-summary/question-overview.js.map +1 -1
- package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-summary/sat-sheet-summary-styled.js +7 -7
- package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-summary/sat-sheet-summary-styled.js.map +1 -1
- package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-summary/sat-sheet-summary.js +26 -24
- package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-summary/sat-sheet-summary.js.map +1 -1
- package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-summary/summary-module.js +15 -13
- package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-summary/summary-module.js.map +1 -1
- package/dist/features/chapters/lpar-chapter/constants/index.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/block-sections/block-section-view.js +129 -69
- package/dist/features/chapters-v2/chapter-details/block-sections/block-section-view.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js +24 -23
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/chapter-details.js +71 -68
- package/dist/features/chapters-v2/chapter-details/chapter-details.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/node-card-styled.js +36 -31
- package/dist/features/chapters-v2/comps/node-card/node-card-styled.js.map +1 -1
- package/dist/features/chapters-v2/comps/sat-mock-test/sat-mock-test-styled.js +22 -0
- package/dist/features/chapters-v2/comps/sat-mock-test/sat-mock-test-styled.js.map +1 -0
- package/dist/features/chapters-v2/comps/sat-mock-test/sat-mock-test.js +151 -0
- package/dist/features/chapters-v2/comps/sat-mock-test/sat-mock-test.js.map +1 -0
- package/dist/features/chapters-v2/constants/block-constants.js +7 -5
- package/dist/features/chapters-v2/constants/block-constants.js.map +1 -1
- package/dist/features/chapters-v2/utils/index.js +8 -2
- package/dist/features/chapters-v2/utils/index.js.map +1 -1
- package/dist/features/chapters-v2/utils/sat-sheet-utils.js +12 -0
- package/dist/features/chapters-v2/utils/sat-sheet-utils.js.map +1 -0
- package/dist/features/journey/hooks/use-home-page-journey/home-page-homeworks-mock.js +8 -4
- package/dist/features/journey/hooks/use-home-page-journey/home-page-homeworks-mock.js.map +1 -1
- package/dist/features/parent-dashboard/comps/cuemath-app-features/cuemath-app-features.js +2 -2
- package/dist/features/parent-dashboard/comps/cuemath-app-features/cuemath-app-features.js.map +1 -1
- package/dist/features/parent-dashboard/comps/math-practice/math-practice.js +12 -12
- package/dist/features/parent-dashboard/comps/math-practice/math-practice.js.map +1 -1
- package/dist/features/sheets/constants/sheet.js +12 -4
- package/dist/features/sheets/constants/sheet.js.map +1 -1
- package/dist/features/trial-session/comps/pla/next-steps/next-steps.js +6 -6
- package/dist/features/trial-session/comps/pla/next-steps/next-steps.js.map +1 -1
- package/dist/features/trial-session/comps/pla/session-status/session-status.js.map +1 -1
- package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card.js +13 -13
- package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card.js.map +1 -1
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions-types.js.map +1 -1
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions.js +9 -9
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-behavior-helper.js +38 -38
- package/dist/features/worksheet/worksheet/worksheet-behavior-helper.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js +128 -126
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js.map +1 -1
- package/dist/index.d.ts +27 -27
- package/dist/index.js +146 -149
- package/dist/index.js.map +1 -1
- package/dist/node_modules/query-string/base.js +1 -1
- package/dist/node_modules/query-string/node_modules/decode-uri-component/index.js.map +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/regex.js +5 -0
- package/dist/node_modules/uuid/dist/esm-browser/regex.js.map +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/rng.js +2 -3
- package/dist/node_modules/uuid/dist/esm-browser/rng.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js +10 -6
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/v4.js +9 -12
- package/dist/node_modules/uuid/dist/esm-browser/v4.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/validate.js +8 -0
- package/dist/node_modules/uuid/dist/esm-browser/validate.js.map +1 -0
- package/package.json +2 -3
- package/dist/features/parent-dashboard/api/parent-home.js +0 -10
- package/dist/features/parent-dashboard/api/parent-home.js.map +0 -1
- package/dist/features/parent-dashboard/comps/compact-header/compact-header.js +0 -30
- package/dist/features/parent-dashboard/comps/compact-header/compact-header.js.map +0 -1
- package/dist/features/parent-dashboard/hooks/use-parent-home-data.js +0 -64
- package/dist/features/parent-dashboard/hooks/use-parent-home-data.js.map +0 -1
- package/dist/features/parent-dashboard/parent-dashboard-constants.js +0 -26
- package/dist/features/parent-dashboard/parent-dashboard-constants.js.map +0 -1
- package/dist/features/parent-dashboard/parent-dashboard-styled.js +0 -33
- package/dist/features/parent-dashboard/parent-dashboard-styled.js.map +0 -1
- package/dist/features/parent-dashboard/parent-dashboard-view.js +0 -203
- package/dist/features/parent-dashboard/parent-dashboard-view.js.map +0 -1
- package/dist/features/parent-dashboard/parent-dashboard.js +0 -8
- package/dist/features/parent-dashboard/parent-dashboard.js.map +0 -1
- package/dist/node_modules/decode-uri-component/index.js.map +0 -1
- package/dist/node_modules/uuid/dist/esm-browser/native.js +0 -7
- package/dist/node_modules/uuid/dist/esm-browser/native.js.map +0 -1
- /package/dist/node_modules/{decode-uri-component → query-string/node_modules/decode-uri-component}/index.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worksheet-questions-controller.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.tsx"],"sourcesContent":["import type {\n IButtonTypes,\n IWorksheetQuestionsControllerProps,\n} from './worksheet-questions-controller-types';\nimport type { FC } from 'react';\n\nimport { deepEqual } from 'fast-equals';\nimport { memo, useEffect, useMemo, useState } from 'react';\n\nimport Check2Icon from '../../../../assets/line-icons/icons/check2';\nimport HandIcon from '../../../../assets/line-icons/icons/hand';\nimport QuestionIcon from '../../../../assets/line-icons/icons/question';\nimport SkipIcon from '../../../../assets/line-icons/icons/skip';\nimport Button from '../../../ui/buttons/button/button';\nimport IconButton from '../../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport useHandlerCallbacks from './use-handler-callbacks';\n\nconst WorksheetQuestionsController: FC<IWorksheetQuestionsControllerProps> = memo(props => {\n const {\n layout,\n learnosity,\n question,\n questions,\n responses,\n questionIndex,\n canSubmitWorksheet,\n isQuestionUnlocked,\n isQuestionAppended,\n response,\n behavior,\n userType,\n setActiveQuestionId,\n setSummaryVisible,\n setBlocker,\n setResponses,\n getTimeSpentOnQuestion,\n onSkip,\n actionBarRightElement,\n } = props;\n\n const { onHelp, onResponseChange, onTeacherValidation, loggerRef } = props;\n const {\n navigationMode,\n canAttempt,\n hints,\n checkButtonLabel,\n retryButtonLabel,\n validation,\n maximumAttempts,\n canExceedAttempts,\n teacherValidationEnabled,\n canTeacherValidate,\n hintsTimer,\n skippableTime,\n skippable,\n } = behavior;\n\n const { response_id, item_type, type, instructor_stimulus, is_optional } = question;\n const hintsAvailable = !hints\n ? 0\n : learnosity.question(response_id)?.getMetadata()?.hints?.length ?? 0;\n\n const isSystemIntro = instructor_stimulus === 'SystemIntro';\n const isExitTicket = item_type === 'exit-ticket';\n const hintsRemaining = canAttempt && hintsAvailable - (response?.hintsUsed ?? 0) > 0;\n\n const [showHintsButton, setShowHintsButton] = useState(false);\n const [skipped, setSkipped] = useState(false);\n const [showSkipButton, setShowSkipButton] = useState(false);\n\n useEffect(() => {\n if (hintsTimer && hintsRemaining) {\n const timeoutId = setTimeout(() => {\n setShowHintsButton(true);\n }, hintsTimer * 1000);\n\n return () => clearTimeout(timeoutId);\n }\n setShowHintsButton(hintsRemaining);\n }, [hintsTimer, hintsRemaining]);\n\n useEffect(() => {\n const canShowSkip = !response?.response && !response?.skipped;\n\n //* If hints are available and user has exhausted all hints then we show skip button.\n //* If hints are not available and user has not given any response or have not skipped a question then we show skip button after skippableTime/ 90 seconds.\n //* Else skip button is hidden.\n if (skippable) {\n if (hintsAvailable > 0 && !hintsRemaining) {\n setShowSkipButton(canShowSkip);\n } else if (hintsAvailable === 0 && canShowSkip) {\n const timeoutId = setTimeout(\n () => {\n setShowSkipButton(canShowSkip);\n },\n (skippableTime ?? 0) * 1000,\n );\n\n return () => clearTimeout(timeoutId);\n } else {\n setShowSkipButton(false);\n }\n }\n }, [hintsAvailable, hintsRemaining, response, skippable, skippableTime]);\n\n const {\n checkButton,\n checkButtonDisabled,\n hintsButton,\n retryButton,\n nextButton,\n nextButtonDisabled,\n startButton,\n readyButton,\n validateButton,\n skipSectionButton,\n submitAttemptButton,\n skipButton,\n } = useMemo<IButtonTypes>(() => {\n const showSkipSectionButton =\n canTeacherValidate && is_optional && response?.assignStatus === 'assigned';\n\n const getSystemValidationButtons = (): IButtonTypes => {\n //* maximumAttempts = -2 means this is a puzzle card.\n if (maximumAttempts === -2) {\n if (userType === 'STUDENT') {\n if (canAttempt) {\n return {\n hintsButton: showHintsButton,\n };\n }\n }\n\n return {};\n }\n\n if (!canAttempt) {\n return {\n nextButton: true,\n };\n }\n\n if (!validation && behavior.navigationMode === 'LINEAR') {\n return {\n nextButton: true,\n nextButtonDisabled: !response?.response,\n hintsButton: showHintsButton,\n skipButton: showSkipButton,\n };\n }\n\n if (!validation) {\n return {\n nextButton: true,\n hintsButton: showHintsButton,\n };\n }\n\n if (!response || !response.response || !response.score) {\n return {\n checkButton: true,\n checkButtonDisabled: true,\n hintsButton: showHintsButton,\n };\n }\n\n const { responseEdited, score, attemptsHistory } = response;\n const maximumAttemptsReached = (attemptsHistory?.length ?? 0) >= maximumAttempts;\n\n if (maximumAttemptsReached && !canExceedAttempts) {\n return {\n nextButton: true,\n };\n }\n\n if (responseEdited) {\n const lastAttemptResponse = attemptsHistory?.slice(-1)[0]?.response;\n\n return {\n nextButton: maximumAttemptsReached,\n checkButton: true,\n checkButtonDisabled: deepEqual(response.response, lastAttemptResponse),\n hintsButton: showHintsButton,\n };\n }\n\n if ((score.score ?? 0) < score.max_score) {\n return {\n nextButton: maximumAttemptsReached,\n retryButton: true,\n hintsButton: showHintsButton,\n };\n }\n\n if ((score.score ?? 0) === score.max_score) {\n return {\n nextButton: true,\n };\n }\n\n return {};\n };\n\n const isPendingTeacherValidation = () =>\n questions.some(({ response_id: questionId }) => {\n const { assignStatus, validatedByTeacher } = responses[questionId] ?? {};\n\n return assignStatus === 'skipped' ? false : validatedByTeacher !== true;\n });\n\n if (teacherValidationEnabled) {\n const { validatedByTeacher } = response ?? {};\n\n // TODO: change the condition to if teacher validator is needed or not\n if (navigationMode === 'ADAPTIVE' || navigationMode === 'CURRENT') {\n if (userType === 'STUDENT') {\n return {\n hintsButton: showHintsButton,\n validateButton: false,\n };\n }\n\n return {\n validateButton: false,\n };\n }\n\n if (validatedByTeacher) {\n return {\n validateButton: true,\n submitAttemptButton:\n canTeacherValidate && canAttempt && userType === 'STUDENT' && canSubmitWorksheet\n ? !isPendingTeacherValidation()\n : false,\n };\n }\n\n if (!isQuestionUnlocked) {\n return {};\n }\n\n if (userType === 'STUDENT') {\n if (isSystemIntro) {\n return {\n startButton: canTeacherValidate && canAttempt,\n };\n }\n\n if (type !== 'clozetext') {\n return {\n ...getSystemValidationButtons(),\n nextButton: false,\n };\n }\n\n return {\n hintsButton: showHintsButton,\n readyButton: canTeacherValidate && isExitTicket && !response?.submittedByStudent,\n };\n }\n\n if (isSystemIntro) {\n return {\n skipSectionButton: showSkipSectionButton,\n };\n }\n\n if (type !== 'clozetext') {\n const { responseEdited, score } = response ?? {};\n\n return {\n skipSectionButton: showSkipSectionButton,\n validateButton:\n responseEdited || !canTeacherValidate\n ? false\n : !!(score?.score && score?.max_score && !((score.score ?? 0) < score.max_score)),\n };\n }\n\n return {\n skipSectionButton: showSkipSectionButton,\n validateButton: canTeacherValidate && (isExitTicket ? response?.submittedByStudent : true),\n };\n }\n\n return getSystemValidationButtons();\n }, [\n canTeacherValidate,\n is_optional,\n response,\n teacherValidationEnabled,\n canAttempt,\n validation,\n behavior.navigationMode,\n maximumAttempts,\n canExceedAttempts,\n showHintsButton,\n showSkipButton,\n questions,\n responses,\n navigationMode,\n isQuestionUnlocked,\n userType,\n isSystemIntro,\n type,\n isExitTicket,\n canSubmitWorksheet,\n ]);\n\n const {\n handleResponseChange,\n handleHelpButtonClick,\n handleBackButtonClick,\n handleNextButtonClick,\n handleCheckButtonClick,\n handleRetryButtonClick,\n handleHintButtonClick,\n handleValidateButtonClick,\n handleStartButtonClick,\n handleSkipSectionButtonClick,\n handleReadyButtonClick,\n handleSkipButtonClick,\n } = useHandlerCallbacks({\n layout,\n question,\n questions,\n learnosity,\n questionIndex,\n setActiveQuestionId,\n setSummaryVisible,\n setBlocker,\n setResponses,\n onResponseChange,\n onTeacherValidation,\n onHelp,\n behavior,\n loggerRef,\n setSkipped,\n getTimeSpentOnQuestion,\n });\n\n useEffect(() => {\n if (skipped) {\n setSkipped(false);\n setShowSkipButton(false);\n handleNextButtonClick();\n if (onSkip) {\n onSkip(question.item_display_number, question.question_number);\n }\n }\n }, [\n handleNextButtonClick,\n onSkip,\n question.item_display_number,\n question.question_number,\n skipped,\n ]);\n\n useEffect(() => {\n const questionInstance = isQuestionAppended ? learnosity.question(response_id) : undefined;\n\n if (questionInstance && canAttempt && (!validation || checkButton)) {\n questionInstance.on('changed', handleResponseChange);\n questionInstance.enable();\n }\n\n return () => {\n if (questionInstance && canAttempt && (!validation || checkButton)) {\n questionInstance.off('changed', handleResponseChange);\n questionInstance.disable();\n }\n };\n }, [\n canAttempt,\n checkButton,\n handleResponseChange,\n isQuestionAppended,\n learnosity,\n response_id,\n validation,\n ]);\n\n return (\n <FlexView\n $background=\"WHITE\"\n $flexDirection=\"row\"\n $flexGapX={0.5}\n $alignItems=\"center\"\n $justifyContent=\"flex-end\"\n >\n {hintsButton && (\n <IconButton\n Icon={QuestionIcon}\n analyticsLabel=\"Hint\"\n renderAs=\"secondary\"\n disabled={!isQuestionAppended}\n onClick={handleHintButtonClick}\n />\n )}\n {!hintsButton && handleHelpButtonClick && (checkButton || retryButton) && (\n <IconButton\n Icon={HandIcon}\n analyticsLabel=\"Ask for help\"\n renderAs=\"secondary\"\n onClick={handleHelpButtonClick}\n />\n )}\n {handleBackButtonClick && (\n <Button\n widthX={6}\n renderAs=\"secondary\"\n size=\"small\"\n label=\"Back\"\n disabled={questionIndex === 0}\n onClick={handleBackButtonClick}\n />\n )}\n {skipButton && (\n <Button\n widthX={6}\n renderAs={retryButton ? 'secondary' : 'primary'}\n size=\"small\"\n label=\"Skip\"\n onClick={handleSkipButtonClick}\n />\n )}\n {nextButton && (\n <Button\n widthX={6}\n renderAs={retryButton ? 'secondary' : 'primary'}\n size=\"small\"\n label=\"Next\"\n onClick={handleNextButtonClick}\n disabled={nextButtonDisabled === true}\n />\n )}\n {retryButton && (\n <Button\n widthX={6}\n renderAs=\"primary\"\n size=\"small\"\n label={retryButtonLabel}\n disabled={!isQuestionAppended}\n onClick={handleRetryButtonClick}\n />\n )}\n {checkButton && (\n <Button\n renderAs=\"primary\"\n size=\"small\"\n label={checkButtonLabel}\n disabled={checkButtonDisabled === true || !isQuestionAppended}\n onClick={handleCheckButtonClick}\n />\n )}\n {startButton && (\n <Button renderAs=\"primary\" size=\"small\" label=\"Start\" onClick={handleStartButtonClick} />\n )}\n {readyButton && (\n <Button renderAs=\"primary\" size=\"small\" label=\"Submit\" onClick={handleReadyButtonClick} />\n )}\n {skipSectionButton && (\n <IconButton\n renderAs=\"primary\"\n Icon={SkipIcon}\n analyticsLabel=\"Skip Section\"\n onClick={handleSkipSectionButtonClick}\n />\n )}\n {!submitAttemptButton && validateButton && (\n <IconButton\n renderAs=\"primary\"\n Icon={Check2Icon}\n disabled={response?.validatedByTeacher}\n analyticsLabel=\"Validate\"\n onClick={handleValidateButtonClick}\n />\n )}\n {actionBarRightElement && actionBarRightElement}\n </FlexView>\n );\n});\n\nexport default WorksheetQuestionsController;\n"],"names":["WorksheetQuestionsController","memo","props","layout","learnosity","question","questions","responses","questionIndex","canSubmitWorksheet","isQuestionUnlocked","isQuestionAppended","response","behavior","userType","setActiveQuestionId","setSummaryVisible","setBlocker","setResponses","getTimeSpentOnQuestion","onSkip","actionBarRightElement","onHelp","onResponseChange","onTeacherValidation","loggerRef","navigationMode","canAttempt","hints","checkButtonLabel","retryButtonLabel","validation","maximumAttempts","canExceedAttempts","teacherValidationEnabled","canTeacherValidate","hintsTimer","skippableTime","skippable","response_id","item_type","type","instructor_stimulus","is_optional","hintsAvailable","_c","_b","_a","isSystemIntro","isExitTicket","hintsRemaining","showHintsButton","setShowHintsButton","useState","skipped","setSkipped","showSkipButton","setShowSkipButton","useEffect","timeoutId","canShowSkip","checkButton","checkButtonDisabled","hintsButton","retryButton","nextButton","nextButtonDisabled","startButton","readyButton","validateButton","skipSectionButton","submitAttemptButton","skipButton","useMemo","showSkipSectionButton","getSystemValidationButtons","responseEdited","score","attemptsHistory","maximumAttemptsReached","lastAttemptResponse","deepEqual","isPendingTeacherValidation","questionId","assignStatus","validatedByTeacher","handleResponseChange","handleHelpButtonClick","handleBackButtonClick","handleNextButtonClick","handleCheckButtonClick","handleRetryButtonClick","handleHintButtonClick","handleValidateButtonClick","handleStartButtonClick","handleSkipSectionButtonClick","handleReadyButtonClick","handleSkipButtonClick","useHandlerCallbacks","questionInstance","jsxs","FlexView","jsx","IconButton","QuestionIcon","HandIcon","Button","SkipIcon","Check2Icon"],"mappings":";;;;;;;;;;;AAkBM,MAAAA,KAAuEC,GAAK,CAASC,MAAA;;AACnF,QAAA;AAAA,IACJ,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,cAAAC;AAAA,IACA,wBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,uBAAAC;AAAA,EACE,IAAAnB,GAEE,EAAE,QAAAoB,IAAQ,kBAAAC,IAAkB,qBAAAC,IAAqB,WAAAC,OAAcvB,GAC/D;AAAA,IACJ,gBAAAwB;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,eAAAC;AAAA,IACA,WAAAC;AAAA,EACE,IAAAzB,GAEE,EAAE,aAAA0B,GAAa,WAAAC,IAAW,MAAAC,GAAM,qBAAAC,IAAqB,aAAAC,EAAgB,IAAAt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,UAACC;AAAA,UAAA;AAAA,YACC,UAAS;AAAA,YACT,MAAMK;AAAA,YACN,UAAUhG,KAAA,gBAAAA,EAAU;AAAA,YACpB,gBAAe;AAAA,YACf,SAASiF;AAAA,UAAA;AAAA,QACX;AAAA,QAEDxE,KAAyBA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGhC,CAAC;"}
|
|
1
|
+
{"version":3,"file":"worksheet-questions-controller.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.tsx"],"sourcesContent":["import type {\n IButtonTypes,\n IWorksheetQuestionsControllerProps,\n} from './worksheet-questions-controller-types';\nimport type { FC } from 'react';\n\nimport { deepEqual } from 'fast-equals';\nimport { memo, useEffect, useMemo, useState } from 'react';\n\nimport Check2Icon from '../../../../assets/line-icons/icons/check2';\nimport HandIcon from '../../../../assets/line-icons/icons/hand';\nimport QuestionIcon from '../../../../assets/line-icons/icons/question';\nimport SkipIcon from '../../../../assets/line-icons/icons/skip';\nimport Button from '../../../ui/buttons/button/button';\nimport IconButton from '../../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport useHandlerCallbacks from './use-handler-callbacks';\n\nconst WorksheetQuestionsController: FC<IWorksheetQuestionsControllerProps> = memo(props => {\n const {\n layout,\n learnosity,\n question,\n questions,\n responses,\n questionIndex,\n canSubmitWorksheet,\n isQuestionUnlocked,\n isQuestionAppended,\n response,\n behavior,\n userType,\n setActiveQuestionId,\n setSummaryVisible,\n setBlocker,\n setResponses,\n getTimeSpentOnQuestion,\n onSkip,\n actionBarRightElement,\n onSubmit,\n } = props;\n\n const { onHelp, onResponseChange, onTeacherValidation, loggerRef } = props;\n const {\n navigationMode,\n canAttempt,\n hints,\n checkButtonLabel,\n retryButtonLabel,\n validation,\n maximumAttempts,\n canExceedAttempts,\n teacherValidationEnabled,\n canTeacherValidate,\n hintsTimer,\n skippableTime,\n skippable,\n } = behavior;\n\n const { response_id, item_type, type, instructor_stimulus, is_optional } = question;\n const hintsAvailable = !hints\n ? 0\n : learnosity.question(response_id)?.getMetadata()?.hints?.length ?? 0;\n\n const isSystemIntro = instructor_stimulus === 'SystemIntro';\n const isExitTicket = item_type === 'exit-ticket';\n const hintsRemaining = canAttempt && hintsAvailable - (response?.hintsUsed ?? 0) > 0;\n\n const [showHintsButton, setShowHintsButton] = useState(false);\n const [skipped, setSkipped] = useState(false);\n const [showSkipButton, setShowSkipButton] = useState(false);\n\n useEffect(() => {\n if (hintsTimer && hintsRemaining) {\n const timeoutId = setTimeout(() => {\n setShowHintsButton(true);\n }, hintsTimer * 1000);\n\n return () => clearTimeout(timeoutId);\n }\n setShowHintsButton(hintsRemaining);\n }, [hintsTimer, hintsRemaining]);\n\n useEffect(() => {\n const canShowSkip = !response?.response && !response?.skipped;\n\n //* If hints are available and user has exhausted all hints then we show skip button.\n //* If hints are not available and user has not given any response or have not skipped a question then we show skip button after skippableTime/ 90 seconds.\n //* Else skip button is hidden.\n if (skippable) {\n if (hintsAvailable > 0 && !hintsRemaining) {\n setShowSkipButton(canShowSkip);\n } else if (hintsAvailable === 0 && canShowSkip) {\n const timeoutId = setTimeout(\n () => {\n setShowSkipButton(canShowSkip);\n },\n (skippableTime ?? 0) * 1000,\n );\n\n return () => clearTimeout(timeoutId);\n } else {\n setShowSkipButton(false);\n }\n }\n }, [hintsAvailable, hintsRemaining, response, skippable, skippableTime]);\n\n const {\n checkButton,\n checkButtonDisabled,\n hintsButton,\n retryButton,\n nextButton,\n nextButtonDisabled,\n startButton,\n readyButton,\n validateButton,\n skipSectionButton,\n submitAttemptButton,\n skipButton,\n } = useMemo<IButtonTypes>(() => {\n const showSkipSectionButton =\n canTeacherValidate && is_optional && response?.assignStatus === 'assigned';\n\n const getSystemValidationButtons = (): IButtonTypes => {\n //* maximumAttempts = -2 means this is a puzzle card.\n if (maximumAttempts === -2) {\n if (userType === 'STUDENT') {\n if (canAttempt) {\n return {\n hintsButton: showHintsButton,\n };\n }\n }\n\n return {};\n }\n\n if (!canAttempt) {\n return {\n nextButton: true,\n };\n }\n\n if (!validation && behavior.navigationMode === 'LINEAR') {\n return {\n nextButton: true,\n nextButtonDisabled: !response?.response,\n hintsButton: showHintsButton,\n skipButton: showSkipButton,\n };\n }\n\n if (!validation) {\n return {\n nextButton: true,\n hintsButton: showHintsButton,\n };\n }\n\n if (!response || !response.response || !response.score) {\n return {\n checkButton: true,\n checkButtonDisabled: true,\n hintsButton: showHintsButton,\n };\n }\n\n const { responseEdited, score, attemptsHistory } = response;\n const maximumAttemptsReached = (attemptsHistory?.length ?? 0) >= maximumAttempts;\n\n if (maximumAttemptsReached && !canExceedAttempts) {\n return {\n nextButton: true,\n };\n }\n\n if (responseEdited) {\n const lastAttemptResponse = attemptsHistory?.slice(-1)[0]?.response;\n\n return {\n nextButton: maximumAttemptsReached,\n checkButton: true,\n checkButtonDisabled: deepEqual(response.response, lastAttemptResponse),\n hintsButton: showHintsButton,\n };\n }\n\n if ((score.score ?? 0) < score.max_score) {\n return {\n nextButton: maximumAttemptsReached,\n retryButton: true,\n hintsButton: showHintsButton,\n };\n }\n\n if ((score.score ?? 0) === score.max_score) {\n return {\n nextButton: true,\n };\n }\n\n return {};\n };\n\n const isPendingTeacherValidation = () =>\n questions.some(({ response_id: questionId }) => {\n const { assignStatus, validatedByTeacher } = responses[questionId] ?? {};\n\n return assignStatus === 'skipped' ? false : validatedByTeacher !== true;\n });\n\n if (teacherValidationEnabled) {\n const { validatedByTeacher } = response ?? {};\n\n // TODO: change the condition to if teacher validator is needed or not\n if (navigationMode === 'ADAPTIVE' || navigationMode === 'CURRENT') {\n if (userType === 'STUDENT') {\n return {\n hintsButton: showHintsButton,\n validateButton: false,\n };\n }\n\n return {\n validateButton: false,\n };\n }\n\n if (validatedByTeacher) {\n return {\n validateButton: true,\n submitAttemptButton:\n canTeacherValidate && canAttempt && userType === 'STUDENT' && canSubmitWorksheet\n ? !isPendingTeacherValidation()\n : false,\n };\n }\n\n if (!isQuestionUnlocked) {\n return {};\n }\n\n if (userType === 'STUDENT') {\n if (isSystemIntro) {\n return {\n startButton: canTeacherValidate && canAttempt,\n };\n }\n\n if (type !== 'clozetext') {\n return {\n ...getSystemValidationButtons(),\n nextButton: false,\n };\n }\n\n return {\n hintsButton: showHintsButton,\n readyButton: canTeacherValidate && isExitTicket && !response?.submittedByStudent,\n };\n }\n\n if (isSystemIntro) {\n return {\n skipSectionButton: showSkipSectionButton,\n };\n }\n\n if (type !== 'clozetext') {\n const { responseEdited, score } = response ?? {};\n\n return {\n skipSectionButton: showSkipSectionButton,\n validateButton:\n responseEdited || !canTeacherValidate\n ? false\n : !!(score?.score && score?.max_score && !((score.score ?? 0) < score.max_score)),\n };\n }\n\n return {\n skipSectionButton: showSkipSectionButton,\n validateButton: canTeacherValidate && (isExitTicket ? response?.submittedByStudent : true),\n };\n }\n\n return getSystemValidationButtons();\n }, [\n canTeacherValidate,\n is_optional,\n response,\n teacherValidationEnabled,\n canAttempt,\n validation,\n behavior.navigationMode,\n maximumAttempts,\n canExceedAttempts,\n showHintsButton,\n showSkipButton,\n questions,\n responses,\n navigationMode,\n isQuestionUnlocked,\n userType,\n isSystemIntro,\n type,\n isExitTicket,\n canSubmitWorksheet,\n ]);\n\n const {\n handleResponseChange,\n handleHelpButtonClick,\n handleBackButtonClick,\n handleNextButtonClick,\n handleCheckButtonClick,\n handleRetryButtonClick,\n handleHintButtonClick,\n handleValidateButtonClick,\n handleStartButtonClick,\n handleSkipSectionButtonClick,\n handleReadyButtonClick,\n handleSkipButtonClick,\n } = useHandlerCallbacks({\n layout,\n question,\n questions,\n learnosity,\n questionIndex,\n setActiveQuestionId,\n setSummaryVisible,\n setBlocker,\n setResponses,\n onResponseChange,\n onTeacherValidation,\n onHelp,\n behavior,\n loggerRef,\n setSkipped,\n getTimeSpentOnQuestion,\n });\n\n useEffect(() => {\n if (skipped) {\n setSkipped(false);\n setShowSkipButton(false);\n handleNextButtonClick();\n if (onSkip) {\n onSkip(question.item_display_number, question.question_number);\n }\n }\n }, [\n handleNextButtonClick,\n onSkip,\n question.item_display_number,\n question.question_number,\n skipped,\n ]);\n\n useEffect(() => {\n const questionInstance = isQuestionAppended ? learnosity.question(response_id) : undefined;\n\n if (questionInstance && canAttempt && (!validation || checkButton)) {\n questionInstance.on('changed', handleResponseChange);\n questionInstance.enable();\n }\n\n return () => {\n if (questionInstance && canAttempt && (!validation || checkButton)) {\n questionInstance.off('changed', handleResponseChange);\n questionInstance.disable();\n }\n };\n }, [\n canAttempt,\n checkButton,\n handleResponseChange,\n isQuestionAppended,\n learnosity,\n response_id,\n validation,\n ]);\n\n return (\n <FlexView\n $background=\"WHITE\"\n $flexDirection=\"row\"\n $flexGapX={0.5}\n $alignItems=\"center\"\n $justifyContent=\"flex-end\"\n >\n {hintsButton && (\n <IconButton\n Icon={QuestionIcon}\n analyticsLabel=\"Hint\"\n renderAs=\"secondary\"\n disabled={!isQuestionAppended}\n onClick={handleHintButtonClick}\n />\n )}\n {!hintsButton && handleHelpButtonClick && (checkButton || retryButton) && (\n <IconButton\n Icon={HandIcon}\n analyticsLabel=\"Ask for help\"\n renderAs=\"secondary\"\n onClick={handleHelpButtonClick}\n />\n )}\n {handleBackButtonClick && (\n <Button\n widthX={6}\n renderAs=\"secondary\"\n size=\"small\"\n label=\"Back\"\n disabled={questionIndex === 0}\n onClick={handleBackButtonClick}\n />\n )}\n {skipButton && (\n <Button\n widthX={6}\n renderAs={retryButton ? 'secondary' : 'primary'}\n size=\"small\"\n label=\"Skip\"\n onClick={handleSkipButtonClick}\n />\n )}\n {nextButton && (\n <Button\n widthX={6}\n renderAs={retryButton ? 'secondary' : 'primary'}\n size=\"small\"\n label=\"Next\"\n onClick={handleNextButtonClick}\n disabled={nextButtonDisabled === true}\n />\n )}\n {retryButton && (\n <Button\n widthX={6}\n renderAs=\"primary\"\n size=\"small\"\n label={retryButtonLabel}\n disabled={!isQuestionAppended}\n onClick={handleRetryButtonClick}\n />\n )}\n {checkButton && (\n <Button\n renderAs=\"primary\"\n size=\"small\"\n label={checkButtonLabel}\n disabled={checkButtonDisabled === true || !isQuestionAppended}\n onClick={handleCheckButtonClick}\n />\n )}\n {startButton && (\n <Button renderAs=\"primary\" size=\"small\" label=\"Start\" onClick={handleStartButtonClick} />\n )}\n {readyButton && (\n <Button renderAs=\"primary\" size=\"small\" label=\"Submit\" onClick={handleReadyButtonClick} />\n )}\n {skipSectionButton && (\n <IconButton\n renderAs=\"primary\"\n Icon={SkipIcon}\n analyticsLabel=\"Skip Section\"\n onClick={handleSkipSectionButtonClick}\n />\n )}\n {!submitAttemptButton && validateButton && (\n <IconButton\n renderAs=\"primary\"\n Icon={Check2Icon}\n disabled={response?.validatedByTeacher}\n analyticsLabel=\"Validate\"\n onClick={handleValidateButtonClick}\n />\n )}\n {submitAttemptButton && (\n <Button renderAs=\"primary\" size=\"small\" label=\"Submit\" onClick={onSubmit} />\n )}\n {actionBarRightElement && actionBarRightElement}\n </FlexView>\n );\n});\n\nexport default WorksheetQuestionsController;\n"],"names":["WorksheetQuestionsController","memo","props","layout","learnosity","question","questions","responses","questionIndex","canSubmitWorksheet","isQuestionUnlocked","isQuestionAppended","response","behavior","userType","setActiveQuestionId","setSummaryVisible","setBlocker","setResponses","getTimeSpentOnQuestion","onSkip","actionBarRightElement","onSubmit","onHelp","onResponseChange","onTeacherValidation","loggerRef","navigationMode","canAttempt","hints","checkButtonLabel","retryButtonLabel","validation","maximumAttempts","canExceedAttempts","teacherValidationEnabled","canTeacherValidate","hintsTimer","skippableTime","skippable","response_id","item_type","type","instructor_stimulus","is_optional","hintsAvailable","_c","_b","_a","isSystemIntro","isExitTicket","hintsRemaining","showHintsButton","setShowHintsButton","useState","skipped","setSkipped","showSkipButton","setShowSkipButton","useEffect","timeoutId","canShowSkip","checkButton","checkButtonDisabled","hintsButton","retryButton","nextButton","nextButtonDisabled","startButton","readyButton","validateButton","skipSectionButton","submitAttemptButton","skipButton","useMemo","showSkipSectionButton","getSystemValidationButtons","responseEdited","score","attemptsHistory","maximumAttemptsReached","lastAttemptResponse","deepEqual","isPendingTeacherValidation","questionId","assignStatus","validatedByTeacher","handleResponseChange","handleHelpButtonClick","handleBackButtonClick","handleNextButtonClick","handleCheckButtonClick","handleRetryButtonClick","handleHintButtonClick","handleValidateButtonClick","handleStartButtonClick","handleSkipSectionButtonClick","handleReadyButtonClick","handleSkipButtonClick","useHandlerCallbacks","questionInstance","jsxs","FlexView","jsx","IconButton","QuestionIcon","HandIcon","Button","SkipIcon","Check2Icon"],"mappings":";;;;;;;;;;;AAkBM,MAAAA,KAAuEC,GAAK,CAASC,MAAA;;AACnF,QAAA;AAAA,IACJ,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,cAAAC;AAAA,IACA,wBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,UAAAC;AAAA,EACE,IAAApB,GAEE,EAAE,QAAAqB,IAAQ,kBAAAC,IAAkB,qBAAAC,IAAqB,WAAAC,OAAcxB,GAC/D;AAAA,IACJ,gBAAAyB;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,eAAAC;AAAA,IACA,WAAAC;AAAA,EACE,IAAA1B,GAEE,EAAE,aAAA2B,GAAa,WAAAC,IAAW,MAAAC,GAAM,qBAAAC,IAAqB,aAAAC,EAAgB,IAAAvC,GACrEwC,IAAkBhB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,YACC,UAAS;AAAA,YACT,MAAMK;AAAA,YACN,UAAUjG,KAAA,gBAAAA,EAAU;AAAA,YACpB,gBAAe;AAAA,YACf,SAASkF;AAAA,UAAA;AAAA,QACX;AAAA,QAEDtB,KACE,gBAAA+B,EAAAI,GAAA,EAAO,UAAS,WAAU,MAAK,SAAQ,OAAM,UAAS,SAASrF,GAAU,CAAA;AAAA,QAE3ED,KAAyBA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGhC,CAAC;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -133,6 +133,13 @@ export declare const Bin2Icon: React.FC<React.SVGProps<SVGSVGElement>>;
|
|
|
133
133
|
|
|
134
134
|
export declare const BinIcon: React.FC<React.SVGProps<SVGSVGElement>>;
|
|
135
135
|
|
|
136
|
+
declare enum BLOCK_STATES {
|
|
137
|
+
LOCKED = "LOCKED",
|
|
138
|
+
NOT_STARTED = "NOT_STARTED",
|
|
139
|
+
IN_PROGRESS = "IN_PROGRESS",
|
|
140
|
+
COMPLETED = "COMPLETED"
|
|
141
|
+
}
|
|
142
|
+
|
|
136
143
|
declare const BLOCK_STATUS: {
|
|
137
144
|
readonly ADDED: "ADDED";
|
|
138
145
|
readonly IN_PROGRESS: "IN_PROGRESS";
|
|
@@ -335,8 +342,6 @@ export declare const Coachmark: React_2.FC<{
|
|
|
335
342
|
|
|
336
343
|
export declare const CodeIcon: React.FC<React.SVGProps<SVGSVGElement>>;
|
|
337
344
|
|
|
338
|
-
export declare const CompactHeader: MemoExoticComponent<({ progressPercentage, showProgress, HeaderAvatar }: ICompactHeaderProps) => JSX.Element | null>;
|
|
339
|
-
|
|
340
345
|
export declare const COMPLETED_SHEET_STATE: TSheetStateProps[];
|
|
341
346
|
|
|
342
347
|
export declare const ContextMenu: FC<IContextMenuProps>;
|
|
@@ -932,6 +937,12 @@ declare interface IBaseWorksheetProps {
|
|
|
932
937
|
|
|
933
938
|
declare interface IBlockSectionsCallbacks extends INodeCardCallbacks {
|
|
934
939
|
onBlockSkipUnskip?: (blockData: IChapterBlockData, skipBlock?: boolean) => void;
|
|
940
|
+
onBlockReset?: (blockData: IChapterBlockData) => void;
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
declare interface IBlockStats {
|
|
944
|
+
sat_max_score: number;
|
|
945
|
+
sat_total_score: number;
|
|
935
946
|
}
|
|
936
947
|
|
|
937
948
|
declare interface IButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, IClickableAnalyticsProps {
|
|
@@ -1016,6 +1027,7 @@ declare interface IChapter extends IChapterState, Pick<IChapterModel, 'code' | '
|
|
|
1016
1027
|
|
|
1017
1028
|
export declare interface IChapterBlockData {
|
|
1018
1029
|
block_type: keyof typeof BLOCK_TYPE;
|
|
1030
|
+
block_statement: string;
|
|
1019
1031
|
chapter_code: string;
|
|
1020
1032
|
code: string;
|
|
1021
1033
|
block_id: string;
|
|
@@ -1025,11 +1037,17 @@ export declare interface IChapterBlockData {
|
|
|
1025
1037
|
section_code: keyof typeof SECTION_CODE;
|
|
1026
1038
|
sheets: INodeDataProps[];
|
|
1027
1039
|
user_block_id: string | null;
|
|
1040
|
+
block_stats: IBlockStats | null;
|
|
1041
|
+
state: TBlockStates;
|
|
1028
1042
|
}
|
|
1029
1043
|
|
|
1030
1044
|
declare interface IChapterBlockPermission {
|
|
1031
1045
|
can_skip: boolean;
|
|
1032
1046
|
can_un_skip: boolean;
|
|
1047
|
+
can_reset: boolean;
|
|
1048
|
+
can_resume: boolean;
|
|
1049
|
+
can_review: boolean;
|
|
1050
|
+
can_start: boolean;
|
|
1033
1051
|
}
|
|
1034
1052
|
|
|
1035
1053
|
export declare interface IChapterBlockV3 {
|
|
@@ -1329,12 +1347,6 @@ export declare interface ICoachmarkProps {
|
|
|
1329
1347
|
isActive: boolean;
|
|
1330
1348
|
}
|
|
1331
1349
|
|
|
1332
|
-
declare interface ICompactHeaderProps {
|
|
1333
|
-
showProgress?: boolean;
|
|
1334
|
-
progressPercentage?: number;
|
|
1335
|
-
HeaderAvatar: ReactElement;
|
|
1336
|
-
}
|
|
1337
|
-
|
|
1338
1350
|
export declare const IconButton: FC<IIconButtonProps>;
|
|
1339
1351
|
|
|
1340
1352
|
declare interface IconProps extends React_2.SVGProps<SVGSVGElement> {
|
|
@@ -2409,7 +2421,7 @@ declare interface IMaintenanceProps {
|
|
|
2409
2421
|
}
|
|
2410
2422
|
|
|
2411
2423
|
declare interface IMathPracticeProps {
|
|
2412
|
-
onSwitchUser
|
|
2424
|
+
onSwitchUser: () => void;
|
|
2413
2425
|
}
|
|
2414
2426
|
|
|
2415
2427
|
export declare interface IMessageProps {
|
|
@@ -2780,6 +2792,7 @@ export declare interface INodeDataProps {
|
|
|
2780
2792
|
unlocked_on_ts: number | null;
|
|
2781
2793
|
user_attempt_id: string | null;
|
|
2782
2794
|
user_chapter_id: string | null;
|
|
2795
|
+
user_block_id: string | null;
|
|
2783
2796
|
user_milestone_id?: string;
|
|
2784
2797
|
user_node_id: string | null;
|
|
2785
2798
|
worksheet_id: string;
|
|
@@ -2895,19 +2908,6 @@ export declare interface IOutcomeStageData {
|
|
|
2895
2908
|
achievementAction?: string | null;
|
|
2896
2909
|
}
|
|
2897
2910
|
|
|
2898
|
-
declare interface IParentDashboardProps {
|
|
2899
|
-
studentName: string;
|
|
2900
|
-
studentServiceId: string;
|
|
2901
|
-
onRescheduleDemo: (demoId?: string) => void;
|
|
2902
|
-
onChangeTutor: (demoId: string) => void;
|
|
2903
|
-
onGetStartedAgain?: () => void;
|
|
2904
|
-
onViewSummary?: (key: string) => void;
|
|
2905
|
-
onSwitchUser?: () => void;
|
|
2906
|
-
canChangeTutor: boolean;
|
|
2907
|
-
isSubscriptionCancelled: boolean;
|
|
2908
|
-
HeaderAvatar: ReactElement;
|
|
2909
|
-
}
|
|
2910
|
-
|
|
2911
2911
|
declare interface IPercentileProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'>, Omit<IBaseInputProps, 'inputElement'> {
|
|
2912
2912
|
}
|
|
2913
2913
|
|
|
@@ -3393,7 +3393,7 @@ declare interface ISessionStatusProps {
|
|
|
3393
3393
|
declare interface ISessionSummaryProps {
|
|
3394
3394
|
isDemoDone: boolean;
|
|
3395
3395
|
studentName: string;
|
|
3396
|
-
onViewSummary
|
|
3396
|
+
onViewSummary: (key: string) => void;
|
|
3397
3397
|
}
|
|
3398
3398
|
|
|
3399
3399
|
declare interface IShareInstructionModalProps {
|
|
@@ -4019,7 +4019,7 @@ export declare interface ITutorialProps {
|
|
|
4019
4019
|
}
|
|
4020
4020
|
|
|
4021
4021
|
declare interface IUpcomingSessionsProps {
|
|
4022
|
-
sessions
|
|
4022
|
+
sessions: TSession[];
|
|
4023
4023
|
}
|
|
4024
4024
|
|
|
4025
4025
|
declare interface IUpdateImages {
|
|
@@ -4972,8 +4972,6 @@ export declare const OverlayLoader: MemoExoticComponent<({ isLoading }: {
|
|
|
4972
4972
|
isLoading?: boolean | undefined;
|
|
4973
4973
|
}) => JSX.Element | null>;
|
|
4974
4974
|
|
|
4975
|
-
export declare const ParentDashboard: MemoExoticComponent<(props: IParentDashboardProps) => JSX.Element>;
|
|
4976
|
-
|
|
4977
4975
|
export declare const ParentDashboardFaqs: () => JSX.Element;
|
|
4978
4976
|
|
|
4979
4977
|
export declare const PencilIcon: React.FC<React.SVGProps<SVGSVGElement>>;
|
|
@@ -5156,7 +5154,7 @@ export declare const RightIcon: React.FC<React.SVGProps<SVGSVGElement>>;
|
|
|
5156
5154
|
|
|
5157
5155
|
export declare const RulerIcon: React.FC<React.SVGProps<SVGSVGElement>>;
|
|
5158
5156
|
|
|
5159
|
-
declare const SAT_NODE_TYPE: {
|
|
5157
|
+
export declare const SAT_NODE_TYPE: {
|
|
5160
5158
|
readonly SAT_ENGLISH_ASSESSMENT: "SAT_ENGLISH_ASSESSMENT";
|
|
5161
5159
|
readonly SAT_MATH_ASSESSMENT: "SAT_MATH_ASSESSMENT";
|
|
5162
5160
|
readonly SAT_MATH_RECAP: "SAT_MATH_RECAP";
|
|
@@ -5434,6 +5432,8 @@ declare type TBlockData = {
|
|
|
5434
5432
|
block_stats: TBlockStatsData;
|
|
5435
5433
|
};
|
|
5436
5434
|
|
|
5435
|
+
declare type TBlockStates = keyof typeof BLOCK_STATES;
|
|
5436
|
+
|
|
5437
5437
|
declare type TBlockStatsData = {
|
|
5438
5438
|
block_status: TBlockStatus;
|
|
5439
5439
|
optional_status: string | null;
|