@cuemath/leap 4.0.9-as1 → 4.1.1-beta.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.
Files changed (20) hide show
  1. package/dist/features/math-fit/math-fit-report/comps/score-section/score-section.js +35 -34
  2. package/dist/features/math-fit/math-fit-report/comps/score-section/score-section.js.map +1 -1
  3. package/dist/features/timeline/monthly-timeline/ptm-report/comps/ptm-feedback/ptm-feedback-styled.js +16 -0
  4. package/dist/features/timeline/monthly-timeline/ptm-report/comps/ptm-feedback/ptm-feedback-styled.js.map +1 -0
  5. package/dist/features/timeline/monthly-timeline/ptm-report/comps/ptm-feedback/ptm-feedback.js +56 -0
  6. package/dist/features/timeline/monthly-timeline/ptm-report/comps/ptm-feedback/ptm-feedback.js.map +1 -0
  7. package/dist/features/timeline/monthly-timeline/ptm-report/comps/sticky-footer/sticky-footer-styled.js +22 -0
  8. package/dist/features/timeline/monthly-timeline/ptm-report/comps/sticky-footer/sticky-footer-styled.js.map +1 -0
  9. package/dist/features/timeline/monthly-timeline/ptm-report/comps/sticky-footer/sticky-footer.js +14 -0
  10. package/dist/features/timeline/monthly-timeline/ptm-report/comps/sticky-footer/sticky-footer.js.map +1 -0
  11. package/dist/features/timeline/monthly-timeline/ptm-report/ptm-report-types.js.map +1 -1
  12. package/dist/features/timeline/monthly-timeline/ptm-report/ptm-report.js +113 -97
  13. package/dist/features/timeline/monthly-timeline/ptm-report/ptm-report.js.map +1 -1
  14. package/dist/features/worksheet/worksheet/worksheet-helpers.js +47 -55
  15. package/dist/features/worksheet/worksheet/worksheet-helpers.js.map +1 -1
  16. package/dist/features/worksheet/worksheet/worksheet-types.js.map +1 -1
  17. package/dist/features/worksheet/worksheet-preview/worksheet-preview-view.js +69 -64
  18. package/dist/features/worksheet/worksheet-preview/worksheet-preview-view.js.map +1 -1
  19. package/dist/index.d.ts +4 -0
  20. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ptm-report.js","sources":["../../../../../src/features/timeline/monthly-timeline/ptm-report/ptm-report.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, type FC } from 'react';\n\nimport { usePTMReportGet } from './api/use-ptm-report-get';\nimport { EPTMTypes, type IPTMReportProps } from './ptm-report-types';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport StudentInfo from './comps/student-info/student-info';\nimport * as Styled from './ptm-report-styled';\nimport KeyNeed from './comps/key-need/key-need';\nimport FlexView from '../../../ui/layout/flex-view';\nimport TeacherObservations from './comps/teacher-observations/teacher-observations';\nimport Strategies from './comps/strategies/strategies';\nimport ParentSupport from './comps/parent-support/parent-support';\nimport UpcomingChapters from './comps/upcoming-chapters/upcoming-chapters';\nimport RealWorldProjects from './comps/real-world-projects/real-world-projects';\nimport SchoolSupport from './comps/school-support/school-support';\nimport Error from '../../../ui/error/error';\n\nconst PTMReport: FC<IPTMReportProps> = ({ ptmId, onAPIComplete }) => {\n const {\n get: getPTMReport,\n data: ptmReportData,\n isProcessing,\n isProcessed,\n isProcessingFailed,\n } = usePTMReportGet(ptmId);\n\n const fetchPTMReport = useCallback(() => {\n getPTMReport(ptmId);\n }, [getPTMReport, ptmId]);\n\n useEffect(() => {\n fetchPTMReport();\n }, [fetchPTMReport]);\n\n useEffect(() => {\n if (isProcessed || isProcessingFailed) {\n onAPIComplete?.(isProcessed && !isProcessingFailed);\n }\n }, [isProcessed, isProcessingFailed, onAPIComplete]);\n\n if (isProcessing || !ptmReportData) {\n return <AppLoader height=\"100dvh\" />;\n }\n\n if (isProcessingFailed) {\n return <Error onTryAgain={fetchPTMReport} height=\"100dvh\" />;\n }\n\n const { ptm_config: ptmConfig, report } = ptmReportData;\n const { ptm_type: ptmType, config } = ptmConfig || {};\n const { ptm_report_sections: sectionsConfig, late_if_minutes: lateIfMinutes } = config || {};\n\n const {\n teacher_observation: teacherObservationConfig,\n learning_strategy: strategyConfig,\n parent_support: parentSupportConfig,\n school_support: schoolSupportConfig,\n } = sectionsConfig || {};\n\n const { subsections: schoolSubsections } = schoolSupportConfig || {};\n const { homework_help: homeworkConfig, test_help: testConfig } = schoolSubsections || {};\n\n const { options: parentOptions } = parentSupportConfig || {};\n const { strategies: strategiesConfig } = strategyConfig || {};\n const { subsections: teacherSubsections } = teacherObservationConfig || {};\n\n const {\n focus_area: focusAreaConfig,\n strengths: strengthsConfig,\n teacher_remarks: remarksConfig,\n } = teacherSubsections || {};\n\n const { areas: focusAreas = [], report_tag: focusAreaTag } = focusAreaConfig || {};\n const { areas: strengthAreas = [] } = strengthsConfig || {};\n const { report_tag: remarksTag } = remarksConfig || {};\n\n const { report_sections: reportSections, student_data: studentData } = report;\n\n const {\n teacher_observation: teacherObservationReport,\n parent_support: parentSupportReport,\n strategies: strategiesReport,\n real_world_project: realWorldReport,\n school_support: schoolSupportReport,\n upcoming_chapters: upcomingChaptersReport,\n } = reportSections || {};\n\n const { homework_help: homeworkReport, test_help: testReport } = schoolSupportReport || {};\n\n const { upcoming_chapters: upcomingChapters } = upcomingChaptersReport || {};\n\n const {\n strengths: strengthsReport = {},\n focus_area: selectedFocusAreaKey,\n teacher_remarks: teacherRemarks,\n } = teacherObservationReport || {};\n\n const {\n first_name: studentName,\n grade: studentGrade,\n key_need: keyNeedData,\n attendance_data: attendanceData,\n homework_data: homeworkData,\n late_class_data: lateClasses = [],\n real_world_project: realWorldProjectData,\n } = studentData || {};\n\n const { classes_completed: completedClasses, weeks_completed: completedWeeks } =\n attendanceData || {};\n\n const { sheets_assigned: assignedSheets, sheets_not_completed: incompleteSheets } =\n homeworkData || {};\n\n const selectedFocusArea = focusAreas.find(\n ({ area_key: areaKey }) => areaKey === selectedFocusAreaKey,\n );\n\n const keyNeedText = keyNeedData?.key_need ?? '';\n const isOnDemandPTM = ptmType === EPTMTypes.ON_DEMAND;\n const lateClassesCount = lateClasses.length;\n const isUpgradePTM = ptmType && ptmType.split('_').includes('UPGRADE');\n const isUpgradeOrOnDemandPTM = isOnDemandPTM || isUpgradePTM;\n\n return (\n <Styled.Container>\n <StudentInfo name={studentName} grade={studentGrade} />\n <FlexView $gutterX={1} $gapX={1}>\n <KeyNeed text={keyNeedText} />\n {isUpgradeOrOnDemandPTM && (\n <>\n <RealWorldProjects projectReport={realWorldReport} projectInfo={realWorldProjectData} />\n <SchoolSupport\n homeworkHelpReport={homeworkReport}\n homeworkHelpConfig={homeworkConfig}\n testHelpReport={testReport}\n testHelpConfig={testConfig}\n studentName={studentName}\n isOnDemandPTM={isOnDemandPTM}\n />\n </>\n )}\n <TeacherObservations\n strengthAreas={strengthAreas}\n strengthsReport={strengthsReport}\n focusArea={selectedFocusArea}\n focusAreaReportTag={focusAreaTag}\n teacherRemarks={teacherRemarks}\n teacherRemarkTag={remarksTag}\n />\n <Strategies report={strategiesReport} strategyConfig={strategiesConfig} />\n <ParentSupport\n report={parentSupportReport}\n options={parentOptions}\n classesCompleted={completedClasses}\n weeksCompleted={completedWeeks}\n sheetsAssigned={assignedSheets}\n sheetsNotCompleted={incompleteSheets}\n lateClassesCount={lateClassesCount}\n lateIfMinutes={lateIfMinutes}\n />\n {isOnDemandPTM && <UpcomingChapters chapters={upcomingChapters} />}\n </FlexView>\n </Styled.Container>\n );\n};\n\nexport default memo(PTMReport);\n"],"names":["PTMReport","ptmId","onAPIComplete","getPTMReport","ptmReportData","isProcessing","isProcessed","isProcessingFailed","usePTMReportGet","fetchPTMReport","useCallback","useEffect","jsx","AppLoader","Error","ptmConfig","report","ptmType","config","sectionsConfig","lateIfMinutes","teacherObservationConfig","strategyConfig","parentSupportConfig","schoolSupportConfig","schoolSubsections","homeworkConfig","testConfig","parentOptions","strategiesConfig","teacherSubsections","focusAreaConfig","strengthsConfig","remarksConfig","focusAreas","focusAreaTag","strengthAreas","remarksTag","reportSections","studentData","teacherObservationReport","parentSupportReport","strategiesReport","realWorldReport","schoolSupportReport","upcomingChaptersReport","homeworkReport","testReport","upcomingChapters","strengthsReport","selectedFocusAreaKey","teacherRemarks","studentName","studentGrade","keyNeedData","attendanceData","homeworkData","lateClasses","realWorldProjectData","completedClasses","completedWeeks","assignedSheets","incompleteSheets","selectedFocusArea","areaKey","keyNeedText","isOnDemandPTM","EPTMTypes","lateClassesCount","isUpgradePTM","jsxs","Styled.Container","StudentInfo","FlexView","KeyNeed","Fragment","RealWorldProjects","SchoolSupport","TeacherObservations","Strategies","ParentSupport","UpcomingChapters","ptmReport","memo"],"mappings":";;;;;;;;;;;;;;;;AAiBA,MAAMA,KAAiC,CAAC,EAAE,OAAAC,GAAO,eAAAC,QAAoB;AAC7D,QAAA;AAAA,IACJ,KAAKC;AAAA,IACL,MAAMC;AAAA,IACN,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,oBAAAC;AAAA,EAAA,IACEC,GAAgBP,CAAK,GAEnBQ,IAAiBC,GAAY,MAAM;AACvC,IAAAP,EAAaF,CAAK;AAAA,EAAA,GACjB,CAACE,GAAcF,CAAK,CAAC;AAYpB,MAVJU,EAAU,MAAM;AACC,IAAAF;EAAA,GACd,CAACA,CAAc,CAAC,GAEnBE,EAAU,MAAM;AACd,KAAIL,KAAeC,OACDL,KAAA,QAAAA,EAAAI,KAAe,CAACC;AAAA,EAEjC,GAAA,CAACD,GAAaC,GAAoBL,CAAa,CAAC,GAE/CG,KAAgB,CAACD;AACZ,WAAA,gBAAAQ,EAACC,IAAU,EAAA,QAAO,SAAS,CAAA;AAGpC,MAAIN;AACF,WAAQ,gBAAAK,EAAAE,IAAA,EAAM,YAAYL,GAAgB,QAAO,SAAS,CAAA;AAG5D,QAAM,EAAE,YAAYM,GAAW,QAAAC,EAAA,IAAWZ,GACpC,EAAE,UAAUa,GAAS,QAAAC,EAAO,IAAIH,KAAa,CAAA,GAC7C,EAAE,qBAAqBI,GAAgB,iBAAiBC,EAAc,IAAIF,KAAU,IAEpF;AAAA,IACJ,qBAAqBG;AAAA,IACrB,mBAAmBC;AAAA,IACnB,gBAAgBC;AAAA,IAChB,gBAAgBC;AAAA,EAAA,IACdL,KAAkB,CAAA,GAEhB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AA,UAChB,oBAAoBC;AAAA,UACpB,kBAAAM;AAAA,UACA,eAAAhD;AAAA,QAAA;AAAA,MACF;AAAA,MACC8C,KAAiB,gBAAAtD,EAACqE,IAAiB,EAAA,UAAUjC,EAAkB,CAAA;AAAA,IAAA,GAClE;AAAA,EACF,EAAA,CAAA;AAEJ,GAEekC,KAAAC,GAAKnF,EAAS;"}
