@cuemath/leap 3.5.30-gg4 → 3.5.30-j1
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 +12 -0
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/images/images.js +8 -0
- package/dist/assets/images/images.js.map +1 -1
- package/dist/assets/line-icons/icons/carat-right.js +26 -0
- package/dist/assets/line-icons/icons/carat-right.js.map +1 -0
- package/dist/features/chapters/chapters-list/chapter-item/chapter-circular-progress/chapter-circular-progress.js +3 -3
- package/dist/features/chapters/chapters-list/chapter-item/chapter-circular-progress/chapter-circular-progress.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel-styled.js +16 -32
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel-styled.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel.js +88 -87
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel.js.map +1 -1
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js +35 -35
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js.map +1 -1
- package/dist/features/stickers/hooks/use-handle-sticker-send/use-handle-sticker-send.js +0 -1
- package/dist/features/stickers/hooks/use-handle-sticker-send/use-handle-sticker-send.js.map +1 -1
- package/dist/features/timeline/daily-timeline-styled.js +13 -9
- package/dist/features/timeline/daily-timeline-styled.js.map +1 -1
- package/dist/features/timeline/daily-timeline-view.js +9 -10
- package/dist/features/timeline/daily-timeline-view.js.map +1 -1
- package/dist/features/timeline/monthly-report/api/use-monthly-report-get.js +13 -0
- package/dist/features/timeline/monthly-report/api/use-monthly-report-get.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/achievements/achievements.js +68 -0
- package/dist/features/timeline/monthly-report/comps/achievements/achievements.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/achievements/achievements.styled.js +15 -0
- package/dist/features/timeline/monthly-report/comps/achievements/achievements.styled.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/activities/activities-card/activities-card.js +128 -0
- package/dist/features/timeline/monthly-report/comps/activities/activities-card/activities-card.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/activities/activities-card/activities-card.styled.js +53 -0
- package/dist/features/timeline/monthly-report/comps/activities/activities-card/activities-card.styled.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/activities/activities-card-puzzles/activities-card-puzzles.js +121 -0
- package/dist/features/timeline/monthly-report/comps/activities/activities-card-puzzles/activities-card-puzzles.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/activities/activities-card-puzzles/activities-card-puzzles.styled.js +58 -0
- package/dist/features/timeline/monthly-report/comps/activities/activities-card-puzzles/activities-card-puzzles.styled.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/activities/activities.js +27 -0
- package/dist/features/timeline/monthly-report/comps/activities/activities.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/activities/constants.js +95 -0
- package/dist/features/timeline/monthly-report/comps/activities/constants.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/activities/utils.js +15 -0
- package/dist/features/timeline/monthly-report/comps/activities/utils.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/attendance/attendance-constants.js +29 -0
- package/dist/features/timeline/monthly-report/comps/attendance/attendance-constants.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/attendance/attendance-utils.js +92 -0
- package/dist/features/timeline/monthly-report/comps/attendance/attendance-utils.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/attendance/attendance.js +44 -0
- package/dist/features/timeline/monthly-report/comps/attendance/attendance.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/attendance/attendance.styled.js +39 -0
- package/dist/features/timeline/monthly-report/comps/attendance/attendance.styled.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/attendance/attendence-view.js +52 -0
- package/dist/features/timeline/monthly-report/comps/attendance/attendence-view.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/feedback/feedback-styled.js +9 -0
- package/dist/features/timeline/monthly-report/comps/feedback/feedback-styled.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/feedback/feedback.js +94 -0
- package/dist/features/timeline/monthly-report/comps/feedback/feedback.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/goal-chapter-card.js +48 -0
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/goal-chapter-card.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/goals-card-styled.js +28 -0
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/goals-card-styled.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/goals-card.js +113 -0
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/goals-card.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/goals/goals-constants.js +30 -0
- package/dist/features/timeline/monthly-report/comps/goals/goals-constants.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/goals/goals.js +22 -0
- package/dist/features/timeline/monthly-report/comps/goals/goals.js.map +1 -0
- package/dist/features/timeline/monthly-report/monthly-report-styled.js +14 -0
- package/dist/features/timeline/monthly-report/monthly-report-styled.js.map +1 -0
- package/dist/features/timeline/monthly-report/monthly-report-types.js +5 -0
- package/dist/features/timeline/monthly-report/monthly-report-types.js.map +1 -0
- package/dist/features/timeline/monthly-report/monthly-report.js +69 -0
- package/dist/features/timeline/monthly-report/monthly-report.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/api/use-monthly-timeline-get.js +10 -0
- package/dist/features/timeline/monthly-timeline/api/use-monthly-timeline-get.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.js +87 -0
- package/dist/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.styled.js +9 -0
- package/dist/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.styled.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/constants.js +41 -0
- package/dist/features/timeline/monthly-timeline/constants.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/monthly-timeline-styled.js +13 -0
- package/dist/features/timeline/monthly-timeline/monthly-timeline-styled.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/monthly-timeline-types.js +6 -0
- package/dist/features/timeline/monthly-timeline/monthly-timeline-types.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/monthly-timeline-view.js +28 -0
- package/dist/features/timeline/monthly-timeline/monthly-timeline-view.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/monthly-timeline.js +62 -0
- package/dist/features/timeline/monthly-timeline/monthly-timeline.js.map +1 -0
- package/dist/features/timeline/ptm-report/api/use-ptm-report-get.js +9 -0
- package/dist/features/timeline/ptm-report/api/use-ptm-report-get.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/key-need/key-need-styled.js +9 -0
- package/dist/features/timeline/ptm-report/comps/key-need/key-need-styled.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/key-need/key-need.js +35 -0
- package/dist/features/timeline/ptm-report/comps/key-need/key-need.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/parent-support/parent-support.js +53 -0
- package/dist/features/timeline/ptm-report/comps/parent-support/parent-support.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/real-world-projects/real-world-projects-styled.js +19 -0
- package/dist/features/timeline/ptm-report/comps/real-world-projects/real-world-projects-styled.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/real-world-projects/real-world-projects.js +50 -0
- package/dist/features/timeline/ptm-report/comps/real-world-projects/real-world-projects.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/report-card/report-card-styled.js +9 -0
- package/dist/features/timeline/ptm-report/comps/report-card/report-card-styled.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/report-card/report-card.js +22 -0
- package/dist/features/timeline/ptm-report/comps/report-card/report-card.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/school-support/school-support-styled.js +9 -0
- package/dist/features/timeline/ptm-report/comps/school-support/school-support-styled.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/school-support/school-support.js +84 -0
- package/dist/features/timeline/ptm-report/comps/school-support/school-support.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/strategies/strategies-constant.js +11 -0
- package/dist/features/timeline/ptm-report/comps/strategies/strategies-constant.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/strategies/strategies.js +36 -0
- package/dist/features/timeline/ptm-report/comps/strategies/strategies.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/strategy-card/strategy-card-styled.js +55 -0
- package/dist/features/timeline/ptm-report/comps/strategy-card/strategy-card-styled.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/strategy-card/strategy-card.js +35 -0
- package/dist/features/timeline/ptm-report/comps/strategy-card/strategy-card.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/student-info/student-info-styled.js +21 -0
- package/dist/features/timeline/ptm-report/comps/student-info/student-info-styled.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/student-info/student-info.js +21 -0
- package/dist/features/timeline/ptm-report/comps/student-info/student-info.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/support-card/support-card-styled.js +9 -0
- package/dist/features/timeline/ptm-report/comps/support-card/support-card-styled.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/support-card/support-card.js +30 -0
- package/dist/features/timeline/ptm-report/comps/support-card/support-card.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/teacher-observations/teacher-observations-constant.js +9 -0
- package/dist/features/timeline/ptm-report/comps/teacher-observations/teacher-observations-constant.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/teacher-observations/teacher-observations.js +56 -0
- package/dist/features/timeline/ptm-report/comps/teacher-observations/teacher-observations.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/upcoming-chapters/upcoming-chapters.js +15 -0
- package/dist/features/timeline/ptm-report/comps/upcoming-chapters/upcoming-chapters.js.map +1 -0
- package/dist/features/timeline/ptm-report/ptm-report-constants.js +16 -0
- package/dist/features/timeline/ptm-report/ptm-report-constants.js.map +1 -0
- package/dist/features/timeline/ptm-report/ptm-report-helpers.js +8 -0
- package/dist/features/timeline/ptm-report/ptm-report-helpers.js.map +1 -0
- package/dist/features/timeline/ptm-report/ptm-report-styled.js +11 -0
- package/dist/features/timeline/ptm-report/ptm-report-styled.js.map +1 -0
- package/dist/features/timeline/ptm-report/ptm-report-types.js +5 -0
- package/dist/features/timeline/ptm-report/ptm-report-types.js.map +1 -0
- package/dist/features/timeline/ptm-report/ptm-report.js +113 -0
- package/dist/features/timeline/ptm-report/ptm-report.js.map +1 -0
- package/dist/features/timeline/timeline-tabs/timeline-tabs-types.js +5 -0
- package/dist/features/timeline/timeline-tabs/timeline-tabs-types.js.map +1 -0
- package/dist/features/timeline/timeline-tabs/timeline-tabs.js +42 -0
- package/dist/features/timeline/timeline-tabs/timeline-tabs.js.map +1 -0
- package/dist/features/timeline/timeline-tabs/timeline-tabs.styled.js +37 -0
- package/dist/features/timeline/timeline-tabs/timeline-tabs.styled.js.map +1 -0
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body-styled.js.map +1 -1
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js +11 -11
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js.map +1 -1
- package/dist/features/ui/swipable-carousel/swipable-carousel-styled.js +57 -0
- package/dist/features/ui/swipable-carousel/swipable-carousel-styled.js.map +1 -0
- package/dist/features/ui/swipable-carousel/swipable-carousel.js +132 -0
- package/dist/features/ui/swipable-carousel/swipable-carousel.js.map +1 -0
- package/dist/features/ui/swipeable-component/swipeable-component-styled.js.map +1 -0
- package/dist/features/ui/swipeable-component/swipeable-component.js +27 -0
- package/dist/features/ui/swipeable-component/swipeable-component.js.map +1 -0
- package/dist/features/worksheet/user-pointer-pin/hooks/use-user-location.js +20 -21
- package/dist/features/worksheet/user-pointer-pin/hooks/use-user-location.js.map +1 -1
- package/dist/features/worksheet/user-pointer-pin/user-pin.js +35 -37
- package/dist/features/worksheet/user-pointer-pin/user-pin.js.map +1 -1
- package/dist/features/worksheet/worksheet/hooks/use-create-imperative-handle.js +132 -132
- package/dist/features/worksheet/worksheet/hooks/use-create-imperative-handle.js.map +1 -1
- package/dist/features/worksheet/worksheet/hooks/use-get-active-question-id.js +62 -0
- package/dist/features/worksheet/worksheet/hooks/use-get-active-question-id.js.map +1 -0
- package/dist/features/worksheet/worksheet/hooks/use-time-on-questions.js +19 -24
- package/dist/features/worksheet/worksheet/hooks/use-time-on-questions.js.map +1 -1
- package/dist/features/worksheet/worksheet/question-tips.js +47 -48
- package/dist/features/worksheet/worksheet/question-tips.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-action-bar/worksheet-action-bar.js +132 -88
- package/dist/features/worksheet/worksheet/worksheet-action-bar/worksheet-action-bar.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-blocker/worksheet-blocker.js +55 -44
- package/dist/features/worksheet/worksheet/worksheet-blocker/worksheet-blocker.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-container.js +87 -0
- package/dist/features/worksheet/worksheet/worksheet-container.js.map +1 -0
- package/dist/features/worksheet/worksheet/worksheet-helpers.js +112 -109
- package/dist/features/worksheet/worksheet/worksheet-helpers.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-navigation/worksheet-item-navigation/worksheet-item-navigation.js +27 -25
- package/dist/features/worksheet/worksheet/worksheet-navigation/worksheet-item-navigation/worksheet-item-navigation.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-navigation/worksheet-item-number/worksheet-item-number.js +47 -47
- package/dist/features/worksheet/worksheet/worksheet-navigation/worksheet-item-number/worksheet-item-number.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-navigation/worksheet-navigation.js +64 -66
- package/dist/features/worksheet/worksheet/worksheet-navigation/worksheet-navigation.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-navigation/worksheet-section-navigation/worksheet-section-navigation.js +40 -38
- package/dist/features/worksheet/worksheet/worksheet-navigation/worksheet-section-navigation/worksheet-section-navigation.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-permissions/error.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/header/header.js +71 -73
- package/dist/features/worksheet/worksheet/worksheet-question/header/header.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js +59 -61
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/subjective-review.js +18 -21
- package/dist/features/worksheet/worksheet/worksheet-question/subjective-review.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +272 -269
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/scribble-switch.js +31 -32
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/scribble-switch.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/use-handler-callbacks.js +149 -147
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/use-handler-callbacks.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js +223 -212
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-questions-summary/worksheet-questions-summary.js +20 -22
- package/dist/features/worksheet/worksheet/worksheet-questions-summary/worksheet-questions-summary.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-sidebar/question-guide.js +55 -57
- package/dist/features/worksheet/worksheet/worksheet-sidebar/question-guide.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-sidebar/sidebar.js +42 -47
- package/dist/features/worksheet/worksheet/worksheet-sidebar/sidebar.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-styled.js +34 -24
- package/dist/features/worksheet/worksheet/worksheet-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-summary/worksheet-summary.js +12 -16
- package/dist/features/worksheet/worksheet/worksheet-summary/worksheet-summary.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-summary-controller/worksheet-summary-controller.js +7 -8
- package/dist/features/worksheet/worksheet/worksheet-summary-controller/worksheet-summary-controller.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-types.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet.js +441 -203
- package/dist/features/worksheet/worksheet/worksheet.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/worksheet-preview-view.js +1 -1
- package/dist/features/worksheet/worksheet-preview/worksheet-preview-view.js.map +1 -1
- package/dist/index.d.ts +276 -31
- package/dist/index.js +465 -451
- package/dist/index.js.map +1 -1
- package/dist/static/2021.0683b580.png +0 -0
- package/dist/static/2022.d34ad7a5.png +0 -0
- package/dist/static/2023.fce87149.png +0 -0
- package/dist/static/2024.a275ee85.png +0 -0
- package/dist/static/2025.677cc187.png +0 -0
- package/dist/static/2026.63763214.png +0 -0
- package/dist/static/2027.b82dc039.png +0 -0
- package/dist/static/2028.580b8cc0.png +0 -0
- package/dist/static/coding-report-icon.91a1e900.svg +1 -0
- package/dist/static/elp-icon.d45b457d.svg +1 -0
- package/dist/static/empty-reports.fe92faad.svg +1 -0
- package/dist/static/english-icon.50c2e005.svg +1 -0
- package/dist/static/full-report.00112c74.svg +1 -0
- package/dist/static/math-fit-grey.c32f37b3.svg +1 -0
- package/dist/static/no-report.4158fad3.svg +1 -0
- package/dist/static/ptm-report-icon.5089218f.svg +1 -0
- package/dist/static/sat-report-icon.4331be86.svg +1 -0
- package/dist/static/science-report-icon.a0014c40.svg +1 -0
- package/dist/static/thumps-down.a1192a62.svg +1 -0
- package/dist/static/thumps-up.caa35a98.svg +1 -0
- package/package.json +3 -4
- package/dist/features/circle-games/game-launcher/comps/swipable-component/swipeable-component-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/swipable-component/swipeable-component.js +0 -26
- package/dist/features/circle-games/game-launcher/comps/swipable-component/swipeable-component.js.map +0 -1
- package/dist/features/worksheet/worksheet/hooks/use-active-question-observer.js +0 -59
- package/dist/features/worksheet/worksheet/hooks/use-active-question-observer.js.map +0 -1
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-store.js +0 -13
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-store.js.map +0 -1
- package/dist/features/worksheet/worksheet/worksheet-blocker/worksheet-blocker-view.js +0 -68
- package/dist/features/worksheet/worksheet/worksheet-blocker/worksheet-blocker-view.js.map +0 -1
- package/dist/features/worksheet/worksheet/worksheet-calculator/worksheet-calculator.js +0 -17
- package/dist/features/worksheet/worksheet/worksheet-calculator/worksheet-calculator.js.map +0 -1
- package/dist/features/worksheet/worksheet/worksheet-nudge-banner/worksheet-nudge-banner-styled.js +0 -20
- package/dist/features/worksheet/worksheet/worksheet-nudge-banner/worksheet-nudge-banner-styled.js.map +0 -1
- package/dist/features/worksheet/worksheet/worksheet-nudge-banner/worksheet-nudge-banner.js +0 -49
- package/dist/features/worksheet/worksheet/worksheet-nudge-banner/worksheet-nudge-banner.js.map +0 -1
- package/dist/features/worksheet/worksheet/worksheet-provider.js +0 -21
- package/dist/features/worksheet/worksheet/worksheet-provider.js.map +0 -1
- package/dist/features/worksheet/worksheet/worksheet-questions/worksheet-questions-styled.js +0 -16
- package/dist/features/worksheet/worksheet/worksheet-questions/worksheet-questions-styled.js.map +0 -1
- package/dist/features/worksheet/worksheet/worksheet-questions/worksheet-questions.js +0 -73
- package/dist/features/worksheet/worksheet/worksheet-questions/worksheet-questions.js.map +0 -1
- package/dist/features/worksheet/worksheet/worksheet-store.js +0 -301
- package/dist/features/worksheet/worksheet/worksheet-store.js.map +0 -1
- package/dist/features/worksheet/worksheet/worksheet-view.js +0 -141
- package/dist/features/worksheet/worksheet/worksheet-view.js.map +0 -1
- package/dist/node_modules/zustand/esm/middleware.js +0 -22
- package/dist/node_modules/zustand/esm/middleware.js.map +0 -1
- package/dist/node_modules/zustand/esm/react/shallow.js +0 -13
- package/dist/node_modules/zustand/esm/react/shallow.js.map +0 -1
- package/dist/node_modules/zustand/esm/vanilla/shallow.js +0 -31
- package/dist/node_modules/zustand/esm/vanilla/shallow.js.map +0 -1
- /package/dist/features/{circle-games/game-launcher/comps/swipable-component → ui/swipeable-component}/swipeable-component-styled.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worksheet-question.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-question/worksheet-question.tsx"],"sourcesContent":["import {\n memo,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type FC,\n} from 'react';\n\nimport { IMAGES } from '../../../../assets/images/images';\nimport CueCanvas from '../../../cue-canvas/cue-canvas';\nimport Pointer from '../../../pointer-sync/pointer';\nimport FlexView from '../../../ui/layout/flex-view';\nimport EVENTS from '../../constants/events';\nimport { LEARNOSITY_KEYBOARD_HEIGHT, QUESTIONS_GAP } from '../constants';\nimport {\n getPaperColorByQuestion,\n isConceptIntroWidget,\n scrollToQuestion,\n} from '../worksheet-helpers';\nimport QuestionHeader from './header/header';\nimport LearnosityQuestion from './learnosity-question';\nimport QuestionBackdrop from './question-backdrop/question-backdrop';\nimport SubjectiveQuestionReview from './subjective-review';\nimport AdvancedPracticeIntro from './system-intros/advanced-practice-intro';\nimport BasicPracticeIntro from './system-intros/basic-practice-intro';\nimport ExitTicketIntro from './system-intros/exit-ticket-intro';\nimport RegularPracticeIntro from './system-intros/regular-practice-intro';\nimport * as Styled from './worksheet-question-styled';\nimport type { IWorksheetQuestionProps } from './worksheet-question-types';\nimport { useWorksheetStore } from '../hooks/use-worksheet-store';\n\nconst WorksheetQuestion: FC<IWorksheetQuestionProps> = memo(function WorksheetQuestion({\n question,\n response,\n nextQuestionId,\n isActive,\n isHidden,\n canRender,\n appended,\n intersectionObserver,\n}) {\n const {\n behavior,\n layout,\n userType,\n responses,\n maxQuestionWidth,\n actionbarHeight,\n worksheetCompleted,\n learnosity,\n onPublishStrokes,\n onReceiveStrokes,\n initialStrokesData,\n onPublishMouseMove,\n onSubscribeMouseMove,\n canResolveDoubt,\n onResolveDoubt,\n userId,\n studentId,\n subjectiveProps,\n loggerRef,\n isScribblingEnabled,\n } = useWorksheetStore(store => ({\n behavior: store.behavior,\n layout: store.layout,\n userType: store.userType,\n responses: store.responses,\n maxQuestionWidth: store.maxQuestionWidth,\n actionbarHeight: store.actionbarHeight,\n worksheetCompleted: store.worksheetCompleted,\n learnosity: store.learnosity,\n onPublishStrokes: store.onPublishStrokes,\n onReceiveStrokes: store.onReceiveStrokes,\n initialStrokesData: store.initialStrokesData,\n onPublishMouseMove: store.onPublishMouseMove,\n onSubscribeMouseMove: store.onSubscribeMouseMove,\n canResolveDoubt: store.canResolveDoubt,\n onResolveDoubt: store.onResolveDoubt,\n userId: store.userId,\n studentId: store.studentId,\n subjectiveProps: store.subjectiveProps,\n loggerRef: store.loggerRef,\n isScribblingEnabled: store.scribblingEnabled,\n }));\n const { background = 'paper' } = layout;\n const paperColor = useMemo(\n () => (background === 'paper' ? getPaperColorByQuestion(question) : undefined),\n [background, question],\n );\n const [questionHeight, setQuestionHeight] = useState<number | undefined>();\n const [canvasHeight, setCanvasHeight] = useState<number | undefined>();\n const {\n validation,\n review,\n maximumAttempts,\n canExceedAttempts,\n teacherValidationEnabled,\n solutionHidden,\n } = behavior;\n const { minQuestionHeight, topOffset, questionsScrollable, renderQuestionHeader, imageHue } =\n layout;\n const {\n type: questionType,\n response_id: responseId,\n stimulus_review,\n item_type,\n instructor_stimulus,\n metadata: { hints: hintsAvailable, solution, widget_reference },\n item_reference,\n question_number,\n item_number,\n item_display_number,\n } = question;\n const isLessonOverview = item_type === 'overview';\n const isConceptIntro = isConceptIntroWidget(instructor_stimulus);\n const isSystemIntro = instructor_stimulus === 'SystemIntro';\n const isIntro = isConceptIntro || isSystemIntro;\n const responseEdited = response?.responseEdited;\n const wrapperClasses = useMemo(() => {\n const classes = [];\n\n if (responseEdited && userType === 'TEACHER') {\n classes.push('attempting');\n }\n\n if (!appended) {\n classes.push('hidden');\n }\n\n if (questionType === 'hotspot') {\n classes.push('correct-answers-hidden');\n }\n\n if (appended && teacherValidationEnabled && questionType === 'clozetext') {\n if (!isConceptIntro || userType === 'STUDENT') {\n classes.push('response-hidden');\n } else {\n classes.push('response-code-hidden');\n }\n }\n\n if (isLessonOverview) {\n classes.push('lesson-overview');\n }\n\n if (isConceptIntro) {\n classes.push('concept-intro');\n }\n\n if (isSystemIntro) {\n classes.push('system-intro');\n }\n\n return classes.join(' ');\n }, [\n appended,\n isConceptIntro,\n isLessonOverview,\n isSystemIntro,\n questionType,\n responseEdited,\n teacherValidationEnabled,\n userType,\n ]);\n const overflowDetectedRef = useRef<Record<string, boolean>>({});\n const hintsUsed = response?.hintsUsed ?? 0;\n const questionRef = useRef<HTMLDivElement>(null);\n const pointerContainerRef = useRef<HTMLDivElement>(null);\n const hints = useMemo(() => hintsAvailable?.slice(0, hintsUsed), [hintsAvailable, hintsUsed]);\n const validateResponse = useMemo(() => {\n if (userType === 'TEACHER') return true;\n\n if (worksheetCompleted) return true;\n\n if (!response) return false;\n\n if (!response.response) return false;\n\n if (response.responseEdited) return false;\n\n return validation;\n }, [response, userType, validation, worksheetCompleted]);\n\n const showCorrectAnswers = useMemo(() => {\n if (userType === 'TEACHER') return true;\n\n if (review) {\n const { attemptsHistory } = response ?? {};\n const maximumAttemptsReached = (attemptsHistory?.length ?? 0) >= maximumAttempts;\n\n return maximumAttemptsReached && !canExceedAttempts;\n }\n\n return false;\n }, [canExceedAttempts, maximumAttempts, response, review, userType]);\n\n const showSolution = useMemo(\n () => solution && worksheetCompleted && !solutionHidden,\n [solutionHidden, solution, worksheetCompleted],\n );\n\n const [dropZoneDimensions, setDropZoneDimensions] = useState({\n width: 0,\n height: 0,\n });\n\n const onUpdateHeight = useCallback((height: number) => {\n setCanvasHeight(height);\n }, []);\n\n useEffect(() => {\n if (questionRef.current) {\n intersectionObserver.observe(questionRef.current);\n }\n }, [intersectionObserver]);\n\n useEffect(() => {\n if (\n appended &&\n (question.type === 'clozeassociation' ||\n question.type === 'association' ||\n question.type === 'clozeformula')\n ) {\n const draggableElements = document.querySelectorAll(\n `.widget-${question.response_id} .lrn_draggable`,\n );\n\n let minWidth = 0;\n let minHeight = 0;\n\n draggableElements.forEach(draggableElement => {\n minWidth = Math.max(minWidth, draggableElement.clientWidth + 33);\n minHeight = Math.max(minHeight, draggableElement.clientHeight + 1);\n });\n\n setDropZoneDimensions({\n width: question.type !== 'association' ? minWidth : 0,\n height: minHeight,\n });\n }\n }, [appended, question.response_id, question.type]);\n\n useEffect(() => {\n if (appended && validateResponse) {\n const learnosityQuestion = learnosity.question(responseId);\n\n if (learnosityQuestion) {\n learnosityQuestion.validate({\n showCorrectAnswers,\n });\n }\n }\n }, [appended, learnosity, responseId, review, showCorrectAnswers, userType, validateResponse]);\n\n useEffect(() => {\n const $questionEl = pointerContainerRef.current;\n\n if (\n appended &&\n $questionEl &&\n loggerRef.current &&\n overflowDetectedRef.current[responseId] === undefined &&\n !isConceptIntro &&\n !isSystemIntro\n ) {\n const parentWidth = $questionEl.clientWidth;\n const nestedElements = $questionEl.querySelectorAll('*');\n\n for (let i = 0; i < nestedElements.length; i++) {\n const element = nestedElements[i];\n\n if (element?.closest('.resize-sensor')) {\n continue;\n }\n\n const elementWidth = element?.clientWidth ?? 0;\n\n if (elementWidth > parentWidth) {\n overflowDetectedRef.current[responseId] = true;\n loggerRef.current(EVENTS.WORKSHEET_V3_GREATER_WIDTH_ELEMENT, {\n item_reference,\n widget_reference,\n question_type: questionType,\n question_number,\n responseId,\n item_number,\n item_display_number,\n });\n break;\n }\n }\n\n overflowDetectedRef.current[responseId] = false;\n }\n }, [\n appended,\n isConceptIntro,\n isSystemIntro,\n item_display_number,\n item_number,\n item_reference,\n loggerRef,\n questionType,\n question_number,\n responseId,\n widget_reference,\n ]);\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(() => {\n const $questionEl = questionRef.current;\n\n const getExtraSpaceNeedForFloatingKeyboard = (questionEl: HTMLDivElement) => {\n const $responseWrapper = questionEl.querySelector('.lrn_response_wrapper');\n\n if (isIntro || !$responseWrapper) {\n return 0;\n }\n\n const questionBottom = questionEl.getBoundingClientRect().bottom;\n const responseWrapperBottom = $responseWrapper.getBoundingClientRect().bottom;\n const spaceFromResponseToBottom = Math.abs(questionBottom - responseWrapperBottom);\n\n if (spaceFromResponseToBottom < LEARNOSITY_KEYBOARD_HEIGHT) {\n return LEARNOSITY_KEYBOARD_HEIGHT - spaceFromResponseToBottom;\n }\n\n return 0;\n };\n\n if (appended && $questionEl) {\n setQuestionHeight(qHeight => {\n const hasFloatingKeyboard = question.ui_style?.type === 'floating-keyboard';\n const v3CodeHidden = teacherValidationEnabled && questionType === 'clozetext';\n const hasKeyboard = hasFloatingKeyboard && !v3CodeHidden;\n const height = $questionEl.clientHeight;\n\n if (height === 0) {\n return qHeight;\n }\n\n // If the question has a floating keyboard, we need to add the height of the keyboard to the question height\n if (!qHeight) {\n return Math.ceil(\n height + (hasKeyboard ? getExtraSpaceNeedForFloatingKeyboard($questionEl) : 0),\n );\n }\n\n const newQuestionHeight = Math.ceil(\n height + (hasKeyboard ? getExtraSpaceNeedForFloatingKeyboard($questionEl) : 0),\n );\n\n if (Math.abs(newQuestionHeight - qHeight) > 4) {\n return newQuestionHeight;\n }\n\n return qHeight;\n });\n }\n\n learnosity.renderMath('mathjax');\n });\n\n useLayoutEffect(() => {\n if (!questionsScrollable && !isHidden) {\n scrollToQuestion(responseId);\n }\n }, [isHidden, questionsScrollable, responseId, topOffset]);\n\n return (\n <Styled.QuestionContainerWrapper\n data-response-id={responseId}\n className={`widget-${responseId}`}\n ref={questionRef}\n $topOffset={topOffset}\n $flexDirection={stimulus_review ? 'row' : 'column'}\n $alignItems={stimulus_review ? 'flex-start' : 'center'}\n $hidden={isHidden}\n $marginBottom={QUESTIONS_GAP}\n >\n {stimulus_review && (\n <Styled.StimulusReview\n dangerouslySetInnerHTML={{\n __html: stimulus_review,\n }}\n />\n )}\n <Styled.QuestionContainer\n ref={pointerContainerRef}\n $width={stimulus_review ? '50%' : `${maxQuestionWidth}px`}\n $minHeight={\n questionHeight ? Math.max(questionHeight - 72, canvasHeight ?? 0) : minQuestionHeight\n }\n $isActive={isActive}\n $paperColor={paperColor}\n $opacity={isActive ? 1 : 0.2}\n $imageHue={imageHue}\n >\n {isActive && !!onPublishMouseMove && !!onSubscribeMouseMove && !!behavior.canvasEnabled && (\n <Pointer\n containerRef={pointerContainerRef}\n onPublish={onPublishMouseMove}\n onSubscribe={onSubscribeMouseMove}\n responseId={responseId}\n />\n )}\n <Styled.QuestionWrapper\n className={wrapperClasses}\n $dropzoneMinWidth={dropZoneDimensions.width}\n $dropzoneMinHeight={dropZoneDimensions.height}\n >\n {renderQuestionHeader && !(isLessonOverview || isConceptIntro || isSystemIntro) && (\n <QuestionHeader\n question={question}\n response={response}\n behavior={behavior}\n paperColor={paperColor}\n actionbarHeight={actionbarHeight}\n canResolveDoubt={canResolveDoubt}\n onResolveDoubt={onResolveDoubt}\n worksheetCompleted={worksheetCompleted}\n />\n )}\n {isLessonOverview && <Styled.LessonOverviewBanner src={IMAGES.LESSON_OVERVIEW_BANNER} />}\n {isConceptIntro && paperColor && <QuestionBackdrop paperColor={paperColor} />}\n {isSystemIntro ? (\n <>\n {item_type === 'practice-basic' && <BasicPracticeIntro />}\n {item_type === 'practice-regular' && <RegularPracticeIntro />}\n {item_type === 'exit-ticket' && <ExitTicketIntro />}\n {item_type?.startsWith('advanced-') && <AdvancedPracticeIntro />}\n </>\n ) : undefined}\n <LearnosityQuestion\n appended={appended}\n question={question}\n response={response?.response}\n canRender={canRender || isActive}\n learnosity={learnosity}\n canForceAppend={userType === 'TEACHER'}\n isConceptIntro={isConceptIntro}\n simState={response?.simState}\n imageHue={imageHue}\n isPuzzle={maximumAttempts === -2}\n />\n\n {!isIntro &&\n !!behavior.canvasEnabled &&\n onPublishStrokes &&\n onReceiveStrokes &&\n questionHeight !== undefined && (\n <Styled.CueCanvasWrapper $canScribble={isScribblingEnabled}>\n <CueCanvas\n canRender={canRender}\n canScribble={isScribblingEnabled && isActive}\n appended={appended}\n canvasId={responseId}\n width={maxQuestionWidth}\n height={Math.max(questionHeight, canvasHeight ?? 0)}\n onUpdateHeight={onUpdateHeight}\n onPublish={onPublishStrokes}\n onSubscribe={onReceiveStrokes}\n userId={userId}\n initialData={initialStrokesData?.[responseId]}\n userType={userType}\n />\n </Styled.CueCanvasWrapper>\n )}\n {!isIntro && hints && hints.length > 0 && (\n <FlexView\n $background=\"BLUE_1\"\n $gutterX={1}\n $gapX={0.5}\n $borderRadiusX={0}\n $borderColor=\"BLUE_2\"\n >\n {hints.map((hint, index) => (\n <Styled.Hint\n key={hint}\n dangerouslySetInnerHTML={{\n __html: `<span style=\"color: #DA5107; font-weight: 600;\">Hint${\n (hintsAvailable?.length ?? 0) > 1 ? ` ${index + 1}` : ''\n }:</span> ${hint}`,\n }}\n />\n ))}\n </FlexView>\n )}\n {showSolution && (\n <FlexView\n $background=\"YELLOW_1\"\n $gutterX={1}\n $gapX={0.875}\n $borderRadiusX={0}\n $borderColor=\"YELLOW_2\"\n >\n <Styled.Solution\n dangerouslySetInnerHTML={{\n __html: `<div style=\"color: #DA5107; font-weight: 600;\">Solution:</div>${solution}`,\n }}\n />\n </FlexView>\n )}\n {!!subjectiveProps && (\n <SubjectiveQuestionReview\n responses={responses}\n response={response}\n nextQuestionId={nextQuestionId}\n responseId={responseId}\n studentId={studentId}\n {...subjectiveProps}\n />\n )}\n </Styled.QuestionWrapper>\n </Styled.QuestionContainer>\n </Styled.QuestionContainerWrapper>\n );\n});\n\nexport default WorksheetQuestion;\n"],"names":["WorksheetQuestion","memo","question","response","nextQuestionId","isActive","isHidden","canRender","appended","intersectionObserver","behavior","layout","userType","responses","maxQuestionWidth","actionbarHeight","worksheetCompleted","learnosity","onPublishStrokes","onReceiveStrokes","initialStrokesData","onPublishMouseMove","onSubscribeMouseMove","canResolveDoubt","onResolveDoubt","userId","studentId","subjectiveProps","loggerRef","isScribblingEnabled","useWorksheetStore","store","background","paperColor","useMemo","getPaperColorByQuestion","questionHeight","setQuestionHeight","useState","canvasHeight","setCanvasHeight","validation","review","maximumAttempts","canExceedAttempts","teacherValidationEnabled","solutionHidden","minQuestionHeight","topOffset","questionsScrollable","renderQuestionHeader","imageHue","questionType","responseId","stimulus_review","item_type","instructor_stimulus","hintsAvailable","solution","widget_reference","item_reference","question_number","item_number","item_display_number","isLessonOverview","isConceptIntro","isConceptIntroWidget","isSystemIntro","isIntro","responseEdited","wrapperClasses","classes","overflowDetectedRef","useRef","hintsUsed","questionRef","pointerContainerRef","hints","validateResponse","showCorrectAnswers","attemptsHistory","showSolution","dropZoneDimensions","setDropZoneDimensions","onUpdateHeight","useCallback","height","useEffect","draggableElements","minWidth","minHeight","draggableElement","learnosityQuestion","$questionEl","parentWidth","nestedElements","i","element","EVENTS","getExtraSpaceNeedForFloatingKeyboard","questionEl","$responseWrapper","questionBottom","responseWrapperBottom","spaceFromResponseToBottom","LEARNOSITY_KEYBOARD_HEIGHT","qHeight","hasKeyboard","_a","newQuestionHeight","useLayoutEffect","scrollToQuestion","jsxs","Styled.QuestionContainerWrapper","QUESTIONS_GAP","jsx","Styled.StimulusReview","Styled.QuestionContainer","Pointer","Styled.QuestionWrapper","QuestionHeader","Styled.LessonOverviewBanner","IMAGES","QuestionBackdrop","Fragment","BasicPracticeIntro","RegularPracticeIntro","ExitTicketIntro","AdvancedPracticeIntro","LearnosityQuestion","Styled.CueCanvasWrapper","CueCanvas","FlexView","hint","index","Styled.Hint","Styled.Solution","SubjectiveQuestionReview"],"mappings":";;;;;;;;;;;;;;;;;;;AAkCM,MAAAA,KAAiDC,GAAK,SAA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BAAA;AAAA,4BACC,yBAAyB;AAAA,8BACvB,QAAQ,iEAAiE9E,CAAQ;AAAA,4BACnF;AAAA,0BAAA;AAAA,wBACF;AAAA,sBAAA;AAAA,oBACF;AAAA,oBAED,CAAC,CAAC/B,KACD,gBAAAwF;AAAA,sBAACsB;AAAA,sBAAA;AAAA,wBACC,WAAA5H;AAAA,wBACA,UAAAV;AAAA,wBACA,gBAAAC;AAAA,wBACA,YAAAiD;AAAA,wBACA,WAAA3B;AAAA,wBACC,GAAGC;AAAA,sBAAA;AAAA,oBACN;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAEJ;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
|
|
1
|
+
{"version":3,"file":"worksheet-question.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-question/worksheet-question.tsx"],"sourcesContent":["import {\n memo,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type FC,\n} from 'react';\n\nimport { IMAGES } from '../../../../assets/images/images';\nimport CueCanvas from '../../../cue-canvas/cue-canvas';\nimport Pointer from '../../../pointer-sync/pointer';\nimport FlexView from '../../../ui/layout/flex-view';\nimport EVENTS from '../../constants/events';\nimport { LEARNOSITY_KEYBOARD_HEIGHT, QUESTIONS_GAP } from '../constants';\nimport {\n getPaperColorByQuestion,\n isConceptIntroWidget,\n scrollToQuestion,\n} from '../worksheet-helpers';\nimport QuestionHeader from './header/header';\nimport LearnosityQuestion from './learnosity-question';\nimport QuestionBackdrop from './question-backdrop/question-backdrop';\nimport SubjectiveQuestionReview from './subjective-review';\nimport AdvancedPracticeIntro from './system-intros/advanced-practice-intro';\nimport BasicPracticeIntro from './system-intros/basic-practice-intro';\nimport ExitTicketIntro from './system-intros/exit-ticket-intro';\nimport RegularPracticeIntro from './system-intros/regular-practice-intro';\nimport * as Styled from './worksheet-question-styled';\nimport type { IWorksheetQuestionProps } from './worksheet-question-types';\n\nconst WorksheetQuestion: FC<IWorksheetQuestionProps> = memo(function WorksheetQuestion({\n userType,\n signedRequest,\n worksheetCompleted,\n question,\n response,\n nextQuestionId,\n isActive,\n isHidden,\n canRender,\n loggerRef,\n appended,\n maxQuestionWidth,\n behavior,\n layout,\n actionbarHeight,\n learnosity,\n intersectionObserver,\n onMediaStateChange,\n onMarkForReview,\n userId,\n onPublishStrokes,\n onReceiveStrokes,\n isScribblingEnabled,\n initialStrokesData,\n onPublishMouseMove,\n onSubscribeMouseMove,\n setActiveQuestionId,\n canResolveDoubt,\n onResolveDoubt,\n studentId,\n responses,\n subjectiveProps,\n}) {\n const { background = 'paper' } = layout;\n const paperColor = useMemo(\n () => (background === 'paper' ? getPaperColorByQuestion(question) : undefined),\n [background, question],\n );\n const [questionHeight, setQuestionHeight] = useState<number | undefined>();\n const [canvasHeight, setCanvasHeight] = useState<number | undefined>();\n const {\n validation,\n review,\n maximumAttempts,\n canExceedAttempts,\n teacherValidationEnabled,\n solutionHidden,\n } = behavior;\n const { minQuestionHeight, topOffset, questionsScrollable, renderQuestionHeader, imageHue } =\n layout;\n const {\n type: questionType,\n response_id: responseId,\n stimulus_review,\n item_type,\n instructor_stimulus,\n metadata: { hints: hintsAvailable, solution, widget_reference },\n item_reference,\n question_number,\n item_number,\n item_display_number,\n } = question;\n const isLessonOverview = item_type === 'overview';\n const isConceptIntro = isConceptIntroWidget(instructor_stimulus);\n const isSystemIntro = instructor_stimulus === 'SystemIntro';\n const isIntro = isConceptIntro || isSystemIntro;\n const responseEdited = response?.responseEdited;\n const wrapperClasses = useMemo(() => {\n const classes = [];\n\n if (responseEdited && userType === 'TEACHER') {\n classes.push('attempting');\n }\n\n if (!appended) {\n classes.push('hidden');\n }\n\n if (questionType === 'hotspot') {\n classes.push('correct-answers-hidden');\n }\n\n if (appended && teacherValidationEnabled && questionType === 'clozetext') {\n if (!isConceptIntro || userType === 'STUDENT') {\n classes.push('response-hidden');\n } else {\n classes.push('response-code-hidden');\n }\n }\n\n if (isLessonOverview) {\n classes.push('lesson-overview');\n }\n\n if (isConceptIntro) {\n classes.push('concept-intro');\n }\n\n if (isSystemIntro) {\n classes.push('system-intro');\n }\n\n return classes.join(' ');\n }, [\n appended,\n isConceptIntro,\n isLessonOverview,\n isSystemIntro,\n questionType,\n responseEdited,\n teacherValidationEnabled,\n userType,\n ]);\n const overflowDetectedRef = useRef<Record<string, boolean>>({});\n\n const hintsUsed = response?.hintsUsed ?? 0;\n const [validatedByTeacherOnMount] = useState(response?.validatedByTeacher ?? false);\n\n const questionRef = useRef<HTMLDivElement>(null);\n const pointerContainerRef = useRef<HTMLDivElement>(null);\n const hints = useMemo(() => hintsAvailable?.slice(0, hintsUsed), [hintsAvailable, hintsUsed]);\n const validateResponse = useMemo(() => {\n if (userType === 'TEACHER') return true;\n\n if (worksheetCompleted) return true;\n\n if (!response) return false;\n\n if (!response.response) return false;\n\n if (response.responseEdited) return false;\n\n return validation;\n }, [response, userType, validation, worksheetCompleted]);\n\n const showCorrectAnswers = useMemo(() => {\n if (userType === 'TEACHER') return true;\n\n if (review) {\n const { attemptsHistory } = response ?? {};\n const maximumAttemptsReached = (attemptsHistory?.length ?? 0) >= maximumAttempts;\n\n return maximumAttemptsReached && !canExceedAttempts;\n }\n\n return false;\n }, [canExceedAttempts, maximumAttempts, response, review, userType]);\n\n const showSolution = useMemo(\n () => solution && worksheetCompleted && !solutionHidden,\n [solutionHidden, solution, worksheetCompleted],\n );\n\n const [dropZoneDimensions, setDropZoneDimensions] = useState({\n width: 0,\n height: 0,\n });\n\n const onUpdateHeight = useCallback((height: number) => {\n setCanvasHeight(height);\n }, []);\n\n useEffect(() => {\n if (questionRef.current) {\n intersectionObserver.observe(questionRef.current);\n }\n }, [intersectionObserver]);\n\n useEffect(() => {\n if (\n appended &&\n (question.type === 'clozeassociation' ||\n question.type === 'association' ||\n question.type === 'clozeformula')\n ) {\n const draggableElements = document.querySelectorAll(\n `.widget-${question.response_id} .lrn_draggable`,\n );\n\n let minWidth = 0;\n let minHeight = 0;\n\n draggableElements.forEach(draggableElement => {\n minWidth = Math.max(minWidth, draggableElement.clientWidth + 33);\n minHeight = Math.max(minHeight, draggableElement.clientHeight + 1);\n });\n\n setDropZoneDimensions({\n width: question.type !== 'association' ? minWidth : 0,\n height: minHeight,\n });\n }\n }, [appended, question.response_id, question.type]);\n\n useEffect(() => {\n if (appended && validateResponse) {\n const learnosityQuestion = learnosity.question(responseId);\n\n if (learnosityQuestion) {\n learnosityQuestion.validate({\n showCorrectAnswers,\n });\n }\n }\n }, [appended, learnosity, responseId, review, showCorrectAnswers, userType, validateResponse]);\n\n useEffect(() => {\n const $questionEl = pointerContainerRef.current;\n\n if (\n appended &&\n $questionEl &&\n loggerRef.current &&\n overflowDetectedRef.current[responseId] === undefined &&\n !isConceptIntro &&\n !isSystemIntro\n ) {\n const parentWidth = $questionEl.clientWidth;\n const nestedElements = $questionEl.querySelectorAll('*');\n\n for (let i = 0; i < nestedElements.length; i++) {\n const element = nestedElements[i];\n\n if (element?.closest('.resize-sensor')) {\n continue;\n }\n\n const elementWidth = element?.clientWidth ?? 0;\n\n if (elementWidth > parentWidth) {\n overflowDetectedRef.current[responseId] = true;\n loggerRef.current(EVENTS.WORKSHEET_V3_GREATER_WIDTH_ELEMENT, {\n item_reference,\n widget_reference,\n question_type: questionType,\n question_number,\n responseId,\n item_number,\n item_display_number,\n });\n break;\n }\n }\n\n overflowDetectedRef.current[responseId] = false;\n }\n }, [\n appended,\n isConceptIntro,\n isSystemIntro,\n item_display_number,\n item_number,\n item_reference,\n loggerRef,\n questionType,\n question_number,\n responseId,\n widget_reference,\n ]);\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(() => {\n const $questionEl = questionRef.current;\n\n const getExtraSpaceNeedForFloatingKeyboard = (questionEl: HTMLDivElement) => {\n const $responseWrapper = questionEl.querySelector('.lrn_response_wrapper');\n\n if (isIntro || !$responseWrapper) {\n return 0;\n }\n\n const questionBottom = questionEl.getBoundingClientRect().bottom;\n const responseWrapperBottom = $responseWrapper.getBoundingClientRect().bottom;\n const spaceFromResponseToBottom = Math.abs(questionBottom - responseWrapperBottom);\n\n if (spaceFromResponseToBottom < LEARNOSITY_KEYBOARD_HEIGHT) {\n return LEARNOSITY_KEYBOARD_HEIGHT - spaceFromResponseToBottom;\n }\n\n return 0;\n };\n\n if (appended && $questionEl) {\n setQuestionHeight(qHeight => {\n const hasFloatingKeyboard = question.ui_style?.type === 'floating-keyboard';\n const v3CodeHidden = teacherValidationEnabled && questionType === 'clozetext';\n const hasKeyboard = hasFloatingKeyboard && !v3CodeHidden;\n const height = $questionEl.clientHeight;\n\n if (height === 0) {\n return qHeight;\n }\n\n // If the question has a floating keyboard, we need to add the height of the keyboard to the question height\n if (!qHeight) {\n return Math.ceil(\n height + (hasKeyboard ? getExtraSpaceNeedForFloatingKeyboard($questionEl) : 0),\n );\n }\n\n const newQuestionHeight = Math.ceil(\n height + (hasKeyboard ? getExtraSpaceNeedForFloatingKeyboard($questionEl) : 0),\n );\n\n if (Math.abs(newQuestionHeight - qHeight) > 4) {\n return newQuestionHeight;\n }\n\n return qHeight;\n });\n }\n\n learnosity.renderMath('mathjax');\n });\n\n useLayoutEffect(() => {\n if (!questionsScrollable && !isHidden) {\n scrollToQuestion(responseId);\n }\n }, [isHidden, questionsScrollable, responseId, topOffset]);\n\n useEffect(() => {\n if (\n teacherValidationEnabled &&\n nextQuestionId &&\n !validatedByTeacherOnMount &&\n response?.validatedByTeacher\n ) {\n const timer = setTimeout(() => {\n if (questionsScrollable) {\n scrollToQuestion(nextQuestionId);\n } else {\n setActiveQuestionId(nextQuestionId);\n }\n }, 1000);\n\n return () => {\n clearTimeout(timer);\n };\n }\n }, [\n nextQuestionId,\n teacherValidationEnabled,\n validatedByTeacherOnMount,\n questionsScrollable,\n setActiveQuestionId,\n response?.validatedByTeacher,\n ]);\n\n return (\n <Styled.QuestionContainerWrapper\n data-response-id={responseId}\n className={`widget-${responseId}`}\n ref={questionRef}\n $topOffset={topOffset}\n $flexDirection={stimulus_review ? 'row' : 'column'}\n $alignItems={stimulus_review ? 'flex-start' : 'center'}\n $hidden={isHidden}\n $marginBottom={QUESTIONS_GAP}\n >\n {stimulus_review && (\n <Styled.StimulusReview\n dangerouslySetInnerHTML={{\n __html: stimulus_review,\n }}\n />\n )}\n <Styled.QuestionContainer\n ref={pointerContainerRef}\n $width={stimulus_review ? '50%' : `${maxQuestionWidth}px`}\n $minHeight={\n questionHeight ? Math.max(questionHeight - 72, canvasHeight ?? 0) : minQuestionHeight\n }\n $isActive={isActive}\n $paperColor={paperColor}\n $opacity={isActive ? 1 : 0.2}\n $imageHue={imageHue}\n >\n {isActive && !!onPublishMouseMove && !!onSubscribeMouseMove && !!behavior.canvasEnabled && (\n <Pointer\n containerRef={pointerContainerRef}\n onPublish={onPublishMouseMove}\n onSubscribe={onSubscribeMouseMove}\n responseId={responseId}\n />\n )}\n <Styled.QuestionWrapper\n className={wrapperClasses}\n $dropzoneMinWidth={dropZoneDimensions.width}\n $dropzoneMinHeight={dropZoneDimensions.height}\n >\n {renderQuestionHeader && !(isLessonOverview || isConceptIntro || isSystemIntro) && (\n <QuestionHeader\n userType={userType}\n question={question}\n response={response}\n behavior={behavior}\n layout={layout}\n paperColor={paperColor}\n onMarkForReview={onMarkForReview}\n actionbarHeight={actionbarHeight}\n canResolveDoubt={canResolveDoubt}\n onResolveDoubt={onResolveDoubt}\n worksheetCompleted={worksheetCompleted}\n />\n )}\n {isLessonOverview && <Styled.LessonOverviewBanner src={IMAGES.LESSON_OVERVIEW_BANNER} />}\n {isConceptIntro && paperColor && <QuestionBackdrop paperColor={paperColor} />}\n {isSystemIntro ? (\n <>\n {item_type === 'practice-basic' && <BasicPracticeIntro />}\n {item_type === 'practice-regular' && <RegularPracticeIntro />}\n {item_type === 'exit-ticket' && <ExitTicketIntro />}\n {item_type?.startsWith('advanced-') && <AdvancedPracticeIntro />}\n </>\n ) : undefined}\n <LearnosityQuestion\n signedRequest={signedRequest}\n appended={appended}\n question={question}\n response={response?.response}\n canRender={canRender || isActive}\n learnosity={learnosity}\n canForceAppend={userType === 'TEACHER'}\n isConceptIntro={isConceptIntro}\n simState={response?.simState}\n onMediaStateChange={onMediaStateChange}\n imageHue={imageHue}\n isPuzzle={maximumAttempts === -2}\n />\n\n {!isIntro &&\n !!behavior.canvasEnabled &&\n onPublishStrokes &&\n onReceiveStrokes &&\n questionHeight !== undefined && (\n <Styled.CueCanvasWrapper $canScribble={isScribblingEnabled}>\n <CueCanvas\n canRender={canRender}\n canScribble={isScribblingEnabled && isActive}\n appended={appended}\n canvasId={responseId}\n width={maxQuestionWidth}\n height={Math.max(questionHeight, canvasHeight ?? 0)}\n onUpdateHeight={onUpdateHeight}\n onPublish={onPublishStrokes}\n onSubscribe={onReceiveStrokes}\n userId={userId}\n initialData={initialStrokesData?.[responseId]}\n userType={userType}\n />\n </Styled.CueCanvasWrapper>\n )}\n {!isIntro && hints && hints.length > 0 && (\n <FlexView\n $background=\"BLUE_1\"\n $gutterX={1}\n $gapX={0.5}\n $borderRadiusX={0}\n $borderColor=\"BLUE_2\"\n >\n {hints.map((hint, index) => (\n <Styled.Hint\n key={hint}\n dangerouslySetInnerHTML={{\n __html: `<span style=\"color: #DA5107; font-weight: 600;\">Hint${\n (hintsAvailable?.length ?? 0) > 1 ? ` ${index + 1}` : ''\n }:</span> ${hint}`,\n }}\n />\n ))}\n </FlexView>\n )}\n {showSolution && (\n <FlexView\n $background=\"YELLOW_1\"\n $gutterX={1}\n $gapX={0.875}\n $borderRadiusX={0}\n $borderColor=\"YELLOW_2\"\n >\n <Styled.Solution\n dangerouslySetInnerHTML={{\n __html: `<div style=\"color: #DA5107; font-weight: 600;\">Solution:</div>${solution}`,\n }}\n />\n </FlexView>\n )}\n {!!subjectiveProps && (\n <SubjectiveQuestionReview\n responses={responses}\n response={response}\n nextQuestionId={nextQuestionId}\n responseId={responseId}\n studentId={studentId}\n userType={userType}\n {...subjectiveProps}\n />\n )}\n </Styled.QuestionWrapper>\n </Styled.QuestionContainer>\n </Styled.QuestionContainerWrapper>\n );\n});\n\nexport default WorksheetQuestion;\n"],"names":["WorksheetQuestion","memo","userType","signedRequest","worksheetCompleted","question","response","nextQuestionId","isActive","isHidden","canRender","loggerRef","appended","maxQuestionWidth","behavior","layout","actionbarHeight","learnosity","intersectionObserver","onMediaStateChange","onMarkForReview","userId","onPublishStrokes","onReceiveStrokes","isScribblingEnabled","initialStrokesData","onPublishMouseMove","onSubscribeMouseMove","setActiveQuestionId","canResolveDoubt","onResolveDoubt","studentId","responses","subjectiveProps","background","paperColor","useMemo","getPaperColorByQuestion","questionHeight","setQuestionHeight","useState","canvasHeight","setCanvasHeight","validation","review","maximumAttempts","canExceedAttempts","teacherValidationEnabled","solutionHidden","minQuestionHeight","topOffset","questionsScrollable","renderQuestionHeader","imageHue","questionType","responseId","stimulus_review","item_type","instructor_stimulus","hintsAvailable","solution","widget_reference","item_reference","question_number","item_number","item_display_number","isLessonOverview","isConceptIntro","isConceptIntroWidget","isSystemIntro","isIntro","responseEdited","wrapperClasses","classes","overflowDetectedRef","useRef","hintsUsed","validatedByTeacherOnMount","questionRef","pointerContainerRef","hints","validateResponse","showCorrectAnswers","attemptsHistory","showSolution","dropZoneDimensions","setDropZoneDimensions","onUpdateHeight","useCallback","height","useEffect","draggableElements","minWidth","minHeight","draggableElement","learnosityQuestion","$questionEl","parentWidth","nestedElements","i","element","EVENTS","getExtraSpaceNeedForFloatingKeyboard","questionEl","$responseWrapper","questionBottom","responseWrapperBottom","spaceFromResponseToBottom","LEARNOSITY_KEYBOARD_HEIGHT","qHeight","hasKeyboard","_a","newQuestionHeight","useLayoutEffect","scrollToQuestion","timer","jsxs","Styled.QuestionContainerWrapper","QUESTIONS_GAP","jsx","Styled.StimulusReview","Styled.QuestionContainer","Pointer","Styled.QuestionWrapper","QuestionHeader","Styled.LessonOverviewBanner","IMAGES","QuestionBackdrop","Fragment","BasicPracticeIntro","RegularPracticeIntro","ExitTicketIntro","AdvancedPracticeIntro","LearnosityQuestion","Styled.CueCanvasWrapper","CueCanvas","FlexView","hint","index","Styled.Hint","Styled.Solution","SubjectiveQuestionReview"],"mappings":";;;;;;;;;;;;;;;;;;AAiCM,MAAAA,KAAiDC,GAAK,SAA2B;AAAA,EACrF,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,QAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,iBAAAC;AACF,GAAG;AACK,QAAA,EAAE,YAAAC,KAAa,QAAY,IAAAnB,GAC3BoB,IAAaC;AAAA,IACjB,MAAOF,OAAe,UAAUG,GAAwBhC,CAAQ,IAAI;AAAA,IACpE,CAAC6B,IAAY7B,CAAQ;AAAA,EAAA,GAEjB,CAACiC,GAAgBC,EAAiB,IAAIC,EAA6B,GACnE,CAACC,IAAcC,EAAe,IAAIF,EAA6B,GAC/D;AAAA,IACJ,YAAAG;AAAA,IACA,QAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,gBAAAC;AAAA,EACE,IAAAlC,GACE,EAAE,mBAAAmC,IAAmB,WAAAC,IAAW,qBAAAC,GAAqB,sBA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A,oBACH;AAAA,oBAEDrD,MACC,gBAAAmC;AAAA,sBAACiB;AAAA,sBAAA;AAAA,wBACC,aAAY;AAAA,wBACZ,UAAU;AAAA,wBACV,OAAO;AAAA,wBACP,gBAAgB;AAAA,wBAChB,cAAa;AAAA,wBAEb,UAAA,gBAAAjB;AAAA,0BAACqB;AAAAA,0BAAA;AAAA,4BACC,yBAAyB;AAAA,8BACvB,QAAQ,iEAAiEhF,CAAQ;AAAA,4BACnF;AAAA,0BAAA;AAAA,wBACF;AAAA,sBAAA;AAAA,oBACF;AAAA,oBAED,CAAC,CAAC3B,MACD,gBAAAsF;AAAA,sBAACsB;AAAA,sBAAA;AAAA,wBACC,WAAA7G;AAAA,wBACA,UAAA1B;AAAA,wBACA,gBAAAC;AAAA,wBACA,YAAAgD;AAAA,wBACA,WAAAxB;AAAA,wBACA,UAAA7B;AAAA,wBACC,GAAG+B;AAAA,sBAAA;AAAA,oBACN;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAEJ;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
|
|
@@ -1,53 +1,52 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
({ theme: r, $active: l }) => `
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { memo as p, useCallback as a } from "react";
|
|
3
|
+
import d from "styled-components";
|
|
4
|
+
import m from "../../../../assets/line-icons/icons/scribble.js";
|
|
5
|
+
import u from "../../../ui/buttons/clickable/clickable.js";
|
|
6
|
+
import e from "../../../ui/layout/flex-view.js";
|
|
7
|
+
import b from "../../constants/events.js";
|
|
8
|
+
const f = d(e)(
|
|
9
|
+
({ theme: o, $active: r }) => `
|
|
11
10
|
width: 36px;
|
|
12
11
|
height: 36px;
|
|
13
12
|
border-radius: 50%;
|
|
14
13
|
border: 1px solid black;
|
|
15
14
|
&:hover {
|
|
16
|
-
background-color: ${
|
|
15
|
+
background-color: ${o.colors.BLACK};
|
|
17
16
|
svg path {
|
|
18
|
-
stroke: ${
|
|
17
|
+
stroke: ${o.colors.WHITE};
|
|
19
18
|
}
|
|
20
19
|
}
|
|
21
|
-
background-color: ${
|
|
20
|
+
background-color: ${r ? o.colors.BLACK : o.colors.WHITE};
|
|
22
21
|
justify-content: center;
|
|
23
22
|
align-items: center;
|
|
24
23
|
svg path {
|
|
25
|
-
stroke: ${
|
|
24
|
+
stroke: ${r ? o.colors.WHITE : o.colors.BLACK};
|
|
26
25
|
}
|
|
27
26
|
`
|
|
28
|
-
),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
scribbling_enabled: e
|
|
27
|
+
), g = p(function({
|
|
28
|
+
isScribblingEnabled: r,
|
|
29
|
+
setIsScribblingEnabled: t,
|
|
30
|
+
isCanvasEnabled: i,
|
|
31
|
+
loggerRef: l,
|
|
32
|
+
canToggleScribbling: s = !0
|
|
33
|
+
}) {
|
|
34
|
+
const n = a(() => {
|
|
35
|
+
t(!r), l.current(b.WORKSHEET_V3_SCRIBBLE_TOGGLE, {
|
|
36
|
+
scribbling_enabled: !r
|
|
39
37
|
});
|
|
40
|
-
}, [
|
|
41
|
-
|
|
38
|
+
}, [r, l, t]);
|
|
39
|
+
return i ? /* @__PURE__ */ c(
|
|
40
|
+
u,
|
|
42
41
|
{
|
|
43
42
|
label: "ScribbleSwitch Toggled",
|
|
44
|
-
onClick:
|
|
45
|
-
disabled: !
|
|
46
|
-
children: /* @__PURE__ */
|
|
43
|
+
onClick: n,
|
|
44
|
+
disabled: !s,
|
|
45
|
+
children: /* @__PURE__ */ c(f, { $active: r, children: /* @__PURE__ */ c(m, {}) })
|
|
47
46
|
}
|
|
48
|
-
) : /* @__PURE__ */
|
|
47
|
+
) : /* @__PURE__ */ c(e, { $widthX: 15.25 });
|
|
49
48
|
});
|
|
50
49
|
export {
|
|
51
|
-
|
|
50
|
+
g as default
|
|
52
51
|
};
|
|
53
52
|
//# sourceMappingURL=scribble-switch.js.map
|
package/dist/features/worksheet/worksheet/worksheet-questions-controller/scribble-switch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scribble-switch.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-questions-controller/scribble-switch.tsx"],"sourcesContent":["import { memo,
|
|
1
|
+
{"version":3,"file":"scribble-switch.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-questions-controller/scribble-switch.tsx"],"sourcesContent":["import { memo, useCallback, type FC, type MutableRefObject } from 'react';\nimport styled from 'styled-components';\n\nimport ScribbleIcon from '../../../../assets/line-icons/icons/scribble';\nimport Clickable from '../../../ui/buttons/clickable/clickable';\nimport FlexView from '../../../ui/layout/flex-view';\nimport EVENTS from '../../constants/events';\n\ninterface IScribbleSwitchProps {\n isScribblingEnabled: boolean;\n setIsScribblingEnabled: (enabled: boolean) => void;\n isCanvasEnabled: boolean;\n loggerRef: MutableRefObject<(eventName: string, data?: Record<string, unknown>) => void>;\n canToggleScribbling?: boolean;\n}\n\nconst IconWrapper = styled(FlexView)<{ $active: boolean }>(\n ({ theme, $active }) => `\n width: 36px;\n height: 36px;\n border-radius: 50%;\n border: 1px solid black;\n &:hover {\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 justify-content: center;\n align-items: center;\n svg path {\n stroke: ${$active ? theme.colors.WHITE : theme.colors.BLACK};\n }\n`,\n);\n\nconst ScribbleSwitch: FC<IScribbleSwitchProps> = memo(function ScribbleSwitch({\n isScribblingEnabled,\n setIsScribblingEnabled,\n isCanvasEnabled,\n loggerRef,\n canToggleScribbling = true,\n}) {\n const handleToggleScribble = useCallback(() => {\n setIsScribblingEnabled(!isScribblingEnabled);\n loggerRef.current(EVENTS.WORKSHEET_V3_SCRIBBLE_TOGGLE, {\n scribbling_enabled: !isScribblingEnabled,\n });\n }, [isScribblingEnabled, loggerRef, setIsScribblingEnabled]);\n\n if (!isCanvasEnabled) {\n // This is done to center align the QuestionNavBar for worksheets for whom scribbling is not enabled.\n return <FlexView $widthX={15.25} />;\n }\n\n return (\n <Clickable\n label=\"ScribbleSwitch Toggled\"\n onClick={handleToggleScribble}\n disabled={!canToggleScribbling}\n >\n <IconWrapper $active={isScribblingEnabled}>\n <ScribbleIcon />\n </IconWrapper>\n </Clickable>\n );\n});\n\nexport default ScribbleSwitch;\n"],"names":["IconWrapper","styled","FlexView","theme","$active","ScribbleSwitch","memo","isScribblingEnabled","setIsScribblingEnabled","isCanvasEnabled","loggerRef","canToggleScribbling","handleToggleScribble","useCallback","EVENTS","jsx","Clickable","ScribbleIcon"],"mappings":";;;;;;;AAgBA,MAAMA,IAAcC,EAAOC,CAAQ;AAAA,EACjC,CAAC,EAAE,OAAAC,GAAO,SAAAC,EAAA,MAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAMFD,EAAM,OAAO,KAAK;AAAA;AAAA,gBAE1BA,EAAM,OAAO,KAAK;AAAA;AAAA;AAAA,sBAGZC,IAAUD,EAAM,OAAO,QAAQA,EAAM,OAAO,KAAK;AAAA;AAAA;AAAA;AAAA,cAIzDC,IAAUD,EAAM,OAAO,QAAQA,EAAM,OAAO,KAAK;AAAA;AAAA;AAG/D,GAEME,IAA2CC,EAAK,SAAwB;AAAA,EAC5E,qBAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,qBAAAC,IAAsB;AACxB,GAAG;AACK,QAAAC,IAAuBC,EAAY,MAAM;AAC7C,IAAAL,EAAuB,CAACD,CAAmB,GACjCG,EAAA,QAAQI,EAAO,8BAA8B;AAAA,MACrD,oBAAoB,CAACP;AAAA,IAAA,CACtB;AAAA,EACA,GAAA,CAACA,GAAqBG,GAAWF,CAAsB,CAAC;AAE3D,SAAKC,IAMH,gBAAAM;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,OAAM;AAAA,MACN,SAASJ;AAAA,MACT,UAAU,CAACD;AAAA,MAEX,4BAACX,GAAY,EAAA,SAASO,GACpB,UAAA,gBAAAQ,EAACE,IAAa,CAAA,GAChB;AAAA,IAAA;AAAA,EAAA,IAXK,gBAAAF,EAACb,GAAS,EAAA,SAAS,MAAO,CAAA;AAcrC,CAAC;"}
|
package/dist/features/worksheet/worksheet/worksheet-questions-controller/use-handler-callbacks.js
CHANGED
|
@@ -1,191 +1,193 @@
|
|
|
1
|
-
import { useCallback as
|
|
2
|
-
import { useErrorBoundary as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { SYSTEM_VALIDATION_AUDIO_LIST as
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
const me = (v) => {
|
|
1
|
+
import { useCallback as c } from "react";
|
|
2
|
+
import { useErrorBoundary as ot } from "react-error-boundary";
|
|
3
|
+
import it from "../../../hooks/use-audio-player.js";
|
|
4
|
+
import ct from "../../constants/events.js";
|
|
5
|
+
import { SYSTEM_VALIDATION_AUDIO_LIST as rt } from "../constants.js";
|
|
6
|
+
import { isOkayTypeQuestion as v, getQuestionMetadata as f, scrollToQuestion as z, checkIsClozeFormulaResponseInvalid as ut } from "../worksheet-helpers.js";
|
|
7
|
+
const kt = (B) => {
|
|
9
8
|
const {
|
|
10
|
-
behavior:
|
|
11
|
-
layout:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
questionIndex:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
loggerRef: E,
|
|
23
|
-
onHelp: k
|
|
24
|
-
} = se((e) => ({
|
|
25
|
-
behavior: e.behavior,
|
|
26
|
-
layout: e.layout,
|
|
27
|
-
questions: e.questions,
|
|
28
|
-
questionIndex: e.activeQuestionIndex,
|
|
29
|
-
setResponses: e.setResponses,
|
|
30
|
-
updateResponse: e.updateResponse,
|
|
31
|
-
onResponseChange: e.onResponseChange,
|
|
32
|
-
showSummary: e.showSummary,
|
|
33
|
-
changeQuestion: e.changeQuestion,
|
|
34
|
-
setBlocker: e.setBlocker,
|
|
35
|
-
onTeacherValidation: e.onTeacherValidation,
|
|
36
|
-
learnosity: e.learnosity,
|
|
37
|
-
loggerRef: e.loggerRef,
|
|
38
|
-
onHelp: e.onHelp
|
|
39
|
-
})), { question: C, getTimeSpentOnQuestion: I, setSkipped: q } = v, { questionsScrollable: M } = L, { response_id: t, item_type: U, question_number: b, item_number: g, total_questions: x } = C, A = U === "exit-ticket", { validation: w, teacherValidationEnabled: D } = V, _ = ee(ne), { showBoundary: N } = J(), R = a(() => {
|
|
40
|
-
const e = l.question(t);
|
|
41
|
-
e && w && !Q(e.getQuestion()) && e.getScore((n) => {
|
|
42
|
-
const { max_score: i, score: c } = n || {};
|
|
43
|
-
i && _(i === c ? "CORRECT" : "INCORRECT");
|
|
9
|
+
behavior: F,
|
|
10
|
+
layout: P,
|
|
11
|
+
learnosity: a,
|
|
12
|
+
question: C,
|
|
13
|
+
questionIndex: k,
|
|
14
|
+
questions: o,
|
|
15
|
+
getTimeSpentOnQuestion: b
|
|
16
|
+
} = B, { setResponses: l, setSummaryVisible: q, setActiveQuestionId: S, setBlocker: d, setSkipped: N } = B, { onHelp: _, onResponseChange: n, onTeacherValidation: E, loggerRef: x } = B, { questionsScrollable: m } = P, { response_id: e, item_type: X, question_number: w, item_number: T, total_questions: H } = C, O = X === "exit-ticket", { validation: Q, teacherValidationEnabled: $ } = F, y = it(rt), { showBoundary: L } = ot(), V = c(() => {
|
|
17
|
+
const t = a.question(e);
|
|
18
|
+
t && Q && !v(t.getQuestion()) && t.getScore((s) => {
|
|
19
|
+
const { max_score: i, score: r } = s || {};
|
|
20
|
+
i && y(i === r ? "CORRECT" : "INCORRECT");
|
|
44
21
|
});
|
|
45
|
-
}, [
|
|
46
|
-
(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
...
|
|
22
|
+
}, [a, y, e, Q]), g = c(
|
|
23
|
+
(t, s, i, r) => {
|
|
24
|
+
const h = b(e);
|
|
25
|
+
l((A) => {
|
|
26
|
+
const u = A[t], I = !!r, D = {
|
|
27
|
+
...f(o, t),
|
|
28
|
+
...u,
|
|
29
|
+
response: s,
|
|
30
|
+
score: i,
|
|
31
|
+
responseEdited: !I,
|
|
32
|
+
attemptsHistory: I ? [...(u == null ? void 0 : u.attemptsHistory) ?? [], { response: s, score: i }] : u == null ? void 0 : u.attemptsHistory,
|
|
33
|
+
skipped: !s,
|
|
34
|
+
timeSpent: h
|
|
35
|
+
};
|
|
36
|
+
return n == null || n({
|
|
37
|
+
responseId: t,
|
|
38
|
+
response: D,
|
|
39
|
+
question: o.find((nt) => nt.response_id === t),
|
|
40
|
+
isNewAttempt: I
|
|
41
|
+
}), {
|
|
42
|
+
...A,
|
|
43
|
+
[t]: D
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
[b, n, o, e, l]
|
|
48
|
+
), M = c(
|
|
49
|
+
(t, s) => {
|
|
50
|
+
l((i) => {
|
|
51
|
+
const r = {
|
|
52
|
+
...f(o, t),
|
|
53
|
+
...i[t],
|
|
51
54
|
validatedByTeacher: !0,
|
|
52
|
-
rating:
|
|
55
|
+
rating: s
|
|
53
56
|
};
|
|
54
|
-
return
|
|
55
|
-
responseId:
|
|
56
|
-
response:
|
|
57
|
-
question:
|
|
57
|
+
return n == null || n({
|
|
58
|
+
responseId: t,
|
|
59
|
+
response: r,
|
|
60
|
+
question: o.find((h) => h.response_id === t),
|
|
58
61
|
isNewAttempt: !1
|
|
59
62
|
}), {
|
|
60
63
|
...i,
|
|
61
|
-
[
|
|
64
|
+
[t]: r
|
|
62
65
|
};
|
|
63
66
|
});
|
|
64
67
|
},
|
|
65
|
-
[
|
|
66
|
-
),
|
|
67
|
-
|
|
68
|
-
questionId:
|
|
69
|
-
questionNumber: `${
|
|
68
|
+
[n, o, l]
|
|
69
|
+
), G = c(() => {
|
|
70
|
+
_ && C && _({
|
|
71
|
+
questionId: e,
|
|
72
|
+
questionNumber: `${T + 1}${H > 1 ? String.fromCharCode(97 + w) : ""}`
|
|
70
73
|
});
|
|
71
|
-
}, [
|
|
72
|
-
|
|
74
|
+
}, [T, _, C, w, e, H]), K = c(() => {
|
|
75
|
+
x.current(ct.WORKSHEET_V3_HINT_SEEN), l((t) => {
|
|
73
76
|
var i;
|
|
74
|
-
const
|
|
75
|
-
...
|
|
76
|
-
...e
|
|
77
|
-
hintsUsed: (((i = e
|
|
77
|
+
const s = {
|
|
78
|
+
...f(o, e),
|
|
79
|
+
...t[e],
|
|
80
|
+
hintsUsed: (((i = t[e]) == null ? void 0 : i.hintsUsed) ?? 0) + 1
|
|
78
81
|
};
|
|
79
|
-
return
|
|
80
|
-
responseId:
|
|
81
|
-
response:
|
|
82
|
-
question:
|
|
82
|
+
return n == null || n({
|
|
83
|
+
responseId: e,
|
|
84
|
+
response: s,
|
|
85
|
+
question: o.find((r) => r.response_id === e),
|
|
83
86
|
isNewAttempt: !1
|
|
84
87
|
}), {
|
|
85
|
-
...
|
|
86
|
-
[
|
|
88
|
+
...t,
|
|
89
|
+
[e]: s
|
|
87
90
|
};
|
|
88
91
|
});
|
|
89
|
-
}, [
|
|
90
|
-
var
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
}, [
|
|
94
|
-
var
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
}, [
|
|
98
|
-
|
|
99
|
-
const
|
|
100
|
-
...
|
|
101
|
-
...e
|
|
92
|
+
}, [x, n, o, e, l]), R = c(() => {
|
|
93
|
+
var s;
|
|
94
|
+
const t = (s = o[k - 1]) == null ? void 0 : s.response_id;
|
|
95
|
+
t && (m ? z(t) : S(t));
|
|
96
|
+
}, [k, o, m, S]), W = c(() => {
|
|
97
|
+
var s;
|
|
98
|
+
const t = (s = o[k + 1]) == null ? void 0 : s.response_id;
|
|
99
|
+
t ? m ? z(t) : S(t) : q(!0);
|
|
100
|
+
}, [k, o, m, S, q]), Y = c(() => {
|
|
101
|
+
l((t) => {
|
|
102
|
+
const s = {
|
|
103
|
+
...f(o, e),
|
|
104
|
+
...t[e],
|
|
102
105
|
skipped: !0
|
|
103
106
|
};
|
|
104
|
-
return
|
|
105
|
-
responseId:
|
|
106
|
-
response:
|
|
107
|
-
question:
|
|
107
|
+
return n == null || n({
|
|
108
|
+
responseId: e,
|
|
109
|
+
response: s,
|
|
110
|
+
question: o.find((i) => i.response_id === e),
|
|
108
111
|
isNewAttempt: !1
|
|
109
112
|
}), {
|
|
110
|
-
...
|
|
111
|
-
[
|
|
113
|
+
...t,
|
|
114
|
+
[e]: s
|
|
112
115
|
};
|
|
113
|
-
}),
|
|
114
|
-
}, [
|
|
115
|
-
(
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
118
|
-
const i =
|
|
119
|
-
(i.type === "clozeformula" &&
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
116
|
+
}), N(!0);
|
|
117
|
+
}, [n, o, e, l, N]), p = c(
|
|
118
|
+
(t) => {
|
|
119
|
+
const s = a.question(e);
|
|
120
|
+
if (s) {
|
|
121
|
+
const i = s.getQuestion(), r = s.getResponse();
|
|
122
|
+
(i.type === "clozeformula" && r && (r == null ? void 0 : r.value) ? ut(r) : !1) && L(new Error("CLOZE_FORMULA_RESPONSE_EXCEEDS_MAX_LENGTH")), s.getScore((u) => {
|
|
123
|
+
g(
|
|
124
|
+
e,
|
|
125
|
+
r,
|
|
126
|
+
v(i) || !u ? {
|
|
124
127
|
max_score: 0,
|
|
125
128
|
score: 0,
|
|
126
|
-
unscored: !
|
|
129
|
+
unscored: !u
|
|
127
130
|
// score will be null for unscored questions
|
|
128
|
-
} : { ...
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
});
|
|
131
|
+
} : { ...u, score: u.score ?? 0 },
|
|
132
|
+
t
|
|
133
|
+
);
|
|
132
134
|
});
|
|
133
135
|
}
|
|
134
136
|
},
|
|
135
|
-
[
|
|
136
|
-
),
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
}, [
|
|
140
|
-
|
|
141
|
-
}, [
|
|
142
|
-
const
|
|
143
|
-
|
|
137
|
+
[a, e, L, g]
|
|
138
|
+
), Z = c(() => {
|
|
139
|
+
const t = a.question(e);
|
|
140
|
+
t && (t.enable(), t.resetValidationUI(), p());
|
|
141
|
+
}, [p, a, e]), U = c(() => {
|
|
142
|
+
V(), p(!0);
|
|
143
|
+
}, [p, V]), j = c(() => {
|
|
144
|
+
const t = a.question(e);
|
|
145
|
+
t && (t.disable(), t.validate(
|
|
144
146
|
{
|
|
145
147
|
feedbackAttempts: !0
|
|
146
148
|
},
|
|
147
|
-
|
|
149
|
+
U
|
|
148
150
|
));
|
|
149
|
-
}, [
|
|
150
|
-
|
|
151
|
-
}, [
|
|
152
|
-
|
|
153
|
-
}, [
|
|
154
|
-
|
|
155
|
-
const
|
|
156
|
-
...
|
|
157
|
-
...e
|
|
151
|
+
}, [U, a, e]), J = c(() => {
|
|
152
|
+
O ? d("exit-ticket-review") : E == null || E(e);
|
|
153
|
+
}, [O, E, e, d]), tt = c(() => {
|
|
154
|
+
M(e);
|
|
155
|
+
}, [e, M]), et = c(() => {
|
|
156
|
+
l((t) => {
|
|
157
|
+
const s = {
|
|
158
|
+
...f(o, e),
|
|
159
|
+
...t[e],
|
|
158
160
|
submittedByStudent: !0
|
|
159
161
|
};
|
|
160
|
-
return
|
|
161
|
-
responseId:
|
|
162
|
-
response:
|
|
163
|
-
question:
|
|
162
|
+
return n == null || n({
|
|
163
|
+
responseId: e,
|
|
164
|
+
response: s,
|
|
165
|
+
question: o.find((i) => i.response_id === e),
|
|
164
166
|
isNewAttempt: !1
|
|
165
167
|
}), {
|
|
166
|
-
...
|
|
167
|
-
[
|
|
168
|
+
...t,
|
|
169
|
+
[e]: s
|
|
168
170
|
};
|
|
169
|
-
}),
|
|
170
|
-
}, [
|
|
171
|
-
|
|
172
|
-
}, [
|
|
171
|
+
}), d("exit-ticket-student-submission");
|
|
172
|
+
}, [n, o, e, d, l]), st = c(() => {
|
|
173
|
+
d("optional-items-skip");
|
|
174
|
+
}, [d]);
|
|
173
175
|
return {
|
|
174
|
-
handleResponseChange:
|
|
175
|
-
handleHelpButtonClick:
|
|
176
|
-
handleHintButtonClick:
|
|
177
|
-
handleBackButtonClick: !
|
|
176
|
+
handleResponseChange: p,
|
|
177
|
+
handleHelpButtonClick: _ ? G : void 0,
|
|
178
|
+
handleHintButtonClick: K,
|
|
179
|
+
handleBackButtonClick: !m && !$ ? R : void 0,
|
|
178
180
|
handleNextButtonClick: W,
|
|
179
|
-
handleRetryButtonClick:
|
|
180
|
-
handleCheckButtonClick:
|
|
181
|
-
handleValidateButtonClick:
|
|
182
|
-
handleStartButtonClick:
|
|
183
|
-
handleReadyButtonClick:
|
|
184
|
-
handleSkipSectionButtonClick:
|
|
185
|
-
handleSkipButtonClick:
|
|
181
|
+
handleRetryButtonClick: Z,
|
|
182
|
+
handleCheckButtonClick: j,
|
|
183
|
+
handleValidateButtonClick: J,
|
|
184
|
+
handleStartButtonClick: tt,
|
|
185
|
+
handleReadyButtonClick: et,
|
|
186
|
+
handleSkipSectionButtonClick: st,
|
|
187
|
+
handleSkipButtonClick: Y
|
|
186
188
|
};
|
|
187
189
|
};
|
|
188
190
|
export {
|
|
189
|
-
|
|
191
|
+
kt as default
|
|
190
192
|
};
|
|
191
193
|
//# sourceMappingURL=use-handler-callbacks.js.map
|