@cuemath/leap 3.4.9-m → 3.4.9

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 (31) hide show
  1. package/dist/features/journey/use-journey/constants.js +7 -5
  2. package/dist/features/journey/use-journey/constants.js.map +1 -1
  3. package/dist/features/journey/use-journey/journey-context-provider.js +84 -72
  4. package/dist/features/journey/use-journey/journey-context-provider.js.map +1 -1
  5. package/dist/features/stickers/hooks/use-handle-sticker-send.js +44 -0
  6. package/dist/features/stickers/hooks/use-handle-sticker-send.js.map +1 -0
  7. package/dist/features/stickers/hooks/use-stickers-error-logger.js +17 -0
  8. package/dist/features/stickers/hooks/use-stickers-error-logger.js.map +1 -0
  9. package/dist/features/stickers/{sticker-selector/hooks → hooks}/use-stickers-journey/use-stickers-journey.js +7 -7
  10. package/dist/features/stickers/hooks/use-stickers-journey/use-stickers-journey.js.map +1 -0
  11. package/dist/features/stickers/sticker-selector/comps/sticker/sticker.js +27 -26
  12. package/dist/features/stickers/sticker-selector/comps/sticker/sticker.js.map +1 -1
  13. package/dist/features/stickers/sticker-selector/sticker-selector.js +67 -66
  14. package/dist/features/stickers/sticker-selector/sticker-selector.js.map +1 -1
  15. package/dist/features/stickers/stickers-analytics-events.js +8 -0
  16. package/dist/features/stickers/stickers-analytics-events.js.map +1 -0
  17. package/dist/features/worksheet/worksheet/worksheet-sidebar/question-guide.js +52 -119
  18. package/dist/features/worksheet/worksheet/worksheet-sidebar/question-guide.js.map +1 -1
  19. package/dist/features/worksheet/worksheet/worksheet-sidebar/sidebar.js +17 -21
  20. package/dist/features/worksheet/worksheet/worksheet-sidebar/sidebar.js.map +1 -1
  21. package/dist/features/worksheet/worksheet/worksheet-sidebar/worksheet-sidebar-styled.js +27 -33
  22. package/dist/features/worksheet/worksheet/worksheet-sidebar/worksheet-sidebar-styled.js.map +1 -1
  23. package/dist/features/worksheet/worksheet/worksheet-types.js.map +1 -1
  24. package/dist/features/worksheet/worksheet/worksheet.js +247 -251
  25. package/dist/features/worksheet/worksheet/worksheet.js.map +1 -1
  26. package/dist/index.d.ts +15 -15
  27. package/dist/index.js +2 -2
  28. package/package.json +1 -1
  29. package/dist/features/stickers/sticker-selector/hooks/use-handle-sticker-send.js +0 -33
  30. package/dist/features/stickers/sticker-selector/hooks/use-handle-sticker-send.js.map +0 -1
  31. package/dist/features/stickers/sticker-selector/hooks/use-stickers-journey/use-stickers-journey.js.map +0 -1
@@ -1,11 +1,10 @@
1
1
  import r from "styled-components";
2
- import p from "../../../../assets/line-icons/icons/bulb.js";
3
- import l from "../../../../assets/line-icons/icons/cross.js";
4
- import d from "../../../../assets/line-icons/icons/info.js";
5
- import a from "../../../../assets/line-icons/icons/sticker.js";
2
+ import c from "../../../../assets/line-icons/icons/bulb.js";
3
+ import d from "../../../../assets/line-icons/icons/cross.js";
4
+ import l from "../../../../assets/line-icons/icons/info.js";
6
5
  import e from "../../../ui/layout/flex-view.js";
7
- import x from "../../../ui/text/text.js";
8
- import { CustomElement as m } from "../worksheet-question/worksheet-question-styled.js";
6
+ import a from "../../../ui/text/text.js";
7
+ import { CustomElement as x } from "../worksheet-question/worksheet-question-styled.js";
9
8
  r(e)`
10
9
  border: 2px solid #000;
11
10
  `;