1
+ {"version":3,"file":"ptm-report.js","sources":["../../../../../src/features/timeline/monthly-timeline/ptm-report/ptm-report.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, useState, type FC } from 'react';\n\nimport { usePTMReportGet } from './api/use-ptm-report-get';\nimport { EPTMTypes, type IPTMReportProps } from './ptm-report-types';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport StudentInfo from './comps/student-info/student-info';\nimport * as Styled from './ptm-report-styled';\nimport KeyNeed from './comps/key-need/key-need';\nimport FlexView from '../../../ui/layout/flex-view';\nimport TeacherObservations from './comps/teacher-observations/teacher-observations';\nimport Strategies from './comps/strategies/strategies';\nimport ParentSupport from './comps/parent-support/parent-support';\nimport UpcomingChapters from './comps/upcoming-chapters/upcoming-chapters';\nimport RealWorldProjects from './comps/real-world-projects/real-world-projects';\nimport SchoolSupport from './comps/school-support/school-support';\nimport Error from '../../../ui/error/error';\nimport StickyFooter from './comps/sticky-footer/sticky-footer';\nimport Separator from '../../../ui/separator/separator';\n// import { IS_APP_RUNNING_IN_RN } from '../../../../constants/app-config';\n\nconst PTMReport: FC<IPTMReportProps> = ({ ptmId, onAPIComplete, onFeedback }) => {\n const [feedback, setFeedback] = useState<'positive' | 'negative' | null>(null);\n const {\n get: getPTMReport,\n data: ptmReportData,\n isProcessing,\n isProcessed,\n isProcessingFailed,\n } = usePTMReportGet(ptmId);\n\n const handleFeedback = useCallback((type: 'positive' | 'negative') => {\n setFeedback(type);\n }, []);\n\n const handleSubmit = useCallback(() => {\n if (onFeedback && feedback) {\n onFeedback(feedback, ptmId);\n }\n }, [feedback, ptmId, onFeedback]);\n\n const fetchPTMReport = useCallback(() => {\n getPTMReport(ptmId);\n }, [getPTMReport, ptmId]);\n\n useEffect(() => {\n fetchPTMReport();\n }, [fetchPTMReport]);\n\n useEffect(() => {\n if (isProcessed || isProcessingFailed) {\n onAPIComplete?.(isProcessed && !isProcessingFailed);\n }\n }, [isProcessed, isProcessingFailed, onAPIComplete]);\n\n useEffect(() => {\n if (feedback) {\n // eslint-disable-next-line no-console\n console.log('submitting feedback:', feedback);\n handleSubmit();\n }\n }, [feedback, handleSubmit]);\n\n if (isProcessing || !ptmReportData) {\n return <AppLoader height=\"100dvh\" />;\n }\n\n if (isProcessingFailed) {\n return <Error onTryAgain={fetchPTMReport} height=\"100dvh\" />;\n }\n\n const {\n ptm_config: ptmConfig,\n report,\n // is_feedback_submitted: isFeedbackSubmitted = true,\n } = ptmReportData;\n const { ptm_type: ptmType, config } = ptmConfig || {};\n const { ptm_report_sections: sectionsConfig, late_if_minutes: lateIfMinutes } = config || {};\n\n const {\n teacher_observation: teacherObservationConfig,\n learning_strategy: strategyConfig,\n parent_support: parentSupportConfig,\n school_support: schoolSupportConfig,\n } = sectionsConfig || {};\n\n const { subsections: schoolSubsections } = schoolSupportConfig || {};\n const { homework_help: homeworkConfig, test_help: testConfig } = schoolSubsections || {};\n\n const { options: parentOptions } = parentSupportConfig || {};\n const { strategies: strategiesConfig } = strategyConfig || {};\n const { subsections: teacherSubsections } = teacherObservationConfig || {};\n\n const {\n focus_area: focusAreaConfig,\n strengths: strengthsConfig,\n teacher_remarks: remarksConfig,\n } = teacherSubsections || {};\n\n const { areas: focusAreas = [], report_tag: focusAreaTag } = focusAreaConfig || {};\n const { areas: strengthAreas = [] } = strengthsConfig || {};\n const { report_tag: remarksTag } = remarksConfig || {};\n\n const { report_sections: reportSections, student_data: studentData } = report;\n\n const {\n teacher_observation: teacherObservationReport,\n parent_support: parentSupportReport,\n strategies: strategiesReport,\n real_world_project: realWorldReport,\n school_support: schoolSupportReport,\n upcoming_chapters: upcomingChaptersReport,\n } = reportSections || {};\n\n const { homework_help: homeworkReport, test_help: testReport } = schoolSupportReport || {};\n\n const { upcoming_chapters: upcomingChapters } = upcomingChaptersReport || {};\n\n const {\n strengths: strengthsReport = {},\n focus_area: selectedFocusAreaKey,\n teacher_remarks: teacherRemarks,\n } = teacherObservationReport || {};\n\n const {\n first_name: studentName,\n grade: studentGrade,\n key_need: keyNeedData,\n attendance_data: attendanceData,\n homework_data: homeworkData,\n late_class_data: lateClasses = [],\n real_world_project: realWorldProjectData,\n } = studentData || {};\n\n const { classes_completed: completedClasses, weeks_completed: completedWeeks } =\n attendanceData || {};\n\n const { sheets_assigned: assignedSheets, sheets_not_completed: incompleteSheets } =\n homeworkData || {};\n\n const selectedFocusArea = focusAreas.find(\n ({ area_key: areaKey }) => areaKey === selectedFocusAreaKey,\n );\n\n const keyNeedText = keyNeedData?.key_need ?? '';\n const isOnDemandPTM = ptmType === EPTMTypes.ON_DEMAND;\n const lateClassesCount = lateClasses.length;\n const isUpgradePTM = ptmType && ptmType.split('_').includes('UPGRADE');\n const isUpgradeOrOnDemandPTM = isOnDemandPTM || isUpgradePTM;\n const showFeedback = true; // isOnDemandPTM || isUpgradePTM;\n\n return (\n <Styled.Container>\n <StudentInfo name={studentName} grade={studentGrade} />\n <FlexView $gutterX={1} $gapX={1}>\n <KeyNeed text={keyNeedText} />\n {isUpgradeOrOnDemandPTM && (\n <>\n <RealWorldProjects projectReport={realWorldReport} projectInfo={realWorldProjectData} />\n <SchoolSupport\n homeworkHelpReport={homeworkReport}\n homeworkHelpConfig={homeworkConfig}\n testHelpReport={testReport}\n testHelpConfig={testConfig}\n studentName={studentName}\n isOnDemandPTM={isOnDemandPTM}\n />\n </>\n )}\n <TeacherObservations\n strengthAreas={strengthAreas}\n strengthsReport={strengthsReport}\n focusArea={selectedFocusArea}\n focusAreaReportTag={focusAreaTag}\n teacherRemarks={teacherRemarks}\n teacherRemarkTag={remarksTag}\n />\n <Strategies report={strategiesReport} strategyConfig={strategiesConfig} />\n <ParentSupport\n report={parentSupportReport}\n options={parentOptions}\n classesCompleted={completedClasses}\n weeksCompleted={completedWeeks}\n sheetsAssigned={assignedSheets}\n sheetsNotCompleted={incompleteSheets}\n lateClassesCount={lateClassesCount}\n lateIfMinutes={lateIfMinutes}\n />\n {isOnDemandPTM && <UpcomingChapters chapters={upcomingChapters} />}\n </FlexView>\n {showFeedback && (\n <>\n <Separator heightX={11} />\n <StickyFooter studentName={studentName} onFeedback={handleFeedback} />\n </>\n )}\n </Styled.Container>\n );\n};\n\nexport default memo(PTMReport);\n"],"names":["PTMReport","ptmId","onAPIComplete","onFeedback","feedback","setFeedback","useState","getPTMReport","ptmReportData","isProcessing","isProcessed","isProcessingFailed","usePTMReportGet","handleFeedback","useCallback","type","handleSubmit","fetchPTMReport","useEffect","jsx","AppLoader","Error","ptmConfig","report","ptmType","config","sectionsConfig","lateIfMinutes","teacherObservationConfig","strategyConfig","parentSupportConfig","schoolSupportConfig","schoolSubsections","homeworkConfig","testConfig","parentOptions","strategiesConfig","teacherSubsections","focusAreaConfig","strengthsConfig","remarksConfig","focusAreas","focusAreaTag","strengthAreas","remarksTag","reportSections","studentData","teacherObservationReport","parentSupportReport","strategiesReport","realWorldReport","schoolSupportReport","upcomingChaptersReport","homeworkReport","testReport","upcomingChapters","strengthsReport","selectedFocusAreaKey","teacherRemarks","studentName","studentGrade","keyNeedData","attendanceData","homeworkData","lateClasses","realWorldProjectData","completedClasses","completedWeeks","assignedSheets","incompleteSheets","selectedFocusArea","areaKey","keyNeedText","isOnDemandPTM","EPTMTypes","lateClassesCount","isUpgradePTM","jsxs","Styled.Container","StudentInfo","FlexView","KeyNeed","Fragment","RealWorldProjects","SchoolSupport","TeacherObservations","Strategies","ParentSupport","UpcomingChapters","Separator","StickyFooter","ptmReport","memo"],"mappings":";;;;;;;;;;;;;;;;;;AAoBA,MAAMA,KAAiC,CAAC,EAAE,OAAAC,GAAO,eAAAC,GAAe,YAAAC,QAAiB;AAC/E,QAA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b;AAAA,UACT,kBAAkB+B;AAAA,UAClB,gBAAgBC;AAAA,UAChB,gBAAgBC;AAAA,UAChB,oBAAoBC;AAAA,UACpB,kBAAAM;AAAA,UACA,eAAAhD;AAAA,QAAA;AAAA,MACF;AAAA,MACC8C,KAAiB,gBAAAtD,EAACqE,IAAiB,EAAA,UAAUjC,GAAkB,CAAA;AAAA,IAAA,GAClE;AAAA,IAGI,gBAAAsB,EAAAK,GAAA,EAAA,UAAA;AAAA,MAAC,gBAAA/D,EAAAsE,IAAA,EAAU,SAAS,GAAI,CAAA;AAAA,MACvB,gBAAAtE,EAAAuE,IAAA,EAAa,aAAA/B,GAA0B,YAAY9C,EAAgB,CAAA;AAAA,IAAA,GACtE;AAAA,EAEJ,EAAA,CAAA;AAEJ,GAEe8E,KAAAC,GAAK5F,EAAS;"}
@@ -1,39 +1,39 @@
1
1
  import _ from "../../../assets/line-icons/icons/bulb2.js";
