@cuemath/leap 3.4.7-m → 3.4.7-m-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/features/stickers/sticker-selector/sticker-selector.js +12 -12
- package/dist/features/stickers/sticker-selector/sticker-selector.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-sidebar/question-guide.js +58 -115
- package/dist/features/worksheet/worksheet/worksheet-sidebar/question-guide.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-sidebar/sidebar.js +2 -2
- package/dist/features/worksheet/worksheet/worksheet-sidebar/sidebar.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-sidebar/worksheet-sidebar-styled.js +27 -33
- package/dist/features/worksheet/worksheet/worksheet-sidebar/worksheet-sidebar-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-types.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet.js +39 -39
- package/dist/features/worksheet/worksheet/worksheet.js.map +1 -1
- package/dist/index.d.ts +8 -3
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { useHandleStickerSend as
|
|
6
|
-
import { TriggerWrapper as
|
|
2
|
+
import { memo as B, useState as G, useCallback as H, useMemo as c } from "react";
|
|
3
|
+
import K from "../../ui/arrow-tooltip/arrow-tooltip.js";
|
|
4
|
+
import R from "./comps/stiker-selector-grid/sticker-selector-grid.js";
|
|
5
|
+
import { useHandleStickerSend as _ } from "./hooks/use-handle-sticker-send.js";
|
|
6
|
+
import { TriggerWrapper as $ } from "./sticker-selector-styled.js";
|
|
7
7
|
const q = ({
|
|
8
8
|
triggerNode: e,
|
|
9
9
|
studentClassroomId: m,
|
|
@@ -30,20 +30,20 @@ const q = ({
|
|
|
30
30
|
zIndex: M,
|
|
31
31
|
parentWidth: X,
|
|
32
32
|
isBlocking: D = !1
|
|
33
|
-
} = f, [o, n] =
|
|
33
|
+
} = f, [o, n] = G(!1), r = _(m), l = H(
|
|
34
34
|
(W) => {
|
|
35
35
|
if (o) return;
|
|
36
36
|
const d = ["burst-from-edges", "pop-expand", "float-up", "fall-down"], Y = d[Math.floor(Math.random() * d.length)];
|
|
37
37
|
r == null || r(W, Y), n(!0);
|
|
38
|
-
const
|
|
38
|
+
const j = setTimeout(() => {
|
|
39
39
|
n(!1);
|
|
40
40
|
}, 5e3);
|
|
41
|
-
return () => clearTimeout(
|
|
41
|
+
return () => clearTimeout(j);
|
|
42
42
|
},
|
|
43
43
|
[r, o]
|
|
44
44
|
), F = c(
|
|
45
45
|
() => /* @__PURE__ */ t(
|
|
46
|
-
|
|
46
|
+
R,
|
|
47
47
|
{
|
|
48
48
|
columns: i,
|
|
49
49
|
gap: s,
|
|
@@ -53,9 +53,9 @@ const q = ({
|
|
|
53
53
|
}
|
|
54
54
|
),
|
|
55
55
|
[i, s, a, l, o]
|
|
56
|
-
), V = c(() => /* @__PURE__ */ t(
|
|
56
|
+
), V = c(() => /* @__PURE__ */ t($, { $disabled: o, children: e }), [o, e]);
|
|
57
57
|
return /* @__PURE__ */ t(
|
|
58
|
-
|
|
58
|
+
K,
|
|
59
59
|
{
|
|
60
60
|
children: V,
|
|
61
61
|
alwaysVisible: !0,
|
|
@@ -81,7 +81,7 @@ const q = ({
|
|
|
81
81
|
tooltipYCoOrdinates: I
|
|
82
82
|
}
|
|
83
83
|
);
|
|
84
|
-
}, Z =
|
|
84
|
+
}, Z = B(q);
|
|
85
85
|
export {
|
|
86
86
|
Z as default
|
|
87
87
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sticker-selector.js","sources":["../../../../src/features/stickers/sticker-selector/sticker-selector.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { memo, useMemo, useState, useCallback } from 'react';\n\nimport ArrowTooltip from '../../ui/arrow-tooltip/arrow-tooltip';\nimport type { IStickerData, TStickerAnimationEffects } from '../stickers-types';\nimport StickerSelectorGrid from './comps/stiker-selector-grid/sticker-selector-grid';\nimport { useHandleStickerSend } from './hooks/use-handle-sticker-send';\nimport * as Styled from './sticker-selector-styled';\nimport type { IStickerSelectorProps } from './sticker-selector-types';\n\nconst StickerSelector: FC<IStickerSelectorProps> = ({\n triggerNode,\n studentClassroomId,\n gridConfig,\n tooltipConfig,\n visible,\n}) => {\n const { columns = 4, gap = 8, stickerSize = 48 } = gridConfig;\n const {\n isAnimated,\n arrowColor,\n arrowSize,\n arrowXCoOrdinates,\n arrowYCoOrdinates,\n backgroundColor,\n borderColor,\n position = 'bottom',\n renderAs = 'primary',\n textVariant,\n tooltipOffset,\n tooltipXCoOrdinates,\n tooltipYCoOrdinates,\n width,\n widthX,\n zIndex,\n parentWidth,\n isBlocking = false,\n } = tooltipConfig;\n\n const [isTemporarilyDisabled, setIsTemporarilyDisabled] = useState(false);\n\n const sendSticker = useHandleStickerSend(studentClassroomId);\n\n const handleStickerSend = useCallback(\n (sticker: IStickerData) => {\n if (isTemporarilyDisabled) return;\n\n const STICKER_EFFECTS = ['burst-from-edges', 'pop-expand', 'float-up', 'fall-down'] as const;\n\n const randomEffect: TStickerAnimationEffects =\n STICKER_EFFECTS[Math.floor(Math.random() * STICKER_EFFECTS.length)]!;\n\n sendSticker?.(sticker, randomEffect);\n setIsTemporarilyDisabled(true);\n\n const timeout = setTimeout(() => {\n setIsTemporarilyDisabled(false);\n }, 5000);\n\n return () => clearTimeout(timeout);\n },\n [sendSticker, isTemporarilyDisabled],\n );\n\n const tooltipItem = useMemo(\n () => (\n <StickerSelectorGrid\n columns={columns}\n gap={gap}\n stickerSize={stickerSize}\n onStickerClick={handleStickerSend}\n disabled={isTemporarilyDisabled}\n />\n ),\n [columns, gap, stickerSize, handleStickerSend, isTemporarilyDisabled],\n );\n\n const triggerEle = useMemo(() => {\n return (\n <Styled.TriggerWrapper $disabled={isTemporarilyDisabled}>{triggerNode}</Styled.TriggerWrapper>\n );\n }, [isTemporarilyDisabled, triggerNode]);\n\n return (\n <ArrowTooltip\n children={triggerEle}\n alwaysVisible\n hidden={!visible}\n tooltipItem={tooltipItem}\n renderAs={renderAs}\n position={position}\n isBlocking={isBlocking}\n isAnimated={isAnimated}\n zIndex={zIndex}\n width={width}\n widthX={widthX}\n parentWidth={parentWidth}\n backgroundColor={backgroundColor}\n borderColor={borderColor}\n textVariant={textVariant}\n tooltipOffset={tooltipOffset}\n arrowColor={arrowColor}\n arrowSize={arrowSize}\n arrowXCoOrdinates={arrowXCoOrdinates}\n arrowYCoOrdinates={arrowYCoOrdinates}\n tooltipXCoOrdinates={tooltipXCoOrdinates}\n tooltipYCoOrdinates={tooltipYCoOrdinates}\n />\n );\n};\n\nexport default memo(StickerSelector);\n"],"names":["StickerSelector","triggerNode","studentClassroomId","gridConfig","tooltipConfig","visible","columns","gap","stickerSize","isAnimated","arrowColor","arrowSize","arrowXCoOrdinates","arrowYCoOrdinates","backgroundColor","borderColor","position","renderAs","textVariant","tooltipOffset","tooltipXCoOrdinates","tooltipYCoOrdinates","width","widthX","zIndex","parentWidth","isBlocking","isTemporarilyDisabled","setIsTemporarilyDisabled","useState","sendSticker","useHandleStickerSend","handleStickerSend","useCallback","sticker","STICKER_EFFECTS","randomEffect","timeout","tooltipItem","useMemo","jsx","StickerSelectorGrid","triggerEle","Styled.TriggerWrapper","ArrowTooltip","
|
|
1
|
+
{"version":3,"file":"sticker-selector.js","sources":["../../../../src/features/stickers/sticker-selector/sticker-selector.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { memo, useMemo, useState, useCallback } from 'react';\n\nimport ArrowTooltip from '../../ui/arrow-tooltip/arrow-tooltip';\nimport type { IStickerData, TStickerAnimationEffects } from '../stickers-types';\nimport StickerSelectorGrid from './comps/stiker-selector-grid/sticker-selector-grid';\nimport { useHandleStickerSend } from './hooks/use-handle-sticker-send';\nimport * as Styled from './sticker-selector-styled';\nimport type { IStickerSelectorProps } from './sticker-selector-types';\n\nconst StickerSelector: FC<IStickerSelectorProps> = ({\n triggerNode,\n studentClassroomId,\n gridConfig,\n tooltipConfig,\n visible,\n}) => {\n const { columns = 4, gap = 8, stickerSize = 48 } = gridConfig;\n const {\n isAnimated,\n arrowColor,\n arrowSize,\n arrowXCoOrdinates,\n arrowYCoOrdinates,\n backgroundColor,\n borderColor,\n position = 'bottom',\n renderAs = 'primary',\n textVariant,\n tooltipOffset,\n tooltipXCoOrdinates,\n tooltipYCoOrdinates,\n width,\n widthX,\n zIndex,\n parentWidth,\n isBlocking = false,\n } = tooltipConfig;\n\n const [isTemporarilyDisabled, setIsTemporarilyDisabled] = useState(false);\n\n const sendSticker = useHandleStickerSend(studentClassroomId);\n\n const handleStickerSend = useCallback(\n (sticker: IStickerData) => {\n if (isTemporarilyDisabled) return;\n\n const STICKER_EFFECTS = ['burst-from-edges', 'pop-expand', 'float-up', 'fall-down'] as const;\n\n const randomEffect: TStickerAnimationEffects =\n STICKER_EFFECTS[Math.floor(Math.random() * STICKER_EFFECTS.length)]!;\n\n sendSticker?.(sticker, randomEffect);\n setIsTemporarilyDisabled(true);\n\n const timeout = setTimeout(() => {\n setIsTemporarilyDisabled(false);\n }, 5000);\n\n return () => clearTimeout(timeout);\n },\n [sendSticker, isTemporarilyDisabled],\n );\n\n const tooltipItem = useMemo(\n () => (\n <StickerSelectorGrid\n columns={columns}\n gap={gap}\n stickerSize={stickerSize}\n onStickerClick={handleStickerSend}\n disabled={isTemporarilyDisabled}\n />\n ),\n [columns, gap, stickerSize, handleStickerSend, isTemporarilyDisabled],\n );\n\n const triggerEle = useMemo(() => {\n return (\n <Styled.TriggerWrapper $disabled={isTemporarilyDisabled}>{triggerNode}</Styled.TriggerWrapper>\n );\n }, [isTemporarilyDisabled, triggerNode]);\n\n return (\n <ArrowTooltip\n children={triggerEle}\n alwaysVisible\n hidden={!visible}\n tooltipItem={tooltipItem}\n renderAs={renderAs}\n position={position}\n isBlocking={isBlocking}\n isAnimated={isAnimated}\n zIndex={zIndex}\n width={width}\n widthX={widthX}\n parentWidth={parentWidth}\n backgroundColor={backgroundColor}\n borderColor={borderColor}\n textVariant={textVariant}\n tooltipOffset={tooltipOffset}\n arrowColor={arrowColor}\n arrowSize={arrowSize}\n arrowXCoOrdinates={arrowXCoOrdinates}\n arrowYCoOrdinates={arrowYCoOrdinates}\n tooltipXCoOrdinates={tooltipXCoOrdinates}\n tooltipYCoOrdinates={tooltipYCoOrdinates}\n />\n );\n};\n\nexport default memo(StickerSelector);\n"],"names":["StickerSelector","triggerNode","studentClassroomId","gridConfig","tooltipConfig","visible","columns","gap","stickerSize","isAnimated","arrowColor","arrowSize","arrowXCoOrdinates","arrowYCoOrdinates","backgroundColor","borderColor","position","renderAs","textVariant","tooltipOffset","tooltipXCoOrdinates","tooltipYCoOrdinates","width","widthX","zIndex","parentWidth","isBlocking","isTemporarilyDisabled","setIsTemporarilyDisabled","useState","sendSticker","useHandleStickerSend","handleStickerSend","useCallback","sticker","STICKER_EFFECTS","randomEffect","timeout","tooltipItem","useMemo","jsx","StickerSelectorGrid","triggerEle","Styled.TriggerWrapper","ArrowTooltip","stickerSelector","memo"],"mappings":";;;;;;AAUA,MAAMA,IAA6C,CAAC;AAAA,EAClD,aAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,eAAAC;AAAA,EACA,SAAAC;AACF,MAAM;AACJ,QAAM,EAAE,SAAAC,IAAU,GAAG,KAAAC,IAAM,GAAG,aAAAC,IAAc,GAAO,IAAAL,GAC7C;AAAA,IACJ,YAAAM;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,aAAAC;AAAA,IACA,eAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,OAAAC;AAAA,IACA,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iBAAAX;AAAA,MACA,aAAAC;AAAA,MACA,aAAAG;AAAA,MACA,eAAAC;AAAA,MACA,YAAAT;AAAA,MACA,WAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,qBAAAO;AAAA,MACA,qBAAAC;AAAA,IAAA;AAAA,EAAA;AAGN,GAEewB,IAAAC,EAAK9C,CAAe;"}
|
|
@@ -1,146 +1,89 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { memo as
|
|
3
|
-
import { useGetEligibleJourneysViaRoute as D } from "../../../journey/hooks/use-get-eligible-journeys-via-route.js";
|
|
4
|
-
import { JOURNEY_ID_TEACHER as Y } from "../../../journey/journey-id/journey-id-teacher.js";
|
|
5
|
-
import { useJourney as F } from "../../../journey/use-journey/use-journey.js";
|
|
6
|
-
import { useStickersJourney as Q } from "../../../stickers/sticker-selector/hooks/use-stickers-journey/use-stickers-journey.js";
|
|
7
|
-
import Z from "../../../stickers/sticker-selector/sticker-selector.js";
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { memo as v, useState as H, useCallback as h, useMemo as X, useRef as N, useEffect as y } from "react";
|
|
8
3
|
import f from "../../../ui/buttons/clickable/clickable.js";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
const
|
|
4
|
+
import c from "../../../ui/layout/flex-view.js";
|
|
5
|
+
import P from "../../../ui/separator/separator.js";
|
|
6
|
+
import u from "../../../ui/text/text.js";
|
|
7
|
+
import _ from "../../constants/events.js";
|
|
8
|
+
import { GuideContainer as V, HintIcon as j, SolIcon as x, Pointer as B, SectionContainer as W, Section as K, CloseIcon as M, Guide as Y } from "./worksheet-sidebar-styled.js";
|
|
9
|
+
const ee = v(
|
|
15
10
|
({
|
|
16
|
-
questionWidth:
|
|
17
|
-
questions:
|
|
18
|
-
activeQuestionIndex:
|
|
19
|
-
learnosity:
|
|
20
|
-
actionbarHeight:
|
|
21
|
-
loggerRef:
|
|
22
|
-
|
|
11
|
+
questionWidth: S,
|
|
12
|
+
questions: k,
|
|
13
|
+
activeQuestionIndex: O,
|
|
14
|
+
learnosity: b,
|
|
15
|
+
actionbarHeight: E,
|
|
16
|
+
loggerRef: l,
|
|
17
|
+
plugins: m
|
|
23
18
|
}) => {
|
|
24
|
-
var
|
|
25
|
-
const [t,
|
|
19
|
+
var g;
|
|
20
|
+
const [t, d] = H(), [A, R] = H({
|
|
26
21
|
top: 0,
|
|
27
22
|
left: 0
|
|
28
|
-
}),
|
|
29
|
-
|
|
30
|
-
}, [
|
|
31
|
-
|
|
32
|
-
}, [
|
|
33
|
-
|
|
23
|
+
}), { top: I, left: p } = A, w = h(() => {
|
|
24
|
+
d("HINT"), l.current(_.WORKSHEET_V3_HINT_SEEN);
|
|
25
|
+
}, [l]), G = h(() => {
|
|
26
|
+
d("SOL"), l.current(_.WORKSHEET_V3_SOLUTION_SEEN);
|
|
27
|
+
}, [l]), L = h(() => {
|
|
28
|
+
d(() => {
|
|
34
29
|
});
|
|
35
|
-
}, []),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
top: l.top + l.height / 2 - 8,
|
|
42
|
-
left: l.right - 78
|
|
30
|
+
}, []), { hints: o, solution: s } = ((g = k[O]) == null ? void 0 : g.metadata) || {}, n = X(() => t === void 0 ? void 0 : t === "HINT" ? o : s, [t, o, s]), C = N(null), T = N(null), $ = h((a) => {
|
|
31
|
+
if (a.current) {
|
|
32
|
+
const i = a.current.getBoundingClientRect();
|
|
33
|
+
R({
|
|
34
|
+
top: i.top + i.height / 2 - 8,
|
|
35
|
+
left: i.right - 78
|
|
43
36
|
// 52px (sidebar width) + 16px (gutter) + 10px
|
|
44
37
|
});
|
|
45
38
|
}
|
|
46
|
-
}, [])
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
stickerSize: 48,
|
|
56
|
-
columns: 4,
|
|
57
|
-
gap: 8
|
|
58
|
-
}),
|
|
59
|
-
[]
|
|
60
|
-
), W = m(
|
|
61
|
-
() => ({
|
|
62
|
-
position: "left",
|
|
63
|
-
zIndex: 1e3,
|
|
64
|
-
arrowYCoOrdinates: -175,
|
|
65
|
-
tooltipXCoOrdinates: "7.5%",
|
|
66
|
-
tooltipYCoOrdinates: "40%"
|
|
67
|
-
}),
|
|
68
|
-
[]
|
|
69
|
-
), M = {
|
|
70
|
-
position: "left",
|
|
71
|
-
tooltipXCoOrdinates: 20,
|
|
72
|
-
tooltipYCoOrdinates: -20
|
|
73
|
-
}, w = D([
|
|
74
|
-
Y.STICKERS_INTRO_JOURNEY
|
|
75
|
-
]), { isJourneyActive: y } = F(), { startTeacherStickersJourney: A } = Q({
|
|
76
|
-
triggerRef: k,
|
|
77
|
-
triggerElement: H,
|
|
78
|
-
tooltipConfig: M
|
|
79
|
-
});
|
|
80
|
-
return t && r && I && I.renderMath("mathjax"), z(() => {
|
|
81
|
-
t === "HINT" ? S(N) : t === "SOL" ? S(_) : r || h(void 0), w.includes(Y.STICKERS_INTRO_JOURNEY) && !y && A();
|
|
82
|
-
}, [
|
|
83
|
-
t,
|
|
84
|
-
S,
|
|
85
|
-
r,
|
|
86
|
-
w,
|
|
87
|
-
y,
|
|
88
|
-
A
|
|
89
|
-
]), /* @__PURE__ */ o(te, { $background: "WHITE", children: [
|
|
90
|
-
b && /* @__PURE__ */ e(
|
|
91
|
-
Z,
|
|
92
|
-
{
|
|
93
|
-
triggerNode: H,
|
|
94
|
-
studentClassroomId: b,
|
|
95
|
-
gridConfig: U,
|
|
96
|
-
tooltipConfig: W,
|
|
97
|
-
visible: g,
|
|
98
|
-
onToggle: p
|
|
99
|
-
}
|
|
100
|
-
),
|
|
101
|
-
/* @__PURE__ */ e(f, { label: "hints", onClick: j, disabled: !n, children: /* @__PURE__ */ o(i, { $alignItems: "center", $justifyContent: "center", ref: N, children: [
|
|
102
|
-
/* @__PURE__ */ e(oe, { width: 32, height: 32, $disabled: !n }),
|
|
103
|
-
/* @__PURE__ */ e(d, { $renderAs: "eyebrow2", $color: n ? "BLACK" : "GREY_4", children: "HINT" }),
|
|
104
|
-
/* @__PURE__ */ e(i, { $gap: 8, $alignItems: "center", children: /* @__PURE__ */ e(v, { width: 24, height: 1, background: "GREY_2" }) })
|
|
39
|
+
}, []);
|
|
40
|
+
return t && n && b && b.renderMath("mathjax"), y(() => {
|
|
41
|
+
t === "HINT" ? $(T) : t === "SOL" ? $(C) : n || d(void 0);
|
|
42
|
+
}, [t, $, n]), /* @__PURE__ */ r(V, { $background: "WHITE", children: [
|
|
43
|
+
(m == null ? void 0 : m.stickers) ?? null,
|
|
44
|
+
/* @__PURE__ */ e(f, { label: "hints", onClick: w, disabled: !o, children: /* @__PURE__ */ r(c, { $alignItems: "center", $justifyContent: "center", ref: T, children: [
|
|
45
|
+
/* @__PURE__ */ e(j, { width: 32, height: 32, $disabled: !o }),
|
|
46
|
+
/* @__PURE__ */ e(u, { $renderAs: "eyebrow2", $color: o ? "BLACK" : "GREY_4", children: "HINT" }),
|
|
47
|
+
/* @__PURE__ */ e(c, { $gap: 8, $alignItems: "center", children: /* @__PURE__ */ e(P, { width: 24, height: 1, background: "GREY_2" }) })
|
|
105
48
|
] }) }),
|
|
106
|
-
/* @__PURE__ */ e(f, { label: "solution", onClick:
|
|
107
|
-
/* @__PURE__ */ e(
|
|
108
|
-
/* @__PURE__ */ e(
|
|
49
|
+
/* @__PURE__ */ e(f, { label: "solution", onClick: G, disabled: !s, children: /* @__PURE__ */ r(c, { $alignItems: "center", $justifyContent: "center", ref: C, children: [
|
|
50
|
+
/* @__PURE__ */ e(x, { width: 32, height: 32, $disabled: !s }),
|
|
51
|
+
/* @__PURE__ */ e(u, { $renderAs: "eyebrow2", $color: o ? "BLACK" : "GREY_4", children: "SOL" })
|
|
109
52
|
] }) }),
|
|
110
|
-
t &&
|
|
53
|
+
t && I && p && /* @__PURE__ */ e(B, { topValue: I, leftValue: p }),
|
|
111
54
|
t && /* @__PURE__ */ e(
|
|
112
|
-
|
|
55
|
+
W,
|
|
113
56
|
{
|
|
114
57
|
$background: "WHITE",
|
|
115
|
-
$questionWidth:
|
|
116
|
-
$actionbarHeight:
|
|
58
|
+
$questionWidth: S,
|
|
59
|
+
$actionbarHeight: E,
|
|
117
60
|
$borderRadius: 10,
|
|
118
|
-
children: /* @__PURE__ */
|
|
119
|
-
|
|
61
|
+
children: /* @__PURE__ */ r(
|
|
62
|
+
K,
|
|
120
63
|
{
|
|
121
64
|
$gutterX: 1,
|
|
122
65
|
$gapX: 1,
|
|
123
|
-
$questionWidth:
|
|
124
|
-
$actionbarHeight:
|
|
66
|
+
$questionWidth: S,
|
|
67
|
+
$actionbarHeight: E,
|
|
125
68
|
children: [
|
|
126
|
-
/* @__PURE__ */ e(f, { label: "close", onClick:
|
|
127
|
-
/* @__PURE__ */ e(
|
|
128
|
-
|
|
129
|
-
|
|
69
|
+
/* @__PURE__ */ e(f, { label: "close", onClick: L, children: /* @__PURE__ */ e(M, {}) }),
|
|
70
|
+
/* @__PURE__ */ e(c, { $gutterX: 0.5, children: /* @__PURE__ */ e(u, { $renderAs: "eyebrow2", $color: "ORANGE_5", $marginBottomX: 0.25, children: t === "HINT" ? "HINTS:" : "SOLUTION:" }) }),
|
|
71
|
+
n && n.map((a, i) => /* @__PURE__ */ r(c, { $gutterX: 0.5, $gapX: 0.5, children: [
|
|
72
|
+
n.length > 1 && /* @__PURE__ */ r(u, { $renderAs: "eyebrow2", $color: "ORANGE_5", $marginBottomX: 0.25, children: [
|
|
130
73
|
t,
|
|
131
74
|
" ",
|
|
132
|
-
|
|
75
|
+
i + 1,
|
|
133
76
|
":"
|
|
134
77
|
] }),
|
|
135
78
|
/* @__PURE__ */ e(
|
|
136
|
-
|
|
79
|
+
Y,
|
|
137
80
|
{
|
|
138
81
|
dangerouslySetInnerHTML: {
|
|
139
|
-
__html:
|
|
82
|
+
__html: a
|
|
140
83
|
}
|
|
141
84
|
}
|
|
142
85
|
)
|
|
143
|
-
] },
|
|
86
|
+
] }, i.toString()))
|
|
144
87
|
]
|
|
145
88
|
}
|
|
146
89
|
)
|
|
@@ -150,6 +93,6 @@ const Te = q(
|
|
|
150
93
|
}
|
|
151
94
|
);
|
|
152
95
|
export {
|
|
153
|
-
|
|
96
|
+
ee as default
|
|
154
97
|
};
|
|
155
98
|
//# sourceMappingURL=question-guide.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"question-guide.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-sidebar/question-guide.tsx"],"sourcesContent":["import React, {\n memo,\n useCallback,\n useEffect,\n useMemo,\n useState,\n useRef,\n type ReactElement,\n type RefObject,\n} from 'react';\n\nimport { useGetEligibleJourneysViaRoute } from '../../../journey/hooks/use-get-eligible-journeys-via-route';\nimport { JOURNEY_ID_TEACHER } from '../../../journey/journey-id/journey-id-teacher';\nimport { useJourney } from '../../../journey/use-journey/use-journey';\nimport { useStickersJourney } from '../../../stickers/sticker-selector/hooks/use-stickers-journey/use-stickers-journey';\nimport StickerSelector from '../../../stickers/sticker-selector/sticker-selector';\nimport {\n type IArrowTooltipProps,\n type TPositionProps,\n} from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport Clickable from '../../../ui/buttons/clickable/clickable';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport EVENTS from '../../constants/events';\nimport type { ILearnosity, IWorksheetProps, IWorksheetQuestion } from '../worksheet-types';\nimport {\n Section,\n GuideContainer,\n CloseIcon,\n SolIcon,\n HintIcon,\n StickersIcon,\n SectionContainer,\n Guide,\n Pointer,\n} from './worksheet-sidebar-styled';\n\ntype TSections = 'HINT' | 'SOL';\n\ninterface IQuestionGuideProps extends Pick<IWorksheetProps, 'loggerRef'> {\n questionWidth: number;\n questions: IWorksheetQuestion[];\n activeQuestionIndex: number;\n learnosity: ILearnosity;\n actionbarHeight: number;\n studentClassroomId?: string;\n}\n\nconst QuestionGuide: React.FC<IQuestionGuideProps> = memo(\n ({\n questionWidth,\n questions,\n activeQuestionIndex,\n learnosity,\n actionbarHeight,\n loggerRef,\n studentClassroomId,\n }) => {\n const [activeSection, setActiveSection] = useState<TSections | undefined>();\n const [pointerPosition, setPointerPosition] = useState({\n top: 0,\n left: 0,\n });\n const [showStickers, setShowStickers] = useState(false);\n const triggerRef = useRef<HTMLDivElement | null>(null);\n const { top, left } = pointerPosition;\n\n const handleHintClick = useCallback(() => {\n setActiveSection('HINT');\n loggerRef.current(EVENTS.WORKSHEET_V3_HINT_SEEN);\n }, [loggerRef]);\n const handleSolClick = useCallback(() => {\n setActiveSection('SOL');\n loggerRef.current(EVENTS.WORKSHEET_V3_SOLUTION_SEEN);\n }, [loggerRef]);\n const handleClose = useCallback(() => {\n setActiveSection(() => undefined);\n }, []);\n const handleBadgeToggle = useCallback(() => {\n setShowStickers(prev => !prev);\n }, []);\n\n const { hints, solution } = questions[activeQuestionIndex]?.metadata || {};\n\n const activeSectionData = useMemo(() => {\n return activeSection === undefined ? undefined : activeSection === 'HINT' ? hints : solution;\n }, [activeSection, hints, solution]);\n\n const sqlRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const hintRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n\n const updatePointerPosition = useCallback((ref: React.RefObject<HTMLDivElement>) => {\n if (ref.current) {\n const rect = ref.current.getBoundingClientRect();\n\n setPointerPosition({\n top: rect.top + rect.height / 2 - 8,\n left: rect.right - 78, // 52px (sidebar width) + 16px (gutter) + 10px\n });\n }\n }, []);\n\n const stickerTrigger = useMemo(\n () => (\n <div ref={triggerRef}>\n <Clickable label=\"teacher-badges\" onClick={handleBadgeToggle}>\n <FlexView $alignItems=\"center\" $justifyContent=\"center\">\n <StickersIcon width={32} height={32} $disabled={!showStickers} />\n <Text $renderAs=\"eyebrow2\" $color={!showStickers ? 'GREY_4' : 'BLACK'}>\n STICKERS\n </Text>\n <FlexView $gap={8} $alignItems=\"center\">\n <Separator width={24} height={1} background=\"GREY_2\" />\n </FlexView>\n </FlexView>\n </Clickable>\n </div>\n ),\n [showStickers, handleBadgeToggle],\n );\n\n const stickerGridConfig = useMemo(\n () => ({\n stickerSize: 48,\n columns: 4,\n gap: 8,\n }),\n [],\n );\n\n const stickerTooltipConfig = useMemo(\n () => ({\n position: 'left' as TPositionProps,\n zIndex: 1000,\n arrowYCoOrdinates: -175,\n tooltipXCoOrdinates: '7.5%',\n tooltipYCoOrdinates: '40%',\n }),\n [],\n );\n\n const coachmarkConfig = {\n position: 'left',\n tooltipXCoOrdinates: 20,\n tooltipYCoOrdinates: -20,\n };\n\n const eligibleJourneyIds = useGetEligibleJourneysViaRoute([\n JOURNEY_ID_TEACHER.STICKERS_INTRO_JOURNEY,\n ]);\n\n const { isJourneyActive } = useJourney();\n\n const { startTeacherStickersJourney } = useStickersJourney({\n triggerRef: triggerRef as RefObject<HTMLDivElement>,\n triggerElement: stickerTrigger as ReactElement,\n tooltipConfig: coachmarkConfig as IArrowTooltipProps,\n });\n\n if (activeSection && activeSectionData && learnosity) {\n learnosity.renderMath('mathjax');\n }\n\n useEffect(() => {\n if (activeSection === 'HINT') {\n updatePointerPosition(hintRef);\n } else if (activeSection === 'SOL') {\n updatePointerPosition(sqlRef);\n } else if (!activeSectionData) {\n setActiveSection(undefined);\n }\n\n if (\n eligibleJourneyIds.includes(JOURNEY_ID_TEACHER.STICKERS_INTRO_JOURNEY) &&\n !isJourneyActive\n ) {\n startTeacherStickersJourney();\n }\n }, [\n activeSection,\n updatePointerPosition,\n activeSectionData,\n eligibleJourneyIds,\n isJourneyActive,\n startTeacherStickersJourney,\n ]);\n\n return (\n <GuideContainer $background=\"WHITE\">\n {studentClassroomId && (\n <StickerSelector\n triggerNode={stickerTrigger}\n studentClassroomId={studentClassroomId}\n gridConfig={stickerGridConfig}\n tooltipConfig={stickerTooltipConfig}\n visible={showStickers}\n onToggle={handleBadgeToggle}\n />\n )}\n <Clickable label=\"hints\" onClick={handleHintClick} disabled={!hints}>\n <FlexView $alignItems=\"center\" $justifyContent=\"center\" ref={hintRef}>\n <HintIcon width={32} height={32} $disabled={!hints} />\n <Text $renderAs=\"eyebrow2\" $color={!hints ? 'GREY_4' : 'BLACK'}>\n HINT\n </Text>\n <FlexView $gap={8} $alignItems=\"center\">\n <Separator width={24} height={1} background=\"GREY_2\" />\n </FlexView>\n </FlexView>\n </Clickable>\n <Clickable label=\"solution\" onClick={handleSolClick} disabled={!solution}>\n <FlexView $alignItems=\"center\" $justifyContent=\"center\" ref={sqlRef}>\n <SolIcon width={32} height={32} $disabled={!solution} />\n <Text $renderAs=\"eyebrow2\" $color={!hints ? 'GREY_4' : 'BLACK'}>\n SOL\n </Text>\n </FlexView>\n </Clickable>\n {activeSection && top && left && <Pointer topValue={top} leftValue={left} />}\n {activeSection && (\n <SectionContainer\n $background=\"WHITE\"\n $questionWidth={questionWidth}\n $actionbarHeight={actionbarHeight}\n $borderRadius={10}\n >\n <Section\n $gutterX={1}\n $gapX={1}\n $questionWidth={questionWidth}\n $actionbarHeight={actionbarHeight}\n >\n <Clickable label=\"close\" onClick={handleClose}>\n <CloseIcon />\n </Clickable>\n <FlexView $gutterX={0.5}>\n <Text $renderAs=\"eyebrow2\" $color=\"ORANGE_5\" $marginBottomX={0.25}>\n {activeSection === 'HINT' ? 'HINTS:' : 'SOLUTION:'}\n </Text>\n </FlexView>\n {activeSectionData &&\n activeSectionData.map((item, index) => (\n <FlexView $gutterX={0.5} $gapX={0.5} key={index.toString()}>\n {activeSectionData.length > 1 && (\n <Text $renderAs=\"eyebrow2\" $color=\"ORANGE_5\" $marginBottomX={0.25}>\n {activeSection} {index + 1}:\n </Text>\n )}\n <Guide\n dangerouslySetInnerHTML={{\n __html: item,\n }}\n />\n </FlexView>\n ))}\n </Section>\n </SectionContainer>\n )}\n </GuideContainer>\n );\n },\n);\n\nexport default QuestionGuide;\n"],"names":["QuestionGuide","memo","questionWidth","questions","activeQuestionIndex","learnosity","actionbarHeight","loggerRef","studentClassroomId","activeSection","setActiveSection","useState","pointerPosition","setPointerPosition","showStickers","setShowStickers","triggerRef","useRef","top","left","handleHintClick","useCallback","EVENTS","handleSolClick","handleClose","handleBadgeToggle","prev","hints","solution","_a","activeSectionData","useMemo","sqlRef","hintRef","updatePointerPosition","ref","rect","stickerTrigger","jsx","Clickable","jsxs","FlexView","StickersIcon","Text","Separator","stickerGridConfig","stickerTooltipConfig","coachmarkConfig","eligibleJourneyIds","useGetEligibleJourneysViaRoute","JOURNEY_ID_TEACHER","isJourneyActive","useJourney","startTeacherStickersJourney","useStickersJourney","useEffect","GuideContainer","StickerSelector","HintIcon","SolIcon","Pointer","SectionContainer","Section","CloseIcon","item","index","Guide"],"mappings":";;;;;;;;;;;;;AAiDA,MAAMA,KAA+CC;AAAA,EACnD,CAAC;AAAA,IACC,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,oBAAAC;AAAA,EAAA,MACI;;AACJ,UAAM,CAACC,GAAeC,CAAgB,IAAIC,EAAgC,GACpE,CAACC,GAAiBC,CAAkB,IAAIF,EAAS;AAAA,MACrD,KAAK;AAAA,MACL,MAAM;AAAA,IAAA,CACP,GACK,CAACG,GAAcC,CAAe,IAAIJ,EAAS,EAAK,GAChDK,IAAaC,EAA8B,IAAI,GAC/C,EAAE,KAAAC,GAAK,MAAAC,EAAS,IAAAP,GAEhBQ,IAAkBC,EAAY,MAAM;AACxC,MAAAX,EAAiB,MAAM,GACbH,EAAA,QAAQe,EAAO,sBAAsB;AAAA,IAAA,GAC9C,CAACf,CAAS,CAAC,GACRgB,IAAiBF,EAAY,MAAM;AACvC,MAAAX,EAAiB,KAAK,GACZH,EAAA,QAAQe,EAAO,0BAA0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cACC,UAAU;AAAA,cACV,OAAO;AAAA,cACP,gBAAgB5D;AAAA,cAChB,kBAAkBI;AAAA,cAElB,UAAA;AAAA,gBAAA,gBAAAgC,EAACC,KAAU,OAAM,SAAQ,SAASf,GAChC,UAAA,gBAAAc,EAACyB,MAAU,EACb,CAAA;AAAA,kCACCtB,GAAS,EAAA,UAAU,KAClB,UAAA,gBAAAH,EAACK,KAAK,WAAU,YAAW,QAAO,YAAW,gBAAgB,MAC1D,UAAAlC,MAAkB,SAAS,WAAW,YACzC,CAAA,GACF;AAAA,gBACCqB,KACCA,EAAkB,IAAI,CAACkC,GAAMC,MAC3B,gBAAAzB,EAACC,GAAS,EAAA,UAAU,KAAK,OAAO,KAC7B,UAAA;AAAA,kBAAkBX,EAAA,SAAS,KACzB,gBAAAU,EAAAG,GAAA,EAAK,WAAU,YAAW,QAAO,YAAW,gBAAgB,MAC1D,UAAA;AAAA,oBAAAlC;AAAA,oBAAc;AAAA,oBAAEwD,IAAQ;AAAA,oBAAE;AAAA,kBAAA,GAC7B;AAAA,kBAEF,gBAAA3B;AAAA,oBAAC4B;AAAA,oBAAA;AAAA,sBACC,yBAAyB;AAAA,wBACvB,QAAQF;AAAA,sBACV;AAAA,oBAAA;AAAA,kBACF;AAAA,gBAAA,KAVwCC,EAAM,SAAS,CAWzD,CACD;AAAA,cAAA;AAAA,YAAA;AAAA,UACL;AAAA,QAAA;AAAA,MACF;AAAA,IAEJ,EAAA,CAAA;AAAA,EAEJ;AACF;"}
|
|
1
|
+
{"version":3,"file":"question-guide.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-sidebar/question-guide.tsx"],"sourcesContent":["import type { RefObject, FC } from 'react';\nimport { memo, useCallback, useEffect, useMemo, useState, useRef } from 'react';\n\nimport Clickable from '../../../ui/buttons/clickable/clickable';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport EVENTS from '../../constants/events';\nimport type { ILearnosity, IWorksheetProps, IWorksheetQuestion } from '../worksheet-types';\nimport {\n Section,\n GuideContainer,\n CloseIcon,\n SolIcon,\n HintIcon,\n SectionContainer,\n Guide,\n Pointer,\n} from './worksheet-sidebar-styled';\n\ntype TSections = 'HINT' | 'SOL';\n\ninterface IQuestionGuideProps extends Pick<IWorksheetProps, 'loggerRef'> {\n questionWidth: number;\n questions: IWorksheetQuestion[];\n activeQuestionIndex: number;\n learnosity: ILearnosity;\n actionbarHeight: number;\n studentClassroomId?: string;\n plugins?: IWorksheetProps['plugins'];\n}\n\nconst QuestionGuide: FC<IQuestionGuideProps> = memo(\n ({\n questionWidth,\n questions,\n activeQuestionIndex,\n learnosity,\n actionbarHeight,\n loggerRef,\n plugins,\n }) => {\n const [activeSection, setActiveSection] = useState<TSections | undefined>();\n const [pointerPosition, setPointerPosition] = useState({\n top: 0,\n left: 0,\n });\n const { top, left } = pointerPosition;\n\n const handleHintClick = useCallback(() => {\n setActiveSection('HINT');\n loggerRef.current(EVENTS.WORKSHEET_V3_HINT_SEEN);\n }, [loggerRef]);\n const handleSolClick = useCallback(() => {\n setActiveSection('SOL');\n loggerRef.current(EVENTS.WORKSHEET_V3_SOLUTION_SEEN);\n }, [loggerRef]);\n const handleClose = useCallback(() => {\n setActiveSection(() => undefined);\n }, []);\n\n const { hints, solution } = questions[activeQuestionIndex]?.metadata || {};\n\n const activeSectionData = useMemo(() => {\n return activeSection === undefined ? undefined : activeSection === 'HINT' ? hints : solution;\n }, [activeSection, hints, solution]);\n\n const sqlRef = useRef<HTMLDivElement>(null) as RefObject<HTMLDivElement>;\n const hintRef = useRef<HTMLDivElement>(null) as RefObject<HTMLDivElement>;\n\n const updatePointerPosition = useCallback((ref: RefObject<HTMLDivElement>) => {\n if (ref.current) {\n const rect = ref.current.getBoundingClientRect();\n\n setPointerPosition({\n top: rect.top + rect.height / 2 - 8,\n left: rect.right - 78, // 52px (sidebar width) + 16px (gutter) + 10px\n });\n }\n }, []);\n\n if (activeSection && activeSectionData && learnosity) {\n learnosity.renderMath('mathjax');\n }\n\n useEffect(() => {\n if (activeSection === 'HINT') {\n updatePointerPosition(hintRef);\n } else if (activeSection === 'SOL') {\n updatePointerPosition(sqlRef);\n } else if (!activeSectionData) {\n setActiveSection(undefined);\n }\n }, [activeSection, updatePointerPosition, activeSectionData]);\n\n return (\n <GuideContainer $background=\"WHITE\">\n {plugins?.stickers ?? null}\n <Clickable label=\"hints\" onClick={handleHintClick} disabled={!hints}>\n <FlexView $alignItems=\"center\" $justifyContent=\"center\" ref={hintRef}>\n <HintIcon width={32} height={32} $disabled={!hints} />\n <Text $renderAs=\"eyebrow2\" $color={!hints ? 'GREY_4' : 'BLACK'}>\n HINT\n </Text>\n <FlexView $gap={8} $alignItems=\"center\">\n <Separator width={24} height={1} background=\"GREY_2\" />\n </FlexView>\n </FlexView>\n </Clickable>\n <Clickable label=\"solution\" onClick={handleSolClick} disabled={!solution}>\n <FlexView $alignItems=\"center\" $justifyContent=\"center\" ref={sqlRef}>\n <SolIcon width={32} height={32} $disabled={!solution} />\n <Text $renderAs=\"eyebrow2\" $color={!hints ? 'GREY_4' : 'BLACK'}>\n SOL\n </Text>\n </FlexView>\n </Clickable>\n {activeSection && top && left && <Pointer topValue={top} leftValue={left} />}\n {activeSection && (\n <SectionContainer\n $background=\"WHITE\"\n $questionWidth={questionWidth}\n $actionbarHeight={actionbarHeight}\n $borderRadius={10}\n >\n <Section\n $gutterX={1}\n $gapX={1}\n $questionWidth={questionWidth}\n $actionbarHeight={actionbarHeight}\n >\n <Clickable label=\"close\" onClick={handleClose}>\n <CloseIcon />\n </Clickable>\n <FlexView $gutterX={0.5}>\n <Text $renderAs=\"eyebrow2\" $color=\"ORANGE_5\" $marginBottomX={0.25}>\n {activeSection === 'HINT' ? 'HINTS:' : 'SOLUTION:'}\n </Text>\n </FlexView>\n {activeSectionData &&\n activeSectionData.map((item, index) => (\n <FlexView $gutterX={0.5} $gapX={0.5} key={index.toString()}>\n {activeSectionData.length > 1 && (\n <Text $renderAs=\"eyebrow2\" $color=\"ORANGE_5\" $marginBottomX={0.25}>\n {activeSection} {index + 1}:\n </Text>\n )}\n <Guide\n dangerouslySetInnerHTML={{\n __html: item,\n }}\n />\n </FlexView>\n ))}\n </Section>\n </SectionContainer>\n )}\n </GuideContainer>\n );\n },\n);\n\nexport default QuestionGuide;\n"],"names":["QuestionGuide","memo","questionWidth","questions","activeQuestionIndex","learnosity","actionbarHeight","loggerRef","plugins","activeSection","setActiveSection","useState","pointerPosition","setPointerPosition","top","left","handleHintClick","useCallback","EVENTS","handleSolClick","handleClose","hints","solution","_a","activeSectionData","useMemo","sqlRef","useRef","hintRef","updatePointerPosition","ref","rect","useEffect","jsxs","GuideContainer","Clickable","FlexView","jsx","HintIcon","Text","Separator","SolIcon","Pointer","SectionContainer","Section","CloseIcon","item","index","Guide"],"mappings":";;;;;;;;AAgCA,MAAMA,KAAyCC;AAAA,EAC7C,CAAC;AAAA,IACC,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,SAAAC;AAAA,EAAA,MACI;;AACJ,UAAM,CAACC,GAAeC,CAAgB,IAAIC,EAAgC,GACpE,CAACC,GAAiBC,CAAkB,IAAIF,EAAS;AAAA,MACrD,KAAK;AAAA,MACL,MAAM;AAAA,IAAA,CACP,GACK,EAAE,KAAAG,GAAK,MAAAC,EAAS,IAAAH,GAEhBI,IAAkBC,EAAY,MAAM;AACxC,MAAAP,EAAiB,MAAM,GACbH,EAAA,QAAQW,EAAO,sBAAsB;AAAA,IAAA,GAC9C,CAACX,CAAS,CAAC,GACRY,IAAiBF,EAAY,MAAM;AACvC,MAAAP,EAAiB,KAAK,GACZH,EAAA,QAAQW,EAAO,0BAA0B;AAAA,IAAA,GAClD,CAACX,CAAS,CAAC,GACRa,IAAcH,EAAY,MAAM;AACpC,MAAAP,EAAiB,MAAA;AAAA,OAAe;AAAA,IAClC,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AA,kBAAkBZ,EAAA,SAAS,KACzB,gBAAAS,EAAAM,GAAA,EAAK,WAAU,YAAW,QAAO,YAAW,gBAAgB,MAC1D,UAAA;AAAA,oBAAA9B;AAAA,oBAAc;AAAA,oBAAEsC,IAAQ;AAAA,oBAAE;AAAA,kBAAA,GAC7B;AAAA,kBAEF,gBAAAV;AAAA,oBAACW;AAAA,oBAAA;AAAA,sBACC,yBAAyB;AAAA,wBACvB,QAAQF;AAAA,sBACV;AAAA,oBAAA;AAAA,kBACF;AAAA,gBAAA,KAVwCC,EAAM,SAAS,CAWzD,CACD;AAAA,cAAA;AAAA,YAAA;AAAA,UACL;AAAA,QAAA;AAAA,MACF;AAAA,IAEJ,EAAA,CAAA;AAAA,EAEJ;AACF;"}
|
|
@@ -17,7 +17,7 @@ const U = x(
|
|
|
17
17
|
actionbarHeight: s,
|
|
18
18
|
openQuestionFeedbackModal: e,
|
|
19
19
|
loggerRef: h,
|
|
20
|
-
|
|
20
|
+
plugins: p
|
|
21
21
|
}) => {
|
|
22
22
|
const d = i[m], { item_reference: o } = d ?? {}, $ = C(() => {
|
|
23
23
|
e && e(o || "");
|
|
@@ -41,7 +41,7 @@ const U = x(
|
|
|
41
41
|
learnosity: a,
|
|
42
42
|
actionbarHeight: s,
|
|
43
43
|
loggerRef: h,
|
|
44
|
-
|
|
44
|
+
plugins: p
|
|
45
45
|
}
|
|
46
46
|
),
|
|
47
47
|
/* @__PURE__ */ r(u, { heightX: 0.5 }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-sidebar/sidebar.tsx"],"sourcesContent":["import { memo, useCallback, type FC } from 'react';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport type { TUserTypes } from '../../../ui/types';\nimport { SIDEBAR_WIDTH } from '../constants';\nimport type { ILearnosity, IWorksheetProps, IWorksheetQuestion } from '../worksheet-types';\nimport Navigator from './navigator';\nimport QuestionGuide from './question-guide';\nimport {\n SideBarContainer,\n UnderlinedText,\n UnderlinedTextWrapper,\n} from './worksheet-sidebar-styled';\n\ninterface IWorksheetSideBarProps extends Pick<IWorksheetProps, 'loggerRef'> {\n questionWidth: number;\n questions: IWorksheetQuestion[];\n activeQuestionIndex: number;\n learnosity: ILearnosity;\n userType: TUserTypes;\n height: number | string;\n actionbarHeight: number;\n
|
|
1
|
+
{"version":3,"file":"sidebar.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-sidebar/sidebar.tsx"],"sourcesContent":["import { memo, useCallback, type FC } from 'react';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport type { TUserTypes } from '../../../ui/types';\nimport { SIDEBAR_WIDTH } from '../constants';\nimport type { ILearnosity, IWorksheetProps, IWorksheetQuestion } from '../worksheet-types';\nimport Navigator from './navigator';\nimport QuestionGuide from './question-guide';\nimport {\n SideBarContainer,\n UnderlinedText,\n UnderlinedTextWrapper,\n} from './worksheet-sidebar-styled';\n\ninterface IWorksheetSideBarProps extends Pick<IWorksheetProps, 'loggerRef' | 'plugins'> {\n questionWidth: number;\n questions: IWorksheetQuestion[];\n activeQuestionIndex: number;\n learnosity: ILearnosity;\n userType: TUserTypes;\n height: number | string;\n actionbarHeight: number;\n openQuestionFeedbackModal?: (itemRef: string) => void;\n}\n\nconst WorksheetSideBar: FC<IWorksheetSideBarProps> = memo(\n ({\n questionWidth,\n questions,\n activeQuestionIndex,\n learnosity,\n userType,\n height,\n actionbarHeight,\n openQuestionFeedbackModal,\n loggerRef,\n plugins,\n }) => {\n const activeQuestion = questions[activeQuestionIndex];\n const { item_reference: itemRef } = activeQuestion ?? {};\n\n const onFeedbackClick = useCallback(() => {\n if (openQuestionFeedbackModal) {\n openQuestionFeedbackModal(itemRef || '');\n }\n }, [itemRef, openQuestionFeedbackModal]);\n\n if (userType !== 'TEACHER' || !openQuestionFeedbackModal) return null;\n\n return (\n <SideBarContainer\n $width={SIDEBAR_WIDTH}\n $questionWidth={questionWidth}\n $height={height}\n $justifyContent=\"space-between\"\n >\n <UnderlinedTextWrapper $width={SIDEBAR_WIDTH} $alignItems=\"flex-start\" $gapX={0.5}>\n <UnderlinedText $renderAs=\"cta1\" onClick={onFeedbackClick}>\n Question Feedback\n </UnderlinedText>\n </UnderlinedTextWrapper>\n\n <FlexView>\n <QuestionGuide\n questionWidth={questionWidth}\n questions={questions}\n activeQuestionIndex={activeQuestionIndex}\n learnosity={learnosity}\n actionbarHeight={actionbarHeight}\n loggerRef={loggerRef}\n plugins={plugins}\n />\n <Separator heightX={0.5} />\n <Navigator />\n </FlexView>\n </SideBarContainer>\n );\n },\n);\n\nexport default WorksheetSideBar;\n"],"names":["WorksheetSideBar","memo","questionWidth","questions","activeQuestionIndex","learnosity","userType","height","actionbarHeight","openQuestionFeedbackModal","loggerRef","plugins","activeQuestion","itemRef","onFeedbackClick","useCallback","jsxs","SideBarContainer","SIDEBAR_WIDTH","jsx","UnderlinedTextWrapper","UnderlinedText","FlexView","QuestionGuide","Separator","Navigator"],"mappings":";;;;;;;;AA0BA,MAAMA,IAA+CC;AAAA,EACnD,CAAC;AAAA,IACC,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,2BAAAC;AAAA,IACA,WAAAC;AAAA,IACA,SAAAC;AAAA,EAAA,MACI;AACE,UAAAC,IAAiBT,EAAUC,CAAmB,GAC9C,EAAE,gBAAgBS,MAAYD,KAAkB,CAAA,GAEhDE,IAAkBC,EAAY,MAAM;AACxC,MAAIN,KACFA,EAA0BI,KAAW,EAAE;AAAA,IACzC,GACC,CAACA,GAASJ,CAAyB,CAAC;AAEvC,WAAIH,MAAa,aAAa,CAACG,IAAkC,OAG/D,gBAAAO;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,QAAQC;AAAA,QACR,gBAAgBhB;AAAA,QAChB,SAASK;AAAA,QACT,iBAAgB;AAAA,QAEhB,UAAA;AAAA,UAAA,gBAAAY,EAACC,GAAsB,EAAA,QAAQF,GAAe,aAAY,cAAa,OAAO,KAC5E,UAAC,gBAAAC,EAAAE,GAAA,EAAe,WAAU,QAAO,SAASP,GAAiB,8BAE3D,CAAA,GACF;AAAA,4BAECQ,GACC,EAAA,UAAA;AAAA,YAAA,gBAAAH;AAAA,cAACI;AAAA,cAAA;AAAA,gBACC,eAAArB;AAAA,gBACA,WAAAC;AAAA,gBACA,qBAAAC;AAAA,gBACA,YAAAC;AAAA,gBACA,iBAAAG;AAAA,gBACA,WAAAE;AAAA,gBACA,SAAAC;AAAA,cAAA;AAAA,YACF;AAAA,YACA,gBAAAQ,EAACK,GAAU,EAAA,SAAS,IAAK,CAAA;AAAA,8BACxBC,GAAU,EAAA;AAAA,UAAA,GACb;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import r from "styled-components";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
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
|
|
8
|
-
import { CustomElement as
|
|
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
|
-
),
|
|
22
|
+
), C = r(e)`
|
|
24
23
|
cursor: pointer;
|
|
25
|
-
`,
|
|
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,
|
|
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
|
-
),
|
|
38
|
-
margin-top: ${typeof o == "number" ? `${-o}px` :
|
|
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
|
-
`),
|
|
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
|
-
),
|
|
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
|
-
`,
|
|
63
|
+
`, W = r(d)`
|
|
65
64
|
position: absolute;
|
|
66
65
|
top: 8px;
|
|
67
66
|
right: 16px;
|
|
68
|
-
`,
|
|
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
|
-
`),
|
|
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
|
-
`),
|
|
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
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
-
|
|
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
|
|
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,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,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}\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 studentClassroomId?: 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;"}
|
|
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 { 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\ninterface IWorksheetPlugins {\n plugins?: {\n stickers?: ReactNode;\n };\n}\n\nexport interface IWorksheetProps\n extends IBaseWorksheetProps,\n IWorksheetCallbackProps,\n ICueCanvasProps,\n ICueCanvasCallbackProps,\n IPointerSyncCallbackProps,\n IWorksheetPlugins {\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 IWorksheetPlugins {\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;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs as y, Fragment as st, jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { memo as at, forwardRef as
|
|
2
|
+
import { memo as at, forwardRef as ct, useMemo as z, useState as C, useCallback as S, useEffect as T, useLayoutEffect as dt } from "react";
|
|
3
3
|
import lt from "../../../assets/line-icons/icons/check2.js";
|
|
4
4
|
import mt from "../../../assets/line-icons/icons/info2.js";
|
|
5
5
|
import ut from "../../../helpers/get-device-details.js";
|
|
6
6
|
import ht from "../../sheet-tools/desmos-calculator/desmos-calculator.js";
|
|
7
|
-
import
|
|
7
|
+
import ce from "../../ui/layout/flex-view.js";
|
|
8
8
|
import ft from "../../ui/text/text.js";
|
|
9
9
|
import pt from "../user-pointer-pin/user-pin.js";
|
|
10
|
-
import { WORKSHEET_NUDGE_BANNER_HEIGHT as
|
|
10
|
+
import { WORKSHEET_NUDGE_BANNER_HEIGHT as de, TOP_NAVIGATION_HEIGHT as gt, DESMOS_CALC_POSITION as bt } from "./constants.js";
|
|
11
11
|
import It from "./hooks/use-create-imperative-handle.js";
|
|
12
12
|
import Ct from "./hooks/use-get-active-question-id.js";
|
|
13
13
|
import St from "./hooks/use-time-on-questions.js";
|
|
@@ -66,10 +66,10 @@ const qt = (he, fe) => {
|
|
|
66
66
|
onResolveDoubt: Me,
|
|
67
67
|
onSkip: xe,
|
|
68
68
|
studentId: Re,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
subjectiveProps: Pe,
|
|
70
|
+
canShowActionBar: Qe = !0,
|
|
71
|
+
actionBarRightElement: Ge,
|
|
72
|
+
plugins: Fe
|
|
73
73
|
} = he, { initialQuestion: je, navigationMode: m, teacherValidationEnabled: qe, maximumAttempts: ee } = a, {
|
|
74
74
|
containerStyle: O,
|
|
75
75
|
containerWidth: Le,
|
|
@@ -89,23 +89,23 @@ const qt = (he, fe) => {
|
|
|
89
89
|
sectioned: qe && m !== "ADAPTIVE" && m !== "CURRENT",
|
|
90
90
|
adaptive: m === "ADAPTIVE"
|
|
91
91
|
})
|
|
92
|
-
), [
|
|
92
|
+
), [c, v] = C(
|
|
93
93
|
() => Ce ?? wt(t)
|
|
94
94
|
), [ie, Ye] = C(!1), u = z(
|
|
95
95
|
() => m !== "OPEN" ? le({
|
|
96
96
|
questions: t,
|
|
97
|
-
responses:
|
|
97
|
+
responses: c,
|
|
98
98
|
behavior: a,
|
|
99
99
|
userType: r
|
|
100
100
|
}) : t.length - 1,
|
|
101
|
-
[a, m, t,
|
|
102
|
-
),
|
|
101
|
+
[a, m, t, c, r]
|
|
102
|
+
), d = t[u], n = c[(d == null ? void 0 : d.response_id) ?? ""], { bannerBackgroundColor: Ze, label: et } = At(r, !!U), [E] = C(
|
|
103
103
|
() => Nt({
|
|
104
104
|
questions: t,
|
|
105
105
|
initialQuestion: je,
|
|
106
106
|
lastUnlockedQuestionIndex: le({
|
|
107
107
|
questions: t,
|
|
108
|
-
responses:
|
|
108
|
+
responses: c,
|
|
109
109
|
behavior: a,
|
|
110
110
|
userType: r
|
|
111
111
|
}),
|
|
@@ -115,7 +115,7 @@ const qt = (he, fe) => {
|
|
|
115
115
|
), { activeQuestionId: w, setActiveQuestionId: H, intersectionObserver: X } = Ct(E), l = z(
|
|
116
116
|
() => t.findIndex((e) => e.response_id === w),
|
|
117
117
|
[w, t]
|
|
118
|
-
), [h, K] = C(!1), [ne, N] = C(), [oe, re] = C(!1), se = St(a,
|
|
118
|
+
), [h, K] = C(!1), [ne, N] = C(), [oe, re] = C(!1), se = St(a, c, w), tt = S(
|
|
119
119
|
(e, s, o) => {
|
|
120
120
|
const b = s === "SIMULATION" ? "simState" : void 0;
|
|
121
121
|
b && (f ? v(($) => {
|
|
@@ -188,10 +188,10 @@ const qt = (he, fe) => {
|
|
|
188
188
|
}), T(() => () => {
|
|
189
189
|
X.disconnect();
|
|
190
190
|
}, [X]), T(() => {
|
|
191
|
-
Q &&
|
|
192
|
-
}, [Q,
|
|
191
|
+
Q && c && Q(c);
|
|
192
|
+
}, [Q, c]), T(() => {
|
|
193
193
|
P && v(P);
|
|
194
|
-
}, [P]),
|
|
194
|
+
}, [P]), dt(() => {
|
|
195
195
|
let e;
|
|
196
196
|
return p && E && (ut().browser_name === "Safari" ? e = setTimeout(() => {
|
|
197
197
|
x(E);
|
|
@@ -199,24 +199,24 @@ const qt = (he, fe) => {
|
|
|
199
199
|
clearTimeout(e);
|
|
200
200
|
};
|
|
201
201
|
}, [p, E, V]), T(() => {
|
|
202
|
-
if (a.teacherValidationEnabled &&
|
|
203
|
-
const { item_type: e, instructor_stimulus: s, is_optional: o } =
|
|
202
|
+
if (a.teacherValidationEnabled && d) {
|
|
203
|
+
const { item_type: e, instructor_stimulus: s, is_optional: o } = d;
|
|
204
204
|
r === "TEACHER" && (e === "exit-ticket" && s !== "SystemIntro" ? n != null && n.submittedByStudent && !(n != null && n.validatedByTeacher) ? N("exit-ticket-review-available") : n != null && n.validatedByTeacher ? B() : N("exit-ticket-teacher-intervention") : o ? n != null && n.assignStatus ? B() : N("optional-items-assignment") : o || B());
|
|
205
205
|
}
|
|
206
206
|
}, [
|
|
207
207
|
a.teacherValidationEnabled,
|
|
208
208
|
B,
|
|
209
|
-
|
|
209
|
+
d,
|
|
210
210
|
n,
|
|
211
211
|
r
|
|
212
212
|
]), T(() => {
|
|
213
|
-
if (a.teacherValidationEnabled &&
|
|
214
|
-
const { item_type: e, instructor_stimulus: s } =
|
|
213
|
+
if (a.teacherValidationEnabled && d) {
|
|
214
|
+
const { item_type: e, instructor_stimulus: s } = d;
|
|
215
215
|
r === "STUDENT" && e === "exit-ticket" && s !== "SystemIntro" && (n != null && n.submittedByStudent ? _ == null || _() : W == null || W());
|
|
216
216
|
}
|
|
217
217
|
}, [
|
|
218
218
|
a.teacherValidationEnabled,
|
|
219
|
-
|
|
219
|
+
d,
|
|
220
220
|
n == null ? void 0 : n.submittedByStudent,
|
|
221
221
|
W,
|
|
222
222
|
_,
|
|
@@ -230,12 +230,12 @@ const qt = (he, fe) => {
|
|
|
230
230
|
$alignItems: "center",
|
|
231
231
|
$width: "100%",
|
|
232
232
|
$heightX: 1.75,
|
|
233
|
-
$height:
|
|
233
|
+
$height: de,
|
|
234
234
|
$gap: 8,
|
|
235
235
|
$gutter: 8,
|
|
236
236
|
$flexGap: 8,
|
|
237
237
|
$background: Ze,
|
|
238
|
-
$topOffset: k.topOffset -
|
|
238
|
+
$topOffset: k.topOffset - de,
|
|
239
239
|
children: [
|
|
240
240
|
U ? /* @__PURE__ */ i(ue, { children: /* @__PURE__ */ i(lt, { width: 16, height: 16 }) }) : /* @__PURE__ */ i(ue, { children: /* @__PURE__ */ i(mt, { width: 16, height: 16 }) }),
|
|
241
241
|
/* @__PURE__ */ i(ft, { $renderAs: "ub3", children: et })
|
|
@@ -248,7 +248,7 @@ const qt = (he, fe) => {
|
|
|
248
248
|
{
|
|
249
249
|
placement: "top",
|
|
250
250
|
questions: t,
|
|
251
|
-
responses:
|
|
251
|
+
responses: c,
|
|
252
252
|
activeQuestionIndex: l,
|
|
253
253
|
lastUnlockedQuestionIndex: u,
|
|
254
254
|
behavior: a,
|
|
@@ -257,11 +257,11 @@ const qt = (he, fe) => {
|
|
|
257
257
|
summaryVisible: h
|
|
258
258
|
}
|
|
259
259
|
) }) }),
|
|
260
|
-
ne &&
|
|
260
|
+
ne && d && /* @__PURE__ */ i(xt, { $minHeight: te, $topOffset: V, children: /* @__PURE__ */ i(ce, { $width: q, $justifyContent: "center", $alignItems: "center", children: /* @__PURE__ */ i(
|
|
261
261
|
Tt,
|
|
262
262
|
{
|
|
263
263
|
blocker: ne,
|
|
264
|
-
lastUnlockedQuestion:
|
|
264
|
+
lastUnlockedQuestion: d,
|
|
265
265
|
studentName: pe,
|
|
266
266
|
onBlockerClose: B,
|
|
267
267
|
onOptionalItemAssignment: $e,
|
|
@@ -297,14 +297,14 @@ const qt = (he, fe) => {
|
|
|
297
297
|
userType: r
|
|
298
298
|
}
|
|
299
299
|
),
|
|
300
|
-
|
|
300
|
+
Qe && /* @__PURE__ */ i(
|
|
301
301
|
Qt,
|
|
302
302
|
{
|
|
303
303
|
$height: g,
|
|
304
304
|
$width: O === "card" || ee === -2 ? L - 32 : "100%",
|
|
305
305
|
$isCardView: O === "card",
|
|
306
306
|
children: /* @__PURE__ */ i(
|
|
307
|
-
|
|
307
|
+
ce,
|
|
308
308
|
{
|
|
309
309
|
$gutterX: 1,
|
|
310
310
|
$flexDirection: "row",
|
|
@@ -319,7 +319,7 @@ const qt = (he, fe) => {
|
|
|
319
319
|
behavior: a,
|
|
320
320
|
worksheetName: J,
|
|
321
321
|
questions: t,
|
|
322
|
-
responses:
|
|
322
|
+
responses: c,
|
|
323
323
|
onCalculatorOpen: ot,
|
|
324
324
|
activeQuestionIndex: l,
|
|
325
325
|
lastUnlockedQuestionIndex: u,
|
|
@@ -343,7 +343,7 @@ const qt = (he, fe) => {
|
|
|
343
343
|
showCalculator: oe,
|
|
344
344
|
loggerRef: j,
|
|
345
345
|
onSkip: xe,
|
|
346
|
-
actionBarRightElement:
|
|
346
|
+
actionBarRightElement: Ge
|
|
347
347
|
}
|
|
348
348
|
)
|
|
349
349
|
}
|
|
@@ -364,7 +364,7 @@ const qt = (he, fe) => {
|
|
|
364
364
|
Bt({ questions: t, lastUnlockedQuestionIndex: u, userType: r }).map(
|
|
365
365
|
(e, s) => {
|
|
366
366
|
var I, A;
|
|
367
|
-
const { response_id: o, is_optional: b } = e, $ = (I =
|
|
367
|
+
const { response_id: o, is_optional: b } = e, $ = (I = c[o]) == null ? void 0 : I.assignStatus;
|
|
368
368
|
return a.teacherValidationEnabled && ($ === "skipped" || b && $ !== "assigned" && r === "STUDENT") ? null : /* @__PURE__ */ i(
|
|
369
369
|
Wt,
|
|
370
370
|
{
|
|
@@ -372,8 +372,8 @@ const qt = (he, fe) => {
|
|
|
372
372
|
userType: r,
|
|
373
373
|
worksheetCompleted: Ee,
|
|
374
374
|
question: e,
|
|
375
|
-
response:
|
|
376
|
-
nextQuestionId: m === "ADAPTIVE" || m === "CURRENT" ?
|
|
375
|
+
response: c[o],
|
|
376
|
+
nextQuestionId: m === "ADAPTIVE" || m === "CURRENT" ? d == null ? void 0 : d.response_id : s < u ? (A = t[s + 1]) == null ? void 0 : A.response_id : void 0,
|
|
377
377
|
maxQuestionWidth: q,
|
|
378
378
|
learnosity: p,
|
|
379
379
|
isActive: o === w,
|
|
@@ -397,8 +397,8 @@ const qt = (he, fe) => {
|
|
|
397
397
|
canResolveDoubt: He,
|
|
398
398
|
onResolveDoubt: Me,
|
|
399
399
|
studentId: Re,
|
|
400
|
-
subjectiveProps:
|
|
401
|
-
responses:
|
|
400
|
+
subjectiveProps: Pe,
|
|
401
|
+
responses: c,
|
|
402
402
|
loggerRef: j
|
|
403
403
|
},
|
|
404
404
|
o
|
|
@@ -410,7 +410,7 @@ const qt = (he, fe) => {
|
|
|
410
410
|
{
|
|
411
411
|
worksheetName: J,
|
|
412
412
|
questions: t,
|
|
413
|
-
responses:
|
|
413
|
+
responses: c,
|
|
414
414
|
activeQuestionIndex: l,
|
|
415
415
|
lastUnlockedQuestionIndex: u,
|
|
416
416
|
onItemNumberClick: M,
|
|
@@ -435,12 +435,12 @@ const qt = (he, fe) => {
|
|
|
435
435
|
actionbarHeight: g,
|
|
436
436
|
openQuestionFeedbackModal: Oe,
|
|
437
437
|
loggerRef: j,
|
|
438
|
-
|
|
438
|
+
plugins: Fe
|
|
439
439
|
}
|
|
440
440
|
)
|
|
441
441
|
] })
|
|
442
442
|
] }) : null;
|
|
443
|
-
}, pi = at(
|
|
443
|
+
}, pi = at(ct(qt));
|
|
444
444
|
export {
|
|
445
445
|
pi as default
|
|
446
446
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worksheet.js","sources":["../../../../src/features/worksheet/worksheet/worksheet.tsx"],"sourcesContent":["import type { ForwardRefRenderFunction } from 'react';\n// import { captureMessage } from '@sentry/browser';\nimport {\n forwardRef,\n memo,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useState,\n} from 'react';\n\nimport Check2Icon from '../../../assets/line-icons/icons/check2';\nimport Info2Icon from '../../../assets/line-icons/icons/info2';\nimport getDeviceDetails from '../../../helpers/get-device-details';\nimport DesmosCalculator from '../../sheet-tools/desmos-calculator/desmos-calculator';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\n// import EVENTS from '../constants/events';\nimport UserPointer from '../user-pointer-pin/user-pin';\nimport {\n DESMOS_CALC_POSITION,\n TOP_NAVIGATION_HEIGHT,\n WORKSHEET_NUDGE_BANNER_HEIGHT,\n} from './constants';\nimport useCreateImperativeHandle from './hooks/use-create-imperative-handle';\nimport useGetActiveQuestionId from './hooks/use-get-active-question-id';\nimport useTimeSpentOnQuestions from './hooks/use-time-on-questions';\nimport QuestionTips from './question-tips';\nimport WorksheetActionBar from './worksheet-action-bar/worksheet-action-bar';\nimport WorksheetBlocker from './worksheet-blocker/worksheet-blocker';\nimport type { TWorksheetBlocker } from './worksheet-blocker/worksheet-blocker-types';\nimport {\n getInitialQuestionId,\n getInitialResponses,\n getLastUnlockedQuestionIndex,\n getQuestionMetadata,\n getQuestionsFromItems,\n getRenderableQuestions,\n getWorksheetDimensions,\n getWorksheetNudgeBannerInfo,\n scrollToQuestion,\n} from './worksheet-helpers';\nimport WorksheetNavigation from './worksheet-navigation/worksheet-navigation';\nimport WorksheetQuestion from './worksheet-question/worksheet-question';\nimport Navigator from './worksheet-sidebar/navigator';\nimport WorksheetSideBar from './worksheet-sidebar/sidebar';\nimport * as Styled from './worksheet-styled';\nimport WorksheetSummary from './worksheet-summary/worksheet-summary';\nimport type { IWorksheetProps, IWorksheetRef, IWorksheetResponse } from './worksheet-types';\n\n/**\n *\n * @param learnosityItems cannot not be changed between the renders\n */\nconst WorksheetComp: ForwardRefRenderFunction<IWorksheetRef, IWorksheetProps> = (props, ref) => {\n const {\n userType,\n studentName = 'Student',\n questionsSignedRequest,\n worksheetName,\n initialResponseId,\n initialItemIndex,\n // learnosityActivityRef,\n learnosityItems,\n learnosityResponses,\n layout,\n behavior,\n updatedResponses,\n showNudgeBanner,\n markedAsCompleted,\n onResponseChange,\n onBulkResponsesChange,\n onResponsesChange,\n onMediaStateChange,\n onTeacherValidation,\n onOptionalItemAssignment,\n onOptionalItemSkip,\n onExitTicketStart,\n onExitTicketSubmit,\n onSubmit,\n learnosity,\n appendedQuestionIds,\n worksheetCompleted,\n userId,\n onPublishStrokes,\n onReceiveStrokes,\n initialStrokesData,\n onHelp,\n onPublishMouseMove,\n onSubscribeMouseMove,\n onActiveQuestionChange,\n openQuestionFeedbackModal,\n summaryDescription,\n canSubmitWorksheet,\n loggerRef,\n canResolveDoubt,\n onResolveDoubt,\n onSkip,\n studentId,\n studentClassroomId,\n subjectiveProps,\n canShowActionBar = true,\n actionBarRightElement,\n } = props;\n const { initialQuestion, navigationMode, teacherValidationEnabled, maximumAttempts } = behavior;\n const {\n containerStyle,\n containerWidth,\n minQuestionHeight,\n minSummaryHeight,\n questionsScrollable,\n navigationBar,\n topOffset,\n renderSideBar,\n showUserPointer = true,\n questionPadding,\n } = layout;\n\n const { actionbarHeight, maxQuestionWidth, questionsContainerWidth } = useMemo(\n () => getWorksheetDimensions(learnosityItems, layout),\n [layout, learnosityItems],\n );\n\n const [questions] = useState(() =>\n getQuestionsFromItems(learnosityItems, {\n sectioned:\n teacherValidationEnabled && navigationMode !== 'ADAPTIVE' && navigationMode !== 'CURRENT',\n adaptive: navigationMode === 'ADAPTIVE',\n }),\n );\n\n const [responses, setResponses] = useState<Record<string, IWorksheetResponse>>(\n () => learnosityResponses ?? getInitialResponses(questions),\n );\n const [isScribblingEnabled, setIsScribblingEnabled] = useState(false);\n const lastUnlockedQuestionIndex = useMemo(\n () =>\n navigationMode !== 'OPEN'\n ? getLastUnlockedQuestionIndex({\n questions,\n responses,\n behavior,\n userType,\n })\n : questions.length - 1,\n [behavior, navigationMode, questions, responses, userType],\n );\n\n const lastUnlockedQuestion = questions[lastUnlockedQuestionIndex];\n const lastUnlockedQuestionResponse = responses[lastUnlockedQuestion?.response_id ?? ''];\n\n const { bannerBackgroundColor: nudgeBannerBackgroundColor, label: nudgeBannerLabel } =\n getWorksheetNudgeBannerInfo(userType, Boolean(markedAsCompleted));\n\n const [initialQuestionId] = useState(() =>\n getInitialQuestionId({\n questions,\n initialQuestion,\n lastUnlockedQuestionIndex: getLastUnlockedQuestionIndex({\n questions,\n responses,\n behavior,\n userType,\n }),\n initialResponseId,\n initialItemIndex,\n }),\n );\n\n const { activeQuestionId, setActiveQuestionId, intersectionObserver } =\n useGetActiveQuestionId(initialQuestionId);\n const activeQuestionIndex = useMemo(\n () => questions.findIndex(question => question.response_id === activeQuestionId),\n [activeQuestionId, questions],\n );\n const [summaryVisible, setSummaryVisible] = useState(false);\n const [blocker, setBlocker] = useState<TWorksheetBlocker>();\n\n const [showCalculator, setShowCalculator] = useState(false);\n const getTimeSpentOnQuestion = useTimeSpentOnQuestions(behavior, responses, activeQuestionId);\n\n const handleMediaStateChange = useCallback<NonNullable<typeof onMediaStateChange>>(\n (question, mediaType, mediaState) => {\n const key = mediaType === 'SIMULATION' ? 'simState' : undefined;\n\n if (!key) return;\n\n if (onResponseChange) {\n setResponses(prevResponses => {\n const questionId = question.response_id;\n const questionMeta = getQuestionMetadata(questions, questionId);\n\n if (!questionMeta) return prevResponses;\n\n const updatedResponse = {\n ...questionMeta,\n ...prevResponses[questionId],\n [key]: mediaState,\n };\n\n onResponseChange?.({\n responseId: questionId,\n response: updatedResponse,\n isNewAttempt: false,\n question,\n });\n\n return {\n ...prevResponses,\n [questionId]: updatedResponse,\n };\n });\n } else if (onMediaStateChange) {\n onMediaStateChange(question, mediaType, mediaState);\n }\n },\n [onMediaStateChange, onResponseChange, questions],\n );\n\n const handleMarkForReview = useCallback(\n (questionId: string, markedForReview: boolean) => {\n setResponses(prevResponses => {\n const questionMeta = getQuestionMetadata(questions, questionId);\n\n if (!questionMeta) return prevResponses;\n\n return {\n ...prevResponses,\n [questionId]: {\n ...questionMeta,\n ...prevResponses[questionId],\n markedForReview,\n },\n };\n });\n },\n [questions],\n );\n\n const handleBlockerClose = useCallback(() => {\n setBlocker(prevBlocker => {\n if (prevBlocker) {\n const lastUnlockedQuestionId = questions[lastUnlockedQuestionIndex]?.response_id;\n\n if (lastUnlockedQuestionId) {\n setTimeout(() => {\n scrollToQuestion(lastUnlockedQuestionId);\n }, 50);\n }\n }\n\n return undefined;\n });\n }, [lastUnlockedQuestionIndex, questions]);\n\n const handleItemNumberClick = useCallback(\n (questionId: string) => {\n setSummaryVisible(false);\n\n if (questionsScrollable) {\n requestAnimationFrame(() => scrollToQuestion(questionId));\n } else {\n setActiveQuestionId(questionId);\n }\n },\n [questionsScrollable, setActiveQuestionId],\n );\n\n const onCalculatorClose = useCallback(() => {\n setShowCalculator(false);\n }, []);\n\n const onCalculatorOpen = useCallback(() => {\n setShowCalculator(true);\n }, []);\n\n const handleOnGoToReview = useCallback(() => {\n setSummaryVisible(true);\n }, []);\n\n useEffect(() => {\n const activeQuestion = questions[activeQuestionIndex];\n\n if (activeQuestion && onActiveQuestionChange) {\n onActiveQuestionChange(activeQuestion);\n }\n }, [onActiveQuestionChange, questions, activeQuestionIndex]);\n\n useCreateImperativeHandle(ref, {\n behavior,\n questions,\n setResponses,\n onResponseChange,\n onBulkResponsesChange,\n getTimeSpentOnQuestion,\n });\n\n useEffect(() => {\n return () => {\n intersectionObserver.disconnect();\n };\n }, [intersectionObserver]);\n\n useEffect(() => {\n if (onResponsesChange && responses) {\n onResponsesChange(responses);\n }\n }, [onResponsesChange, responses]);\n\n useEffect(() => {\n if (updatedResponses) {\n setResponses(updatedResponses);\n }\n }, [updatedResponses]);\n\n useLayoutEffect(() => {\n let timer: NodeJS.Timeout;\n\n if (learnosity && initialQuestionId) {\n if (getDeviceDetails().browser_name === 'Safari') {\n timer = setTimeout(() => {\n scrollToQuestion(initialQuestionId);\n }, 400);\n } else {\n scrollToQuestion(initialQuestionId);\n }\n }\n\n return () => {\n clearTimeout(timer);\n };\n }, [learnosity, initialQuestionId, topOffset]);\n\n useEffect(() => {\n if (behavior.teacherValidationEnabled && lastUnlockedQuestion) {\n const { item_type, instructor_stimulus, is_optional } = lastUnlockedQuestion;\n\n if (userType === 'TEACHER') {\n if (item_type === 'exit-ticket' && instructor_stimulus !== 'SystemIntro') {\n if (\n lastUnlockedQuestionResponse?.submittedByStudent &&\n !lastUnlockedQuestionResponse?.validatedByTeacher\n ) {\n setBlocker('exit-ticket-review-available');\n } else if (!lastUnlockedQuestionResponse?.validatedByTeacher) {\n setBlocker('exit-ticket-teacher-intervention');\n } else {\n handleBlockerClose();\n }\n } else if (is_optional) {\n if (!lastUnlockedQuestionResponse?.assignStatus) {\n setBlocker('optional-items-assignment');\n } else {\n handleBlockerClose();\n }\n } else if (!is_optional) {\n handleBlockerClose();\n }\n }\n }\n }, [\n behavior.teacherValidationEnabled,\n handleBlockerClose,\n lastUnlockedQuestion,\n lastUnlockedQuestionResponse,\n userType,\n ]);\n\n useEffect(() => {\n if (behavior.teacherValidationEnabled && lastUnlockedQuestion) {\n const { item_type, instructor_stimulus } = lastUnlockedQuestion;\n\n if (userType === 'STUDENT') {\n if (item_type === 'exit-ticket' && instructor_stimulus !== 'SystemIntro') {\n if (lastUnlockedQuestionResponse?.submittedByStudent) {\n onExitTicketSubmit?.();\n } else {\n onExitTicketStart?.();\n }\n }\n }\n }\n }, [\n behavior.teacherValidationEnabled,\n lastUnlockedQuestion,\n lastUnlockedQuestionResponse?.submittedByStudent,\n onExitTicketStart,\n onExitTicketSubmit,\n userType,\n ]);\n\n // useEffect(() => {\n // if (navigationMode === 'CURRENT') {\n // learnosityItems.forEach(({ reference, questions: itemQuestions }) => {\n // if (itemQuestions.length < 3) {\n // captureMessage(`Diagnostics item has Less than 3 questions: ${reference}`, {\n // tags: {\n // 'content-type': 'learnosity',\n // 'activity-reference': learnosityActivityRef,\n // 'item-reference': reference,\n // },\n // fingerprint: [`diagnostics-item-questions-count-${reference}`], // Add unique fingerprint\n // });\n // } else if (\n // itemQuestions[0]?.instructor_stimulus !== 'Try' ||\n // itemQuestions[1]?.instructor_stimulus !== 'Learn' ||\n // itemQuestions[2]?.instructor_stimulus !== 'Apply'\n // ) {\n // captureMessage(\n // `Diagnostics questions sequence is incorrect expected [Try, Learn, Apply]: ${reference}`,\n // {\n // tags: {\n // 'content-type': 'learnosity',\n // 'activity-reference': learnosityActivityRef,\n // 'item-reference': reference,\n // },\n // fingerprint: [`diagnostics-item-questions-sequence-${reference}`], // Add unique fingerprint\n // },\n // );\n // }\n // });\n // }\n // }, [learnosityActivityRef, learnosityItems, navigationMode]);\n\n // useEffect(() => {\n // questions.forEach(question => {\n // const { validation, item_reference, type, question_number, metadata } = question;\n // const responseNeeded = teacherValidationEnabled ? type !== 'clozetext' : true;\n\n // if (responseNeeded && validation?.valid_response) {\n // const value = validation.valid_response.value ?? [];\n\n // if (value?.length === 0) {\n // const altResponses = validation.alt_responses ?? [];\n // const hasAltResponse = altResponses.some(altResponse => altResponse.value.length > 0);\n\n // if (!hasAltResponse) {\n // captureMessage(`Question has no valid response: ${metadata.widget_reference}`, {\n // tags: {\n // 'content-type': 'learnosity',\n // 'activity-reference': learnosityActivityRef,\n // 'item-reference': item_reference,\n // 'question-number': question_number,\n // 'widget-reference': metadata.widget_reference,\n // },\n // fingerprint: [`no-valid-response-${metadata.widget_reference}`], // Add unique fingerprint\n // });\n // loggerRef.current(EVENTS.WORKSHEET_V3_QUESTION_MISSING_VALIDATION, {\n // item_reference: item_reference,\n // widget_reference: metadata.widget_reference,\n // question_type: type,\n // question_number: question_number,\n // });\n // }\n // }\n // }\n // });\n // }, [learnosityActivityRef, loggerRef, questions, teacherValidationEnabled]);\n\n if (!learnosity) {\n return null;\n }\n\n return (\n <>\n {showNudgeBanner && (\n <Styled.NudgeBannerWrapper\n $flexDirection=\"row\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $width=\"100%\"\n $heightX={1.75}\n $height={WORKSHEET_NUDGE_BANNER_HEIGHT}\n $gap={8}\n $gutter={8}\n $flexGap={8}\n $background={nudgeBannerBackgroundColor}\n $topOffset={layout.topOffset - WORKSHEET_NUDGE_BANNER_HEIGHT}\n >\n {markedAsCompleted ? (\n <Styled.NudgeBannerIcon>\n <Check2Icon width={16} height={16} />\n </Styled.NudgeBannerIcon>\n ) : (\n <Styled.NudgeBannerIcon>\n <Info2Icon width={16} height={16} />\n </Styled.NudgeBannerIcon>\n )}\n\n <Text $renderAs=\"ub3\">{nudgeBannerLabel}</Text>\n </Styled.NudgeBannerWrapper>\n )}\n\n <Styled.WorksheetContainer $background=\"WHITE_1\" $width={containerWidth}>\n {navigationBar === 'top' && (\n <Styled.NavigationContainer $topOffset={topOffset} $height={TOP_NAVIGATION_HEIGHT}>\n <Styled.NavigationWrapper>\n <WorksheetNavigation\n placement=\"top\"\n questions={questions}\n responses={responses}\n activeQuestionIndex={activeQuestionIndex}\n lastUnlockedQuestionIndex={lastUnlockedQuestionIndex}\n behavior={behavior}\n onItemNumberClick={handleItemNumberClick}\n userType={userType}\n summaryVisible={summaryVisible}\n />\n </Styled.NavigationWrapper>\n </Styled.NavigationContainer>\n )}\n {blocker && lastUnlockedQuestion && (\n <Styled.BlockerWrapper $minHeight={minQuestionHeight} $topOffset={topOffset}>\n <FlexView $width={maxQuestionWidth} $justifyContent=\"center\" $alignItems=\"center\">\n <WorksheetBlocker\n blocker={blocker}\n lastUnlockedQuestion={lastUnlockedQuestion}\n studentName={studentName}\n onBlockerClose={handleBlockerClose}\n onOptionalItemAssignment={onOptionalItemAssignment}\n onOptionalItemSkip={onOptionalItemSkip}\n onTeacherValidation={onTeacherValidation}\n />\n </FlexView>\n </Styled.BlockerWrapper>\n )}\n {showUserPointer && (\n <UserPointer\n activeQuestionIndex={activeQuestionIndex}\n onClick={handleItemNumberClick}\n questions={questions}\n bottomOffset={actionbarHeight}\n topOffset={topOffset}\n userType={userType}\n />\n )}\n {showCalculator && (\n <Styled.DesmosCalcWrapper>\n <DesmosCalculator initialPosition={DESMOS_CALC_POSITION} onClose={onCalculatorClose} />\n </Styled.DesmosCalcWrapper>\n )}\n <Styled.ActionbarContainer\n $marginTop={userType === 'TEACHER' && summaryVisible ? '0' : actionbarHeight}\n $height={actionbarHeight}\n $isCardView={containerStyle === 'card'}\n >\n {maximumAttempts !== -2 && (\n <QuestionTips\n width={questionsContainerWidth - 32}\n question={questions[activeQuestionIndex]}\n learnosity={learnosity}\n userType={userType}\n />\n )}\n {canShowActionBar && (\n <Styled.ActionbarWrapper\n $height={actionbarHeight}\n $width={\n containerStyle === 'card' || maximumAttempts === -2\n ? questionsContainerWidth - 32\n : '100%'\n }\n $isCardView={containerStyle === 'card'}\n >\n <FlexView\n $gutterX={1}\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n $width={questionsContainerWidth - 32}\n >\n <WorksheetActionBar\n userType={userType}\n layout={layout}\n behavior={behavior}\n worksheetName={worksheetName}\n questions={questions}\n responses={responses}\n onCalculatorOpen={onCalculatorOpen}\n activeQuestionIndex={activeQuestionIndex}\n lastUnlockedQuestionIndex={lastUnlockedQuestionIndex}\n appendedQuestionIds={appendedQuestionIds}\n learnosity={learnosity}\n canSubmitWorksheet={canSubmitWorksheet}\n isScribblingEnabled={isScribblingEnabled}\n isSummaryVisible={summaryVisible}\n setResponses={setResponses}\n getTimeSpentOnQuestion={getTimeSpentOnQuestion}\n setSummaryVisible={setSummaryVisible}\n setBlocker={setBlocker}\n setIsScribblingEnabled={setIsScribblingEnabled}\n setActiveQuestionId={setActiveQuestionId}\n onItemNumberClick={handleItemNumberClick}\n onGoToReview={handleOnGoToReview}\n onResponseChange={onResponseChange}\n onHelp={onHelp}\n onTeacherValidation={onTeacherValidation}\n onSubmit={onSubmit}\n showCalculator={showCalculator}\n loggerRef={loggerRef}\n onSkip={onSkip}\n actionBarRightElement={actionBarRightElement}\n />\n </FlexView>\n </Styled.ActionbarWrapper>\n )}\n {!summaryVisible && questionsScrollable && userType === 'STUDENT' && (\n <Styled.StudentWorksheetSideBar>\n <Navigator />\n </Styled.StudentWorksheetSideBar>\n )}\n </Styled.ActionbarContainer>\n <Styled.QuestionsWrapper\n $actionbarHeight={actionbarHeight}\n $isCardView={containerStyle === 'card'}\n $questionPadding={questionPadding}\n >\n {getRenderableQuestions({ questions, lastUnlockedQuestionIndex, userType }).map(\n (question, questionIndex) => {\n const { response_id: responseId, is_optional } = question;\n const assignStatus = responses[responseId]?.assignStatus;\n\n if (behavior.teacherValidationEnabled) {\n if (assignStatus === 'skipped') return null;\n\n if (is_optional && assignStatus !== 'assigned' && userType === 'STUDENT') {\n return null;\n }\n }\n\n return (\n <WorksheetQuestion\n key={responseId}\n signedRequest={questionsSignedRequest}\n userType={userType}\n worksheetCompleted={worksheetCompleted}\n question={question}\n response={responses[responseId]}\n nextQuestionId={\n navigationMode === 'ADAPTIVE' || navigationMode === 'CURRENT'\n ? lastUnlockedQuestion?.response_id\n : questionIndex < lastUnlockedQuestionIndex\n ? questions[questionIndex + 1]?.response_id\n : undefined\n }\n maxQuestionWidth={maxQuestionWidth}\n learnosity={learnosity}\n isActive={responseId === activeQuestionId}\n isHidden={\n (!questionsScrollable && responseId !== activeQuestionId) || summaryVisible\n }\n canRender={\n activeQuestionIndex > -1 &&\n (questionIndex === activeQuestionIndex ||\n (navigationMode !== 'CURRENT' && questionIndex === activeQuestionIndex + 1))\n }\n appended={appendedQuestionIds.includes(responseId)}\n behavior={behavior}\n layout={layout}\n actionbarHeight={actionbarHeight}\n intersectionObserver={intersectionObserver}\n onMarkForReview={handleMarkForReview}\n onMediaStateChange={handleMediaStateChange}\n userId={userId}\n isScribblingEnabled={isScribblingEnabled}\n onPublishStrokes={onPublishStrokes}\n onReceiveStrokes={onReceiveStrokes}\n initialStrokesData={initialStrokesData}\n onPublishMouseMove={onPublishMouseMove}\n onSubscribeMouseMove={onSubscribeMouseMove}\n setActiveQuestionId={setActiveQuestionId}\n canResolveDoubt={canResolveDoubt}\n onResolveDoubt={onResolveDoubt}\n studentId={studentId}\n subjectiveProps={subjectiveProps}\n responses={responses}\n loggerRef={loggerRef}\n />\n );\n },\n )}\n {summaryVisible && (\n <WorksheetSummary\n worksheetName={worksheetName}\n questions={questions}\n responses={responses}\n activeQuestionIndex={activeQuestionIndex}\n lastUnlockedQuestionIndex={lastUnlockedQuestionIndex}\n onItemNumberClick={handleItemNumberClick}\n behavior={behavior}\n minHeight={minSummaryHeight}\n summaryDescription={summaryDescription}\n summaryVisible={summaryVisible}\n />\n )}\n </Styled.QuestionsWrapper>\n {!summaryVisible && renderSideBar && (\n <WorksheetSideBar\n questionWidth={maxQuestionWidth}\n questions={questions}\n activeQuestionIndex={activeQuestionIndex}\n learnosity={learnosity}\n userType={userType}\n height={minQuestionHeight}\n actionbarHeight={actionbarHeight}\n openQuestionFeedbackModal={openQuestionFeedbackModal}\n loggerRef={loggerRef}\n studentClassroomId={studentClassroomId}\n />\n )}\n </Styled.WorksheetContainer>\n </>\n );\n};\n\nconst Worksheet = memo(forwardRef(WorksheetComp));\n\nexport default Worksheet;\n"],"names":["WorksheetComp","props","ref","userType","studentName","questionsSignedRequest","worksheetName","initialResponseId","initialItemIndex","learnosityItems","learnosityResponses","layout","behavior","updatedResponses","showNudgeBanner","markedAsCompleted","onResponseChange","onBulkResponsesChange","onResponsesChange","onMediaStateChange","onTeacherValidation","onOptionalItemAssignment","onOptionalItemSkip","onExitTicketStart","onExitTicketSubmit","onSubmit","learnosity","appendedQuestionIds","worksheetCompleted","userId","onPublishStrokes","onReceiveStrokes","initialStrokesData","onHelp","onPublishMouseMove","onSubscribeMouseMove","onActiveQuestionChange","openQuestionFeedbackModal","summaryDescription","canSubmitWorksheet","loggerRef","canResolveDoubt","onResolveDoubt","onSkip","studentId","studentClassroomId","subjectiveProps","canShowActionBar","actionBarRightElement","initialQuestion","navigationMode","teacherValidationEnabled","maximumAttempts","containerStyle","containerWidth","minQuestionHeight","minSummaryHeight","questionsScrollable","navigationBar","topOffset","renderSideBar","showUserPointer","questionPadding","actionbarHeight","maxQuestionWidth","questionsContainerWidth","useMemo","getWorksheetDimensions","questions","useState","getQuestionsFromItems","responses","setResponses","getInitialResponses","isScribblingEnabled","setIsScribblingEnabled","lastUnlockedQuestionIndex","getLastUnlockedQuestionIndex","lastUnlockedQuestion","lastUnlockedQuestionResponse","nudgeBannerBackgroundColor","nudgeBannerLabel","getWorksheetNudgeBannerInfo","initialQuestionId","getInitialQuestionId","activeQuestionId","setActiveQuestionId","intersectionObserver","useGetActiveQuestionId","activeQuestionIndex","question","summaryVisible","setSummaryVisible","blocker","setBlocker","showCalculator","setShowCalculator","getTimeSpentOnQuestion","useTimeSpentOnQuestions","handleMediaStateChange","useCallback","mediaType","mediaState","key","prevResponses","questionId","questionMeta","getQuestionMetadata","updatedResponse","handleMarkForReview","markedForReview","handleBlockerClose","prevBlocker","lastUnlockedQuestionId","_a","scrollToQuestion","handleItemNumberClick","onCalculatorClose","onCalculatorOpen","handleOnGoToReview","useEffect","activeQuestion","useCreateImperativeHandle","useLayoutEffect","timer","getDeviceDetails","item_type","instructor_stimulus","is_optional","jsxs","Fragment","Styled.NudgeBannerWrapper","WORKSHEET_NUDGE_BANNER_HEIGHT","jsx","Styled.NudgeBannerIcon","Check2Icon","Info2Icon","Text","Styled.WorksheetContainer","Styled.NavigationContainer","TOP_NAVIGATION_HEIGHT","Styled.NavigationWrapper","WorksheetNavigation","Styled.BlockerWrapper","FlexView","WorksheetBlocker","UserPointer","Styled.DesmosCalcWrapper","DesmosCalculator","DESMOS_CALC_POSITION","Styled.ActionbarContainer","QuestionTips","Styled.ActionbarWrapper","WorksheetActionBar","Styled.StudentWorksheetSideBar","Navigator","Styled.QuestionsWrapper","getRenderableQuestions","questionIndex","responseId","assignStatus","WorksheetQuestion","_b","WorksheetSummary","WorksheetSideBar","Worksheet","memo","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuDA,MAAMA,KAA0E,CAACC,IAAOC,OAAQ;AACxF,QAAA;AAAA,IACJ,UAAAC;AAAA,IACA,aAAAC,KAAc;AAAA,IACd,wBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,kBAAAC;AAAA;AAAA,IAEA,iBAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,sBAAAC;AAAA,IACA,wBAAAC;AAAA,IACA,2BAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,WAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,kBAAAC,KAAmB;AAAA,IACnB,uB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AA,CAAA,IA3PO;AA6PX,GAEMwH,KAAYC,GAAKC,GAAWvK,EAAa,CAAC;"}
|
|
1
|
+
{"version":3,"file":"worksheet.js","sources":["../../../../src/features/worksheet/worksheet/worksheet.tsx"],"sourcesContent":["import type { ForwardRefRenderFunction } from 'react';\n// import { captureMessage } from '@sentry/browser';\nimport {\n forwardRef,\n memo,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useState,\n} from 'react';\n\nimport Check2Icon from '../../../assets/line-icons/icons/check2';\nimport Info2Icon from '../../../assets/line-icons/icons/info2';\nimport getDeviceDetails from '../../../helpers/get-device-details';\nimport DesmosCalculator from '../../sheet-tools/desmos-calculator/desmos-calculator';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\n// import EVENTS from '../constants/events';\nimport UserPointer from '../user-pointer-pin/user-pin';\nimport {\n DESMOS_CALC_POSITION,\n TOP_NAVIGATION_HEIGHT,\n WORKSHEET_NUDGE_BANNER_HEIGHT,\n} from './constants';\nimport useCreateImperativeHandle from './hooks/use-create-imperative-handle';\nimport useGetActiveQuestionId from './hooks/use-get-active-question-id';\nimport useTimeSpentOnQuestions from './hooks/use-time-on-questions';\nimport QuestionTips from './question-tips';\nimport WorksheetActionBar from './worksheet-action-bar/worksheet-action-bar';\nimport WorksheetBlocker from './worksheet-blocker/worksheet-blocker';\nimport type { TWorksheetBlocker } from './worksheet-blocker/worksheet-blocker-types';\nimport {\n getInitialQuestionId,\n getInitialResponses,\n getLastUnlockedQuestionIndex,\n getQuestionMetadata,\n getQuestionsFromItems,\n getRenderableQuestions,\n getWorksheetDimensions,\n getWorksheetNudgeBannerInfo,\n scrollToQuestion,\n} from './worksheet-helpers';\nimport WorksheetNavigation from './worksheet-navigation/worksheet-navigation';\nimport WorksheetQuestion from './worksheet-question/worksheet-question';\nimport Navigator from './worksheet-sidebar/navigator';\nimport WorksheetSideBar from './worksheet-sidebar/sidebar';\nimport * as Styled from './worksheet-styled';\nimport WorksheetSummary from './worksheet-summary/worksheet-summary';\nimport type { IWorksheetProps, IWorksheetRef, IWorksheetResponse } from './worksheet-types';\n\n/**\n *\n * @param learnosityItems cannot not be changed between the renders\n */\nconst WorksheetComp: ForwardRefRenderFunction<IWorksheetRef, IWorksheetProps> = (props, ref) => {\n const {\n userType,\n studentName = 'Student',\n questionsSignedRequest,\n worksheetName,\n initialResponseId,\n initialItemIndex,\n // learnosityActivityRef,\n learnosityItems,\n learnosityResponses,\n layout,\n behavior,\n updatedResponses,\n showNudgeBanner,\n markedAsCompleted,\n onResponseChange,\n onBulkResponsesChange,\n onResponsesChange,\n onMediaStateChange,\n onTeacherValidation,\n onOptionalItemAssignment,\n onOptionalItemSkip,\n onExitTicketStart,\n onExitTicketSubmit,\n onSubmit,\n learnosity,\n appendedQuestionIds,\n worksheetCompleted,\n userId,\n onPublishStrokes,\n onReceiveStrokes,\n initialStrokesData,\n onHelp,\n onPublishMouseMove,\n onSubscribeMouseMove,\n onActiveQuestionChange,\n openQuestionFeedbackModal,\n summaryDescription,\n canSubmitWorksheet,\n loggerRef,\n canResolveDoubt,\n onResolveDoubt,\n onSkip,\n studentId,\n subjectiveProps,\n canShowActionBar = true,\n actionBarRightElement,\n plugins,\n } = props;\n const { initialQuestion, navigationMode, teacherValidationEnabled, maximumAttempts } = behavior;\n const {\n containerStyle,\n containerWidth,\n minQuestionHeight,\n minSummaryHeight,\n questionsScrollable,\n navigationBar,\n topOffset,\n renderSideBar,\n showUserPointer = true,\n questionPadding,\n } = layout;\n\n const { actionbarHeight, maxQuestionWidth, questionsContainerWidth } = useMemo(\n () => getWorksheetDimensions(learnosityItems, layout),\n [layout, learnosityItems],\n );\n\n const [questions] = useState(() =>\n getQuestionsFromItems(learnosityItems, {\n sectioned:\n teacherValidationEnabled && navigationMode !== 'ADAPTIVE' && navigationMode !== 'CURRENT',\n adaptive: navigationMode === 'ADAPTIVE',\n }),\n );\n\n const [responses, setResponses] = useState<Record<string, IWorksheetResponse>>(\n () => learnosityResponses ?? getInitialResponses(questions),\n );\n const [isScribblingEnabled, setIsScribblingEnabled] = useState(false);\n const lastUnlockedQuestionIndex = useMemo(\n () =>\n navigationMode !== 'OPEN'\n ? getLastUnlockedQuestionIndex({\n questions,\n responses,\n behavior,\n userType,\n })\n : questions.length - 1,\n [behavior, navigationMode, questions, responses, userType],\n );\n\n const lastUnlockedQuestion = questions[lastUnlockedQuestionIndex];\n const lastUnlockedQuestionResponse = responses[lastUnlockedQuestion?.response_id ?? ''];\n\n const { bannerBackgroundColor: nudgeBannerBackgroundColor, label: nudgeBannerLabel } =\n getWorksheetNudgeBannerInfo(userType, Boolean(markedAsCompleted));\n\n const [initialQuestionId] = useState(() =>\n getInitialQuestionId({\n questions,\n initialQuestion,\n lastUnlockedQuestionIndex: getLastUnlockedQuestionIndex({\n questions,\n responses,\n behavior,\n userType,\n }),\n initialResponseId,\n initialItemIndex,\n }),\n );\n\n const { activeQuestionId, setActiveQuestionId, intersectionObserver } =\n useGetActiveQuestionId(initialQuestionId);\n const activeQuestionIndex = useMemo(\n () => questions.findIndex(question => question.response_id === activeQuestionId),\n [activeQuestionId, questions],\n );\n const [summaryVisible, setSummaryVisible] = useState(false);\n const [blocker, setBlocker] = useState<TWorksheetBlocker>();\n\n const [showCalculator, setShowCalculator] = useState(false);\n const getTimeSpentOnQuestion = useTimeSpentOnQuestions(behavior, responses, activeQuestionId);\n\n const handleMediaStateChange = useCallback<NonNullable<typeof onMediaStateChange>>(\n (question, mediaType, mediaState) => {\n const key = mediaType === 'SIMULATION' ? 'simState' : undefined;\n\n if (!key) return;\n\n if (onResponseChange) {\n setResponses(prevResponses => {\n const questionId = question.response_id;\n const questionMeta = getQuestionMetadata(questions, questionId);\n\n if (!questionMeta) return prevResponses;\n\n const updatedResponse = {\n ...questionMeta,\n ...prevResponses[questionId],\n [key]: mediaState,\n };\n\n onResponseChange?.({\n responseId: questionId,\n response: updatedResponse,\n isNewAttempt: false,\n question,\n });\n\n return {\n ...prevResponses,\n [questionId]: updatedResponse,\n };\n });\n } else if (onMediaStateChange) {\n onMediaStateChange(question, mediaType, mediaState);\n }\n },\n [onMediaStateChange, onResponseChange, questions],\n );\n\n const handleMarkForReview = useCallback(\n (questionId: string, markedForReview: boolean) => {\n setResponses(prevResponses => {\n const questionMeta = getQuestionMetadata(questions, questionId);\n\n if (!questionMeta) return prevResponses;\n\n return {\n ...prevResponses,\n [questionId]: {\n ...questionMeta,\n ...prevResponses[questionId],\n markedForReview,\n },\n };\n });\n },\n [questions],\n );\n\n const handleBlockerClose = useCallback(() => {\n setBlocker(prevBlocker => {\n if (prevBlocker) {\n const lastUnlockedQuestionId = questions[lastUnlockedQuestionIndex]?.response_id;\n\n if (lastUnlockedQuestionId) {\n setTimeout(() => {\n scrollToQuestion(lastUnlockedQuestionId);\n }, 50);\n }\n }\n\n return undefined;\n });\n }, [lastUnlockedQuestionIndex, questions]);\n\n const handleItemNumberClick = useCallback(\n (questionId: string) => {\n setSummaryVisible(false);\n\n if (questionsScrollable) {\n requestAnimationFrame(() => scrollToQuestion(questionId));\n } else {\n setActiveQuestionId(questionId);\n }\n },\n [questionsScrollable, setActiveQuestionId],\n );\n\n const onCalculatorClose = useCallback(() => {\n setShowCalculator(false);\n }, []);\n\n const onCalculatorOpen = useCallback(() => {\n setShowCalculator(true);\n }, []);\n\n const handleOnGoToReview = useCallback(() => {\n setSummaryVisible(true);\n }, []);\n\n useEffect(() => {\n const activeQuestion = questions[activeQuestionIndex];\n\n if (activeQuestion && onActiveQuestionChange) {\n onActiveQuestionChange(activeQuestion);\n }\n }, [onActiveQuestionChange, questions, activeQuestionIndex]);\n\n useCreateImperativeHandle(ref, {\n behavior,\n questions,\n setResponses,\n onResponseChange,\n onBulkResponsesChange,\n getTimeSpentOnQuestion,\n });\n\n useEffect(() => {\n return () => {\n intersectionObserver.disconnect();\n };\n }, [intersectionObserver]);\n\n useEffect(() => {\n if (onResponsesChange && responses) {\n onResponsesChange(responses);\n }\n }, [onResponsesChange, responses]);\n\n useEffect(() => {\n if (updatedResponses) {\n setResponses(updatedResponses);\n }\n }, [updatedResponses]);\n\n useLayoutEffect(() => {\n let timer: NodeJS.Timeout;\n\n if (learnosity && initialQuestionId) {\n if (getDeviceDetails().browser_name === 'Safari') {\n timer = setTimeout(() => {\n scrollToQuestion(initialQuestionId);\n }, 400);\n } else {\n scrollToQuestion(initialQuestionId);\n }\n }\n\n return () => {\n clearTimeout(timer);\n };\n }, [learnosity, initialQuestionId, topOffset]);\n\n useEffect(() => {\n if (behavior.teacherValidationEnabled && lastUnlockedQuestion) {\n const { item_type, instructor_stimulus, is_optional } = lastUnlockedQuestion;\n\n if (userType === 'TEACHER') {\n if (item_type === 'exit-ticket' && instructor_stimulus !== 'SystemIntro') {\n if (\n lastUnlockedQuestionResponse?.submittedByStudent &&\n !lastUnlockedQuestionResponse?.validatedByTeacher\n ) {\n setBlocker('exit-ticket-review-available');\n } else if (!lastUnlockedQuestionResponse?.validatedByTeacher) {\n setBlocker('exit-ticket-teacher-intervention');\n } else {\n handleBlockerClose();\n }\n } else if (is_optional) {\n if (!lastUnlockedQuestionResponse?.assignStatus) {\n setBlocker('optional-items-assignment');\n } else {\n handleBlockerClose();\n }\n } else if (!is_optional) {\n handleBlockerClose();\n }\n }\n }\n }, [\n behavior.teacherValidationEnabled,\n handleBlockerClose,\n lastUnlockedQuestion,\n lastUnlockedQuestionResponse,\n userType,\n ]);\n\n useEffect(() => {\n if (behavior.teacherValidationEnabled && lastUnlockedQuestion) {\n const { item_type, instructor_stimulus } = lastUnlockedQuestion;\n\n if (userType === 'STUDENT') {\n if (item_type === 'exit-ticket' && instructor_stimulus !== 'SystemIntro') {\n if (lastUnlockedQuestionResponse?.submittedByStudent) {\n onExitTicketSubmit?.();\n } else {\n onExitTicketStart?.();\n }\n }\n }\n }\n }, [\n behavior.teacherValidationEnabled,\n lastUnlockedQuestion,\n lastUnlockedQuestionResponse?.submittedByStudent,\n onExitTicketStart,\n onExitTicketSubmit,\n userType,\n ]);\n\n // useEffect(() => {\n // if (navigationMode === 'CURRENT') {\n // learnosityItems.forEach(({ reference, questions: itemQuestions }) => {\n // if (itemQuestions.length < 3) {\n // captureMessage(`Diagnostics item has Less than 3 questions: ${reference}`, {\n // tags: {\n // 'content-type': 'learnosity',\n // 'activity-reference': learnosityActivityRef,\n // 'item-reference': reference,\n // },\n // fingerprint: [`diagnostics-item-questions-count-${reference}`], // Add unique fingerprint\n // });\n // } else if (\n // itemQuestions[0]?.instructor_stimulus !== 'Try' ||\n // itemQuestions[1]?.instructor_stimulus !== 'Learn' ||\n // itemQuestions[2]?.instructor_stimulus !== 'Apply'\n // ) {\n // captureMessage(\n // `Diagnostics questions sequence is incorrect expected [Try, Learn, Apply]: ${reference}`,\n // {\n // tags: {\n // 'content-type': 'learnosity',\n // 'activity-reference': learnosityActivityRef,\n // 'item-reference': reference,\n // },\n // fingerprint: [`diagnostics-item-questions-sequence-${reference}`], // Add unique fingerprint\n // },\n // );\n // }\n // });\n // }\n // }, [learnosityActivityRef, learnosityItems, navigationMode]);\n\n // useEffect(() => {\n // questions.forEach(question => {\n // const { validation, item_reference, type, question_number, metadata } = question;\n // const responseNeeded = teacherValidationEnabled ? type !== 'clozetext' : true;\n\n // if (responseNeeded && validation?.valid_response) {\n // const value = validation.valid_response.value ?? [];\n\n // if (value?.length === 0) {\n // const altResponses = validation.alt_responses ?? [];\n // const hasAltResponse = altResponses.some(altResponse => altResponse.value.length > 0);\n\n // if (!hasAltResponse) {\n // captureMessage(`Question has no valid response: ${metadata.widget_reference}`, {\n // tags: {\n // 'content-type': 'learnosity',\n // 'activity-reference': learnosityActivityRef,\n // 'item-reference': item_reference,\n // 'question-number': question_number,\n // 'widget-reference': metadata.widget_reference,\n // },\n // fingerprint: [`no-valid-response-${metadata.widget_reference}`], // Add unique fingerprint\n // });\n // loggerRef.current(EVENTS.WORKSHEET_V3_QUESTION_MISSING_VALIDATION, {\n // item_reference: item_reference,\n // widget_reference: metadata.widget_reference,\n // question_type: type,\n // question_number: question_number,\n // });\n // }\n // }\n // }\n // });\n // }, [learnosityActivityRef, loggerRef, questions, teacherValidationEnabled]);\n\n if (!learnosity) {\n return null;\n }\n\n return (\n <>\n {showNudgeBanner && (\n <Styled.NudgeBannerWrapper\n $flexDirection=\"row\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $width=\"100%\"\n $heightX={1.75}\n $height={WORKSHEET_NUDGE_BANNER_HEIGHT}\n $gap={8}\n $gutter={8}\n $flexGap={8}\n $background={nudgeBannerBackgroundColor}\n $topOffset={layout.topOffset - WORKSHEET_NUDGE_BANNER_HEIGHT}\n >\n {markedAsCompleted ? (\n <Styled.NudgeBannerIcon>\n <Check2Icon width={16} height={16} />\n </Styled.NudgeBannerIcon>\n ) : (\n <Styled.NudgeBannerIcon>\n <Info2Icon width={16} height={16} />\n </Styled.NudgeBannerIcon>\n )}\n\n <Text $renderAs=\"ub3\">{nudgeBannerLabel}</Text>\n </Styled.NudgeBannerWrapper>\n )}\n\n <Styled.WorksheetContainer $background=\"WHITE_1\" $width={containerWidth}>\n {navigationBar === 'top' && (\n <Styled.NavigationContainer $topOffset={topOffset} $height={TOP_NAVIGATION_HEIGHT}>\n <Styled.NavigationWrapper>\n <WorksheetNavigation\n placement=\"top\"\n questions={questions}\n responses={responses}\n activeQuestionIndex={activeQuestionIndex}\n lastUnlockedQuestionIndex={lastUnlockedQuestionIndex}\n behavior={behavior}\n onItemNumberClick={handleItemNumberClick}\n userType={userType}\n summaryVisible={summaryVisible}\n />\n </Styled.NavigationWrapper>\n </Styled.NavigationContainer>\n )}\n {blocker && lastUnlockedQuestion && (\n <Styled.BlockerWrapper $minHeight={minQuestionHeight} $topOffset={topOffset}>\n <FlexView $width={maxQuestionWidth} $justifyContent=\"center\" $alignItems=\"center\">\n <WorksheetBlocker\n blocker={blocker}\n lastUnlockedQuestion={lastUnlockedQuestion}\n studentName={studentName}\n onBlockerClose={handleBlockerClose}\n onOptionalItemAssignment={onOptionalItemAssignment}\n onOptionalItemSkip={onOptionalItemSkip}\n onTeacherValidation={onTeacherValidation}\n />\n </FlexView>\n </Styled.BlockerWrapper>\n )}\n {showUserPointer && (\n <UserPointer\n activeQuestionIndex={activeQuestionIndex}\n onClick={handleItemNumberClick}\n questions={questions}\n bottomOffset={actionbarHeight}\n topOffset={topOffset}\n userType={userType}\n />\n )}\n {showCalculator && (\n <Styled.DesmosCalcWrapper>\n <DesmosCalculator initialPosition={DESMOS_CALC_POSITION} onClose={onCalculatorClose} />\n </Styled.DesmosCalcWrapper>\n )}\n <Styled.ActionbarContainer\n $marginTop={userType === 'TEACHER' && summaryVisible ? '0' : actionbarHeight}\n $height={actionbarHeight}\n $isCardView={containerStyle === 'card'}\n >\n {maximumAttempts !== -2 && (\n <QuestionTips\n width={questionsContainerWidth - 32}\n question={questions[activeQuestionIndex]}\n learnosity={learnosity}\n userType={userType}\n />\n )}\n {canShowActionBar && (\n <Styled.ActionbarWrapper\n $height={actionbarHeight}\n $width={\n containerStyle === 'card' || maximumAttempts === -2\n ? questionsContainerWidth - 32\n : '100%'\n }\n $isCardView={containerStyle === 'card'}\n >\n <FlexView\n $gutterX={1}\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n $width={questionsContainerWidth - 32}\n >\n <WorksheetActionBar\n userType={userType}\n layout={layout}\n behavior={behavior}\n worksheetName={worksheetName}\n questions={questions}\n responses={responses}\n onCalculatorOpen={onCalculatorOpen}\n activeQuestionIndex={activeQuestionIndex}\n lastUnlockedQuestionIndex={lastUnlockedQuestionIndex}\n appendedQuestionIds={appendedQuestionIds}\n learnosity={learnosity}\n canSubmitWorksheet={canSubmitWorksheet}\n isScribblingEnabled={isScribblingEnabled}\n isSummaryVisible={summaryVisible}\n setResponses={setResponses}\n getTimeSpentOnQuestion={getTimeSpentOnQuestion}\n setSummaryVisible={setSummaryVisible}\n setBlocker={setBlocker}\n setIsScribblingEnabled={setIsScribblingEnabled}\n setActiveQuestionId={setActiveQuestionId}\n onItemNumberClick={handleItemNumberClick}\n onGoToReview={handleOnGoToReview}\n onResponseChange={onResponseChange}\n onHelp={onHelp}\n onTeacherValidation={onTeacherValidation}\n onSubmit={onSubmit}\n showCalculator={showCalculator}\n loggerRef={loggerRef}\n onSkip={onSkip}\n actionBarRightElement={actionBarRightElement}\n />\n </FlexView>\n </Styled.ActionbarWrapper>\n )}\n {!summaryVisible && questionsScrollable && userType === 'STUDENT' && (\n <Styled.StudentWorksheetSideBar>\n <Navigator />\n </Styled.StudentWorksheetSideBar>\n )}\n </Styled.ActionbarContainer>\n <Styled.QuestionsWrapper\n $actionbarHeight={actionbarHeight}\n $isCardView={containerStyle === 'card'}\n $questionPadding={questionPadding}\n >\n {getRenderableQuestions({ questions, lastUnlockedQuestionIndex, userType }).map(\n (question, questionIndex) => {\n const { response_id: responseId, is_optional } = question;\n const assignStatus = responses[responseId]?.assignStatus;\n\n if (behavior.teacherValidationEnabled) {\n if (assignStatus === 'skipped') return null;\n\n if (is_optional && assignStatus !== 'assigned' && userType === 'STUDENT') {\n return null;\n }\n }\n\n return (\n <WorksheetQuestion\n key={responseId}\n signedRequest={questionsSignedRequest}\n userType={userType}\n worksheetCompleted={worksheetCompleted}\n question={question}\n response={responses[responseId]}\n nextQuestionId={\n navigationMode === 'ADAPTIVE' || navigationMode === 'CURRENT'\n ? lastUnlockedQuestion?.response_id\n : questionIndex < lastUnlockedQuestionIndex\n ? questions[questionIndex + 1]?.response_id\n : undefined\n }\n maxQuestionWidth={maxQuestionWidth}\n learnosity={learnosity}\n isActive={responseId === activeQuestionId}\n isHidden={\n (!questionsScrollable && responseId !== activeQuestionId) || summaryVisible\n }\n canRender={\n activeQuestionIndex > -1 &&\n (questionIndex === activeQuestionIndex ||\n (navigationMode !== 'CURRENT' && questionIndex === activeQuestionIndex + 1))\n }\n appended={appendedQuestionIds.includes(responseId)}\n behavior={behavior}\n layout={layout}\n actionbarHeight={actionbarHeight}\n intersectionObserver={intersectionObserver}\n onMarkForReview={handleMarkForReview}\n onMediaStateChange={handleMediaStateChange}\n userId={userId}\n isScribblingEnabled={isScribblingEnabled}\n onPublishStrokes={onPublishStrokes}\n onReceiveStrokes={onReceiveStrokes}\n initialStrokesData={initialStrokesData}\n onPublishMouseMove={onPublishMouseMove}\n onSubscribeMouseMove={onSubscribeMouseMove}\n setActiveQuestionId={setActiveQuestionId}\n canResolveDoubt={canResolveDoubt}\n onResolveDoubt={onResolveDoubt}\n studentId={studentId}\n subjectiveProps={subjectiveProps}\n responses={responses}\n loggerRef={loggerRef}\n />\n );\n },\n )}\n {summaryVisible && (\n <WorksheetSummary\n worksheetName={worksheetName}\n questions={questions}\n responses={responses}\n activeQuestionIndex={activeQuestionIndex}\n lastUnlockedQuestionIndex={lastUnlockedQuestionIndex}\n onItemNumberClick={handleItemNumberClick}\n behavior={behavior}\n minHeight={minSummaryHeight}\n summaryDescription={summaryDescription}\n summaryVisible={summaryVisible}\n />\n )}\n </Styled.QuestionsWrapper>\n {!summaryVisible && renderSideBar && (\n <WorksheetSideBar\n questionWidth={maxQuestionWidth}\n questions={questions}\n activeQuestionIndex={activeQuestionIndex}\n learnosity={learnosity}\n userType={userType}\n height={minQuestionHeight}\n actionbarHeight={actionbarHeight}\n openQuestionFeedbackModal={openQuestionFeedbackModal}\n loggerRef={loggerRef}\n plugins={plugins}\n />\n )}\n </Styled.WorksheetContainer>\n </>\n );\n};\n\nconst Worksheet = memo(forwardRef(WorksheetComp));\n\nexport default Worksheet;\n"],"names":["WorksheetComp","props","ref","userType","studentName","questionsSignedRequest","worksheetName","initialResponseId","initialItemIndex","learnosityItems","learnosityResponses","layout","behavior","updatedResponses","showNudgeBanner","markedAsCompleted","onResponseChange","onBulkResponsesChange","onResponsesChange","onMediaStateChange","onTeacherValidation","onOptionalItemAssignment","onOptionalItemSkip","onExitTicketStart","onExitTicketSubmit","onSubmit","learnosity","appendedQuestionIds","worksheetCompleted","userId","onPublishStrokes","onReceiveStrokes","initialStrokesData","onHelp","onPublishMouseMove","onSubscribeMouseMove","onActiveQuestionChange","openQuestionFeedbackModal","summaryDescription","canSubmitWorksheet","loggerRef","canResolveDoubt","onResolveDoubt","onSkip","studentId","subjectiveProps","canShowActionBar","actionBarRightElement","plugins","initialQuestion","navigationMode","teacherValidationEnabled","maximumAttempts","containerStyle","containerWidth","minQuestionHeight","minSummaryHeight","questionsScrollable","navigationBar","topOffset","renderSideBar","showUserPointer","questionPadding","actionbarHeight","maxQuestionWidth","questionsContainerWidth","useMemo","getWorksheetDimensions","questions","useState","getQuestionsFromItems","responses","setResponses","getInitialResponses","isScribblingEnabled","setIsScribblingEnabled","lastUnlockedQuestionIndex","getLastUnlockedQuestionIndex","lastUnlockedQuestion","lastUnlockedQuestionResponse","nudgeBannerBackgroundColor","nudgeBannerLabel","getWorksheetNudgeBannerInfo","initialQuestionId","getInitialQuestionId","activeQuestionId","setActiveQuestionId","intersectionObserver","useGetActiveQuestionId","activeQuestionIndex","question","summaryVisible","setSummaryVisible","blocker","setBlocker","showCalculator","setShowCalculator","getTimeSpentOnQuestion","useTimeSpentOnQuestions","handleMediaStateChange","useCallback","mediaType","mediaState","key","prevResponses","questionId","questionMeta","getQuestionMetadata","updatedResponse","handleMarkForReview","markedForReview","handleBlockerClose","prevBlocker","lastUnlockedQuestionId","_a","scrollToQuestion","handleItemNumberClick","onCalculatorClose","onCalculatorOpen","handleOnGoToReview","useEffect","activeQuestion","useCreateImperativeHandle","useLayoutEffect","timer","getDeviceDetails","item_type","instructor_stimulus","is_optional","jsxs","Fragment","Styled.NudgeBannerWrapper","WORKSHEET_NUDGE_BANNER_HEIGHT","jsx","Styled.NudgeBannerIcon","Check2Icon","Info2Icon","Text","Styled.WorksheetContainer","Styled.NavigationContainer","TOP_NAVIGATION_HEIGHT","Styled.NavigationWrapper","WorksheetNavigation","Styled.BlockerWrapper","FlexView","WorksheetBlocker","UserPointer","Styled.DesmosCalcWrapper","DesmosCalculator","DESMOS_CALC_POSITION","Styled.ActionbarContainer","QuestionTips","Styled.ActionbarWrapper","WorksheetActionBar","Styled.StudentWorksheetSideBar","Navigator","Styled.QuestionsWrapper","getRenderableQuestions","questionIndex","responseId","assignStatus","WorksheetQuestion","_b","WorksheetSummary","WorksheetSideBar","Worksheet","memo","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuDA,MAAMA,KAA0E,CAACC,IAAOC,OAAQ;AACxF,QAAA;AAAA,IACJ,UAAAC;AAAA,IACA,aAAAC,KAAc;AAAA,IACd,wBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,kBAAAC;AAAA;AAAA,IAEA,iBAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,sBAAAC;AAAA,IACA,wBAAAC;AAAA,IACA,2BAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,WAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,kBAAAC,KAAmB;AAAA,IACnB,uBAAAC;AAAA,IACA,SAAAC;AAAA,EACE,IAAA/C,IACE,EAAE,iBAAAgD,IAAiB,gBAAAC,GAAgB,0BAAAC,IAA0B,iBAAAC,OAAoBxC,GACjF;AAAA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7 @@ declare interface IWorksheetCallbackProps {
|
|
|
4661
4661
|
loggerRef: MutableRefObject<(eventName: string, data?: Record<string, unknown>) => void>;
|
|
4662
4662
|
}
|
|
4663
4663
|
|
|
4664
|
-
declare interface IWorksheetContainerProps extends Omit<IBaseWorksheetProps, 'behavior'>, IWorksheetCallbackProps, ICueCanvasProps, ICueCanvasCallbackProps, IPointerSyncCallbackProps {
|
|
4664
|
+
declare interface IWorksheetContainerProps extends Omit<IBaseWorksheetProps, 'behavior'>, IWorksheetCallbackProps, ICueCanvasProps, ICueCanvasCallbackProps, IPointerSyncCallbackProps, IWorksheetPlugins {
|
|
4665
4665
|
studentId: string;
|
|
4666
4666
|
attemptId?: string;
|
|
4667
4667
|
itemsSignedRequest: string;
|
|
@@ -4732,7 +4732,13 @@ declare interface IWorksheetPermissionV2 {
|
|
|
4732
4732
|
reason: string;
|
|
4733
4733
|
}
|
|
4734
4734
|
|
|
4735
|
-
|
|
4735
|
+
declare interface IWorksheetPlugins {
|
|
4736
|
+
plugins?: {
|
|
4737
|
+
stickers?: ReactNode;
|
|
4738
|
+
};
|
|
4739
|
+
}
|
|
4740
|
+
|
|
4741
|
+
export declare interface IWorksheetProps extends IBaseWorksheetProps, IWorksheetCallbackProps, ICueCanvasProps, ICueCanvasCallbackProps, IPointerSyncCallbackProps, IWorksheetPlugins {
|
|
4736
4742
|
learnosityActivityRef?: string;
|
|
4737
4743
|
learnosityItems: ILearnosityItem[];
|
|
4738
4744
|
learnosityResponses?: Record<string, IWorksheetResponse>;
|
|
@@ -4743,7 +4749,6 @@ export declare interface IWorksheetProps extends IBaseWorksheetProps, IWorksheet
|
|
|
4743
4749
|
summaryDescription?: ReactElement | null;
|
|
4744
4750
|
canSubmitWorksheet?: boolean;
|
|
4745
4751
|
studentId: string;
|
|
4746
|
-
studentClassroomId?: string;
|
|
4747
4752
|
attemptId?: string;
|
|
4748
4753
|
subjectiveProps?: ISubjectiveSheetProps;
|
|
4749
4754
|
}
|