@cuemath/leap 3.2.19-beta-0.1 → 3.2.19-link.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/assets/illustrations/illustrations.js +6 -6
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/line-icons/icons/star3.js +32 -0
- package/dist/assets/line-icons/icons/star3.js.map +1 -0
- package/dist/assets/lottie/lottie.js +0 -5
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/features/analytics-events/platform-events-student.js +1 -2
- package/dist/features/analytics-events/platform-events-student.js.map +1 -1
- package/dist/features/analytics-events/platform-events-teacher.js +4 -6
- package/dist/features/analytics-events/platform-events-teacher.js.map +1 -1
- package/dist/features/analytics-events/whitelist-events.js +8 -10
- package/dist/features/analytics-events/whitelist-events.js.map +1 -1
- package/dist/features/chapters-v2/utils/node-card-utils.js +2 -2
- package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
- package/dist/features/communication/pub-sub/constants.js +4 -7
- package/dist/features/communication/pub-sub/constants.js.map +1 -1
- package/dist/features/homework/homework-card-view.js +97 -85
- package/dist/features/homework/homework-card-view.js.map +1 -1
- package/dist/features/homework/homework-card.js +42 -44
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-view.js +29 -31
- package/dist/features/homework/hw-card-list/hw-card-list-view.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list.js +48 -54
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
- package/dist/features/homework/utils.js +27 -33
- package/dist/features/homework/utils.js.map +1 -1
- package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js +11 -17
- package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js.map +1 -1
- package/dist/features/journey/journey-id/journey-id-student.js +1 -1
- package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
- package/dist/features/journey/journey-id/journey-id-teacher.js +2 -2
- package/dist/features/journey/journey-id/journey-id-teacher.js.map +1 -1
- package/dist/features/puzzles/app/puzzle-app-styled.js +6 -10
- package/dist/features/puzzles/app/puzzle-app-styled.js.map +1 -1
- package/dist/features/puzzles/comps/puzzle-card-styled.js +69 -24
- package/dist/features/puzzles/comps/puzzle-card-styled.js.map +1 -1
- package/dist/features/puzzles/comps/puzzle-card.js +30 -79
- package/dist/features/puzzles/comps/puzzle-card.js.map +1 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js +25 -55
- package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js.map +1 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container.js +107 -100
- package/dist/features/puzzles/puzzle-container/puzzle-container.js.map +1 -1
- package/dist/features/puzzles/puzzle-feedback-celebration/puzzle-feedback-celebration.js +1 -1
- package/dist/features/puzzles/puzzle-feedback-celebration/puzzle-feedback-celebration.js.map +1 -1
- package/dist/features/puzzles/utils/puzzle-pattern.js +13 -28
- package/dist/features/puzzles/utils/puzzle-pattern.js.map +1 -1
- package/dist/features/trial-session/comps/student-profile/student-profile.js +1 -1
- package/dist/features/trial-session/comps/teacher-intro/teacher-intro-styled.js +7 -50
- package/dist/features/trial-session/comps/teacher-intro/teacher-intro-styled.js.map +1 -1
- package/dist/features/trial-session/comps/teacher-intro/teacher-intro.js +15 -69
- package/dist/features/trial-session/comps/teacher-intro/teacher-intro.js.map +1 -1
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile-styled.js +49 -0
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile-styled.js.map +1 -0
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js +64 -0
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js.map +1 -0
- package/dist/features/ui/accordion/accordion-items/accordion-items-styled.js +28 -0
- package/dist/features/ui/accordion/accordion-items/accordion-items-styled.js.map +1 -0
- package/dist/features/ui/accordion/accordion-items/accordion-items.js +83 -0
- package/dist/features/ui/accordion/accordion-items/accordion-items.js.map +1 -0
- package/dist/features/ui/accordion/accordion.js +62 -0
- package/dist/features/ui/accordion/accordion.js.map +1 -0
- package/dist/features/ui/inputs/base-input/base-input.js +11 -11
- package/dist/features/ui/inputs/base-input/base-input.js.map +1 -1
- package/dist/features/ui/inputs/text-input/text-input.js +19 -18
- package/dist/features/ui/inputs/text-input/text-input.js.map +1 -1
- package/dist/features/ui/modals/modal-styled.js +42 -8
- package/dist/features/ui/modals/modal-styled.js.map +1 -1
- package/dist/features/ui/modals/modal.js +37 -27
- package/dist/features/ui/modals/modal.js.map +1 -1
- package/dist/features/ui/text/text.js +31 -29
- package/dist/features/ui/text/text.js.map +1 -1
- package/dist/features/ui/theme/clrs.js +2 -0
- package/dist/features/ui/theme/clrs.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-helpers.js +19 -20
- package/dist/features/worksheet/worksheet/worksheet-helpers.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js +12 -16
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js +47 -101
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +146 -149
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js +207 -242
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-styled.js +37 -37
- package/dist/features/worksheet/worksheet/worksheet-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-types.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet.js +313 -307
- package/dist/features/worksheet/worksheet/worksheet.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js +1 -1
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/worksheet-preview.js +35 -44
- package/dist/features/worksheet/worksheet-preview/worksheet-preview.js.map +1 -1
- package/dist/index.d.ts +71 -89
- package/dist/index.js +626 -626
- package/dist/static/puzzle-pattern-blue.f4bea1ee.svg +1 -0
- package/dist/static/puzzle-pattern-green.c9f84bbc.svg +1 -0
- package/dist/static/puzzle-pattern-orange.3da09665.svg +1 -0
- package/dist/static/puzzle-pattern-purple.5fb5a319.svg +1 -0
- package/dist/static/puzzle-pattern-yellow.aadbf457.svg +1 -0
- package/dist/static/stripe-blurple.6abf422f.svg +1 -0
- package/package.json +2 -3
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js +0 -72
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js +0 -59
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js +0 -63
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js +0 -67
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js +0 -70
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js +0 -59
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js +0 -59
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js +0 -70
- package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js.map +0 -1
- package/dist/features/puzzles/api/puzzle-dashboard.js +0 -10
- package/dist/features/puzzles/api/puzzle-dashboard.js.map +0 -1
- package/dist/features/puzzles/constants/puzzle-container.js +0 -8
- package/dist/features/puzzles/constants/puzzle-container.js.map +0 -1
- package/dist/features/puzzles/puzzle-analytics-events.js +0 -11
- package/dist/features/puzzles/puzzle-analytics-events.js.map +0 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container-view.js +0 -55
- package/dist/features/puzzles/puzzle-container/puzzle-container-view.js.map +0 -1
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js +0 -37
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js.map +0 -1
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js +0 -110
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js.map +0 -1
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js +0 -28
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js.map +0 -1
- package/dist/static/puzzle-blue-lottie.7017e2e8.json +0 -1
- package/dist/static/puzzle-blue-lottie.bf64ebc5.json +0 -12760
- package/dist/static/puzzle-dashboard-banner.b7956519.svg +0 -1
- package/dist/static/puzzle-green-lottie.1da90698.json +0 -1
- package/dist/static/puzzle-orange-lottie.cfcf3724.json +0 -1
- package/dist/static/puzzle-pattern-blue.abff0164.svg +0 -1
- package/dist/static/puzzle-pattern-green.b8ba1840.svg +0 -1
- package/dist/static/puzzle-pattern-orange.3f5a17ff.svg +0 -1
- package/dist/static/puzzle-pattern-purple.14b09759.svg +0 -1
- package/dist/static/puzzle-pattern-yellow.50917fab.svg +0 -1
- package/dist/static/puzzle-purple-lottie.e70de110.json +0 -9860
- package/dist/static/puzzle-yellow-lottie.275b5cf4.json +0 -1
@@ -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 ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport Button from '../../../ui/buttons/button/button';\nimport IconButton from '../../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport { useWorksheetJourney } from '../hooks/use-worksheet-journey';\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 onSubmit,\n onSkip,\n onUnassign,\n onReview,\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 canUnAssign,\n canTeacherValidateDisabled,\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 const isPuzzleCard = useMemo(() => maximumAttempts === -2, [maximumAttempts]);\n\n const [showHintsButton, setShowHintsButton] = useState(false);\n const [skipped, setSkipped] = useState(false);\n const [showSkipButton, setShowSkipButton] = useState(false);\n\n const { puzzleAttemptCtaRef, puzzleReviewCtaRef, puzzleUnassignRef } = useWorksheetJourney({\n behavior,\n });\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 unassignButton,\n reviewButton,\n submitAttemptButtonDisabled,\n submitAttemptButtonTooltip,\n submitAttemptButtonTooltipText,\n reviewButtonDisabled,\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 submitAttemptButton: true,\n };\n }\n\n return {\n submitAttemptButton: true,\n submitAttemptButtonDisabled: true,\n submitAttemptButtonTooltip: true,\n submitAttemptButtonTooltipText: canTeacherValidate\n ? 'To be discussed with tutor'\n : 'Already solved',\n };\n }\n\n if (canUnAssign) {\n return {\n unassignButton: true,\n };\n }\n\n return {\n reviewButton: canTeacherValidate,\n reviewButtonDisabled: canTeacherValidateDisabled,\n };\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 canUnAssign,\n navigationMode,\n isQuestionUnlocked,\n userType,\n isSystemIntro,\n type,\n isExitTicket,\n canSubmitWorksheet,\n canTeacherValidateDisabled,\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 <ArrowTooltip\n position=\"top\"\n renderAs=\"primary\"\n tooltipItem={submitAttemptButtonTooltipText ?? ''}\n hidden={!submitAttemptButtonTooltip}\n >\n <div ref={isPuzzleCard ? puzzleAttemptCtaRef : undefined}>\n <Button\n renderAs=\"primary\"\n size=\"small\"\n label={isPuzzleCard ? 'I have solved' : 'Submit'}\n onClick={onSubmit}\n disabled={submitAttemptButtonDisabled}\n />\n </div>\n </ArrowTooltip>\n )}\n {unassignButton && (\n <div ref={puzzleUnassignRef}>\n <Button\n widthX={6}\n renderAs=\"primary\"\n size=\"small\"\n label=\"Unassign\"\n onClick={onUnassign}\n />\n </div>\n )}\n {reviewButton && (\n <ArrowTooltip\n tooltipItem=\"Review this in class with student.\"\n position=\"top\"\n renderAs=\"primary\"\n hidden={!reviewButtonDisabled}\n >\n <div ref={puzzleReviewCtaRef}>\n <Button\n widthX={6}\n renderAs=\"primary\"\n size=\"small\"\n label=\"Review\"\n onClick={onReview}\n disabled={reviewButtonDisabled}\n />\n </div>\n </ArrowTooltip>\n )}\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","onSubmit","onSkip","onUnassign","onReview","onHelp","onResponseChange","onTeacherValidation","loggerRef","navigationMode","canAttempt","hints","checkButtonLabel","retryButtonLabel","validation","maximumAttempts","canExceedAttempts","teacherValidationEnabled","canTeacherValidate","hintsTimer","skippableTime","skippable","canUnAssign","canTeacherValidateDisabled","response_id","item_type","type","instructor_stimulus","is_optional","hintsAvailable","_c","_b","_a","isSystemIntro","isExitTicket","hintsRemaining","isPuzzleCard","useMemo","showHintsButton","setShowHintsButton","useState","skipped","setSkipped","showSkipButton","setShowSkipButton","puzzleAttemptCtaRef","puzzleReviewCtaRef","puzzleUnassignRef","useWorksheetJourney","useEffect","timeoutId","canShowSkip","checkButton","checkButtonDisabled","hintsButton","retryButton","nextButton","nextButtonDisabled","startButton","readyButton","validateButton","skipSectionButton","submitAttemptButton","skipButton","unassignButton","reviewButton","submitAttemptButtonDisabled","submitAttemptButtonTooltip","submitAttemptButtonTooltipText","reviewButtonDisabled","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","ArrowTooltip"],"mappings":";;;;;;;;;;;;;AAoBM,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,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,EACE,IAAArB,GAEE,EAAE,QAAAsB,IAAQ,kBAAAC,IAAkB,qBAAAC,IAAqB,WAAAC,OAAczB,GAC/D;AAAA,IACJ,gBAAA0B;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,IACA,aAAAC;AAAA,IACA,4BAAAC;AAAA,EACE,IAAA7B,GAEE,EAAE,aAAA8B,GAAa,WAAAC,IAAW,MAAAC,GAAM,qBAAAC,IAAqB,aAAAC,EAAgB,IAAA1C,GACrE2C,IAAkBlB,OAEpBmB,MAAAC,MAAAC,KAAA/C,EAAW,SAASuC,CAAW,MAA/B,gBAAA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AA;AAAA,QAAA,GAEb;AAAA,QAED8D,MACC,gBAAAiC;AAAA,UAACO;AAAA,UAAA;AAAA,YACC,aAAY;AAAA,YACZ,UAAS;AAAA,YACT,UAAS;AAAA,YACT,QAAQ,CAACpC;AAAA,YAET,UAAA,gBAAA6B,EAAC,OAAI,EAAA,KAAKpD,IACR,UAAA,gBAAAoD;AAAA,cAACI;AAAA,cAAA;AAAA,gBACC,QAAQ;AAAA,gBACR,UAAS;AAAA,gBACT,MAAK;AAAA,gBACL,OAAM;AAAA,gBACN,SAASlG;AAAA,gBACT,UAAUiE;AAAA,cAAA;AAAA,YAAA,GAEd;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR,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 ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\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 onSubmit,\n onSkip,\n onUnassign,\n onReview,\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 canUnAssign,\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 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 unassignButton,\n reviewButton,\n submitAttemptButtonDisabled,\n submitAttemptButtonTooltip,\n submitAttemptButtonTooltipText,\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 submitAttemptButton: true,\n };\n }\n\n return {\n submitAttemptButton: true,\n submitAttemptButtonDisabled: true,\n submitAttemptButtonTooltip: true,\n submitAttemptButtonTooltipText: canTeacherValidate\n ? 'To be discussed with tutor'\n : 'Already solved',\n };\n }\n\n if (canUnAssign) {\n return {\n unassignButton: true,\n };\n }\n\n return {\n reviewButton: canTeacherValidate,\n };\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 canUnAssign,\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 <ArrowTooltip\n position=\"top\"\n renderAs=\"primary\"\n tooltipItem={submitAttemptButtonTooltipText ?? ''}\n hidden={!submitAttemptButtonTooltip}\n >\n <Button\n renderAs=\"primary\"\n size=\"small\"\n label={maximumAttempts === -2 ? 'I have solved' : 'Submit'}\n onClick={onSubmit}\n disabled={submitAttemptButtonDisabled}\n />\n </ArrowTooltip>\n )}\n {unassignButton && (\n <Button widthX={6} renderAs=\"primary\" size=\"small\" label=\"Unassign\" onClick={onUnassign} />\n )}\n {reviewButton && (\n <Button widthX={6} renderAs=\"primary\" size=\"small\" label=\"Review\" onClick={onReview} />\n )}\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","onSubmit","onSkip","onUnassign","onReview","onHelp","onResponseChange","onTeacherValidation","loggerRef","navigationMode","canAttempt","hints","checkButtonLabel","retryButtonLabel","validation","maximumAttempts","canExceedAttempts","teacherValidationEnabled","canTeacherValidate","hintsTimer","skippableTime","skippable","canUnAssign","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","unassignButton","reviewButton","submitAttemptButtonDisabled","submitAttemptButtonTooltip","submitAttemptButtonTooltipText","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","Quest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AA,QAED,CAAC7B,KAAuBF,MACvB,gBAAAsC;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,UAAS;AAAA,YACT,MAAMK;AAAA,YACN,UAAUxG,KAAA,gBAAAA,EAAU;AAAA,YACpB,gBAAe;AAAA,YACf,SAASyF;AAAA,UAAA;AAAA,QACX;AAAA,QAED3B,KACC,gBAAAoC;AAAA,UAACO;AAAA,UAAA;AAAA,YACC,UAAS;AAAA,YACT,UAAS;AAAA,YACT,aAAarC,MAAkC;AAAA,YAC/C,QAAQ,CAACD;AAAA,YAET,UAAA,gBAAA+B;AAAA,cAACI;AAAA,cAAA;AAAA,gBACC,UAAS;AAAA,gBACT,MAAK;AAAA,gBACL,OAAOhF,MAAoB,KAAK,kBAAkB;AAAA,gBAClD,SAASd;AAAA,gBACT,UAAU0D;AAAA,cAAA;AAAA,YACZ;AAAA,UAAA;AAAA,QACF;AAAA,QAEDF,MACC,gBAAAkC,EAACI,GAAO,EAAA,QAAQ,GAAG,UAAS,WAAU,MAAK,SAAQ,OAAM,YAAW,SAAS5F,GAAY,CAAA;AAAA,QAE1FuD,MACC,gBAAAiC,EAACI,GAAO,EAAA,QAAQ,GAAG,UAAS,WAAU,MAAK,SAAQ,OAAM,UAAS,SAAS3F,GAAU,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAI7F,CAAC;"}
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import t, { createGlobalStyle as
|
1
|
+
import t, { createGlobalStyle as d } from "styled-components";
|
2
2
|
import i from "../../ui/layout/flex-view.js";
|
3
|
-
import { QUESTIONS_GAP as l, WORKSHEET_CONTAINER_BORDER_RADIUS as n, TOP_NAVIGATION_HEIGHT as
|
4
|
-
const
|
3
|
+
import { QUESTIONS_GAP as l, WORKSHEET_CONTAINER_BORDER_RADIUS as n, TOP_NAVIGATION_HEIGHT as c, ACTION_BAR_HEIGHT as s, SIDEBAR_WIDTH as a } from "./constants.js";
|
4
|
+
const g = t(i)(({ $topOffset: o }) => `
|
5
5
|
position: sticky;
|
6
6
|
top: ${o}px;
|
7
7
|
z-index: 1;
|
8
|
-
`),
|
8
|
+
`), u = t.div(({ theme: o }) => {
|
9
9
|
const { colors: r } = o;
|
10
10
|
return `
|
11
11
|
width: 16px;
|
@@ -13,18 +13,18 @@ const u = t(i)(({ $topOffset: o }) => `
|
|
13
13
|
border-radius: 32px;
|
14
14
|
border: 0.667px solid ${r.BLACK_T_87}
|
15
15
|
`;
|
16
|
-
}),
|
16
|
+
}), E = t(i)`
|
17
17
|
position: relative;
|
18
|
-
`,
|
19
|
-
({ $isCardView: o, theme: r
|
20
|
-
${o
|
18
|
+
`, _ = t(i)(
|
19
|
+
({ $isCardView: o, theme: r }) => `
|
20
|
+
${o ? `
|
21
21
|
border-left: 1px solid ${r.colors.GREY_2};
|
22
22
|
border-right: 1px solid ${r.colors.GREY_2};
|
23
23
|
` : ""}
|
24
|
-
padding-top: ${
|
24
|
+
padding-top: ${l}px;
|
25
25
|
z-index: 0;
|
26
26
|
`
|
27
|
-
),
|
27
|
+
), h = t(i)(
|
28
28
|
({ theme: o, $topOffset: r }) => `
|
29
29
|
position: sticky;
|
30
30
|
top: ${r}px;
|
@@ -33,23 +33,23 @@ const u = t(i)(({ $topOffset: o }) => `
|
|
33
33
|
justify-content: flex-end;
|
34
34
|
background-color: ${o.colors.WHITE};
|
35
35
|
`
|
36
|
-
),
|
36
|
+
), f = t(i)`
|
37
37
|
border: 1px solid ${({ theme: o }) => o.colors.GREY_2};
|
38
38
|
border-top: 0px;
|
39
39
|
border-radius: ${n}px ${n}px 0 0;
|
40
40
|
overflow: hidden;
|
41
|
-
`,
|
42
|
-
({ theme: { colors: o }, $height: r, $isCardView: e, $marginTop: p
|
41
|
+
`, I = t(i)(
|
42
|
+
({ theme: { colors: o }, $height: r, $isCardView: e, $marginTop: p }) => `
|
43
43
|
position: sticky;
|
44
44
|
top: calc(100% - ${r}px);
|
45
45
|
margin-top: -${p}px;
|
46
46
|
z-index: 1;
|
47
|
-
${e
|
47
|
+
${e ? `
|
48
48
|
border-left: 1px solid ${o.GREY_2};
|
49
49
|
border-right: 1px solid ${o.GREY_2};
|
50
50
|
` : ""}
|
51
51
|
`
|
52
|
-
),
|
52
|
+
), R = t(i)(
|
53
53
|
({ theme: { colors: o }, $isCardView: r }) => `
|
54
54
|
align-items: center;
|
55
55
|
justify-content: center;
|
@@ -63,12 +63,12 @@ const u = t(i)(({ $topOffset: o }) => `
|
|
63
63
|
border-top-right-radius: 8px;
|
64
64
|
` : ""}
|
65
65
|
`
|
66
|
-
),
|
66
|
+
), T = t(i)(
|
67
67
|
({ theme: o, $minHeight: r, $topOffset: e }) => `
|
68
68
|
box-sizing: content-box;
|
69
69
|
position: sticky;
|
70
70
|
width: calc(100% - 2px);
|
71
|
-
top: ${e +
|
71
|
+
top: ${e + c}px;
|
72
72
|
z-index: 2;
|
73
73
|
min-height: ${r}${typeof r == "number" ? "px" : ""};
|
74
74
|
padding-bottom: ${s / 2}px;
|
@@ -83,17 +83,17 @@ const u = t(i)(({ $topOffset: o }) => `
|
|
83
83
|
box-sizing: border-box;
|
84
84
|
}
|
85
85
|
`
|
86
|
-
),
|
86
|
+
), W = t(i)`
|
87
87
|
position: absolute;
|
88
88
|
width: 100%;
|
89
89
|
bottom: ${s}px;
|
90
90
|
left: 0;
|
91
|
-
`,
|
91
|
+
`, k = t(i)(({ theme: o }) => `
|
92
92
|
position: sticky;
|
93
93
|
top: 0;
|
94
94
|
left: 0;
|
95
95
|
z-index: ${o.zIndex.DESMOS_CALCULATOR};
|
96
|
-
`),
|
96
|
+
`), A = t(i)(
|
97
97
|
({ theme: o, $active: r }) => `
|
98
98
|
width: 36px;
|
99
99
|
height: 36px;
|
@@ -110,13 +110,13 @@ const u = t(i)(({ $topOffset: o }) => `
|
|
110
110
|
stroke: ${r ? o.colors.WHITE : o.colors.BLACK};
|
111
111
|
}
|
112
112
|
`
|
113
|
-
),
|
113
|
+
), y = t(i)`
|
114
114
|
position: absolute;
|
115
115
|
bottom: 8px;
|
116
|
-
right: -${
|
116
|
+
right: -${a}px;
|
117
117
|
align-items: center;
|
118
118
|
z-index: 1;
|
119
|
-
`,
|
119
|
+
`, G = d`
|
120
120
|
div[role="dialog"][aria-label="Math Response Modal"] {
|
121
121
|
width: 405px !important; /* Set the desired width */
|
122
122
|
}
|
@@ -126,19 +126,19 @@ const u = t(i)(({ $topOffset: o }) => `
|
|
126
126
|
}
|
127
127
|
`;
|
128
128
|
export {
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
129
|
+
I as ActionbarContainer,
|
130
|
+
R as ActionbarWrapper,
|
131
|
+
T as BlockerWrapper,
|
132
|
+
k as DesmosCalcWrapper,
|
133
|
+
A as IconContainer,
|
134
|
+
G as LearnosityStyleOverrides,
|
135
|
+
h as NavigationContainer,
|
136
|
+
f as NavigationWrapper,
|
137
|
+
u as NudgeBannerIcon,
|
138
|
+
g as NudgeBannerWrapper,
|
139
|
+
_ as QuestionsWrapper,
|
140
|
+
y as StudentWorksheetSideBar,
|
141
|
+
W as SummaryWrapper,
|
142
|
+
E as WorksheetContainer
|
143
143
|
};
|
144
144
|
//# sourceMappingURL=worksheet-styled.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"worksheet-styled.js","sources":["../../../../src/features/worksheet/worksheet/worksheet-styled.tsx"],"sourcesContent":["import styled, { createGlobalStyle } from 'styled-components';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport {\n ACTION_BAR_HEIGHT,\n QUESTIONS_GAP,\n SIDEBAR_WIDTH,\n TOP_NAVIGATION_HEIGHT,\n WORKSHEET_CONTAINER_BORDER_RADIUS,\n} from './constants';\n\nconst NudgeBannerWrapper = styled(FlexView)<{ $topOffset: number }>(({ $topOffset }) => {\n return `\n position: sticky;\n top: ${$topOffset}px;\n z-index: 1;\n `;\n});\n\nconst NudgeBannerIcon = styled.div(({ theme }) => {\n const { colors } = theme;\n\n return `\n width: 16px;\n height: 16px;\n border-radius: 32px;\n border: 0.667px solid ${colors.BLACK_T_87}\n `;\n});\n\nconst WorksheetContainer = styled(FlexView)`\n position: relative;\n`;\n\ninterface IQuestionsWrapperProps {\n $actionbarHeight: number;\n $isCardView: boolean;\n
|
1
|
+
{"version":3,"file":"worksheet-styled.js","sources":["../../../../src/features/worksheet/worksheet/worksheet-styled.tsx"],"sourcesContent":["import styled, { createGlobalStyle } from 'styled-components';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport {\n ACTION_BAR_HEIGHT,\n QUESTIONS_GAP,\n SIDEBAR_WIDTH,\n TOP_NAVIGATION_HEIGHT,\n WORKSHEET_CONTAINER_BORDER_RADIUS,\n} from './constants';\n\nconst NudgeBannerWrapper = styled(FlexView)<{ $topOffset: number }>(({ $topOffset }) => {\n return `\n position: sticky;\n top: ${$topOffset}px;\n z-index: 1;\n `;\n});\n\nconst NudgeBannerIcon = styled.div(({ theme }) => {\n const { colors } = theme;\n\n return `\n width: 16px;\n height: 16px;\n border-radius: 32px;\n border: 0.667px solid ${colors.BLACK_T_87}\n `;\n});\n\nconst WorksheetContainer = styled(FlexView)`\n position: relative;\n`;\n\ninterface IQuestionsWrapperProps {\n $actionbarHeight: number;\n $isCardView: boolean;\n}\n\nconst QuestionsWrapper = styled(FlexView)<IQuestionsWrapperProps>(\n ({ $isCardView, theme }) => `\n ${\n $isCardView\n ? `\n border-left: 1px solid ${theme.colors.GREY_2};\n border-right: 1px solid ${theme.colors.GREY_2};\n `\n : ''\n }\n padding-top: ${QUESTIONS_GAP}px;\n z-index: 0;\n`,\n);\n\nconst NavigationContainer = styled(FlexView)<{ $topOffset: number }>(\n ({ theme, $topOffset }) => `\n position: sticky;\n top: ${$topOffset}px;\n width: 100%;\n z-index: 1;\n justify-content: flex-end;\n background-color: ${theme.colors.WHITE};\n`,\n);\n\nconst NavigationWrapper = styled(FlexView)`\n border: 1px solid ${({ theme }) => theme.colors.GREY_2};\n border-top: 0px;\n border-radius: ${WORKSHEET_CONTAINER_BORDER_RADIUS}px ${WORKSHEET_CONTAINER_BORDER_RADIUS}px 0 0;\n overflow: hidden;\n`;\n\nconst ActionbarContainer = styled(FlexView)<{ $isCardView: boolean; $marginTop: string | number }>(\n ({ theme: { colors }, $height, $isCardView, $marginTop }) => `\n position: sticky;\n top: calc(100% - ${$height}px);\n margin-top: -${$marginTop}px;\n z-index: 1;\n ${\n $isCardView\n ? `\n border-left: 1px solid ${colors.GREY_2};\n border-right: 1px solid ${colors.GREY_2};\n `\n : ''\n }\n `,\n);\n\nconst ActionbarWrapper = styled(FlexView)<{ $isCardView: boolean }>(\n ({ theme: { colors }, $isCardView }) => `\n align-items: center;\n justify-content: center;\n align-self: center;\n background-color: ${colors.WHITE};\n border-top: 1px solid ${colors.GREY_2};\n ${\n $isCardView\n ? `\n border-left: 1px solid ${colors.GREY_2};\n border-right: 1px solid ${colors.GREY_2};\n border-top-left-radius: 8px;\n border-top-right-radius: 8px;\n `\n : ''\n }\n `,\n);\n\ninterface IBlockerWrapperProps {\n $minHeight: number | string;\n $topOffset: number;\n}\n\nconst BlockerWrapper = styled(FlexView)<IBlockerWrapperProps>(\n ({ theme, $minHeight, $topOffset }) => `\n box-sizing: content-box;\n position: sticky;\n width: calc(100% - 2px);\n top: ${$topOffset + TOP_NAVIGATION_HEIGHT}px;\n z-index: 2;\n min-height: ${$minHeight}${typeof $minHeight === 'number' ? 'px' : ''};\n padding-bottom: ${ACTION_BAR_HEIGHT / 2}px;\n background-color: ${theme.colors.WHITE_70};\n border-left: 1px solid ${theme.colors.GREY_2};\n border-right: 1px solid ${theme.colors.GREY_2};\n backdrop-filter: blur(7px);\n align-items: center;\n justify-content: center;\n\n & * {\n box-sizing: border-box;\n }\n`,\n);\n\nconst SummaryWrapper = styled(FlexView)`\n position: absolute;\n width: 100%;\n bottom: ${ACTION_BAR_HEIGHT}px;\n left: 0;\n`;\n\nconst DesmosCalcWrapper = styled(FlexView)(({ theme }) => {\n return `\n position: sticky;\n top: 0;\n left: 0;\n z-index: ${theme.zIndex.DESMOS_CALCULATOR};\n `;\n});\n\nconst IconContainer = styled(FlexView)<{ $active: boolean }>(\n ({ theme, $active }) => `\n width: 36px;\n height: 36px;\n border-radius: 50%;\n &:hover {\n cursor: pointer;\n background-color: ${theme.colors.BLACK};\n svg path {\n stroke: ${theme.colors.WHITE};\n }\n }\n background-color: ${$active ? theme.colors.BLACK : theme.colors.WHITE};\n svg path {\n stroke: ${$active ? theme.colors.WHITE : theme.colors.BLACK};\n }\n`,\n);\n\nconst StudentWorksheetSideBar = styled(FlexView)`\n position: absolute;\n bottom: 8px;\n right: -${SIDEBAR_WIDTH}px;\n align-items: center;\n z-index: 1;\n`;\n\nconst LearnosityStyleOverrides = createGlobalStyle`\n div[role=\"dialog\"][aria-label=\"Math Response Modal\"] {\n width: 405px !important; /* Set the desired width */\n }\n\n button.lds-flexible-container__trigger--resize {\n visibility: hidden !important; /* Hide the resize button */\n }\n`;\n\nexport {\n NudgeBannerWrapper,\n NudgeBannerIcon,\n WorksheetContainer,\n QuestionsWrapper,\n NavigationContainer,\n ActionbarContainer,\n NavigationWrapper,\n ActionbarWrapper,\n BlockerWrapper,\n SummaryWrapper,\n IconContainer,\n DesmosCalcWrapper,\n StudentWorksheetSideBar,\n LearnosityStyleOverrides,\n};\n"],"names":["NudgeBannerWrapper","styled","FlexView","$topOffset","NudgeBannerIcon","theme","colors","WorksheetContainer","QuestionsWrapper","$isCardView","QUESTIONS_GAP","NavigationContainer","NavigationWrapper","WORKSHEET_CONTAINER_BORDER_RADIUS","ActionbarContainer","$height","$marginTop","ActionbarWrapper","BlockerWrapper","$minHeight","TOP_NAVIGATION_HEIGHT","ACTION_BAR_HEIGHT","SummaryWrapper","DesmosCalcWrapper","IconContainer","$active","StudentWorksheetSideBar","SIDEBAR_WIDTH","LearnosityStyleOverrides","createGlobalStyle"],"mappings":";;;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AAAA,YAGnCyB,CAAa;AAAA;AAAA;AAAA,GAKnBC,IAA2BC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"worksheet-types.js","sources":["../../../../src/features/worksheet/worksheet/worksheet-types.ts"],"sourcesContent":["import type { IActionData, TPublish, TSubscribe } from '../../cue-canvas/types/cue-canvas';\nimport type { TPublishMouseMove, TSubscribeMouseMove } from '../../pointer-sync/pointer-types';\nimport type { TColorNames, THueNames, TUserTypes } from '../../ui/types';\nimport type { IFile } from './worksheet-question/subjective-review';\nimport type { MutableRefObject, ReactElement } from 'react';\n\nexport enum QUESTION_TAGS {\n TRIAL_TOPIC = 'trial-topic',\n QUESTION_CODE = 'question code',\n}\n\nexport enum QUESTIONS_RATING {\n E = 3,\n S = 2, // Just right\n H = 1,\n}\n\nexport interface ILearnosityError {\n code: number;\n consumerKey: string;\n detail: string;\n errorUI: string;\n msg: string;\n}\n\ninterface ILearnosityQuestionMetadata {\n widget_reference: string;\n sheet_reference: string;\n hints?: string[];\n solution?: string[];\n teacher_tips?: string[];\n valid_response_count: number;\n source: {\n organisation_id: number;\n };\n}\n\nexport type TInstructorStimulus =\n | 'SystemIntro' // lesson v3\n | 'Intro' // lesson v3\n | 'Concept-Intro' // lesson v3\n | 'Instruction' // lesson v3\n | 'Task' // lesson v3\n | 'Try' // trial v3\n | 'Learn' // trial v3\n | 'Apply'; // trial v3\nexport type TItemType =\n | 'overview'\n | 'learning-we-do'\n | 'learning-your-turn'\n | 'learning-explore'\n | 'practice-basic'\n | 'practice-basic-optional'\n | 'practice-regular'\n | 'practice-regular-optional'\n | 'exit-ticket'\n | 'advanced-we-do'\n | 'advanced-your-turn'\n | 'advanced-explore'\n | 'advanced-practice';\n\nexport type TSectionName =\n | 'overview'\n | 'learning'\n | 'practice-basic'\n | 'practice-regular'\n | 'exit-ticket'\n | 'advanced';\n\nexport interface IQuestionValidResponse {\n score: number;\n value: unknown[];\n}\n\nexport interface ISheetNudgeBannerInfo {\n bannerBackgroundColor: TColorNames;\n label: string;\n}\n\nexport interface ILearnosityQuestion {\n response_id: string;\n instructor_stimulus?: TInstructorStimulus;\n metadata: ILearnosityQuestionMetadata;\n instant_feedback?: boolean;\n math_renderer?: string;\n template?: string;\n tokenization?: string;\n numberPad?: string[];\n symbols?: unknown[];\n response_container?: Record<string, unknown>;\n ui_style?: Record<string, unknown>;\n shuffle_options?: boolean;\n // for custom type question validation is undefined.\n validation?: {\n scoring_type?: string;\n unscored?: boolean;\n valid_response?: IQuestionValidResponse;\n alt_responses?: IQuestionValidResponse[];\n penalty?: number;\n min_score_if_attempted?: number;\n };\n is_math?: boolean;\n labels?: Record<string, unknown>;\n line?: Record<string, unknown>;\n points?: string[];\n snap_to_ticks?: boolean;\n ticks?: Record<string, unknown>;\n max_length?: number;\n type:\n | 'hotspot'\n | 'tokenhighlight'\n | 'numberline'\n | 'clozeassociation'\n | 'clozetext'\n | 'association'\n | 'classification'\n | 'clozedropdown'\n | 'clozeformula'\n | 'mcq'\n | 'choicematrix'\n | 'plaintext'\n | 'drawing';\n case_sensitive?: boolean;\n show_copy?: boolean;\n show_cut?: boolean;\n show_paste?: boolean;\n spellcheck?: boolean;\n stimulus?: string;\n stimulus_review?: string;\n stimulus_list?: string[];\n image?: Record<string, unknown>;\n areas?: unknown[];\n area_attributes?: Record<string, unknown>;\n possible_responses?: string[][] | string[];\n duplicate_responses?: boolean;\n response_containers?: unknown[];\n options?: Record<string, unknown>[] | string[];\n feedback_attempts?: number;\n stems?: string[];\n multiple_responses?: boolean;\n}\n\nexport interface ILearnosityItem {\n reference: string;\n questions: ILearnosityQuestion[];\n source: Record<string, unknown>;\n content: string;\n metadata: Record<string, unknown> | unknown[];\n workflow: unknown[];\n response_ids: string[];\n feature_ids: unknown[];\n features: unknown[];\n itemType?: TItemType;\n tags?: string[];\n}\n\nexport interface IWorksheetQuestion extends ILearnosityQuestion {\n item_reference: string;\n item_type?: TItemType;\n section_name?: TSectionName;\n is_optional?: boolean;\n item_tags: string[];\n item_tags_map: Record<string, string>;\n item_number: number;\n item_display_number: number;\n question_number: number;\n total_questions: number;\n}\n\nexport interface ILearnosityQuestionScore {\n score?: number | null;\n max_score: number;\n unscored?: boolean;\n}\n\nexport interface ILearnosityQuestionResponse {\n value: unknown;\n responses?: unknown;\n type: unknown;\n updatedFormat?: boolean;\n wordCount?: number;\n apiVersion: string;\n revision: number;\n feedbackAttemptsCount?: number;\n}\n\nexport interface IAttempt {\n response: ILearnosityQuestionResponse;\n score: ILearnosityQuestionScore;\n}\n\ninterface ITeacherReview {\n reviewComment?: string;\n images?: string[];\n}\nexport interface IWorksheetResponse {\n widgetReference: string;\n itemReference: string;\n itemPosition: number; // 0 based\n questionPosition: number; // 0 based\n isOkayTypeQuestion: boolean;\n response?: ILearnosityQuestionResponse;\n simState?: Record<string, unknown>;\n score?: ILearnosityQuestionScore;\n responseEdited?: boolean;\n hintsUsed?: number;\n markedForReview?: boolean;\n attemptsHistory?: IAttempt[];\n validatedByTeacher?: boolean;\n submittedByStudent?: boolean;\n assignStatus?: 'assigned' | 'skipped';\n rating?: number;\n skipped?: boolean;\n doubtResolved?: boolean;\n teacherReview?: ITeacherReview;\n tags?: Record<string, string>;\n timeSpent?: number;\n}\n\ntype TMathRenderer = 'mathjax' | 'mathquill';\nexport interface ILearnosity {\n ready: () => void;\n questions: () => Record<string, unknown>;\n question: (responseId: string) =>\n | {\n enable: () => boolean;\n disable: () => boolean;\n getQuestion: () => ILearnosityQuestion;\n getMetadata: () => ILearnosityQuestionMetadata;\n getResponse: () => ILearnosityQuestionResponse;\n getScore: (\n callback?: (score: ILearnosityQuestionScore | null) => void,\n ) => ILearnosityQuestionScore;\n validate: (\n options?: { showCorrectAnswers?: boolean; feedbackAttempts?: boolean },\n callback?: () => void,\n ) => void;\n resetValidationUI: () => void;\n on: (eventName: 'changed', callback: () => void) => void;\n off: (eventName: 'changed', callback?: () => void) => void;\n }\n | undefined;\n append: (toAppend: {\n questions: ILearnosityQuestion[];\n responses?: Record<string, unknown>;\n }) => void;\n appendQuestion: (toAppend: {\n questions: ILearnosityQuestion[];\n responses?: Record<string, unknown>;\n }) => void;\n reset: () => void;\n renderMath: (renderer: TMathRenderer) => void;\n}\n\nexport interface IWorksheetBehavior {\n /**\n * If true, Opens the worksheet in resume mode.\n * - If false, Opens the worksheet in review mode.\n */\n canAttempt: boolean;\n /**\n * If true, the user can mark the question for review.\n */\n canMarkForReview: boolean;\n /**\n * The mode of navigation for the worksheet.\n * - `OPEN` mode allows the user to navigate to any question in the worksheet.\n * - `LINEAR` mode allows the user to navigate to the next question only.\n * - `ADAPTIVE` mode allows the user to navigate future questions based on the rating of the current question.\n * - `CURRENT` mode allows the user to navigate to the current question only. Back and forth not allowed.\n */\n navigationMode: 'OPEN' | 'LINEAR' | 'ADAPTIVE' | 'CURRENT';\n /**\n * The initial question to display when the worksheet is loaded.\n * - `FIRST` mode displays the first question in the worksheet.\n * - `CURRENT` mode displays the question that the user was last on.\n */\n initialQuestion: 'FIRST' | 'CURRENT';\n /**\n * If hints are available, on clicking the help button, first availble hint will be shown.\n * Clicking again will show the next hint.\n * If no more hints are available, onHelp will be called.\n */\n hints: boolean;\n /**\n * The time in seconds after which the hints button will be shown.\n */\n hintsTimer?: number; // in seconds\n /**\n * If true, the user can skip the question without attempting it.\n * Skip button will be shown only after the hints are exausted and skipTimer is reached.\n */\n skippable?: boolean;\n /**\n * The time in seconds after which the user can skip the question.\n */\n skippableTime?: number; // in seconds\n /**\n * If true, teacher validation is needed for the question to proceed\n */\n teacherValidationEnabled: boolean;\n /**\n * If worksheet is attempting outside the class setting\n * * In case of puzzle worksheet.\n * * If true,\n * For student we show tooltip with 'Discuss with tutor in class'.\n * For teacher we show review cta.\n * * If false,\n * For student we show tooltip with 'Already solved'.\n * For teacher we don't show review cta.\n */\n canTeacherValidate: boolean;\n /**\n * * In case of puzzle worksheet for teacher\n * * If true,\n * Teacher validation button will be disabled.\n * * If false,\n * Teacher validation button will be active.\n */\n canTeacherValidateDisabled?: boolean;\n /**\n * If true, questions will be validated and feedback will be shown.\n */\n validation: boolean;\n /**\n * If true, questions will be validated and feedback will be shown along with the correct answer.\n */\n solutionHidden?: boolean;\n /**\n * If true, solution will be hidden.\n */\n review: boolean;\n /**\n * The maximum number of attempts allowed for each question.\n * 0 means unlimited attempts.\n * -1 means attempts will not be validated, hence not pushed to attempt history.\n * -2 means the sheet is a puzzle sheet\n * After reaching the maximum number of attempts, the user cannot attempt the question anymore.\n * If maxAtttmpts reached and canExceedAttempts is true, the user can still attempt the question\n * , also user will have the option to move to next question\n */\n maximumAttempts: number;\n /**\n * If true, the user can exceed the maximum number of attempts.\n */\n canExceedAttempts: boolean;\n /**\n * If the worksheet minimumAccuracy is not met, on clicking the final submit button, onMinimumAccuracyNotMet will be called.\n */\n minimumAccuracy: number;\n /**\n * Label for the check button\n * For example,\n * - \"Check\" for Checking the answer\n * - \"Submit\" for Submitting the answer when doing assessment\n */\n checkButtonLabel: string;\n /**\n * If attempt is incorrect, we show retry button, this is the label for the retry button\n * For example,\n * - 'Try Again' for retrying the question\n */\n retryButtonLabel: string;\n /**\n * If true show demos calculator https://www.desmos.com/calculator\n */\n canShowDesmosCalc: boolean;\n /**\n * If true, the user can unassign the sheet.\n */\n canUnAssign?: boolean;\n /**\n * If true, journey will be started.\n */\n canStartJourney?: boolean;\n}\n\nexport type TWORKSHHET_QUESTION_MEDIA_TYPE = 'SIMULATION' | 'VIDEO' | 'AUDIO';\n\nexport interface IWorksheetCallbackProps {\n onResponseChange?: (options: {\n responseId: string;\n response: IWorksheetResponse;\n isNewAttempt: boolean;\n question: IWorksheetQuestion;\n }) => void;\n onBulkResponsesChange?: (responses: Record<string, IWorksheetResponse>) => void;\n onResponsesChange?: (responses: Record<string, IWorksheetResponse>) => void;\n onMediaStateChange?: (\n question: IWorksheetQuestion,\n mediaType: TWORKSHHET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n onTeacherValidation?: (questionId: string, rating?: keyof typeof QUESTIONS_RATING) => void;\n onOptionalItemAssignment?: (itemType: TItemType) => void;\n onOptionalItemSkip?: (itemType: TItemType) => void;\n onHelp?: (options: { questionId: string; questionNumber: string }) => void;\n onMinimumAccuracyNotMet?: (accuracy: number) => void;\n onExitTicketStart?: () => void;\n onExitTicketSubmit?: () => void;\n onSubmit?: (responses: Record<string, IWorksheetResponse>) => void;\n onUnassign?: () => void;\n onReview?: () => void;\n loggerRef: MutableRefObject<(eventName: string, data?: Record<string, unknown>) => void>;\n}\n\nexport interface ICueCanvasCallbackProps {\n onPublishStrokes?: TPublish;\n onReceiveStrokes?: TSubscribe;\n}\n\nexport interface ICueCanvasProps {\n initialStrokesData?: Record<string, IActionData[]>;\n isCanvasEnabled: boolean;\n canToggleScribbling?: boolean;\n}\n\nexport interface IPointerSyncCallbackProps {\n onPublishMouseMove?: TPublishMouseMove;\n onSubscribeMouseMove?: TSubscribeMouseMove;\n}\n\nexport interface IWorksheetLayout {\n containerStyle: 'none' | 'card';\n navigationBar: 'none' | 'top' | 'bottom';\n actionBar: 'none' | 'bottom';\n containerWidth: string;\n topOffset: number; // Offset from the top of the screen, for eg: height of the header\n questionsScrollable: boolean;\n minQuestionHeight: string | number;\n minSummaryHeight: string | number;\n renderSideBar: boolean;\n showUserPointer?: boolean;\n renderQuestionHeader?: boolean;\n imageHue?: THueNames;\n}\n\nexport interface ISubjectiveSheetProps {\n onAddReviewComment?: (\n responseId: string,\n commentData: {\n score: ILearnosityQuestionScore;\n teacherReview: ITeacherReview;\n },\n ) => void;\n openImagesReviewModal?: (props: IOpenImageReviewModalProps) => void;\n handleReviewSubmit?: () => void;\n isSubmittingReview?: boolean;\n isReviewPending?: boolean;\n}\n\ninterface IBaseWorksheetProps {\n userType: TUserTypes;\n userId: string;\n studentId: string;\n studentName?: string;\n worksheetName: string;\n background?: 'none' | 'paper';\n layout: IWorksheetLayout;\n behavior: IWorksheetBehavior;\n initialResponseId?: string;\n initialItemIndex?: number;\n updatedResponses?: Record<string, IWorksheetResponse>;\n worksheetCompleted: boolean;\n showNudgeBanner?: boolean;\n markedAsCompleted?: boolean;\n onResolveDoubt?: (responseId: string) => void;\n onActiveQuestionChange?: (question: IWorksheetQuestion) => void;\n canResolveDoubt?: boolean;\n onSkip?: (itemIndex: number, widgetIndex: number) => void;\n canShowActionBar?: boolean;\n}\n\nexport interface IWorksheetProps\n extends IBaseWorksheetProps,\n IWorksheetCallbackProps,\n ICueCanvasProps,\n ICueCanvasCallbackProps,\n IPointerSyncCallbackProps {\n learnosityActivityRef?: string;\n learnosityItems: ILearnosityItem[];\n learnosityResponses?: Record<string, IWorksheetResponse>;\n learnosity: ILearnosity;\n appendedQuestionIds: string[];\n questionsSignedRequest: string;\n openQuestionFeedbackModal?: (itemRef: string) => void;\n summaryDescription?: ReactElement | null;\n canSubmitWorksheet?: boolean;\n studentId: string;\n attemptId?: string;\n subjectiveProps?: ISubjectiveSheetProps;\n}\n\nexport interface IUpdateImages {\n filteredImages: string[];\n newImages: IFile[];\n}\nexport interface IOpenImageReviewModalProps {\n isReviewed?: boolean;\n disableScoreForm?: boolean;\n imageUrls?: string[];\n filteredImageUrls?: (props: IUpdateImages) => void;\n uploadedImages?: (IFile | string)[];\n image?: string;\n}\n\nexport interface IWorksheetContainerProps\n extends IBaseWorksheetProps,\n IWorksheetCallbackProps,\n ICueCanvasProps,\n ICueCanvasCallbackProps,\n IPointerSyncCallbackProps {\n studentId: string;\n attemptId?: string;\n itemsSignedRequest: string;\n questionsSignedRequest: string;\n onLoaded: () => void;\n onErrored: (error: { code?: number; message: string }) => void;\n onResponsesLoaded?: (responses: Record<string, IWorksheetResponse>) => void;\n openQuestionFeedbackModal?: (itemRef: string) => void;\n summaryDescription?: ReactElement | null;\n canSubmitWorksheet?: boolean;\n subjectiveProps?: ISubjectiveSheetProps;\n}\n\nexport interface IWorksheetRef {\n validateQuestion: (\n responseId: string,\n rating?: keyof typeof QUESTIONS_RATING,\n skipRemainingQuestions?: boolean,\n ) => void;\n assignOptionalItems: (itemType: TItemType) => void;\n skipOptionalItems: (itemType: TItemType) => void;\n updateMediaState: (\n responseId: string,\n mediaType: TWORKSHHET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n}\n\ninterface IWorksheetHeaderLayoutArgs {\n isPuzzleWorksheet?: boolean;\n isTestWorksheet?: boolean;\n imageHue?: THueNames;\n}\n\nexport interface IWorksheetHeaderLayoutProps {\n (args: IWorksheetHeaderLayoutArgs): {\n bgColor: TColorNames;\n borderColor?: TColorNames;\n textColor?: TColorNames;\n };\n}\n"],"names":["QUESTION_TAGS","QUESTIONS_RATING"],"mappings":"AAMY,IAAAA,sBAAAA,OACVA,EAAA,cAAc,eACdA,EAAA,gBAAgB,iBAFNA,IAAAA,KAAA,CAAA,CAAA,GAKAC,sBAAAA,OACVA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KACAA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KACAA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KAHUA,IAAAA,KAAA,CAAA,CAAA;"}
|
1
|
+
{"version":3,"file":"worksheet-types.js","sources":["../../../../src/features/worksheet/worksheet/worksheet-types.ts"],"sourcesContent":["import type { IActionData, TPublish, TSubscribe } from '../../cue-canvas/types/cue-canvas';\nimport type { TPublishMouseMove, TSubscribeMouseMove } from '../../pointer-sync/pointer-types';\nimport type { TColorNames, THueNames, TUserTypes } from '../../ui/types';\nimport type { IFile } from './worksheet-question/subjective-review';\nimport type { MutableRefObject, ReactElement } from 'react';\n\nexport enum QUESTION_TAGS {\n TRIAL_TOPIC = 'trial-topic',\n QUESTION_CODE = 'question code',\n}\n\nexport enum QUESTIONS_RATING {\n E = 3,\n S = 2, // Just right\n H = 1,\n}\n\nexport interface ILearnosityError {\n code: number;\n consumerKey: string;\n detail: string;\n errorUI: string;\n msg: string;\n}\n\ninterface ILearnosityQuestionMetadata {\n widget_reference: string;\n sheet_reference: string;\n hints?: string[];\n solution?: string[];\n teacher_tips?: string[];\n valid_response_count: number;\n source: {\n organisation_id: number;\n };\n}\n\nexport type TInstructorStimulus =\n | 'SystemIntro' // lesson v3\n | 'Intro' // lesson v3\n | 'Concept-Intro' // lesson v3\n | 'Instruction' // lesson v3\n | 'Task' // lesson v3\n | 'Try' // trial v3\n | 'Learn' // trial v3\n | 'Apply'; // trial v3\nexport type TItemType =\n | 'overview'\n | 'learning-we-do'\n | 'learning-your-turn'\n | 'learning-explore'\n | 'practice-basic'\n | 'practice-basic-optional'\n | 'practice-regular'\n | 'practice-regular-optional'\n | 'exit-ticket'\n | 'advanced-we-do'\n | 'advanced-your-turn'\n | 'advanced-explore'\n | 'advanced-practice';\n\nexport type TSectionName =\n | 'overview'\n | 'learning'\n | 'practice-basic'\n | 'practice-regular'\n | 'exit-ticket'\n | 'advanced';\n\nexport interface IQuestionValidResponse {\n score: number;\n value: unknown[];\n}\n\nexport interface ISheetNudgeBannerInfo {\n bannerBackgroundColor: TColorNames;\n label: string;\n}\n\nexport interface ILearnosityQuestion {\n response_id: string;\n instructor_stimulus?: TInstructorStimulus;\n metadata: ILearnosityQuestionMetadata;\n instant_feedback?: boolean;\n math_renderer?: string;\n template?: string;\n tokenization?: string;\n numberPad?: string[];\n symbols?: unknown[];\n response_container?: Record<string, unknown>;\n ui_style?: Record<string, unknown>;\n shuffle_options?: boolean;\n // for custom type question validation is undefined.\n validation?: {\n scoring_type?: string;\n unscored?: boolean;\n valid_response?: IQuestionValidResponse;\n alt_responses?: IQuestionValidResponse[];\n penalty?: number;\n min_score_if_attempted?: number;\n };\n is_math?: boolean;\n labels?: Record<string, unknown>;\n line?: Record<string, unknown>;\n points?: string[];\n snap_to_ticks?: boolean;\n ticks?: Record<string, unknown>;\n max_length?: number;\n type:\n | 'hotspot'\n | 'tokenhighlight'\n | 'numberline'\n | 'clozeassociation'\n | 'clozetext'\n | 'association'\n | 'classification'\n | 'clozedropdown'\n | 'clozeformula'\n | 'mcq'\n | 'choicematrix'\n | 'plaintext'\n | 'drawing';\n case_sensitive?: boolean;\n show_copy?: boolean;\n show_cut?: boolean;\n show_paste?: boolean;\n spellcheck?: boolean;\n stimulus?: string;\n stimulus_review?: string;\n stimulus_list?: string[];\n image?: Record<string, unknown>;\n areas?: unknown[];\n area_attributes?: Record<string, unknown>;\n possible_responses?: string[][] | string[];\n duplicate_responses?: boolean;\n response_containers?: unknown[];\n options?: Record<string, unknown>[] | string[];\n feedback_attempts?: number;\n stems?: string[];\n multiple_responses?: boolean;\n}\n\nexport interface ILearnosityItem {\n reference: string;\n questions: ILearnosityQuestion[];\n source: Record<string, unknown>;\n content: string;\n metadata: Record<string, unknown> | unknown[];\n workflow: unknown[];\n response_ids: string[];\n feature_ids: unknown[];\n features: unknown[];\n itemType?: TItemType;\n tags?: string[];\n}\n\nexport interface IWorksheetQuestion extends ILearnosityQuestion {\n item_reference: string;\n item_type?: TItemType;\n section_name?: TSectionName;\n is_optional?: boolean;\n item_tags: string[];\n item_tags_map: Record<string, string>;\n item_number: number;\n item_display_number: number;\n question_number: number;\n total_questions: number;\n}\n\nexport interface ILearnosityQuestionScore {\n score?: number | null;\n max_score: number;\n unscored?: boolean;\n}\n\nexport interface ILearnosityQuestionResponse {\n value: unknown;\n responses?: unknown;\n type: unknown;\n updatedFormat?: boolean;\n wordCount?: number;\n apiVersion: string;\n revision: number;\n feedbackAttemptsCount?: number;\n}\n\nexport interface IAttempt {\n response: ILearnosityQuestionResponse;\n score: ILearnosityQuestionScore;\n}\n\ninterface ITeacherReview {\n reviewComment?: string;\n images?: string[];\n}\nexport interface IWorksheetResponse {\n widgetReference: string;\n itemReference: string;\n itemPosition: number; // 0 based\n questionPosition: number; // 0 based\n isOkayTypeQuestion: boolean;\n response?: ILearnosityQuestionResponse;\n simState?: Record<string, unknown>;\n score?: ILearnosityQuestionScore;\n responseEdited?: boolean;\n hintsUsed?: number;\n markedForReview?: boolean;\n attemptsHistory?: IAttempt[];\n validatedByTeacher?: boolean;\n submittedByStudent?: boolean;\n assignStatus?: 'assigned' | 'skipped';\n rating?: number;\n skipped?: boolean;\n doubtResolved?: boolean;\n teacherReview?: ITeacherReview;\n tags?: Record<string, string>;\n timeSpent?: number;\n}\n\ntype TMathRenderer = 'mathjax' | 'mathquill';\nexport interface ILearnosity {\n ready: () => void;\n questions: () => Record<string, unknown>;\n question: (responseId: string) =>\n | {\n enable: () => boolean;\n disable: () => boolean;\n getQuestion: () => ILearnosityQuestion;\n getMetadata: () => ILearnosityQuestionMetadata;\n getResponse: () => ILearnosityQuestionResponse;\n getScore: (\n callback?: (score: ILearnosityQuestionScore | null) => void,\n ) => ILearnosityQuestionScore;\n validate: (\n options?: { showCorrectAnswers?: boolean; feedbackAttempts?: boolean },\n callback?: () => void,\n ) => void;\n resetValidationUI: () => void;\n on: (eventName: 'changed', callback: () => void) => void;\n off: (eventName: 'changed', callback?: () => void) => void;\n }\n | undefined;\n append: (toAppend: {\n questions: ILearnosityQuestion[];\n responses?: Record<string, unknown>;\n }) => void;\n appendQuestion: (toAppend: {\n questions: ILearnosityQuestion[];\n responses?: Record<string, unknown>;\n }) => void;\n reset: () => void;\n renderMath: (renderer: TMathRenderer) => void;\n}\n\nexport interface IWorksheetBehavior {\n /**\n * If true, Opens the worksheet in resume mode.\n * - If false, Opens the worksheet in review mode.\n */\n canAttempt: boolean;\n /**\n * If true, the user can mark the question for review.\n */\n canMarkForReview: boolean;\n /**\n * The mode of navigation for the worksheet.\n * - `OPEN` mode allows the user to navigate to any question in the worksheet.\n * - `LINEAR` mode allows the user to navigate to the next question only.\n * - `ADAPTIVE` mode allows the user to navigate future questions based on the rating of the current question.\n * - `CURRENT` mode allows the user to navigate to the current question only. Back and forth not allowed.\n */\n navigationMode: 'OPEN' | 'LINEAR' | 'ADAPTIVE' | 'CURRENT';\n /**\n * The initial question to display when the worksheet is loaded.\n * - `FIRST` mode displays the first question in the worksheet.\n * - `CURRENT` mode displays the question that the user was last on.\n */\n initialQuestion: 'FIRST' | 'CURRENT';\n /**\n * If hints are available, on clicking the help button, first availble hint will be shown.\n * Clicking again will show the next hint.\n * If no more hints are available, onHelp will be called.\n */\n hints: boolean;\n /**\n * The time in seconds after which the hints button will be shown.\n */\n hintsTimer?: number; // in seconds\n /**\n * If true, the user can skip the question without attempting it.\n * Skip button will be shown only after the hints are exausted and skipTimer is reached.\n */\n skippable?: boolean;\n /**\n * The time in seconds after which the user can skip the question.\n */\n skippableTime?: number; // in seconds\n /**\n * If true, teacher validation is needed for the question to proceed\n */\n teacherValidationEnabled: boolean;\n /**\n * If worksheet is attempting outside the class setting\n * * In case of puzzle worksheet.\n * * If true,\n * For student we show tooltip with 'Discuss with tutor in class'.\n * For teacher we show review cta.\n * * If false,\n * For student we show tooltip with 'Already solved'.\n * For teacher we don't show review cta.\n */\n canTeacherValidate: boolean;\n /**\n * If true, questions will be validated and feedback will be shown.\n */\n validation: boolean;\n /**\n * If true, questions will be validated and feedback will be shown along with the correct answer.\n */\n solutionHidden?: boolean;\n /**\n * If true, solution will be hidden.\n */\n review: boolean;\n /**\n * The maximum number of attempts allowed for each question.\n * 0 means unlimited attempts.\n * -1 means attempts will not be validated, hence not pushed to attempt history.\n * -2 means the sheet is a puzzle sheet\n * After reaching the maximum number of attempts, the user cannot attempt the question anymore.\n * If maxAtttmpts reached and canExceedAttempts is true, the user can still attempt the question\n * , also user will have the option to move to next question\n */\n maximumAttempts: number;\n /**\n * If true, the user can exceed the maximum number of attempts.\n */\n canExceedAttempts: boolean;\n /**\n * If the worksheet minimumAccuracy is not met, on clicking the final submit button, onMinimumAccuracyNotMet will be called.\n */\n minimumAccuracy: number;\n /**\n * Label for the check button\n * For example,\n * - \"Check\" for Checking the answer\n * - \"Submit\" for Submitting the answer when doing assessment\n */\n checkButtonLabel: string;\n /**\n * If attempt is incorrect, we show retry button, this is the label for the retry button\n * For example,\n * - 'Try Again' for retrying the question\n */\n retryButtonLabel: string;\n /**\n * If true show demos calculator https://www.desmos.com/calculator\n */\n canShowDesmosCalc: boolean;\n /**\n * If true, the user can unassign the sheet.\n */\n canUnAssign?: boolean;\n}\n\nexport type TWORKSHHET_QUESTION_MEDIA_TYPE = 'SIMULATION' | 'VIDEO' | 'AUDIO';\n\nexport interface IWorksheetCallbackProps {\n onResponseChange?: (options: {\n responseId: string;\n response: IWorksheetResponse;\n isNewAttempt: boolean;\n question: IWorksheetQuestion;\n }) => void;\n onBulkResponsesChange?: (responses: Record<string, IWorksheetResponse>) => void;\n onResponsesChange?: (responses: Record<string, IWorksheetResponse>) => void;\n onMediaStateChange?: (\n question: IWorksheetQuestion,\n mediaType: TWORKSHHET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n onTeacherValidation?: (questionId: string, rating?: keyof typeof QUESTIONS_RATING) => void;\n onOptionalItemAssignment?: (itemType: TItemType) => void;\n onOptionalItemSkip?: (itemType: TItemType) => void;\n onHelp?: (options: { questionId: string; questionNumber: string }) => void;\n onMinimumAccuracyNotMet?: (accuracy: number) => void;\n onExitTicketStart?: () => void;\n onExitTicketSubmit?: () => void;\n onSubmit?: (responses: Record<string, IWorksheetResponse>) => void;\n onUnassign?: () => void;\n onReview?: () => void;\n loggerRef: MutableRefObject<(eventName: string, data?: Record<string, unknown>) => void>;\n}\n\nexport interface ICueCanvasCallbackProps {\n onPublishStrokes?: TPublish;\n onReceiveStrokes?: TSubscribe;\n}\n\nexport interface ICueCanvasProps {\n initialStrokesData?: Record<string, IActionData[]>;\n isCanvasEnabled: boolean;\n canToggleScribbling?: boolean;\n}\n\nexport interface IPointerSyncCallbackProps {\n onPublishMouseMove?: TPublishMouseMove;\n onSubscribeMouseMove?: TSubscribeMouseMove;\n}\n\nexport interface IWorksheetLayout {\n containerStyle: 'none' | 'card';\n navigationBar: 'none' | 'top' | 'bottom';\n actionBar: 'none' | 'bottom';\n containerWidth: string;\n topOffset: number; // Offset from the top of the screen, for eg: height of the header\n questionsScrollable: boolean;\n minQuestionHeight: string | number;\n minSummaryHeight: string | number;\n renderSideBar: boolean;\n showUserPointer?: boolean;\n renderQuestionHeader?: boolean;\n imageHue?: THueNames;\n}\n\nexport interface ISubjectiveSheetProps {\n onAddReviewComment?: (\n responseId: string,\n commentData: {\n score: ILearnosityQuestionScore;\n teacherReview: ITeacherReview;\n },\n ) => void;\n openImagesReviewModal?: (props: IOpenImageReviewModalProps) => void;\n handleReviewSubmit?: () => void;\n isSubmittingReview?: boolean;\n isReviewPending?: boolean;\n}\n\ninterface IBaseWorksheetProps {\n userType: TUserTypes;\n userId: string;\n studentId: string;\n studentName?: string;\n worksheetName: string;\n background?: 'none' | 'paper';\n layout: IWorksheetLayout;\n behavior: IWorksheetBehavior;\n initialResponseId?: string;\n initialItemIndex?: number;\n updatedResponses?: Record<string, IWorksheetResponse>;\n worksheetCompleted: boolean;\n showNudgeBanner?: boolean;\n markedAsCompleted?: boolean;\n onResolveDoubt?: (responseId: string) => void;\n onActiveQuestionChange?: (question: IWorksheetQuestion) => void;\n canResolveDoubt?: boolean;\n onSkip?: (itemIndex: number, widgetIndex: number) => void;\n canShowActionBar?: boolean;\n}\n\nexport interface IWorksheetProps\n extends IBaseWorksheetProps,\n IWorksheetCallbackProps,\n ICueCanvasProps,\n ICueCanvasCallbackProps,\n IPointerSyncCallbackProps {\n learnosityActivityRef?: string;\n learnosityItems: ILearnosityItem[];\n learnosityResponses?: Record<string, IWorksheetResponse>;\n learnosity: ILearnosity;\n appendedQuestionIds: string[];\n questionsSignedRequest: string;\n openQuestionFeedbackModal?: (itemRef: string) => void;\n summaryDescription?: ReactElement | null;\n canSubmitWorksheet?: boolean;\n studentId: string;\n attemptId?: string;\n subjectiveProps?: ISubjectiveSheetProps;\n}\n\nexport interface IUpdateImages {\n filteredImages: string[];\n newImages: IFile[];\n}\nexport interface IOpenImageReviewModalProps {\n isReviewed?: boolean;\n disableScoreForm?: boolean;\n imageUrls?: string[];\n filteredImageUrls?: (props: IUpdateImages) => void;\n uploadedImages?: (IFile | string)[];\n image?: string;\n}\n\nexport interface IWorksheetContainerProps\n extends IBaseWorksheetProps,\n IWorksheetCallbackProps,\n ICueCanvasProps,\n ICueCanvasCallbackProps,\n IPointerSyncCallbackProps {\n studentId: string;\n attemptId?: string;\n itemsSignedRequest: string;\n questionsSignedRequest: string;\n onLoaded: () => void;\n onErrored: (error: { code?: number; message: string }) => void;\n onResponsesLoaded?: (responses: Record<string, IWorksheetResponse>) => void;\n openQuestionFeedbackModal?: (itemRef: string) => void;\n summaryDescription?: ReactElement | null;\n canSubmitWorksheet?: boolean;\n subjectiveProps?: ISubjectiveSheetProps;\n}\n\nexport interface IWorksheetRef {\n validateQuestion: (\n responseId: string,\n rating?: keyof typeof QUESTIONS_RATING,\n skipRemainingQuestions?: boolean,\n ) => void;\n assignOptionalItems: (itemType: TItemType) => void;\n skipOptionalItems: (itemType: TItemType) => void;\n updateMediaState: (\n responseId: string,\n mediaType: TWORKSHHET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n}\n\ninterface IWorksheetHeaderLayoutArgs {\n isPuzzleWorksheet?: boolean;\n isTestWorksheet?: boolean;\n imageHue?: THueNames;\n}\n\nexport interface IWorksheetHeaderLayoutProps {\n (args: IWorksheetHeaderLayoutArgs): {\n bgColor: TColorNames;\n borderColor?: TColorNames;\n textColor?: TColorNames;\n };\n}\n"],"names":["QUESTION_TAGS","QUESTIONS_RATING"],"mappings":"AAMY,IAAAA,sBAAAA,OACVA,EAAA,cAAc,eACdA,EAAA,gBAAgB,iBAFNA,IAAAA,KAAA,CAAA,CAAA,GAKAC,sBAAAA,OACVA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KACAA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KACAA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KAHUA,IAAAA,KAAA,CAAA,CAAA;"}
|