2
2
  import f from "../../../assets/line-icons/icons/edit-star.js";
3
3
  import E from "../../../assets/line-icons/icons/edit2.js";
4
- import T from "../../../assets/line-icons/icons/practice.js";
4
+ import h from "../../../assets/line-icons/icons/practice.js";
5
5
  import C from "../../../assets/line-icons/icons/question-letter.js";
6
- import I from "../../../assets/line-icons/icons/star2.js";
6
+ import w from "../../../assets/line-icons/icons/star2.js";
7
7
  import s from "../constants/events.js";
8
- import { ACTION_BAR_HEIGHT as h, QUESTION_WIDTH as d, SPLIT_QUESTION_WIDTH as w, CLOZE_FORMULA_RESPONSE_LIMIT as S } from "./constants.js";
9
- const O = ({
8
+ import { ACTION_BAR_HEIGHT as T, QUESTION_WIDTH as d, SPLIT_QUESTION_WIDTH as I, CLOZE_FORMULA_RESPONSE_LIMIT as S } from "./constants.js";
9
+ const k = ({
10
10
  questions: e,
11
11
  initialQuestion: t,
12
12
  initialResponseId: r,
13
13
  initialItemIndex: n,
14
14
  lastUnlockedQuestionIndex: o,
15
- lastAttemptableQuestionIndex: i
15
+ lastAttemptableQuestionIndex: c
16
16
  }) => {
17
17
  var u, l;
18
- const a = e.slice(0, o + 1), m = e[o], g = e[i];
19
- if (r && a.find((c) => c.response_id === r))
18
+ const i = e.slice(0, o + 1), m = e[o], p = e[c];
19
+ if (r && i.find((a) => a.response_id === r))
20
20
  return r;
21
21
  if (typeof n == "number" && n <= m.item_number) {
22
- const c = e.find((p) => p.item_number === n);
23
- if (c != null && c.response_id)
24
- return c.response_id;
22
+ const a = e.find((g) => g.item_number === n);
23
+ if (a != null && a.response_id)
24
+ return a.response_id;
25
25
  }
26
26
  if (t === "FIRST" && ((u = e[0]) != null && u.response_id))
27
27
  return e[0].response_id;
28
28
  if (t === "CURRENT")
29
- return g.response_id;
29
+ return p.response_id;
30
30
  if ((l = e[0]) != null && l.response_id)
31
31
  return e[0].response_id;
32
32
  throw new Error("Initial question not found");
33
33
  };
34
- function A(e, t) {
34
+ function v(e, t) {
35
35
  var n, o;
36
- const r = Array.isArray(e) ? e.find((i) => i.response_id === t) : e;
36
+ const r = Array.isArray(e) ? e.find((c) => c.response_id === t) : e;
37
37
  if (!r)
38
38
  throw new Error(`Question with id ${t} not found`);
39
39
  return {
@@ -41,38 +41,39 @@ function A(e, t) {
41
41
  itemReference: r.item_reference,
42
42
  itemPosition: r.item_number,
43
43
  questionPosition: r.question_number,
44
- isOkayTypeQuestion: b(r),
44
+ isOkayTypeQuestion: A(r),
45
45
  score: {
46
46
  max_score: ((o = (n = r == null ? void 0 : r.validation) == null ? void 0 : n.valid_response) == null ? void 0 : o.score) ?? 0 * r.metadata.valid_response_count
47
47
  },
48
48
  tags: {
49
49
  ...r.item_tags_map,
50
- instructor_stimulus: r.instructor_stimulus
51
- }
50
+ instructor_stimulus: r.instructor_stimulus ?? ""
51
+ },
52
+ distractor_rationale_response_level: r.metadata.distractor_rationale_response_level
52
53
  };
53
54
  }
54
- const W = (e) => e.reduce(
55
+ const x = (e) => e.reduce(
55
56
  (t, r) => ({
56
57
  ...t,
57
- [r.response_id]: A(e, r.response_id)
58
+ [r.response_id]: v(e, r.response_id)
58
59
  }),
59
60
  {}
60
- ), k = (e, t) => {
61
+ ), Q = (e, t) => {
61
62
  const { actionBar: r } = t;
62
63
  return {
63
64
  questionsContainerWidth: !e.some(
64
- (i) => i.questions.some((a) => a.stimulus_review)
65
- ) ? d : w,
65
+ (c) => c.questions.some((i) => i.stimulus_review)
66
+ ) ? d : I,
66
67
  maxQuestionWidth: d,
67
- actionbarHeight: r === "bottom" ? h : 0
68
+ actionbarHeight: r === "bottom" ? T : 0
68
69
  };
69
- }, Q = (e, { animation: t = !1, block: r = "start" } = {}) => {
70
+ }, W = (e, { animation: t = !1, block: r = "start" } = {}) => {
70
71
  const n = document.querySelectorAll(`.widget-${e}`)[0];
71
72
  n && n.scrollIntoView({
72
73
  block: r,
73
74
  behavior: t ? "smooth" : "instant"
74
75
  });
75
- }, b = (e) => {
76
+ }, A = (e) => {
76
77
  const { type: t, options: r, instructor_stimulus: n } = e;
77
78
  return ("item_type" in e ? e.item_type : void 0) === "overview" || n === "Intro" || n === "SystemIntro" || n === "Concept-Intro" ? !0 : t === "mcq" && (r == null ? void 0 : r.length) === 1;
78
79
  }, P = ({
@@ -85,7 +86,7 @@ const W = (e) => e.reduce(
85
86
  return !(n && n.score === n.max_score);
86
87
  }
87
88
  return !1;
88
- }, U = (e) => {
89
+ }, $ = (e) => {
89
90
  window.MathJax = {
90
91
  options: {
91
92
  enableMenu: !1,
@@ -128,7 +129,7 @@ const W = (e) => e.reduce(
128
129
  matchFontHeight: !1
129
130
  }
130
131
  };
131
- }, $ = (e) => {
132
+ }, U = (e) => {
132
133
  const { item_type: t, instructor_stimulus: r } = e, n = r == null ? void 0 : r.toLowerCase();
133
134
  switch (t) {
134
135
  case "overview":
@@ -148,7 +149,7 @@ const W = (e) => e.reduce(
148
149
  default:
149
150
  return n === "learn" ? "blue" : n === "try" || n === "apply" ? "green" : "yellow";
150
151
  }
151
- }, H = (e) => `https://cuemath-intel.s3.ap-southeast-1.amazonaws.com/media/math-canvas/paper-${e}.png`, F = (e, t) => {
152
+ }, F = (e) => `https://cuemath-intel.s3.ap-southeast-1.amazonaws.com/media/math-canvas/paper-${e}.png`, G = (e, t) => {
152
153
  if (!t)
153
154
  return "GREY_3";
154
155
  switch (e) {
@@ -166,7 +167,7 @@ const W = (e) => e.reduce(
166
167
  default:
167
168
  return "GREY_3";
168
169
  }
169
- }, G = (e) => {
170
+ }, H = (e) => {
170
171
  switch (e) {
171
172
  case "learning":
172
173
  return "BLUE_1";
@@ -203,7 +204,7 @@ const W = (e) => e.reduce(
203
204
  case "learning":
204
205
  return _;
205
206
  case "practice":
206
- return T;
207
+ return h;
207
208
  case "practice-basic":
208
209
  return E;
209
210
  case "practice-regular":
@@ -211,7 +212,7 @@ const W = (e) => e.reduce(
211
212
  case "exit-ticket":
212
213
  return C;
213
214
  case "advanced":
214
- return I;
215
+ return w;
215
216
  default:
216
217
  return _;
217
218
  }
@@ -220,28 +221,19 @@ const W = (e) => e.reduce(
220
221
  ) : !1, D = ({
221
222
  isPuzzleWorksheet: e,
222
223
  isTestWorksheet: t,
223
- imageHue: r = "BLUE",
224
- userType: n
224
+ imageHue: r = "BLUE"
225
225
  }) => e ? {
226
226
  bgColor: `${r}_3`,
227
227
  borderColor: `${r}_4`,
228
- textColor: "BLACK_T_87",
229
- alignTextItem: "center"
230
- } : t ? n === "STUDENT" ? {
231
- bgColor: "BLACK",
232
- borderColor: "WHITE_4",
233
- textColor: "WHITE",
234
- alignTextItem: "center"
235
- } : {
228
+ textColor: "BLACK_T_87"
229
+ } : t ? {
236
230
  bgColor: "WHITE_3",
237
231
  borderColor: "WHITE_4",
238
- textColor: "BLACK_T_87",
239
- alignTextItem: "flex-start"
232
+ textColor: "BLACK_T_87"
240
233
  } : {
241
234
  bgColor: "BLACK",
242
235
  borderColor: "BLACK_4",
243
- textColor: "WHITE",
244
- alignTextItem: "center"
236
+ textColor: "WHITE"
245
237
  }, V = (e) => e ? `${e}_1` : "BLUE_1", X = (e) => {
246
238
  if (!e)
247
239
  return !1;
@@ -250,23 +242,23 @@ const W = (e) => e.reduce(
250
242
  };
251
243
  export {
252
244
  K as checkIsClozeFormulaResponseInvalid,
253
- O as getInitialQuestionId,
254
- W as getInitialResponses,
255
- G as getNavigationSectionBackgroundColor,
245
+ k as getInitialQuestionId,
246
+ x as getInitialResponses,
247
+ H as getNavigationSectionBackgroundColor,
256
248
  z as getNavigationSectionIcon,
257
249
  Y as getNavigationSectionName,
258
- $ as getPaperColorByQuestion,
250
+ U as getPaperColorByQuestion,
259
251
  V as getPuzzleWorksheetBackgroundColor,
260
- H as getQuestionBackgroundImage,
261
- F as getQuestionBorderColor,
262
- A as getQuestionMetadata,
263
- k as getWorksheetDimensions,
252
+ F as getQuestionBackgroundImage,
253
+ G as getQuestionBorderColor,
254
+ v as getQuestionMetadata,
255
+ Q as getWorksheetDimensions,
264
256
  D as getWorksheetHeaderLayout,
265
257
  X as isConceptIntroWidget,
266
- b as isOkayTypeQuestion,
258
+ A as isOkayTypeQuestion,
267
259
  J as isSATAssessmentNode,
268
260
  P as isTeacherInterventionNeeded,
269
- Q as scrollToQuestion,
270
- U as setMathJaxConfigInWindow
261
+ W as scrollToQuestion,
262
+ $ as setMathJaxConfigInWindow
271
263
  };
272
264
  //# sourceMappingURL=worksheet-helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"worksheet-helpers.js","sources":["../../../../src/features/worksheet/worksheet/worksheet-helpers.ts"],"sourcesContent":["import Bulb2Icon from '../../../assets/line-icons/icons/bulb2';\nimport EditStarIcon from '../../../assets/line-icons/icons/edit-star';\nimport Edit2Icon from '../../../assets/line-icons/icons/edit2';\nimport PracticeIcon from '../../../assets/line-icons/icons/practice';\nimport QuestionLetterIcon from '../../../assets/line-icons/icons/question-letter';\nimport Star2Icon from '../../../assets/line-icons/icons/star2';\nimport { type NODE_TYPES } from '../../../types/models/worksheet';\nimport type { TColorNames, THueNames } from '../../ui/types';\nimport EVENTS from '../constants/events';\nimport {\n ACTION_BAR_HEIGHT,\n CLOZE_FORMULA_RESPONSE_LIMIT,\n QUESTION_WIDTH,\n SPLIT_QUESTION_WIDTH,\n} from './constants';\nimport type { TWorksheetQuestionPaperColor } from './worksheet-question/worksheet-question-types';\nimport {\n type ILearnosityItem,\n type ILearnosityQuestion,\n type ILearnosityQuestionResponse,\n type IWorksheetBehavior,\n type IWorksheetHeaderLayoutProps,\n type IWorksheetLayout,\n type IWorksheetQuestion,\n type IWorksheetResponse,\n type TInstructorStimulus,\n type TSectionName,\n} from './worksheet-types';\n\ninterface IGetInitialQuestionId {\n (params: {\n questions: IWorksheetQuestion[];\n initialQuestion: IWorksheetBehavior['initialQuestion'];\n lastUnlockedQuestionIndex: number;\n lastAttemptableQuestionIndex: number;\n initialResponseId?: string;\n initialItemIndex?: number;\n }): string;\n}\n\nconst getInitialQuestionId: IGetInitialQuestionId = ({\n questions,\n initialQuestion,\n initialResponseId,\n initialItemIndex,\n lastUnlockedQuestionIndex,\n lastAttemptableQuestionIndex,\n}) => {\n const unlockedQuestions = questions.slice(0, lastUnlockedQuestionIndex + 1);\n const lastUnlockedQuestion = questions[lastUnlockedQuestionIndex]!;\n const lastAttemptableQuestion = questions[lastAttemptableQuestionIndex]!;\n\n if (initialResponseId && unlockedQuestions.find(q => q.response_id === initialResponseId)) {\n return initialResponseId;\n }\n\n if (\n typeof initialItemIndex === 'number' &&\n initialItemIndex <= lastUnlockedQuestion.item_number\n ) {\n const question = questions.find(q => q.item_number === initialItemIndex);\n\n if (question?.response_id) {\n return question.response_id;\n }\n }\n\n if (initialQuestion === 'FIRST' && questions[0]?.response_id) {\n return questions[0].response_id;\n }\n\n if (initialQuestion === 'CURRENT') {\n return lastAttemptableQuestion.response_id;\n }\n\n if (questions[0]?.response_id) {\n return questions[0].response_id;\n }\n\n throw new Error('Initial question not found');\n};\n\ntype TQuestionMetadata = Pick<\n IWorksheetResponse,\n 'widgetReference' | 'itemReference' | 'itemPosition' | 'questionPosition' | 'isOkayTypeQuestion'\n>;\n\nfunction getQuestionMetadata(\n questions: IWorksheetQuestion[],\n questionId: string,\n): TQuestionMetadata;\nfunction getQuestionMetadata(question: IWorksheetQuestion): TQuestionMetadata;\nfunction getQuestionMetadata(\n questions: IWorksheetQuestion | IWorksheetQuestion[],\n questionId?: string,\n) {\n const question = Array.isArray(questions)\n ? questions.find(q => q.response_id === questionId)\n : questions;\n\n if (!question) {\n throw new Error(`Question with id ${questionId} not found`);\n }\n\n return {\n widgetReference: question.metadata.widget_reference,\n itemReference: question.item_reference,\n itemPosition: question.item_number,\n questionPosition: question.question_number,\n isOkayTypeQuestion: isOkayTypeQuestion(question),\n score: {\n max_score:\n question?.validation?.valid_response?.score ?? 0 * question.metadata.valid_response_count,\n },\n tags: {\n ...question.item_tags_map,\n instructor_stimulus: question.instructor_stimulus,\n },\n };\n}\n\ninterface IGetInitialResponses {\n (questions: IWorksheetQuestion[]): Record<string, IWorksheetResponse>;\n}\n\nconst getInitialResponses: IGetInitialResponses = questions => {\n return questions.reduce(\n (acc, question) => ({\n ...acc,\n [question.response_id]: getQuestionMetadata(questions, question.response_id),\n }),\n {},\n );\n};\n\ninterface IGetWorksheetDimensions {\n (\n items: ILearnosityItem[],\n layout: IWorksheetLayout,\n ): {\n questionsContainerWidth: number;\n maxQuestionWidth: number;\n actionbarHeight: number;\n };\n}\n\nconst getWorksheetDimensions: IGetWorksheetDimensions = (items, layout) => {\n const { actionBar } = layout;\n const isSingleColumn = !items.some(item =>\n item.questions.some(question => question.stimulus_review),\n );\n const actionbarHeight = actionBar === 'bottom' ? ACTION_BAR_HEIGHT : 0;\n\n return {\n questionsContainerWidth: isSingleColumn ? QUESTION_WIDTH : SPLIT_QUESTION_WIDTH,\n maxQuestionWidth: QUESTION_WIDTH,\n actionbarHeight,\n };\n};\n\ninterface IScrollToQuestion {\n (questionId: string, params?: { animation?: boolean; block?: 'start' | 'end' }): void;\n}\n\nconst scrollToQuestion: IScrollToQuestion = (\n questionId,\n { animation = false, block = 'start' } = {},\n) => {\n const $questionEl = document.querySelectorAll(`.widget-${questionId}`)[0];\n\n if ($questionEl) {\n $questionEl.scrollIntoView({\n block,\n behavior: animation ? 'smooth' : 'instant',\n });\n }\n};\n\ninterface IIsOkayTypeQuestion {\n (question: IWorksheetQuestion | ILearnosityQuestion): boolean;\n}\n\nconst isOkayTypeQuestion: IIsOkayTypeQuestion = question => {\n const { type, options, instructor_stimulus } = question;\n const itemType = 'item_type' in question ? question.item_type : undefined;\n\n if (\n itemType === 'overview' ||\n instructor_stimulus === 'Intro' ||\n instructor_stimulus === 'SystemIntro' ||\n instructor_stimulus === 'Concept-Intro'\n ) {\n return true;\n }\n\n return type === 'mcq' && options?.length === 1 ? true : false;\n};\n\ninterface IIsTeacherInterventionNeeded {\n (params: {\n attemptsAfterTeacherInterventionNeeded: number | undefined;\n attemptsHistory: IWorksheetResponse['attemptsHistory'];\n }): boolean;\n}\n\nconst isTeacherInterventionNeeded: IIsTeacherInterventionNeeded = ({\n attemptsAfterTeacherInterventionNeeded,\n attemptsHistory,\n}) => {\n if (\n attemptsAfterTeacherInterventionNeeded &&\n (attemptsHistory?.length ?? 0) >= attemptsAfterTeacherInterventionNeeded\n ) {\n const score = attemptsHistory?.slice(-1)[0]?.score;\n\n if (score && score.score === score.max_score) {\n return false;\n }\n\n return true;\n }\n\n return false;\n};\n\nconst setMathJaxConfigInWindow = (\n logger: (eventName: string, data?: Record<string, unknown>) => void,\n) => {\n window.MathJax = {\n options: {\n enableMenu: false,\n ignoreHtmlClass: 'lrn_noMath',\n compileError: function (doc, math, err) {\n logger(EVENTS.MATHJAX_COMPILE_ERROR);\n doc.compileError(math, err);\n },\n typesetError: function (doc, math, err) {\n logger(EVENTS.MATHJAX_TYPESET_ERROR);\n doc.typesetError(math, err);\n // throw new Error('typesetError');\n },\n },\n tex: {\n inlineMath: [\n ['\\\\(', '\\\\)'],\n ['$$', '$$'],\n ],\n displayMath: [['\\\\[', '\\\\]']],\n macros: {\n abs: ['{|#1|}', 1],\n degree: ['°'],\n longdiv: ['{\\\\enclose{longdiv}{#1}}', 1],\n atomic: ['{_{#1}^{#2}}', 2],\n polyatomic: ['{_{#2}{}^{#1}}', 2],\n circledot: ['{\\\\odot}'],\n parallelogram: ['\\\\unicode{x25B1}'],\n ngtr: ['\\\\unicode{x226F}'],\n nless: ['\\\\unicode{x226E}'],\n MathQuillVarField: ['#1', 1],\n overarc: ['{\\\\overparen{#1}}', 1],\n },\n formatError: (jax, err) => {\n logger(EVENTS.MATHJAX_FORMAT_ERROR, {\n id: err.id,\n message: err.message,\n });\n jax.formatError(err);\n },\n },\n chtml: {\n minScale: 1,\n matchFontHeight: false,\n },\n };\n};\n\ninterface IGetPaperColorByQuestion {\n (question: IWorksheetQuestion): TWorksheetQuestionPaperColor;\n}\n\nconst getPaperColorByQuestion: IGetPaperColorByQuestion = question => {\n const { item_type, instructor_stimulus } = question;\n const lowerCaseInstructorStimulus = instructor_stimulus?.toLowerCase();\n\n switch (item_type) {\n case 'overview':\n case 'learning':\n return 'blue';\n case 'learning-we-do':\n case 'learning-your-turn':\n case 'learning-explore':\n if (\n lowerCaseInstructorStimulus === 'instruction' ||\n lowerCaseInstructorStimulus === 'intro' ||\n lowerCaseInstructorStimulus === 'concept-intro'\n ) {\n return 'blue';\n }\n\n if (lowerCaseInstructorStimulus === 'task') {\n return 'green';\n }\n\n return 'yellow';\n case 'practice-basic':\n case 'practice-regular':\n return 'yellow';\n case 'exit-ticket':\n return 'purple';\n case 'advanced-practice':\n return 'orange';\n default:\n if (lowerCaseInstructorStimulus === 'learn') return 'blue';\n\n if (lowerCaseInstructorStimulus === 'try' || lowerCaseInstructorStimulus === 'apply')\n return 'green';\n\n return 'yellow';\n }\n};\n\nconst getQuestionBackgroundImage = (paperColor: TWorksheetQuestionPaperColor) => {\n return `https://cuemath-intel.s3.ap-southeast-1.amazonaws.com/media/math-canvas/paper-${paperColor}.png`;\n};\n\nconst getQuestionBorderColor = (\n paperColor: TWorksheetQuestionPaperColor,\n isActive?: boolean,\n): TColorNames => {\n if (!isActive) {\n return 'GREY_3';\n }\n\n switch (paperColor) {\n case 'orange':\n case 'white':\n return 'ORANGE_2';\n case 'blue':\n return 'BLUE_2';\n case 'green':\n return 'GREEN_2';\n case 'yellow':\n return 'YELLOW_2';\n case 'purple':\n return 'PURPLE_2';\n default:\n return 'GREY_3';\n }\n};\n\nconst getNavigationSectionBackgroundColor = (sectionName?: TSectionName): TColorNames => {\n switch (sectionName) {\n case 'learning':\n return 'BLUE_1';\n case 'practice':\n case 'practice-basic':\n case 'practice-regular':\n return 'YELLOW_1';\n case 'exit-ticket':\n return 'PURPLE_1';\n case 'advanced':\n return 'ORANGE_1';\n default:\n return 'YELLOW_1';\n }\n};\n\nconst getNavigationSectionName = (sectionName?: TSectionName): string => {\n switch (sectionName) {\n case 'learning':\n return 'Learning';\n case 'practice':\n return 'Practice';\n case 'practice-basic':\n return 'Basic practice';\n case 'practice-regular':\n return 'Regular practice';\n case 'exit-ticket':\n return 'Mini quiz';\n case 'advanced':\n return 'Advanced work';\n default:\n return '';\n }\n};\n\nconst getNavigationSectionIcon = (sectionName?: TSectionName) => {\n switch (sectionName) {\n case 'learning':\n return Bulb2Icon;\n case 'practice':\n return PracticeIcon;\n case 'practice-basic':\n return Edit2Icon;\n case 'practice-regular':\n return EditStarIcon;\n case 'exit-ticket':\n return QuestionLetterIcon;\n case 'advanced':\n return Star2Icon;\n default:\n return Bulb2Icon;\n }\n};\n\nconst isSATAssessmentNode = (nodeType: NODE_TYPES) =>\n nodeType === 'SAT_ENGLISH_ASSESSMENT' || nodeType === 'SAT_MATH_ASSESSMENT';\n\nconst checkIsClozeFormulaResponseInvalid = (response: ILearnosityQuestionResponse) => {\n if (Array.isArray(response.value)) {\n const isInvalid = response.value.some(\n item => typeof item === 'string' && item.length > CLOZE_FORMULA_RESPONSE_LIMIT,\n );\n\n return isInvalid;\n }\n\n return false;\n};\n\nconst getWorksheetHeaderLayout: IWorksheetHeaderLayoutProps = ({\n isPuzzleWorksheet,\n isTestWorksheet,\n imageHue = 'BLUE',\n userType,\n}) => {\n if (isPuzzleWorksheet) {\n return {\n bgColor: `${imageHue}_3`,\n borderColor: `${imageHue}_4`,\n textColor: 'BLACK_T_87',\n alignTextItem: 'center',\n };\n }\n\n if (isTestWorksheet) {\n if (userType === 'STUDENT') {\n return {\n bgColor: 'BLACK',\n borderColor: 'WHITE_4',\n textColor: 'WHITE',\n alignTextItem: 'center',\n };\n }\n\n return {\n bgColor: 'WHITE_3',\n borderColor: 'WHITE_4',\n textColor: 'BLACK_T_87',\n alignTextItem: 'flex-start',\n };\n }\n\n return {\n bgColor: 'BLACK',\n borderColor: 'BLACK_4',\n textColor: 'WHITE',\n alignTextItem: 'center',\n };\n};\n\ninterface IGetPuzzleWorksheetBackgroundColor {\n (imageHue?: THueNames): TColorNames;\n}\n\nconst getPuzzleWorksheetBackgroundColor: IGetPuzzleWorksheetBackgroundColor = imageHue => {\n if (!imageHue) return 'BLUE_1';\n\n return `${imageHue}_1`;\n};\n\nconst isConceptIntroWidget = (instructorStimulus?: TInstructorStimulus) => {\n if (!instructorStimulus) {\n return false;\n }\n\n const lowerCaseInstructorStimulus = instructorStimulus.toLowerCase();\n\n return lowerCaseInstructorStimulus === 'intro' || lowerCaseInstructorStimulus === 'concept-intro';\n};\n\nexport {\n checkIsClozeFormulaResponseInvalid,\n getInitialQuestionId,\n getInitialResponses,\n getNavigationSectionBackgroundColor,\n getNavigationSectionIcon,\n getNavigationSectionName,\n getPaperColorByQuestion,\n getPuzzleWorksheetBackgroundColor,\n getQuestionBackgroundImage,\n getQuestionBorderColor,\n getQuestionMetadata,\n getWorksheetDimensions,\n getWorksheetHeaderLayout,\n isConceptIntroWidget,\n isOkayTypeQuestion,\n isSATAssessmentNode,\n isTeacherInterventionNeeded,\n scrollToQuestion,\n setMathJaxConfigInWindow,\n};\n"],"names":["getInitialQuestionId","questions","initialQuestion","initialResponseId","initialItemIndex","lastUnlockedQuestionIndex","lastAttemptableQuestionIndex","unlockedQuestions","lastUnlockedQuestion","lastAttemptableQuestion","q","question","_a","_b","getQuestionMetadata","questionId","isOkayTypeQuestion","getInitialResponses","acc","getWorksheetDimensions","items","layout","actionBar","item","QUESTION_WIDTH","SPLIT_QUESTION_WIDTH","ACTION_BAR_HEIGHT","scrollToQuestion","animation","block","$questionEl","type","options","instructor_stimulus","isTeacherInterventionNeeded","attemptsAfterTeacherInterventionNeeded","attemptsHistory","score","setMathJaxConfigInWindow","logger","doc","math","err","EVENTS","jax","getPaperColorByQuestion","item_type","lowerCaseInstructorStimulus","getQuestionBackgroundImage","paperColor","getQuestionBorderColor","isActive","getNavigationSectionBackgroundColor","sectionName","getNavigationSectionName","getNavigationSectionIcon","Bulb2Icon","PracticeIcon","Edit2Icon","EditStarIcon","QuestionLetterIcon","Star2Icon","isSATAssessmentNode","nodeType","checkIsClozeFormulaResponseInvalid","response","CLOZE_FORMULA_RESPONSE_LIMIT","getWorksheetHeaderLayout","isPuzzleWorksheet","isTestWorksheet","imageHue","userType","getPuzzleWorksheetBackgroundColor","isConceptIntroWidget","instructorStimulus"],"mappings":";;;;;;;;AAwCA,MAAMA,IAA8C,CAAC;AAAA,EACnD,WAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,8BAAAC;AACF,MAAM;;AACJ,QAAMC,IAAoBN,EAAU,MAAM,GAAGI,IAA4B,CAAC,GACpEG,IAAuBP,EAAUI,CAAyB,GAC1DI,IAA0BR,EAAUK,CAA4B;AAEtE,MAAIH,KAAqBI,EAAkB,KAAK,OAAKG,EAAE,gBAAgBP,CAAiB;AAC/E,WAAAA;AAGT,MACE,OAAOC,KAAqB,YAC5BA,KAAoBI,EAAqB,aACzC;AACA,UAAMG,IAAWV,EAAU,KAAK,CAAKS,MAAAA,EAAE,gBAAgBN,CAAgB;AAEvE,QAAIO,KAAA,QAAAA,EAAU;AACZ,aAAOA,EAAS;AAAA,EAEpB;AAEA,MA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AAAA,EACX;AACF,GAEMM,IAAsB,CAACC,MAC3BA,MAAa,4BAA4BA,MAAa,uBAElDC,IAAqC,CAACC,MACtC,MAAM,QAAQA,EAAS,KAAK,IACZA,EAAS,MAAM;AAAA,EAC/B,CAAQ1C,MAAA,OAAOA,KAAS,YAAYA,EAAK,SAAS2C;AAAA,IAM/C,IAGHC,IAAwD,CAAC;AAAA,EAC7D,mBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,UAAAC;AACF,MACMH,IACK;AAAA,EACL,SAAS,GAAGE,CAAQ;AAAA,EACpB,aAAa,GAAGA,CAAQ;AAAA,EACxB,WAAW;AAAA,EACX,eAAe;AAAA,IAIfD,IACEE,MAAa,YACR;AAAA,EACL,SAAS;AAAA,EACT,aAAa;AAAA,EACb,WAAW;AAAA,EACX,eAAe;AAAA,IAIZ;AAAA,EACL,SAAS;AAAA,EACT,aAAa;AAAA,EACb,WAAW;AAAA,EACX,eAAe;AAAA,IAIZ;AAAA,EACL,SAAS;AAAA,EACT,aAAa;AAAA,EACb,WAAW;AAAA,EACX,eAAe;AAAA,GAQbC,IAAwE,CAAYF,MACnFA,IAEE,GAAGA,CAAQ,OAFI,UAKlBG,IAAuB,CAACC,MAA6C;AACzE,MAAI,CAACA;AACI,WAAA;AAGH,QAAA3B,IAA8B2B,EAAmB;AAEhD,SAAA3B,MAAgC,WAAWA,MAAgC;AACpF;"}
1
+ {"version":3,"file":"worksheet-helpers.js","sources":["../../../../src/features/worksheet/worksheet/worksheet-helpers.ts"],"sourcesContent":["import Bulb2Icon from '../../../assets/line-icons/icons/bulb2';\nimport EditStarIcon from '../../../assets/line-icons/icons/edit-star';\nimport Edit2Icon from '../../../assets/line-icons/icons/edit2';\nimport PracticeIcon from '../../../assets/line-icons/icons/practice';\nimport QuestionLetterIcon from '../../../assets/line-icons/icons/question-letter';\nimport Star2Icon from '../../../assets/line-icons/icons/star2';\nimport { type NODE_TYPES } from '../../../types/models/worksheet';\nimport type { TColorNames, THueNames } from '../../ui/types';\nimport EVENTS from '../constants/events';\nimport {\n ACTION_BAR_HEIGHT,\n CLOZE_FORMULA_RESPONSE_LIMIT,\n QUESTION_WIDTH,\n SPLIT_QUESTION_WIDTH,\n} from './constants';\nimport type { TWorksheetQuestionPaperColor } from './worksheet-question/worksheet-question-types';\nimport {\n type ILearnosityItem,\n type ILearnosityQuestion,\n type ILearnosityQuestionResponse,\n type IWorksheetBehavior,\n type IWorksheetHeaderLayoutProps,\n type IWorksheetLayout,\n type IWorksheetQuestion,\n type IWorksheetResponse,\n type TInstructorStimulus,\n type TSectionName,\n} from './worksheet-types';\n\ninterface IGetInitialQuestionId {\n (params: {\n questions: IWorksheetQuestion[];\n initialQuestion: IWorksheetBehavior['initialQuestion'];\n lastUnlockedQuestionIndex: number;\n lastAttemptableQuestionIndex: number;\n initialResponseId?: string;\n initialItemIndex?: number;\n }): string;\n}\n\nconst getInitialQuestionId: IGetInitialQuestionId = ({\n questions,\n initialQuestion,\n initialResponseId,\n initialItemIndex,\n lastUnlockedQuestionIndex,\n lastAttemptableQuestionIndex,\n}) => {\n const unlockedQuestions = questions.slice(0, lastUnlockedQuestionIndex + 1);\n const lastUnlockedQuestion = questions[lastUnlockedQuestionIndex]!;\n const lastAttemptableQuestion = questions[lastAttemptableQuestionIndex]!;\n\n if (initialResponseId && unlockedQuestions.find(q => q.response_id === initialResponseId)) {\n return initialResponseId;\n }\n\n if (\n typeof initialItemIndex === 'number' &&\n initialItemIndex <= lastUnlockedQuestion.item_number\n ) {\n const question = questions.find(q => q.item_number === initialItemIndex);\n\n if (question?.response_id) {\n return question.response_id;\n }\n }\n\n if (initialQuestion === 'FIRST' && questions[0]?.response_id) {\n return questions[0].response_id;\n }\n\n if (initialQuestion === 'CURRENT') {\n return lastAttemptableQuestion.response_id;\n }\n\n if (questions[0]?.response_id) {\n return questions[0].response_id;\n }\n\n throw new Error('Initial question not found');\n};\n\ntype TQuestionMetadata = Pick<\n IWorksheetResponse,\n | 'widgetReference'\n | 'itemReference'\n | 'itemPosition'\n | 'questionPosition'\n | 'isOkayTypeQuestion'\n | 'score'\n | 'tags'\n> & {\n distractor_rationale_response_level?: IWorksheetResponse['distractor_rationale_response_level'];\n};\n\nfunction getQuestionMetadata(\n questions: IWorksheetQuestion[],\n questionId: string,\n): TQuestionMetadata;\nfunction getQuestionMetadata(question: IWorksheetQuestion): TQuestionMetadata;\nfunction getQuestionMetadata(\n questions: IWorksheetQuestion | IWorksheetQuestion[],\n questionId?: string,\n): TQuestionMetadata {\n const question = Array.isArray(questions)\n ? questions.find(q => q.response_id === questionId)\n : questions;\n\n if (!question) {\n throw new Error(`Question with id ${questionId} not found`);\n }\n\n return {\n widgetReference: question.metadata.widget_reference,\n itemReference: question.item_reference,\n itemPosition: question.item_number,\n questionPosition: question.question_number,\n isOkayTypeQuestion: isOkayTypeQuestion(question),\n score: {\n max_score:\n question?.validation?.valid_response?.score ?? 0 * question.metadata.valid_response_count,\n },\n tags: {\n ...question.item_tags_map,\n instructor_stimulus: question.instructor_stimulus ?? '',\n },\n distractor_rationale_response_level: question.metadata.distractor_rationale_response_level,\n };\n}\n\ninterface IGetInitialResponses {\n (questions: IWorksheetQuestion[]): Record<string, IWorksheetResponse>;\n}\n\nconst getInitialResponses: IGetInitialResponses = questions => {\n return questions.reduce(\n (acc, question) => ({\n ...acc,\n [question.response_id]: getQuestionMetadata(questions, question.response_id),\n }),\n {},\n );\n};\n\ninterface IGetWorksheetDimensions {\n (\n items: ILearnosityItem[],\n layout: IWorksheetLayout,\n ): {\n questionsContainerWidth: number;\n maxQuestionWidth: number;\n actionbarHeight: number;\n };\n}\n\nconst getWorksheetDimensions: IGetWorksheetDimensions = (items, layout) => {\n const { actionBar } = layout;\n const isSingleColumn = !items.some(item =>\n item.questions.some(question => question.stimulus_review),\n );\n const actionbarHeight = actionBar === 'bottom' ? ACTION_BAR_HEIGHT : 0;\n\n return {\n questionsContainerWidth: isSingleColumn ? QUESTION_WIDTH : SPLIT_QUESTION_WIDTH,\n maxQuestionWidth: QUESTION_WIDTH,\n actionbarHeight,\n };\n};\n\ninterface IScrollToQuestion {\n (questionId: string, params?: { animation?: boolean; block?: 'start' | 'end' }): void;\n}\n\nconst scrollToQuestion: IScrollToQuestion = (\n questionId,\n { animation = false, block = 'start' } = {},\n) => {\n const $questionEl = document.querySelectorAll(`.widget-${questionId}`)[0];\n\n if ($questionEl) {\n $questionEl.scrollIntoView({\n block,\n behavior: animation ? 'smooth' : 'instant',\n });\n }\n};\n\ninterface IIsOkayTypeQuestion {\n (question: IWorksheetQuestion | ILearnosityQuestion): boolean;\n}\n\nconst isOkayTypeQuestion: IIsOkayTypeQuestion = question => {\n const { type, options, instructor_stimulus } = question;\n const itemType = 'item_type' in question ? question.item_type : undefined;\n\n if (\n itemType === 'overview' ||\n instructor_stimulus === 'Intro' ||\n instructor_stimulus === 'SystemIntro' ||\n instructor_stimulus === 'Concept-Intro'\n ) {\n return true;\n }\n\n return type === 'mcq' && options?.length === 1 ? true : false;\n};\n\ninterface IIsTeacherInterventionNeeded {\n (params: {\n attemptsAfterTeacherInterventionNeeded: number | undefined;\n attemptsHistory: IWorksheetResponse['attemptsHistory'];\n }): boolean;\n}\n\nconst isTeacherInterventionNeeded: IIsTeacherInterventionNeeded = ({\n attemptsAfterTeacherInterventionNeeded,\n attemptsHistory,\n}) => {\n if (\n attemptsAfterTeacherInterventionNeeded &&\n (attemptsHistory?.length ?? 0) >= attemptsAfterTeacherInterventionNeeded\n ) {\n const score = attemptsHistory?.slice(-1)[0]?.score;\n\n if (score && score.score === score.max_score) {\n return false;\n }\n\n return true;\n }\n\n return false;\n};\n\nconst setMathJaxConfigInWindow = (\n logger: (eventName: string, data?: Record<string, unknown>) => void,\n) => {\n window.MathJax = {\n options: {\n enableMenu: false,\n ignoreHtmlClass: 'lrn_noMath',\n compileError: function (doc, math, err) {\n logger(EVENTS.MATHJAX_COMPILE_ERROR);\n doc.compileError(math, err);\n },\n typesetError: function (doc, math, err) {\n logger(EVENTS.MATHJAX_TYPESET_ERROR);\n doc.typesetError(math, err);\n // throw new Error('typesetError');\n },\n },\n tex: {\n inlineMath: [\n ['\\\\(', '\\\\)'],\n ['$$', '$$'],\n ],\n displayMath: [['\\\\[', '\\\\]']],\n macros: {\n abs: ['{|#1|}', 1],\n degree: ['°'],\n longdiv: ['{\\\\enclose{longdiv}{#1}}', 1],\n atomic: ['{_{#1}^{#2}}', 2],\n polyatomic: ['{_{#2}{}^{#1}}', 2],\n circledot: ['{\\\\odot}'],\n parallelogram: ['\\\\unicode{x25B1}'],\n ngtr: ['\\\\unicode{x226F}'],\n nless: ['\\\\unicode{x226E}'],\n MathQuillVarField: ['#1', 1],\n overarc: ['{\\\\overparen{#1}}', 1],\n },\n formatError: (jax, err) => {\n logger(EVENTS.MATHJAX_FORMAT_ERROR, {\n id: err.id,\n message: err.message,\n });\n jax.formatError(err);\n },\n },\n chtml: {\n minScale: 1,\n matchFontHeight: false,\n },\n };\n};\n\ninterface IGetPaperColorByQuestion {\n (question: IWorksheetQuestion): TWorksheetQuestionPaperColor;\n}\n\nconst getPaperColorByQuestion: IGetPaperColorByQuestion = question => {\n const { item_type, instructor_stimulus } = question;\n const lowerCaseInstructorStimulus = instructor_stimulus?.toLowerCase();\n\n switch (item_type) {\n case 'overview':\n case 'learning':\n return 'blue';\n case 'learning-we-do':\n case 'learning-your-turn':\n case 'learning-explore':\n if (\n lowerCaseInstructorStimulus === 'instruction' ||\n lowerCaseInstructorStimulus === 'intro' ||\n lowerCaseInstructorStimulus === 'concept-intro'\n ) {\n return 'blue';\n }\n\n if (lowerCaseInstructorStimulus === 'task') {\n return 'green';\n }\n\n return 'yellow';\n case 'practice-basic':\n case 'practice-regular':\n return 'yellow';\n case 'exit-ticket':\n return 'purple';\n case 'advanced-practice':\n return 'orange';\n default:\n if (lowerCaseInstructorStimulus === 'learn') return 'blue';\n\n if (lowerCaseInstructorStimulus === 'try' || lowerCaseInstructorStimulus === 'apply')\n return 'green';\n\n return 'yellow';\n }\n};\n\nconst getQuestionBackgroundImage = (paperColor: TWorksheetQuestionPaperColor) => {\n return `https://cuemath-intel.s3.ap-southeast-1.amazonaws.com/media/math-canvas/paper-${paperColor}.png`;\n};\n\nconst getQuestionBorderColor = (\n paperColor: TWorksheetQuestionPaperColor,\n isActive?: boolean,\n): TColorNames => {\n if (!isActive) {\n return 'GREY_3';\n }\n\n switch (paperColor) {\n case 'orange':\n case 'white':\n return 'ORANGE_2';\n case 'blue':\n return 'BLUE_2';\n case 'green':\n return 'GREEN_2';\n case 'yellow':\n return 'YELLOW_2';\n case 'purple':\n return 'PURPLE_2';\n default:\n return 'GREY_3';\n }\n};\n\nconst getNavigationSectionBackgroundColor = (sectionName?: TSectionName): TColorNames => {\n switch (sectionName) {\n case 'learning':\n return 'BLUE_1';\n case 'practice':\n case 'practice-basic':\n case 'practice-regular':\n return 'YELLOW_1';\n case 'exit-ticket':\n return 'PURPLE_1';\n case 'advanced':\n return 'ORANGE_1';\n default:\n return 'YELLOW_1';\n }\n};\n\nconst getNavigationSectionName = (sectionName?: TSectionName): string => {\n switch (sectionName) {\n case 'learning':\n return 'Learning';\n case 'practice':\n return 'Practice';\n case 'practice-basic':\n return 'Basic practice';\n case 'practice-regular':\n return 'Regular practice';\n case 'exit-ticket':\n return 'Mini quiz';\n case 'advanced':\n return 'Advanced work';\n default:\n return '';\n }\n};\n\nconst getNavigationSectionIcon = (sectionName?: TSectionName) => {\n switch (sectionName) {\n case 'learning':\n return Bulb2Icon;\n case 'practice':\n return PracticeIcon;\n case 'practice-basic':\n return Edit2Icon;\n case 'practice-regular':\n return EditStarIcon;\n case 'exit-ticket':\n return QuestionLetterIcon;\n case 'advanced':\n return Star2Icon;\n default:\n return Bulb2Icon;\n }\n};\n\nconst isSATAssessmentNode = (nodeType: NODE_TYPES) =>\n nodeType === 'SAT_ENGLISH_ASSESSMENT' || nodeType === 'SAT_MATH_ASSESSMENT';\n\nconst checkIsClozeFormulaResponseInvalid = (response: ILearnosityQuestionResponse) => {\n if (Array.isArray(response.value)) {\n const isInvalid = response.value.some(\n item => typeof item === 'string' && item.length > CLOZE_FORMULA_RESPONSE_LIMIT,\n );\n\n return isInvalid;\n }\n\n return false;\n};\n\nconst getWorksheetHeaderLayout: IWorksheetHeaderLayoutProps = ({\n isPuzzleWorksheet,\n isTestWorksheet,\n imageHue = 'BLUE',\n}) => {\n if (isPuzzleWorksheet) {\n return {\n bgColor: `${imageHue}_3`,\n borderColor: `${imageHue}_4`,\n textColor: 'BLACK_T_87',\n };\n }\n\n if (isTestWorksheet) {\n return {\n bgColor: 'WHITE_3',\n borderColor: 'WHITE_4',\n textColor: 'BLACK_T_87',\n };\n }\n\n return {\n bgColor: 'BLACK',\n borderColor: 'BLACK_4',\n textColor: 'WHITE',\n };\n};\n\ninterface IGetPuzzleWorksheetBackgroundColor {\n (imageHue?: THueNames): TColorNames;\n}\n\nconst getPuzzleWorksheetBackgroundColor: IGetPuzzleWorksheetBackgroundColor = imageHue => {\n if (!imageHue) return 'BLUE_1';\n\n return `${imageHue}_1`;\n};\n\nconst isConceptIntroWidget = (instructorStimulus?: TInstructorStimulus) => {\n if (!instructorStimulus) {\n return false;\n }\n\n const lowerCaseInstructorStimulus = instructorStimulus.toLowerCase();\n\n return lowerCaseInstructorStimulus === 'intro' || lowerCaseInstructorStimulus === 'concept-intro';\n};\n\nexport {\n checkIsClozeFormulaResponseInvalid,\n getInitialQuestionId,\n getInitialResponses,\n getNavigationSectionBackgroundColor,\n getNavigationSectionIcon,\n getNavigationSectionName,\n getPaperColorByQuestion,\n getPuzzleWorksheetBackgroundColor,\n getQuestionBackgroundImage,\n getQuestionBorderColor,\n getQuestionMetadata,\n getWorksheetDimensions,\n getWorksheetHeaderLayout,\n isConceptIntroWidget,\n isOkayTypeQuestion,\n isSATAssessmentNode,\n isTeacherInterventionNeeded,\n scrollToQuestion,\n setMathJaxConfigInWindow,\n};\n"],"names":["getInitialQuestionId","questions","initialQuestion","initialResponseId","initialItemIndex","lastUnlockedQuestionIndex","lastAttemptableQuestionIndex","unlockedQuestions","lastUnlockedQuestion","lastAttemptableQuestion","q","question","_a","_b","getQuestionMetadata","questionId","isOkayTypeQuestion","getInitialResponses","acc","getWorksheetDimensions","items","layout","actionBar","item","QUESTION_WIDTH","SPLIT_QUESTION_WIDTH","ACTION_BAR_HEIGHT","scrollToQuestion","animation","block","$questionEl","type","options","instructor_stimulus","isTeacherInterventionNeeded","attemptsAfterTeacherInterventionNeeded","attemptsHistory","score","setMathJaxConfigInWindow","logger","doc","math","err","EVENTS","jax","getPaperColorByQuestion","item_type","lowerCaseInstructorStimulus","getQuestionBackgroundImage","paperColor","getQuestionBorderColor","isActive","getNavigationSectionBackgroundColor","sectionName","getNavigationSectionName","getNavigationSectionIcon","Bulb2Icon","PracticeIcon","Edit2Icon","EditStarIcon","QuestionLetterIcon","Star2Icon","isSATAssessmentNode","nodeType","checkIsClozeFormulaResponseInvalid","response","CLOZE_FORMULA_RESPONSE_LIMIT","getWorksheetHeaderLayout","isPuzzleWorksheet","isTestWorksheet","imageHue","getPuzzleWorksheetBackgroundColor","isConceptIntroWidget","instructorStimulus"],"mappings":";;;;;;;;AAwCA,MAAMA,IAA8C,CAAC;AAAA,EACnD,WAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,8BAAAC;AACF,MAAM;;AACJ,QAAMC,IAAoBN,EAAU,MAAM,GAAGI,IAA4B,CAAC,GACpEG,IAAuBP,EAAUI,CAAyB,GAC1DI,IAA0BR,EAAUK,CAA4B;AAEtE,MAAIH,KAAqBI,EAAkB,KAAK,OAAKG,EAAE,gBAAgBP,CAAiB;AAC/E,WAAAA;AAGT,MACE,OAAOC,KAAqB,YAC5BA,KAAoBI,EAAqB,aACzC;AACA,UAAMG,IAAWV,EAAU,KAAK,CAAKS,MAAAA,EAAE,gBAAgBN,CAAgB;AAEvE,QAAIO,KAAA,QAAAA,E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,aAAAC;AAAA,IACT,KAAK;AACI,aAAAC;AAAA,IACT,KAAK;AACI,aAAAC;AAAA,IACT;AACS,aAAAL;AAAA,EACX;AACF,GAEMM,IAAsB,CAACC,MAC3BA,MAAa,4BAA4BA,MAAa,uBAElDC,IAAqC,CAACC,MACtC,MAAM,QAAQA,EAAS,KAAK,IACZA,EAAS,MAAM;AAAA,EAC/B,CAAQ1C,MAAA,OAAOA,KAAS,YAAYA,EAAK,SAAS2C;AAAA,IAM/C,IAGHC,IAAwD,CAAC;AAAA,EAC7D,mBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,UAAAC,IAAW;AACb,MACMF,IACK;AAAA,EACL,SAAS,GAAGE,CAAQ;AAAA,EACpB,aAAa,GAAGA,CAAQ;AAAA,EACxB,WAAW;AAAA,IAIXD,IACK;AAAA,EACL,SAAS;AAAA,EACT,aAAa;AAAA,EACb,WAAW;AAAA,IAIR;AAAA,EACL,SAAS;AAAA,EACT,aAAa;AAAA,EACb,WAAW;AAAA,GAQTE,IAAwE,CAAYD,MACnFA,IAEE,GAAGA,CAAQ,OAFI,UAKlBE,IAAuB,CAACC,MAA6C;AACzE,MAAI,CAACA;AACI,WAAA;AAGH,QAAA1B,IAA8B0B,EAAmB;AAEhD,SAAA1B,MAAgC,WAAWA,MAAgC;AACpF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"worksheet-types.js","sources":["../../../../src/features/worksheet/worksheet/worksheet-types.ts"],"sourcesContent":["import type { MutableRefObject, ReactElement, ReactNode } from 'react';\n\nimport type { EWorksheetActivity, TNodeTypes } from '../../../types/models/worksheet';\nimport 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 '../../hooks/use-s3-helper/use-s3-helper';\nimport type { TWorksheetBlocker } from './worksheet-blocker/worksheet-blocker-types';\nimport { type TStyleAttrubutes } from '../../ui/accordion-section/accordion-section-types';\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 acknowledgements?: string;\n sample_answer?: 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\n\nexport type TItemType =\n | 'overview'\n | 'learning'\n | 'learning-we-do'\n | 'learning-your-turn'\n | 'learning-explore'\n | 'practice'\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'\n | 'practice-basic'\n | 'practice-regular'\n | 'exit-ticket'\n | 'advanced';\n\ninterface 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 /**\n * If true, the question is not a question, but a content only item\n * e.g. Intro, Overview, Instruction etc.\n */\n is_non_question?: boolean;\n concept_intro_stimulus?: string; // Content for concept intro widget\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 * if true, scribbler button will be shown on the question\n */\n can_scribble: boolean; // If true, the question can be scribbled on\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\ninterface 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 /**\n * For non question questions, when user click on start, responseGiven will be true\n */\n responseGiven?: boolean;\n retryEnabled?: boolean;\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 discussionQuestionOffset?: 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, after the question is system validated, teacher discussion button will be shown when the question has discussion points.\n */\n teacherDiscussionEnabled?: boolean;\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 * This needs teacherValidationEnabled to be true\n * TODO: Consider changing to accept validation type: 'system' | 'teacher' | undefined instead of boolean\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, solution wont be shown to the user.\n */\n solutionHidden?: boolean;\n /**\n * If true, questions will be validated and feedback will be shown along with the correct answer.\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 /**\n * After attemptsAfterTeacherInterventionNeeded incorrect attempts, retry button will be disabled in class, move ahead button will show ouside class.\n */\n attemptsAfterTeacherInterventionNeeded?: number;\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, canvas is enabled and user can use canvas to scribble on the worksheet by toggling the scribble button\n canvasEnabled?: boolean;\n\n // If true, the user can scribble on workheet\n canScribble?: boolean;\n}\n\nexport type TWORKSHEET_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: TWORKSHEET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n onTeacherValidation?: (questionId: string, rating?: keyof typeof QUESTIONS_RATING) => void;\n onAllowRetry?: (questionId: string) => 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?: (\n responses: Record<string, IWorksheetResponse>,\n questions: IWorksheetQuestion[],\n ) => void;\n onActiveQuestionChange?: (question: IWorksheetQuestion) => void;\n onResolveDoubt?: (responseId: string) => void;\n onSkip?: (itemIndex: number, widgetIndex: number) => void;\n onLoaded: () => void;\n onErrored: (error: { code?: number; message: string }) => void;\n onResponsesLoaded?: (responses: Record<string, IWorksheetResponse>) => void;\n openQuestionFeedbackModal?: (itemRef: string) => void;\n}\n\ninterface ICueCanvasCallbackProps {\n onPublishStrokes?: TPublish;\n onReceiveStrokes?: TSubscribe;\n}\n\ninterface ICueCanvasProps {\n initialStrokesData?: Record<string, IActionData[]>;\n}\n\ninterface 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 showUserPointer?: boolean;\n renderQuestionHeader?: boolean;\n imageHue?: THueNames;\n background?: 'none' | 'paper';\n questionPadding: number;\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 initialResponseId?: string;\n initialItemIndex?: number;\n layout: IWorksheetLayout;\n updatedResponses?: Record<string, IWorksheetResponse>;\n worksheetCompleted: boolean;\n showNudgeBanner?: boolean;\n markedAsCompleted?: boolean;\n canResolveDoubt?: boolean;\n actionBarRightElement?: ReactElement; // Extra Elements to be rendered in the action bar\n attemptId?: string;\n itemsSignedRequest: string;\n questionsSignedRequest: string;\n summaryDescription?: ReactElement | null;\n canSubmitWorksheet?: boolean;\n selectedTopics?: string[];\n subjectiveProps?: ISubjectiveSheetProps;\n inClass?: boolean; // If true, the worksheet is rendered inside class\n activityType: EWorksheetActivity | null;\n isDesmosEnabled?: boolean; // If true, the worksheet can show desmos calculator\n nodeType: TNodeTypes; // NodeType of the worksheet\n mode: 'resume' | 'review' | 'preview'; // mode of the worksheet\n loggerRef: MutableRefObject<(eventName: string, data?: Record<string, unknown>) => void>;\n behaviorOverride?: Partial<IWorksheetBehavior>;\n}\n\ninterface IWorksheetPlugins {\n plugins?: {\n stickers?: ReactNode;\n };\n}\n\ninterface IUpdateImages {\n filteredImages: string[];\n newImages: IFile[];\n}\ninterface 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 IWorksheetProps\n extends IBaseWorksheetProps,\n IWorksheetCallbackProps,\n ICueCanvasProps,\n ICueCanvasCallbackProps,\n IPointerSyncCallbackProps,\n IWorksheetPlugins {}\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: TWORKSHEET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n allowRetry: (responseId: string) => void;\n}\n\ninterface IWorksheetHeaderLayoutArgs {\n isPuzzleWorksheet?: boolean;\n isTestWorksheet?: boolean;\n imageHue?: THueNames;\n userType?: TUserTypes;\n}\n\nexport interface IWorksheetHeaderLayoutProps {\n (args: IWorksheetHeaderLayoutArgs): {\n bgColor: TColorNames;\n borderColor?: TColorNames;\n textColor?: TColorNames;\n alignTextItem?: TStyleAttrubutes['alignItems'];\n };\n}\n\nexport type TWorksheetStoreProps = Omit<\n IBaseWorksheetProps,\n 'studentName' | 'itemsSignedRequest' | 'mode'\n> &\n Required<Pick<IBaseWorksheetProps, 'studentName'>> &\n Omit<IWorksheetCallbackProps, 'onLoaded' | 'onErrored'> &\n ICueCanvasProps &\n ICueCanvasCallbackProps &\n IPointerSyncCallbackProps &\n IWorksheetPlugins & {\n behavior: IWorksheetBehavior;\n learnosityItems: ILearnosityItem[];\n learnosityResponses?: Record<string, IWorksheetResponse>;\n learnosity: ILearnosity;\n appendedQuestionIds: string[];\n };\n\nexport enum EActiveQuestionTool {\n TEACHING_TOOLS = 'TEACHING_TOOLS',\n SOLUTION = 'SOLUTION',\n DISCUSSION = 'DISCUSSION',\n}\n\nexport interface IWorksheetStoreState {\n questions: IWorksheetQuestion[];\n renderableQuestions: IWorksheetQuestion[];\n responses: Record<string, IWorksheetResponse>;\n lastUnlockedQuestionIndex: number;\n initialQuestionId: string;\n activeQuestionId: string;\n activeQuestionIndex: number;\n questionsContainerWidth: number;\n maxQuestionWidth: number;\n actionbarHeight: number;\n summaryVisible: boolean;\n calculatorVisible: boolean;\n scribblingEnabled: boolean;\n activeQuestionTool?: EActiveQuestionTool;\n blocker?: TWorksheetBlocker;\n scrolledToInitialQuestion: boolean;\n}\n\n// Actions interface - contains all the methods\ninterface IWorksheetStoreActions {\n mergeWorksheetProps: (data: TWorksheetStoreProps) => void;\n setResponses: (\n responses:\n | IWorksheetStore['responses']\n | ((prevResponses: IWorksheetStore['responses']) => IWorksheetStore['responses']),\n ) => void;\n showSummary: () => void;\n hideSummary: () => void;\n toggleSummary: () => void;\n toggleCalculator: () => void;\n toggleScribble: () => void;\n setBlocker: (blocker?: TWorksheetBlocker) => void;\n /**\n *\n * @param scrollToLastUnlockedQuestion - If true, scrolls to the last unlocked question after removing the blocker. Default is true.\n * @returns\n */\n removeBlocker: (scrollToLastUnlockedQuestion?: boolean) => void;\n updateResponse: (options: {\n responseId: string;\n response: ILearnosityQuestionResponse;\n score: ILearnosityQuestionScore;\n timeSpent: number;\n answerChecked?: boolean;\n }) => void;\n updateMediaState: (\n responseId: string,\n mediaType: TWORKSHEET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n setDiscussionQuestionOffset: (responseId: string, offset: number) => void;\n markForReview: (responseId: string, markedForReview: boolean) => void;\n changeQuestion: (questionId: string, shouldScroll?: boolean, scrollDelay?: number) => void;\n setActiveQuestionTool: (tool: EActiveQuestionTool) => void;\n unsetActiveQuestionTool: () => void;\n destroy: () => void;\n}\n\n// Combined store interface\nexport interface IWorksheetStore\n extends IWorksheetStoreState,\n TWorksheetStoreProps,\n IWorksheetStoreActions {}\n"],"names":["QUESTION_TAGS","QUESTIONS_RATING","EActiveQuestionTool"],"mappings":"AAUY,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,GA0jBAC,sBAAAA,OACVA,EAAA,iBAAiB,kBACjBA,EAAA,WAAW,YACXA,EAAA,aAAa,cAHHA,IAAAA,KAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"worksheet-types.js","sources":["../../../../src/features/worksheet/worksheet/worksheet-types.ts"],"sourcesContent":["import type { MutableRefObject, ReactElement, ReactNode } from 'react';\n\nimport type { EWorksheetActivity, TNodeTypes } from '../../../types/models/worksheet';\nimport 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 '../../hooks/use-s3-helper/use-s3-helper';\nimport type { TWorksheetBlocker } from './worksheet-blocker/worksheet-blocker-types';\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 acknowledgements?: string;\n sample_answer?: string;\n hints?: string[];\n solution?: string[];\n teacher_tips?: string[];\n valid_response_count: number;\n distractor_rationale_response_level?: string[];\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\n\nexport type TItemType =\n | 'overview'\n | 'learning'\n | 'learning-we-do'\n | 'learning-your-turn'\n | 'learning-explore'\n | 'practice'\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'\n | 'practice-basic'\n | 'practice-regular'\n | 'exit-ticket'\n | 'advanced';\n\ninterface 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 /**\n * If true, the question is not a question, but a content only item\n * e.g. Intro, Overview, Instruction etc.\n */\n is_non_question?: boolean;\n concept_intro_stimulus?: string; // Content for concept intro widget\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 * if true, scribbler button will be shown on the question\n */\n can_scribble: boolean; // If true, the question can be scribbled on\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\ninterface 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 /**\n * For non question questions, when user click on start, responseGiven will be true\n */\n responseGiven?: boolean;\n retryEnabled?: boolean;\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 discussionQuestionOffset?: number;\n distractor_rationale_response_level?: string[];\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, after the question is system validated, teacher discussion button will be shown when the question has discussion points.\n */\n teacherDiscussionEnabled?: boolean;\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 * This needs teacherValidationEnabled to be true\n * TODO: Consider changing to accept validation type: 'system' | 'teacher' | undefined instead of boolean\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, solution wont be shown to the user.\n */\n solutionHidden?: boolean;\n /**\n * If true, questions will be validated and feedback will be shown along with the correct answer.\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 /**\n * After attemptsAfterTeacherInterventionNeeded incorrect attempts, retry button will be disabled in class, move ahead button will show ouside class.\n */\n attemptsAfterTeacherInterventionNeeded?: number;\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, canvas is enabled and user can use canvas to scribble on the worksheet by toggling the scribble button\n canvasEnabled?: boolean;\n\n // If true, the user can scribble on workheet\n canScribble?: boolean;\n}\n\nexport type TWORKSHEET_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: TWORKSHEET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n onTeacherValidation?: (questionId: string, rating?: keyof typeof QUESTIONS_RATING) => void;\n onAllowRetry?: (questionId: string) => 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?: (\n responses: Record<string, IWorksheetResponse>,\n questions: IWorksheetQuestion[],\n ) => void;\n onActiveQuestionChange?: (question: IWorksheetQuestion) => void;\n onResolveDoubt?: (responseId: string) => void;\n onSkip?: (itemIndex: number, widgetIndex: number) => void;\n onLoaded: () => void;\n onErrored: (error: { code?: number; message: string }) => void;\n onResponsesLoaded?: (responses: Record<string, IWorksheetResponse>) => void;\n openQuestionFeedbackModal?: (itemRef: string) => void;\n}\n\ninterface ICueCanvasCallbackProps {\n onPublishStrokes?: TPublish;\n onReceiveStrokes?: TSubscribe;\n}\n\ninterface ICueCanvasProps {\n initialStrokesData?: Record<string, IActionData[]>;\n}\n\ninterface 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 showUserPointer?: boolean;\n renderQuestionHeader?: boolean;\n imageHue?: THueNames;\n background?: 'none' | 'paper';\n questionPadding: number;\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 initialResponseId?: string;\n initialItemIndex?: number;\n layout: IWorksheetLayout;\n updatedResponses?: Record<string, IWorksheetResponse>;\n worksheetCompleted: boolean;\n showNudgeBanner?: boolean;\n markedAsCompleted?: boolean;\n canResolveDoubt?: boolean;\n actionBarRightElement?: ReactElement; // Extra Elements to be rendered in the action bar\n attemptId?: string;\n itemsSignedRequest: string;\n questionsSignedRequest: string;\n summaryDescription?: ReactElement | null;\n canSubmitWorksheet?: boolean;\n selectedTopics?: string[];\n subjectiveProps?: ISubjectiveSheetProps;\n inClass?: boolean; // If true, the worksheet is rendered inside class\n activityType: EWorksheetActivity | null;\n isDesmosEnabled?: boolean; // If true, the worksheet can show desmos calculator\n nodeType: TNodeTypes; // NodeType of the worksheet\n mode: 'resume' | 'review' | 'preview'; // mode of the worksheet\n loggerRef: MutableRefObject<(eventName: string, data?: Record<string, unknown>) => void>;\n behaviorOverride?: Partial<IWorksheetBehavior>;\n}\n\ninterface IWorksheetPlugins {\n plugins?: {\n stickers?: ReactNode;\n };\n}\n\ninterface IUpdateImages {\n filteredImages: string[];\n newImages: IFile[];\n}\ninterface 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 IWorksheetProps\n extends IBaseWorksheetProps,\n IWorksheetCallbackProps,\n ICueCanvasProps,\n ICueCanvasCallbackProps,\n IPointerSyncCallbackProps,\n IWorksheetPlugins {}\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: TWORKSHEET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n allowRetry: (responseId: string) => 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\nexport type TWorksheetStoreProps = Omit<\n IBaseWorksheetProps,\n 'studentName' | 'itemsSignedRequest' | 'mode'\n> &\n Required<Pick<IBaseWorksheetProps, 'studentName'>> &\n Omit<IWorksheetCallbackProps, 'onLoaded' | 'onErrored'> &\n ICueCanvasProps &\n ICueCanvasCallbackProps &\n IPointerSyncCallbackProps &\n IWorksheetPlugins & {\n behavior: IWorksheetBehavior;\n learnosityItems: ILearnosityItem[];\n learnosityResponses?: Record<string, IWorksheetResponse>;\n learnosity: ILearnosity;\n appendedQuestionIds: string[];\n };\n\nexport enum EActiveQuestionTool {\n TEACHING_TOOLS = 'TEACHING_TOOLS',\n SOLUTION = 'SOLUTION',\n DISCUSSION = 'DISCUSSION',\n}\n\nexport interface IWorksheetStoreState {\n questions: IWorksheetQuestion[];\n renderableQuestions: IWorksheetQuestion[];\n responses: Record<string, IWorksheetResponse>;\n lastUnlockedQuestionIndex: number;\n initialQuestionId: string;\n activeQuestionId: string;\n activeQuestionIndex: number;\n questionsContainerWidth: number;\n maxQuestionWidth: number;\n actionbarHeight: number;\n summaryVisible: boolean;\n calculatorVisible: boolean;\n scribblingEnabled: boolean;\n activeQuestionTool?: EActiveQuestionTool;\n blocker?: TWorksheetBlocker;\n scrolledToInitialQuestion: boolean;\n}\n\n// Actions interface - contains all the methods\ninterface IWorksheetStoreActions {\n mergeWorksheetProps: (data: TWorksheetStoreProps) => void;\n setResponses: (\n responses:\n | IWorksheetStore['responses']\n | ((prevResponses: IWorksheetStore['responses']) => IWorksheetStore['responses']),\n ) => void;\n showSummary: () => void;\n hideSummary: () => void;\n toggleSummary: () => void;\n toggleCalculator: () => void;\n toggleScribble: () => void;\n setBlocker: (blocker?: TWorksheetBlocker) => void;\n /**\n *\n * @param scrollToLastUnlockedQuestion - If true, scrolls to the last unlocked question after removing the blocker. Default is true.\n * @returns\n */\n removeBlocker: (scrollToLastUnlockedQuestion?: boolean) => void;\n updateResponse: (options: {\n responseId: string;\n response: ILearnosityQuestionResponse;\n score: ILearnosityQuestionScore;\n timeSpent: number;\n answerChecked?: boolean;\n }) => void;\n updateMediaState: (\n responseId: string,\n mediaType: TWORKSHEET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n setDiscussionQuestionOffset: (responseId: string, offset: number) => void;\n markForReview: (responseId: string, markedForReview: boolean) => void;\n changeQuestion: (questionId: string, shouldScroll?: boolean, scrollDelay?: number) => void;\n setActiveQuestionTool: (tool: EActiveQuestionTool) => void;\n unsetActiveQuestionTool: () => void;\n destroy: () => void;\n}\n\n// Combined store interface\nexport interface IWorksheetStore\n extends IWorksheetStoreState,\n TWorksheetStoreProps,\n IWorksheetStoreActions {}\n"],"names":["QUESTION_TAGS","QUESTIONS_RATING","EActiveQuestionTool"],"mappings":"AASY,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,GA0jBAC,sBAAAA,OACVA,EAAA,iBAAiB,kBACjBA,EAAA,WAAW,YACXA,EAAA,aAAa,cAHHA,IAAAA,KAAA,CAAA,CAAA;"}