@@ -20,29 +19,29 @@ const y = r(e)(
20
19
  border: 1px solid ${i.colors.GREY_2};
21
20
  overflow: hidden;
22
21
  `
23
- ), S = r(e)`
22
+ ), C = r(e)`
24
23
  cursor: pointer;
25
- `, k = r(x)`
24
+ `, I = r(a)`
26
25
  text-decoration: underline;
27
26
  white-space: nowrap;
28
27
  writing-mode: vertical-rl;
29
28
  text-align: right;
30
- `, s = (t) => t.startsWith("calc(") ? t.replace(")", " - 0px)") : t, c = (t) => t.trim().split(/\s+(?=[+-])/).map((n) => n.startsWith("-") ? `+${n.slice(1)}` : n.startsWith("+") ? `-${n.slice(1)}` : `-${n}`).join(" "), f = (t) => t.startsWith("calc(") && t.endsWith(")") ? (t = t.slice(5, -1), `calc(${c(t)})`) : c(t), E = r(e)(
29
+ `, s = (t) => t.startsWith("calc(") ? t.replace(")", " - 0px)") : t, p = (t) => t.trim().split(/\s+(?=[+-])/).map((n) => n.startsWith("-") ? `+${n.slice(1)}` : n.startsWith("+") ? `-${n.slice(1)}` : `-${n}`).join(" "), m = (t) => t.startsWith("calc(") && t.endsWith(")") ? (t = t.slice(5, -1), `calc(${p(t)})`) : p(t), T = r(e)(
31
30
  ({ $questionWidth: t }) => `
32
31
  width: calc(${t}px - 32px); // 32px is the left + right padding
33
32
  overflow-y: auto;
34
33
  height: 100%;
35
34
  display: flex;
36
35
  `
37
- ), G = r(e)(({ $questionWidth: t, $height: o }) => `
38
- margin-top: ${typeof o == "number" ? `${-o}px` : f(s(o))};
36
+ ), E = r(e)(({ $questionWidth: t, $height: o }) => `
37
+ margin-top: ${typeof o == "number" ? `${-o}px` : m(s(o))};
39
38
  position: sticky;
40
39
  left: calc((100% - ${t}px ) *.5 + ${t}px + 12px);
41
40
  bottom: 16px;
42
41
  align-items: center;
43
42
  height: ${typeof o == "number" ? `${o}px` : s(o)};
44
43
  z-index: 1;
45
- `), T = r(e)(
44
+ `), G = r(e)(
46
45
  ({ theme: t }) => `
47
46
  width: 100%;
48
47
  border-radius: 8px;
@@ -51,7 +50,7 @@ const y = r(e)(
51
50
  align-items: center;
52
51
  padding: 10px;
53
52
  `
54
- ), B = r.div`
53
+ ), S = r.div`
55
54
  position: fixed;
56
55
  top: ${({ topValue: t }) => `${t}px`};
57
56
  left: ${({ leftValue: t }) => `${t}px`};
@@ -61,37 +60,32 @@ const y = r(e)(
61
60
  background: white;
62
61
  border-top: 1px solid #e0e0e0;
63
62
  border-right: 1px solid #e0e0e0;
64
- `, R = r(l)`
63
+ `, W = r(d)`
65
64
  position: absolute;
66
65
  top: 8px;
67
66
  right: 16px;
68
- `, W = r(d)(({ theme: t, $disabled: o }) => `
67
+ `, k = r(l)(({ theme: t, $disabled: o }) => `
69
68
  & path {
70
69
  stroke: ${o ? t.colors.GREY_4 : t.colors.BLACK};
71
70
  }
72
- `), Y = r(p)(({ theme: t, $disabled: o }) => `
71
+ `), v = r(c)(({ theme: t, $disabled: o }) => `
73
72
  & path {
74
73
  stroke: ${o ? t.colors.GREY_4 : t.colors.BLACK};
75
74
  }
76
- `), _ = r(a)(({ theme: t, $disabled: o }) => `
77
- & path {
78
- stroke: ${o ? t.colors.GREY_4 : t.colors.BLACK};
79
- }
80
- `), v = r(m)``;
75
+ `), B = r(x)``;
81
76
  export {
82
- R as CloseIcon,
83
- v as Guide,
84
- T as GuideContainer,
85
- W as HintIcon,
86
- B as Pointer,
87
- E as Section,
77
+ W as CloseIcon,
78
+ B as Guide,
79
+ G as GuideContainer,
80
+ k as HintIcon,
81
+ S as Pointer,
82
+ T as Section,
88
83
  y as SectionContainer,
89
- G as SideBarContainer,
90
- Y as SolIcon,
91
- _ as StickersIcon,
92
- k as UnderlinedText,
93
- S as UnderlinedTextWrapper,
84
+ E as SideBarContainer,
85
+ v as SolIcon,
86
+ I as UnderlinedText,
87
+ C as UnderlinedTextWrapper,
94
88
  s as getMinHeightFromString,
95
- f as negateExpression
89
+ m as negateExpression
96
90
  };
97
91
  //# sourceMappingURL=worksheet-sidebar-styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"worksheet-sidebar-styled.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-sidebar/worksheet-sidebar-styled.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport BulbIcon from '../../../../assets/line-icons/icons/bulb';\nimport CrossIcon from '../../../../assets/line-icons/icons/cross';\nimport InfoIcon from '../../../../assets/line-icons/icons/info';\nimport StickerIcon from '../../../../assets/line-icons/icons/sticker';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport { CustomElement } from '../worksheet-question/worksheet-question-styled';\n\nexport const Circle = styled(FlexView)`\n border: 2px solid #000;\n`;\nexport const SectionContainer = styled(FlexView)<{\n $questionWidth: number;\n $actionbarHeight: number;\n}>(\n ({ $questionWidth, $actionbarHeight, theme }) => `\n position: absolute;\n bottom: ${$actionbarHeight}px;\n right: 80px; //52px(sidebar(width) +12px(gutter) + (16px)\n width: calc(${$questionWidth}px - 32px); // 32px is the left + right padding\n height: 30%;\n display: flex;\n border: 1px solid ${theme.colors.GREY_2};\n overflow: hidden;\n`,\n);\n\nexport const UnderlinedTextWrapper = styled(FlexView)`\n cursor: pointer;\n`;\n\nexport const UnderlinedText = styled(Text)`\n text-decoration: underline;\n white-space: nowrap;\n writing-mode: vertical-rl;\n text-align: right;\n`;\n\nexport const getMinHeightFromString = (minHeight: string) => {\n if (minHeight.startsWith('calc(')) {\n return minHeight.replace(')', ' - 0px)');\n }\n\n return minHeight;\n};\n\nconst negateString = (expression: string) => {\n const terms = expression.trim().split(/\\s+(?=[+-])/);\n const negatedTerms = terms.map(term => {\n if (term.startsWith('-')) {\n return `+${term.slice(1)}`; // change - to +\n }\n\n if (term.startsWith('+')) {\n return `-${term.slice(1)}`; // change + to -\n }\n\n return `-${term}`; // add leading '-'\n });\n\n return negatedTerms.join(' ');\n};\n\nexport const negateExpression = (expression: string) => {\n if (expression.startsWith('calc(') && expression.endsWith(')')) {\n expression = expression.slice(5, -1); // Remove 'calc(' and ')'\n const negatedTerms = negateString(expression);\n\n return `calc(${negatedTerms})`;\n }\n\n return negateString(expression);\n};\n\nexport const Section = styled(FlexView)<{\n $questionWidth: number;\n $actionbarHeight: number;\n}>(\n ({ $questionWidth }) => `\n width: calc(${$questionWidth}px - 32px); // 32px is the left + right padding\n overflow-y: auto;\n height: 100%;\n display: flex;\n`,\n);\nexport const SideBarContainer = styled(FlexView)<{\n $questionWidth: number;\n $height: number | string;\n}>(({ $questionWidth, $height }) => {\n return `\n margin-top: ${\n typeof $height === 'number'\n ? `${-$height}px`\n : negateExpression(getMinHeightFromString($height))\n };\n position: sticky;\n left: calc((100% - ${$questionWidth}px ) *.5 + ${$questionWidth}px + 12px);\n bottom: 16px;\n align-items: center;\n height: ${typeof $height === 'number' ? `${$height}px` : getMinHeightFromString($height)};\n z-index: 1;\n`;\n});\n\nexport const GuideContainer = styled(FlexView)(\n ({ theme }) => `\n width: 100%;\n border-radius: 8px;\n border: 1px solid ${theme.colors.GREY_2};\n justify-content: center;\n align-items: center;\n padding: 10px;\n`,\n);\n\nexport const Pointer = styled.div<{ topValue: number; leftValue: number }>`\n position: fixed;\n top: ${({ topValue }) => `${topValue}px`};\n left: ${({ leftValue }) => `${leftValue}px`};\n width: 15px;\n height: 15px;\n transform: rotate(45deg);\n background: white;\n border-top: 1px solid #e0e0e0;\n border-right: 1px solid #e0e0e0;\n`;\n\nexport const CloseIcon = styled(CrossIcon)`\n position: absolute;\n top: 8px;\n right: 16px;\n`;\n\nexport const HintIcon = styled(InfoIcon)<{ $disabled: boolean }>(({ theme, $disabled }) => {\n return `\n & path {\n stroke: ${$disabled ? theme.colors.GREY_4 : theme.colors.BLACK};\n }\n `;\n});\n\nexport const SolIcon = styled(BulbIcon)<{ $disabled: boolean }>(({ theme, $disabled }) => {\n return `\n & path {\n stroke: ${$disabled ? theme.colors.GREY_4 : theme.colors.BLACK};\n }\n `;\n});\nexport const StickersIcon = styled(StickerIcon)<{ $disabled: boolean }>(({ theme, $disabled }) => {\n return `\n & path {\n stroke: ${$disabled ? theme.colors.GREY_4 : theme.colors.BLACK};\n }\n `;\n});\n\nexport const Guide = styled(CustomElement)``;\n"],"names":["styled","FlexView","SectionContainer","$questionWidth","$actionbarHeight","theme","UnderlinedTextWrapper","UnderlinedText","Text","getMinHeightFromString","minHeight","negateString","expression","term","negateExpression","Section","SideBarContainer","$height","GuideContainer","Pointer","topValue","leftValue","CloseIcon","CrossIcon","HintIcon","InfoIcon","$disabled","SolIcon","BulbIcon","StickersIcon","StickerIcon","Guide","CustomElement"],"mappings":";;;;;;;;AAUsBA,EAAOC,CAAQ;AAAA;AAAA;AAGxB,MAAAC,IAAmBF,EAAOC,CAAQ;AAAA,EAI7C,CAAC,EAAE,gBAAAE,GAAgB,kBAAAC,GAAkB,OAAAC,EAAY,MAAA;AAAA;AAAA,YAEvCD,CAAgB;AAAA;AAAA,gBAEZD,CAAc;AAAA;AAAA;AAAA,sBAGRE,EAAM,OAAO,MAAM;AAAA;AAAA;AAGzC,GAEaC,IAAwBN,EAAOC,CAAQ;AAAA;AAAA,GAIvCM,IAAiBP,EAAOQ,CAAI;AAAA;AAAA;AAAA;AAAA;AAAA,GAO5BC,IAAyB,CAACC,MACjCA,EAAU,WAAW,OAAO,IACvBA,EAAU,QAAQ,KAAK,SAAS,IAGlCA,GAGHC,IAAe,CAACC,MACNA,EAAW,KAAK,EAAE,MAAM,aAAa,EACxB,IAAI,CAAQC,MACjCA,EAAK,WAAW,GAAG,IACd,IAAIA,EAAK,MAAM,CAAC,CAAC,KAGtBA,EAAK,WAAW,GAAG,IACd,IAAIA,EAAK,MAAM,CAAC,CAAC,KAGnB,IAAIA,CAAI,EAChB,EAEmB,KAAK,GAAG,GAGjBC,IAAmB,CAACF,MAC3BA,EAAW,WAAW,OAAO,KAAKA,EAAW,SAAS,GAAG,KAC9CA,IAAAA,EAAW,MAAM,GAAG,EAAE,GAG5B,QAFcD,EAAaC,CAAU,CAEjB,OAGtBD,EAAaC,CAAU,GAGnBG,IAAUf,EAAOC,CAAQ;AAAA,EAIpC,CAAC,EAAE,gBAAAE,EAAA,MAAqB;AAAA,gBACVA,CAAc;AAAA;AAAA;AAAA;AAAA;AAK9B,GACaa,IAAmBhB,EAAOC,CAAQ,EAG5C,CAAC,EAAE,gBAAAE,GAAgB,SAAAc,QACb;AAAA,gBAEL,OAAOA,KAAY,WACf,GAAG,CAACA,CAAO,OACXH,EAAiBL,EAAuBQ,CAAO,CAAC,CACtD;AAAA;AAAA,uBAEqBd,CAAc,cAAcA,CAAc;AAAA;AAAA;AAAA,YAGrD,OAAOc,KAAY,WAAW,GAAGA,CAAO,OAAOR,EAAuBQ,CAAO,CAAC;AAAA;AAAA,CAGzF,GAEYC,IAAiBlB,EAAOC,CAAQ;AAAA,EAC3C,CAAC,EAAE,OAAAI,EAAA,MAAY;AAAA;AAAA;AAAA,sBAGKA,EAAM,OAAO,MAAM;AAAA;AAAA;AAAA;AAAA;AAKzC,GAEac,IAAUnB,EAAO;AAAA;AAAA,SAErB,CAAC,EAAE,UAAAoB,EAAe,MAAA,GAAGA,CAAQ,IAAI;AAAA,UAChC,CAAC,EAAE,WAAAC,EAAgB,MAAA,GAAGA,CAAS,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAShCC,IAAYtB,EAAOuB,CAAS;AAAA;AAAA;AAAA;AAAA,GAM5BC,IAAWxB,EAAOyB,CAAQ,EAA0B,CAAC,EAAE,OAAApB,GAAO,WAAAqB,QAClE;AAAA;AAAA,gBAEOA,IAAYrB,EAAM,OAAO,SAASA,EAAM,OAAO,KAAK;AAAA;AAAA,GAGnE,GAEYsB,IAAU3B,EAAO4B,CAAQ,EAA0B,CAAC,EAAE,OAAAvB,GAAO,WAAAqB,QACjE;AAAA;AAAA,gBAEOA,IAAYrB,EAAM,OAAO,SAASA,EAAM,OAAO,KAAK;AAAA;AAAA,GAGnE,GACYwB,IAAe7B,EAAO8B,CAAW,EAA0B,CAAC,EAAE,OAAAzB,GAAO,WAAAqB,QACzE;AAAA;AAAA,gBAEOA,IAAYrB,EAAM,OAAO,SAASA,EAAM,OAAO,KAAK;AAAA;AAAA,GAGnE,GAEY0B,IAAQ/B,EAAOgC,CAAa;"}
1
+ {"version":3,"file":"worksheet-sidebar-styled.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-sidebar/worksheet-sidebar-styled.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport BulbIcon from '../../../../assets/line-icons/icons/bulb';\nimport CrossIcon from '../../../../assets/line-icons/icons/cross';\nimport InfoIcon from '../../../../assets/line-icons/icons/info';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport { CustomElement } from '../worksheet-question/worksheet-question-styled';\n\nexport const Circle = styled(FlexView)`\n border: 2px solid #000;\n`;\nexport const SectionContainer = styled(FlexView)<{\n $questionWidth: number;\n $actionbarHeight: number;\n}>(\n ({ $questionWidth, $actionbarHeight, theme }) => `\n position: absolute;\n bottom: ${$actionbarHeight}px;\n right: 80px; //52px(sidebar(width) +12px(gutter) + (16px)\n width: calc(${$questionWidth}px - 32px); // 32px is the left + right padding\n height: 30%;\n display: flex;\n border: 1px solid ${theme.colors.GREY_2};\n overflow: hidden;\n`,\n);\n\nexport const UnderlinedTextWrapper = styled(FlexView)`\n cursor: pointer;\n`;\n\nexport const UnderlinedText = styled(Text)`\n text-decoration: underline;\n white-space: nowrap;\n writing-mode: vertical-rl;\n text-align: right;\n`;\n\nexport const getMinHeightFromString = (minHeight: string) => {\n if (minHeight.startsWith('calc(')) {\n return minHeight.replace(')', ' - 0px)');\n }\n\n return minHeight;\n};\n\nconst negateString = (expression: string) => {\n const terms = expression.trim().split(/\\s+(?=[+-])/);\n const negatedTerms = terms.map(term => {\n if (term.startsWith('-')) {\n return `+${term.slice(1)}`; // change - to +\n }\n\n if (term.startsWith('+')) {\n return `-${term.slice(1)}`; // change + to -\n }\n\n return `-${term}`; // add leading '-'\n });\n\n return negatedTerms.join(' ');\n};\n\nexport const negateExpression = (expression: string) => {\n if (expression.startsWith('calc(') && expression.endsWith(')')) {\n expression = expression.slice(5, -1); // Remove 'calc(' and ')'\n const negatedTerms = negateString(expression);\n\n return `calc(${negatedTerms})`;\n }\n\n return negateString(expression);\n};\n\nexport const Section = styled(FlexView)<{\n $questionWidth: number;\n $actionbarHeight: number;\n}>(\n ({ $questionWidth }) => `\n width: calc(${$questionWidth}px - 32px); // 32px is the left + right padding\n overflow-y: auto;\n height: 100%;\n display: flex;\n`,\n);\nexport const SideBarContainer = styled(FlexView)<{\n $questionWidth: number;\n $height: number | string;\n}>(({ $questionWidth, $height }) => {\n return `\n margin-top: ${\n typeof $height === 'number'\n ? `${-$height}px`\n : negateExpression(getMinHeightFromString($height))\n };\n position: sticky;\n left: calc((100% - ${$questionWidth}px ) *.5 + ${$questionWidth}px + 12px);\n bottom: 16px;\n align-items: center;\n height: ${typeof $height === 'number' ? `${$height}px` : getMinHeightFromString($height)};\n z-index: 1;\n`;\n});\n\nexport const GuideContainer = styled(FlexView)(\n ({ theme }) => `\n width: 100%;\n border-radius: 8px;\n border: 1px solid ${theme.colors.GREY_2};\n justify-content: center;\n align-items: center;\n padding: 10px;\n`,\n);\n\nexport const Pointer = styled.div<{ topValue: number; leftValue: number }>`\n position: fixed;\n top: ${({ topValue }) => `${topValue}px`};\n left: ${({ leftValue }) => `${leftValue}px`};\n width: 15px;\n height: 15px;\n transform: rotate(45deg);\n background: white;\n border-top: 1px solid #e0e0e0;\n border-right: 1px solid #e0e0e0;\n`;\n\nexport const CloseIcon = styled(CrossIcon)`\n position: absolute;\n top: 8px;\n right: 16px;\n`;\n\nexport const HintIcon = styled(InfoIcon)<{ $disabled: boolean }>(({ theme, $disabled }) => {\n return `\n & path {\n stroke: ${$disabled ? theme.colors.GREY_4 : theme.colors.BLACK};\n }\n `;\n});\n\nexport const SolIcon = styled(BulbIcon)<{ $disabled: boolean }>(({ theme, $disabled }) => {\n return `\n & path {\n stroke: ${$disabled ? theme.colors.GREY_4 : theme.colors.BLACK};\n }\n `;\n});\n\nexport const Guide = styled(CustomElement)``;\n"],"names":["styled","FlexView","SectionContainer","$questionWidth","$actionbarHeight","theme","UnderlinedTextWrapper","UnderlinedText","Text","getMinHeightFromString","minHeight","negateString","expression","term","negateExpression","Section","SideBarContainer","$height","GuideContainer","Pointer","topValue","leftValue","CloseIcon","CrossIcon","HintIcon","InfoIcon","$disabled","SolIcon","BulbIcon","Guide","CustomElement"],"mappings":";;;;;;;AASsBA,EAAOC,CAAQ;AAAA;AAAA;AAGxB,MAAAC,IAAmBF,EAAOC,CAAQ;AAAA,EAI7C,CAAC,EAAE,gBAAAE,GAAgB,kBAAAC,GAAkB,OAAAC,EAAY,MAAA;AAAA;AAAA,YAEvCD,CAAgB;AAAA;AAAA,gBAEZD,CAAc;AAAA;AAAA;AAAA,sBAGRE,EAAM,OAAO,MAAM;AAAA;AAAA;AAGzC,GAEaC,IAAwBN,EAAOC,CAAQ;AAAA;AAAA,GAIvCM,IAAiBP,EAAOQ,CAAI;AAAA;AAAA;AAAA;AAAA;AAAA,GAO5BC,IAAyB,CAACC,MACjCA,EAAU,WAAW,OAAO,IACvBA,EAAU,QAAQ,KAAK,SAAS,IAGlCA,GAGHC,IAAe,CAACC,MACNA,EAAW,KAAK,EAAE,MAAM,aAAa,EACxB,IAAI,CAAQC,MACjCA,EAAK,WAAW,GAAG,IACd,IAAIA,EAAK,MAAM,CAAC,CAAC,KAGtBA,EAAK,WAAW,GAAG,IACd,IAAIA,EAAK,MAAM,CAAC,CAAC,KAGnB,IAAIA,CAAI,EAChB,EAEmB,KAAK,GAAG,GAGjBC,IAAmB,CAACF,MAC3BA,EAAW,WAAW,OAAO,KAAKA,EAAW,SAAS,GAAG,KAC9CA,IAAAA,EAAW,MAAM,GAAG,EAAE,GAG5B,QAFcD,EAAaC,CAAU,CAEjB,OAGtBD,EAAaC,CAAU,GAGnBG,IAAUf,EAAOC,CAAQ;AAAA,EAIpC,CAAC,EAAE,gBAAAE,EAAA,MAAqB;AAAA,gBACVA,CAAc;AAAA;AAAA;AAAA;AAAA;AAK9B,GACaa,IAAmBhB,EAAOC,CAAQ,EAG5C,CAAC,EAAE,gBAAAE,GAAgB,SAAAc,QACb;AAAA,gBAEL,OAAOA,KAAY,WACf,GAAG,CAACA,CAAO,OACXH,EAAiBL,EAAuBQ,CAAO,CAAC,CACtD;AAAA;AAAA,uBAEqBd,CAAc,cAAcA,CAAc;AAAA;AAAA;AAAA,YAGrD,OAAOc,KAAY,WAAW,GAAGA,CAAO,OAAOR,EAAuBQ,CAAO,CAAC;AAAA;AAAA,CAGzF,GAEYC,IAAiBlB,EAAOC,CAAQ;AAAA,EAC3C,CAAC,EAAE,OAAAI,EAAA,MAAY;AAAA;AAAA;AAAA,sBAGKA,EAAM,OAAO,MAAM;AAAA;AAAA;AAAA;AAAA;AAKzC,GAEac,IAAUnB,EAAO;AAAA;AAAA,SAErB,CAAC,EAAE,UAAAoB,EAAe,MAAA,GAAGA,CAAQ,IAAI;AAAA,UAChC,CAAC,EAAE,WAAAC,EAAgB,MAAA,GAAGA,CAAS,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAShCC,IAAYtB,EAAOuB,CAAS;AAAA;AAAA;AAAA;AAAA,GAM5BC,IAAWxB,EAAOyB,CAAQ,EAA0B,CAAC,EAAE,OAAApB,GAAO,WAAAqB,QAClE;AAAA;AAAA,gBAEOA,IAAYrB,EAAM,OAAO,SAASA,EAAM,OAAO,KAAK;AAAA;AAAA,GAGnE,GAEYsB,IAAU3B,EAAO4B,CAAQ,EAA0B,CAAC,EAAE,OAAAvB,GAAO,WAAAqB,QACjE;AAAA;AAAA,gBAEOA,IAAYrB,EAAM,OAAO,SAASA,EAAM,OAAO,KAAK;AAAA;AAAA,GAGnE,GAEYwB,IAAQ7B,EAAO8B,CAAa;"}
@@ -1 +1 @@
1
- {"version":3,"file":"worksheet-types.js","sources":["../../../../src/features/worksheet/worksheet/worksheet-types.ts"],"sourcesContent":["import type { MutableRefObject, ReactElement } from 'react';\n\nimport type { 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 './worksheet-question/subjective-review';\n\nexport enum QUESTION_TAGS {\n TRIAL_TOPIC = 'trial-topic',\n QUESTION_CODE = 'question code',\n}\n\nexport enum QUESTIONS_RATING {\n E = 3,\n S = 2, // Just right\n H = 1,\n}\n\nexport interface ILearnosityError {\n code: number;\n consumerKey: string;\n detail: string;\n errorUI: string;\n msg: string;\n}\n\ninterface ILearnosityQuestionMetadata {\n widget_reference: string;\n sheet_reference: string;\n hints?: string[];\n solution?: string[];\n teacher_tips?: string[];\n valid_response_count: number;\n source: {\n organisation_id: number;\n };\n}\n\nexport type TInstructorStimulus =\n | 'SystemIntro' // lesson v3\n | 'Intro' // lesson v3\n | 'Concept-Intro' // lesson v3\n | 'Instruction' // lesson v3\n | 'Task' // lesson v3\n | 'Try' // trial v3\n | 'Learn' // trial v3\n | 'Apply'; // trial v3\nexport type TItemType =\n | 'overview'\n | 'learning-we-do'\n | 'learning-your-turn'\n | 'learning-explore'\n | 'practice-basic'\n | 'practice-basic-optional'\n | 'practice-regular'\n | 'practice-regular-optional'\n | 'exit-ticket'\n | 'advanced-we-do'\n | 'advanced-your-turn'\n | 'advanced-explore'\n | 'advanced-practice';\n\nexport type TSectionName =\n | 'overview'\n | 'learning'\n | 'practice-basic'\n | 'practice-regular'\n | 'exit-ticket'\n | 'advanced';\n\nexport interface IQuestionValidResponse {\n score: number;\n value: unknown[];\n}\n\nexport interface ISheetNudgeBannerInfo {\n bannerBackgroundColor: TColorNames;\n label: string;\n}\n\nexport interface ILearnosityQuestion {\n response_id: string;\n instructor_stimulus?: TInstructorStimulus;\n metadata: ILearnosityQuestionMetadata;\n instant_feedback?: boolean;\n math_renderer?: string;\n template?: string;\n tokenization?: string;\n numberPad?: string[];\n symbols?: unknown[];\n response_container?: Record<string, unknown>;\n ui_style?: Record<string, unknown>;\n shuffle_options?: boolean;\n // for custom type question validation is undefined.\n validation?: {\n scoring_type?: string;\n unscored?: boolean;\n valid_response?: IQuestionValidResponse;\n alt_responses?: IQuestionValidResponse[];\n penalty?: number;\n min_score_if_attempted?: number;\n };\n is_math?: boolean;\n labels?: Record<string, unknown>;\n line?: Record<string, unknown>;\n points?: string[];\n snap_to_ticks?: boolean;\n ticks?: Record<string, unknown>;\n max_length?: number;\n type:\n | 'hotspot'\n | 'tokenhighlight'\n | 'numberline'\n | 'clozeassociation'\n | 'clozetext'\n | 'association'\n | 'classification'\n | 'clozedropdown'\n | 'clozeformula'\n | 'mcq'\n | 'choicematrix'\n | 'plaintext'\n | 'drawing';\n case_sensitive?: boolean;\n show_copy?: boolean;\n show_cut?: boolean;\n show_paste?: boolean;\n spellcheck?: boolean;\n stimulus?: string;\n stimulus_review?: string;\n stimulus_list?: string[];\n image?: Record<string, unknown>;\n areas?: unknown[];\n area_attributes?: Record<string, unknown>;\n possible_responses?: string[][] | string[];\n duplicate_responses?: boolean;\n response_containers?: unknown[];\n options?: Record<string, unknown>[] | string[];\n feedback_attempts?: number;\n stems?: string[];\n multiple_responses?: boolean;\n}\n\nexport interface ILearnosityItem {\n reference: string;\n questions: ILearnosityQuestion[];\n source: Record<string, unknown>;\n content: string;\n metadata: Record<string, unknown> | unknown[];\n workflow: unknown[];\n response_ids: string[];\n feature_ids: unknown[];\n features: unknown[];\n itemType?: TItemType;\n tags?: string[];\n}\n\nexport interface IWorksheetQuestion extends ILearnosityQuestion {\n item_reference: string;\n item_type?: TItemType;\n section_name?: TSectionName;\n is_optional?: boolean;\n item_tags: string[];\n item_tags_map: Record<string, string>;\n item_number: number;\n item_display_number: number;\n question_number: number;\n total_questions: number;\n}\n\nexport interface ILearnosityQuestionScore {\n score?: number | null;\n max_score: number;\n unscored?: boolean;\n}\n\nexport interface ILearnosityQuestionResponse {\n value: unknown;\n responses?: unknown;\n type: unknown;\n updatedFormat?: boolean;\n wordCount?: number;\n apiVersion: string;\n revision: number;\n feedbackAttemptsCount?: number;\n}\n\nexport interface IAttempt {\n response: ILearnosityQuestionResponse;\n score: ILearnosityQuestionScore;\n}\n\ninterface ITeacherReview {\n reviewComment?: string;\n images?: string[];\n}\nexport interface IWorksheetResponse {\n widgetReference: string;\n itemReference: string;\n itemPosition: number; // 0 based\n questionPosition: number; // 0 based\n isOkayTypeQuestion: boolean;\n response?: ILearnosityQuestionResponse;\n simState?: Record<string, unknown>;\n score?: ILearnosityQuestionScore;\n responseEdited?: boolean;\n hintsUsed?: number;\n markedForReview?: boolean;\n attemptsHistory?: IAttempt[];\n validatedByTeacher?: boolean;\n submittedByStudent?: boolean;\n assignStatus?: 'assigned' | 'skipped';\n rating?: number;\n skipped?: boolean;\n doubtResolved?: boolean;\n teacherReview?: ITeacherReview;\n tags?: Record<string, string>;\n timeSpent?: number;\n}\n\ntype TMathRenderer = 'mathjax' | 'mathquill';\nexport interface ILearnosity {\n ready: () => void;\n questions: () => Record<string, unknown>;\n question: (responseId: string) =>\n | {\n enable: () => boolean;\n disable: () => boolean;\n getQuestion: () => ILearnosityQuestion;\n getMetadata: () => ILearnosityQuestionMetadata;\n getResponse: () => ILearnosityQuestionResponse;\n getScore: (\n callback?: (score: ILearnosityQuestionScore | null) => void,\n ) => ILearnosityQuestionScore;\n validate: (\n options?: { showCorrectAnswers?: boolean; feedbackAttempts?: boolean },\n callback?: () => void,\n ) => void;\n resetValidationUI: () => void;\n on: (eventName: 'changed', callback: () => void) => void;\n off: (eventName: 'changed', callback?: () => void) => void;\n }\n | undefined;\n append: (toAppend: {\n questions: ILearnosityQuestion[];\n responses?: Record<string, unknown>;\n }) => void;\n appendQuestion: (toAppend: {\n questions: ILearnosityQuestion[];\n responses?: Record<string, unknown>;\n }) => void;\n reset: () => void;\n renderMath: (renderer: TMathRenderer) => void;\n}\n\nexport interface IWorksheetBehavior {\n /**\n * If true, Opens the worksheet in resume mode.\n * - If false, Opens the worksheet in review mode.\n */\n canAttempt: boolean;\n /**\n * If true, the user can mark the question for review.\n */\n canMarkForReview: boolean;\n /**\n * The mode of navigation for the worksheet.\n * - `OPEN` mode allows the user to navigate to any question in the worksheet.\n * - `LINEAR` mode allows the user to navigate to the next question only.\n * - `ADAPTIVE` mode allows the user to navigate future questions based on the rating of the current question.\n * - `CURRENT` mode allows the user to navigate to the current question only. Back and forth not allowed.\n */\n navigationMode: 'OPEN' | 'LINEAR' | 'ADAPTIVE' | 'CURRENT';\n /**\n * The initial question to display when the worksheet is loaded.\n * - `FIRST` mode displays the first question in the worksheet.\n * - `CURRENT` mode displays the question that the user was last on.\n */\n initialQuestion: 'FIRST' | 'CURRENT';\n /**\n * If hints are available, on clicking the help button, first availble hint will be shown.\n * Clicking again will show the next hint.\n * If no more hints are available, onHelp will be called.\n */\n hints: boolean;\n /**\n * The time in seconds after which the hints button will be shown.\n */\n hintsTimer?: number; // in seconds\n /**\n * If true, the user can skip the question without attempting it.\n * Skip button will be shown only after the hints are exausted and skipTimer is reached.\n */\n skippable?: boolean;\n /**\n * The time in seconds after which the user can skip the question.\n */\n skippableTime?: number; // in seconds\n /**\n * If true, teacher validation is needed for the question to proceed\n */\n teacherValidationEnabled: boolean;\n /**\n * If worksheet is attempting outside the class setting\n * This needs teacherValidationEnabled to be true\n * TODO-ANTIL: Accept only validation which can be 'system' or 'teacher' or undefined\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 * 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 TWORKSHHET_QUESTION_MEDIA_TYPE = 'SIMULATION' | 'VIDEO' | 'AUDIO';\n\nexport interface IWorksheetCallbackProps {\n onResponseChange?: (options: {\n responseId: string;\n response: IWorksheetResponse;\n isNewAttempt: boolean;\n question: IWorksheetQuestion;\n }) => void;\n onBulkResponsesChange?: (responses: Record<string, IWorksheetResponse>) => void;\n onResponsesChange?: (responses: Record<string, IWorksheetResponse>) => void;\n onMediaStateChange?: (\n question: IWorksheetQuestion,\n mediaType: TWORKSHHET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n onTeacherValidation?: (questionId: string, rating?: keyof typeof QUESTIONS_RATING) => void;\n onOptionalItemAssignment?: (itemType: TItemType) => void;\n onOptionalItemSkip?: (itemType: TItemType) => void;\n onHelp?: (options: { questionId: string; questionNumber: string }) => void;\n onMinimumAccuracyNotMet?: (accuracy: number) => void;\n onExitTicketStart?: () => void;\n onExitTicketSubmit?: () => void;\n onSubmit?: (responses: Record<string, IWorksheetResponse>) => void;\n loggerRef: MutableRefObject<(eventName: string, data?: Record<string, unknown>) => void>;\n}\n\nexport interface ICueCanvasCallbackProps {\n onPublishStrokes?: TPublish;\n onReceiveStrokes?: TSubscribe;\n}\n\nexport interface ICueCanvasProps {\n initialStrokesData?: Record<string, IActionData[]>;\n}\n\nexport interface IPointerSyncCallbackProps {\n onPublishMouseMove?: TPublishMouseMove;\n onSubscribeMouseMove?: TSubscribeMouseMove;\n}\n\nexport interface IWorksheetLayout {\n containerStyle: 'none' | 'card';\n navigationBar: 'none' | 'top' | 'bottom';\n actionBar: 'none' | 'bottom';\n containerWidth: string;\n topOffset: number; // Offset from the top of the screen, for eg: height of the header\n questionsScrollable: boolean;\n minQuestionHeight: string | number;\n minSummaryHeight: string | number;\n renderSideBar: boolean;\n showUserPointer?: boolean;\n renderQuestionHeader?: boolean;\n imageHue?: THueNames;\n 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 layout: IWorksheetLayout;\n behavior: IWorksheetBehavior;\n initialResponseId?: string;\n initialItemIndex?: number;\n updatedResponses?: Record<string, IWorksheetResponse>;\n worksheetCompleted: boolean;\n showNudgeBanner?: boolean;\n markedAsCompleted?: boolean;\n onResolveDoubt?: (responseId: string) => void;\n onActiveQuestionChange?: (question: IWorksheetQuestion) => void;\n canResolveDoubt?: boolean;\n onSkip?: (itemIndex: number, widgetIndex: number) => void;\n canShowActionBar?: boolean;\n actionBarRightElement?: ReactElement; // Extra Elements to be rendered in the action bar\n}\ninterface StickerFeatureConfig {\n studentClassroomId: string;\n enableStickers: boolean;\n}\n\ninterface FeatureConfigs {\n stickers?: StickerFeatureConfig;\n}\n\nexport interface IWorksheetProps<\n TExtraFeatures extends Record<string, unknown> = Record<string, never>,\n> extends IBaseWorksheetProps,\n IWorksheetCallbackProps,\n ICueCanvasProps,\n ICueCanvasCallbackProps,\n IPointerSyncCallbackProps {\n learnosityActivityRef?: string;\n learnosityItems: ILearnosityItem[];\n learnosityResponses?: Record<string, IWorksheetResponse>;\n learnosity: ILearnosity;\n appendedQuestionIds: string[];\n questionsSignedRequest: string;\n openQuestionFeedbackModal?: (itemRef: string) => void;\n summaryDescription?: ReactElement | null;\n canSubmitWorksheet?: boolean;\n studentId: string;\n attemptId?: string;\n subjectiveProps?: ISubjectiveSheetProps;\n featuresConfig?: FeatureConfigs & TExtraFeatures;\n}\n\nexport interface IUpdateImages {\n filteredImages: string[];\n newImages: IFile[];\n}\nexport interface IOpenImageReviewModalProps {\n isReviewed?: boolean;\n disableScoreForm?: boolean;\n imageUrls?: string[];\n filteredImageUrls?: (props: IUpdateImages) => void;\n uploadedImages?: (IFile | string)[];\n image?: string;\n}\n\nexport interface IWorksheetContainerProps<\n TExtraFeatures extends Record<string, unknown> = Record<string, never>,\n> extends Omit<IBaseWorksheetProps, 'behavior'>,\n IWorksheetCallbackProps,\n ICueCanvasProps,\n ICueCanvasCallbackProps,\n IPointerSyncCallbackProps {\n studentId: string;\n attemptId?: string;\n itemsSignedRequest: string;\n questionsSignedRequest: string;\n onLoaded: () => void;\n onErrored: (error: { code?: number; message: string }) => void;\n onResponsesLoaded?: (responses: Record<string, IWorksheetResponse>) => void;\n openQuestionFeedbackModal?: (itemRef: string) => void;\n summaryDescription?: ReactElement | null;\n canSubmitWorksheet?: boolean;\n subjectiveProps?: ISubjectiveSheetProps;\n inClass?: boolean; // If true, the worksheet is rendered inside class\n isLessonV3Enabled?: boolean; // If true, the worksheet is rendered in lesson v3 mode\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 featuresConfig?: FeatureConfigs & TExtraFeatures;\n}\n\nexport interface IWorksheetRef {\n validateQuestion: (\n responseId: string,\n rating?: keyof typeof QUESTIONS_RATING,\n skipRemainingQuestions?: boolean,\n ) => void;\n assignOptionalItems: (itemType: TItemType) => void;\n skipOptionalItems: (itemType: TItemType) => void;\n updateMediaState: (\n responseId: string,\n mediaType: TWORKSHHET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n}\n\ninterface IWorksheetHeaderLayoutArgs {\n isPuzzleWorksheet?: boolean;\n isTestWorksheet?: boolean;\n imageHue?: THueNames;\n}\n\nexport interface IWorksheetHeaderLayoutProps {\n (args: IWorksheetHeaderLayoutArgs): {\n bgColor: TColorNames;\n borderColor?: TColorNames;\n textColor?: TColorNames;\n };\n}\n"],"names":["QUESTION_TAGS","QUESTIONS_RATING"],"mappings":"AAQY,IAAAA,sBAAAA,OACVA,EAAA,cAAc,eACdA,EAAA,gBAAgB,iBAFNA,IAAAA,KAAA,CAAA,CAAA,GAKAC,sBAAAA,OACVA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KACAA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KACAA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KAHUA,IAAAA,KAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"worksheet-types.js","sources":["../../../../src/features/worksheet/worksheet/worksheet-types.ts"],"sourcesContent":["import type { MutableRefObject, ReactElement } from 'react';\n\nimport type { 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 './worksheet-question/subjective-review';\n\nexport enum QUESTION_TAGS {\n TRIAL_TOPIC = 'trial-topic',\n QUESTION_CODE = 'question code',\n}\n\nexport enum QUESTIONS_RATING {\n E = 3,\n S = 2, // Just right\n H = 1,\n}\n\nexport interface ILearnosityError {\n code: number;\n consumerKey: string;\n detail: string;\n errorUI: string;\n msg: string;\n}\n\ninterface ILearnosityQuestionMetadata {\n widget_reference: string;\n sheet_reference: string;\n hints?: string[];\n solution?: string[];\n teacher_tips?: string[];\n valid_response_count: number;\n source: {\n organisation_id: number;\n };\n}\n\nexport type TInstructorStimulus =\n | 'SystemIntro' // lesson v3\n | 'Intro' // lesson v3\n | 'Concept-Intro' // lesson v3\n | 'Instruction' // lesson v3\n | 'Task' // lesson v3\n | 'Try' // trial v3\n | 'Learn' // trial v3\n | 'Apply'; // trial v3\nexport type TItemType =\n | 'overview'\n | 'learning-we-do'\n | 'learning-your-turn'\n | 'learning-explore'\n | 'practice-basic'\n | 'practice-basic-optional'\n | 'practice-regular'\n | 'practice-regular-optional'\n | 'exit-ticket'\n | 'advanced-we-do'\n | 'advanced-your-turn'\n | 'advanced-explore'\n | 'advanced-practice';\n\nexport type TSectionName =\n | 'overview'\n | 'learning'\n | 'practice-basic'\n | 'practice-regular'\n | 'exit-ticket'\n | 'advanced';\n\nexport interface IQuestionValidResponse {\n score: number;\n value: unknown[];\n}\n\nexport interface ISheetNudgeBannerInfo {\n bannerBackgroundColor: TColorNames;\n label: string;\n}\n\nexport interface ILearnosityQuestion {\n response_id: string;\n instructor_stimulus?: TInstructorStimulus;\n metadata: ILearnosityQuestionMetadata;\n instant_feedback?: boolean;\n math_renderer?: string;\n template?: string;\n tokenization?: string;\n numberPad?: string[];\n symbols?: unknown[];\n response_container?: Record<string, unknown>;\n ui_style?: Record<string, unknown>;\n shuffle_options?: boolean;\n // for custom type question validation is undefined.\n validation?: {\n scoring_type?: string;\n unscored?: boolean;\n valid_response?: IQuestionValidResponse;\n alt_responses?: IQuestionValidResponse[];\n penalty?: number;\n min_score_if_attempted?: number;\n };\n is_math?: boolean;\n labels?: Record<string, unknown>;\n line?: Record<string, unknown>;\n points?: string[];\n snap_to_ticks?: boolean;\n ticks?: Record<string, unknown>;\n max_length?: number;\n type:\n | 'hotspot'\n | 'tokenhighlight'\n | 'numberline'\n | 'clozeassociation'\n | 'clozetext'\n | 'association'\n | 'classification'\n | 'clozedropdown'\n | 'clozeformula'\n | 'mcq'\n | 'choicematrix'\n | 'plaintext'\n | 'drawing';\n case_sensitive?: boolean;\n show_copy?: boolean;\n show_cut?: boolean;\n show_paste?: boolean;\n spellcheck?: boolean;\n stimulus?: string;\n stimulus_review?: string;\n stimulus_list?: string[];\n image?: Record<string, unknown>;\n areas?: unknown[];\n area_attributes?: Record<string, unknown>;\n possible_responses?: string[][] | string[];\n duplicate_responses?: boolean;\n response_containers?: unknown[];\n options?: Record<string, unknown>[] | string[];\n feedback_attempts?: number;\n stems?: string[];\n multiple_responses?: boolean;\n}\n\nexport interface ILearnosityItem {\n reference: string;\n questions: ILearnosityQuestion[];\n source: Record<string, unknown>;\n content: string;\n metadata: Record<string, unknown> | unknown[];\n workflow: unknown[];\n response_ids: string[];\n feature_ids: unknown[];\n features: unknown[];\n itemType?: TItemType;\n tags?: string[];\n}\n\nexport interface IWorksheetQuestion extends ILearnosityQuestion {\n item_reference: string;\n item_type?: TItemType;\n section_name?: TSectionName;\n is_optional?: boolean;\n item_tags: string[];\n item_tags_map: Record<string, string>;\n item_number: number;\n item_display_number: number;\n question_number: number;\n total_questions: number;\n}\n\nexport interface ILearnosityQuestionScore {\n score?: number | null;\n max_score: number;\n unscored?: boolean;\n}\n\nexport interface ILearnosityQuestionResponse {\n value: unknown;\n responses?: unknown;\n type: unknown;\n updatedFormat?: boolean;\n wordCount?: number;\n apiVersion: string;\n revision: number;\n feedbackAttemptsCount?: number;\n}\n\nexport interface IAttempt {\n response: ILearnosityQuestionResponse;\n score: ILearnosityQuestionScore;\n}\n\ninterface ITeacherReview {\n reviewComment?: string;\n images?: string[];\n}\nexport interface IWorksheetResponse {\n widgetReference: string;\n itemReference: string;\n itemPosition: number; // 0 based\n questionPosition: number; // 0 based\n isOkayTypeQuestion: boolean;\n response?: ILearnosityQuestionResponse;\n simState?: Record<string, unknown>;\n score?: ILearnosityQuestionScore;\n responseEdited?: boolean;\n hintsUsed?: number;\n markedForReview?: boolean;\n attemptsHistory?: IAttempt[];\n validatedByTeacher?: boolean;\n submittedByStudent?: boolean;\n assignStatus?: 'assigned' | 'skipped';\n rating?: number;\n skipped?: boolean;\n doubtResolved?: boolean;\n teacherReview?: ITeacherReview;\n tags?: Record<string, string>;\n timeSpent?: number;\n}\n\ntype TMathRenderer = 'mathjax' | 'mathquill';\nexport interface ILearnosity {\n ready: () => void;\n questions: () => Record<string, unknown>;\n question: (responseId: string) =>\n | {\n enable: () => boolean;\n disable: () => boolean;\n getQuestion: () => ILearnosityQuestion;\n getMetadata: () => ILearnosityQuestionMetadata;\n getResponse: () => ILearnosityQuestionResponse;\n getScore: (\n callback?: (score: ILearnosityQuestionScore | null) => void,\n ) => ILearnosityQuestionScore;\n validate: (\n options?: { showCorrectAnswers?: boolean; feedbackAttempts?: boolean },\n callback?: () => void,\n ) => void;\n resetValidationUI: () => void;\n on: (eventName: 'changed', callback: () => void) => void;\n off: (eventName: 'changed', callback?: () => void) => void;\n }\n | undefined;\n append: (toAppend: {\n questions: ILearnosityQuestion[];\n responses?: Record<string, unknown>;\n }) => void;\n appendQuestion: (toAppend: {\n questions: ILearnosityQuestion[];\n responses?: Record<string, unknown>;\n }) => void;\n reset: () => void;\n renderMath: (renderer: TMathRenderer) => void;\n}\n\nexport interface IWorksheetBehavior {\n /**\n * If true, Opens the worksheet in resume mode.\n * - If false, Opens the worksheet in review mode.\n */\n canAttempt: boolean;\n /**\n * If true, the user can mark the question for review.\n */\n canMarkForReview: boolean;\n /**\n * The mode of navigation for the worksheet.\n * - `OPEN` mode allows the user to navigate to any question in the worksheet.\n * - `LINEAR` mode allows the user to navigate to the next question only.\n * - `ADAPTIVE` mode allows the user to navigate future questions based on the rating of the current question.\n * - `CURRENT` mode allows the user to navigate to the current question only. Back and forth not allowed.\n */\n navigationMode: 'OPEN' | 'LINEAR' | 'ADAPTIVE' | 'CURRENT';\n /**\n * The initial question to display when the worksheet is loaded.\n * - `FIRST` mode displays the first question in the worksheet.\n * - `CURRENT` mode displays the question that the user was last on.\n */\n initialQuestion: 'FIRST' | 'CURRENT';\n /**\n * If hints are available, on clicking the help button, first availble hint will be shown.\n * Clicking again will show the next hint.\n * If no more hints are available, onHelp will be called.\n */\n hints: boolean;\n /**\n * The time in seconds after which the hints button will be shown.\n */\n hintsTimer?: number; // in seconds\n /**\n * If true, the user can skip the question without attempting it.\n * Skip button will be shown only after the hints are exausted and skipTimer is reached.\n */\n skippable?: boolean;\n /**\n * The time in seconds after which the user can skip the question.\n */\n skippableTime?: number; // in seconds\n /**\n * If true, teacher validation is needed for the question to proceed\n */\n teacherValidationEnabled: boolean;\n /**\n * If worksheet is attempting outside the class setting\n * This needs teacherValidationEnabled to be true\n * TODO-ANTIL: Accept only validation which can be 'system' or 'teacher' or undefined\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 * 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 TWORKSHHET_QUESTION_MEDIA_TYPE = 'SIMULATION' | 'VIDEO' | 'AUDIO';\n\nexport interface IWorksheetCallbackProps {\n onResponseChange?: (options: {\n responseId: string;\n response: IWorksheetResponse;\n isNewAttempt: boolean;\n question: IWorksheetQuestion;\n }) => void;\n onBulkResponsesChange?: (responses: Record<string, IWorksheetResponse>) => void;\n onResponsesChange?: (responses: Record<string, IWorksheetResponse>) => void;\n onMediaStateChange?: (\n question: IWorksheetQuestion,\n mediaType: TWORKSHHET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n onTeacherValidation?: (questionId: string, rating?: keyof typeof QUESTIONS_RATING) => void;\n onOptionalItemAssignment?: (itemType: TItemType) => void;\n onOptionalItemSkip?: (itemType: TItemType) => void;\n onHelp?: (options: { questionId: string; questionNumber: string }) => void;\n onMinimumAccuracyNotMet?: (accuracy: number) => void;\n onExitTicketStart?: () => void;\n onExitTicketSubmit?: () => void;\n onSubmit?: (responses: Record<string, IWorksheetResponse>) => void;\n loggerRef: MutableRefObject<(eventName: string, data?: Record<string, unknown>) => void>;\n}\n\nexport interface ICueCanvasCallbackProps {\n onPublishStrokes?: TPublish;\n onReceiveStrokes?: TSubscribe;\n}\n\nexport interface ICueCanvasProps {\n initialStrokesData?: Record<string, IActionData[]>;\n}\n\nexport interface IPointerSyncCallbackProps {\n onPublishMouseMove?: TPublishMouseMove;\n onSubscribeMouseMove?: TSubscribeMouseMove;\n}\n\nexport interface IWorksheetLayout {\n containerStyle: 'none' | 'card';\n navigationBar: 'none' | 'top' | 'bottom';\n actionBar: 'none' | 'bottom';\n containerWidth: string;\n topOffset: number; // Offset from the top of the screen, for eg: height of the header\n questionsScrollable: boolean;\n minQuestionHeight: string | number;\n minSummaryHeight: string | number;\n renderSideBar: boolean;\n showUserPointer?: boolean;\n renderQuestionHeader?: boolean;\n imageHue?: THueNames;\n 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 layout: IWorksheetLayout;\n behavior: IWorksheetBehavior;\n initialResponseId?: string;\n initialItemIndex?: number;\n updatedResponses?: Record<string, IWorksheetResponse>;\n worksheetCompleted: boolean;\n showNudgeBanner?: boolean;\n markedAsCompleted?: boolean;\n onResolveDoubt?: (responseId: string) => void;\n onActiveQuestionChange?: (question: IWorksheetQuestion) => void;\n canResolveDoubt?: boolean;\n onSkip?: (itemIndex: number, widgetIndex: number) => void;\n canShowActionBar?: boolean;\n actionBarRightElement?: ReactElement; // Extra Elements to be rendered in the action bar\n}\n\nexport interface IWorksheetProps\n extends IBaseWorksheetProps,\n IWorksheetCallbackProps,\n ICueCanvasProps,\n ICueCanvasCallbackProps,\n IPointerSyncCallbackProps {\n learnosityActivityRef?: string;\n learnosityItems: ILearnosityItem[];\n learnosityResponses?: Record<string, IWorksheetResponse>;\n learnosity: ILearnosity;\n appendedQuestionIds: string[];\n questionsSignedRequest: string;\n openQuestionFeedbackModal?: (itemRef: string) => void;\n summaryDescription?: ReactElement | null;\n canSubmitWorksheet?: boolean;\n studentId: string;\n attemptId?: string;\n subjectiveProps?: ISubjectiveSheetProps;\n}\n\nexport interface IUpdateImages {\n filteredImages: string[];\n newImages: IFile[];\n}\nexport interface IOpenImageReviewModalProps {\n isReviewed?: boolean;\n disableScoreForm?: boolean;\n imageUrls?: string[];\n filteredImageUrls?: (props: IUpdateImages) => void;\n uploadedImages?: (IFile | string)[];\n image?: string;\n}\n\nexport interface IWorksheetContainerProps\n extends Omit<IBaseWorksheetProps, 'behavior'>,\n IWorksheetCallbackProps,\n ICueCanvasProps,\n ICueCanvasCallbackProps,\n IPointerSyncCallbackProps {\n studentId: string;\n attemptId?: string;\n itemsSignedRequest: string;\n questionsSignedRequest: string;\n onLoaded: () => void;\n onErrored: (error: { code?: number; message: string }) => void;\n onResponsesLoaded?: (responses: Record<string, IWorksheetResponse>) => void;\n openQuestionFeedbackModal?: (itemRef: string) => void;\n summaryDescription?: ReactElement | null;\n canSubmitWorksheet?: boolean;\n subjectiveProps?: ISubjectiveSheetProps;\n inClass?: boolean; // If true, the worksheet is rendered inside class\n isLessonV3Enabled?: boolean; // If true, the worksheet is rendered in lesson v3 mode\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}\n\nexport interface IWorksheetRef {\n validateQuestion: (\n responseId: string,\n rating?: keyof typeof QUESTIONS_RATING,\n skipRemainingQuestions?: boolean,\n ) => void;\n assignOptionalItems: (itemType: TItemType) => void;\n skipOptionalItems: (itemType: TItemType) => void;\n updateMediaState: (\n responseId: string,\n mediaType: TWORKSHHET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n}\n\ninterface IWorksheetHeaderLayoutArgs {\n isPuzzleWorksheet?: boolean;\n isTestWorksheet?: boolean;\n imageHue?: THueNames;\n}\n\nexport interface IWorksheetHeaderLayoutProps {\n (args: IWorksheetHeaderLayoutArgs): {\n bgColor: TColorNames;\n borderColor?: TColorNames;\n textColor?: TColorNames;\n };\n}\n"],"names":["QUESTION_TAGS","QUESTIONS_RATING"],"mappings":"AAQY,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;"}