@cuemath/leap 3.5.11 → 3.5.12

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.
@@ -1,107 +1,107 @@
1
- import { jsxs as T, jsx as i, Fragment as Pt } from "react/jsx-runtime";
2
- import { memo as Vt, useMemo as p, useState as A, useRef as X, useCallback as Xt, useEffect as H, useLayoutEffect as jt } from "react";
3
- import { IMAGES as Gt } from "../../../../assets/images/images.js";
4
- import Yt from "../../../cue-canvas/cue-canvas.js";
5
- import Zt from "../../../pointer-sync/pointer.js";
6
- import Rt from "../../../ui/layout/flex-view.js";
7
- import kt from "../../constants/events.js";
8
- import { QUESTIONS_GAP as Jt, LEARNOSITY_KEYBOARD_HEIGHT as wt } from "../constants.js";
9
- import { getPaperColorByQuestion as qt, isConceptIntroWidget as te, scrollToQuestion as St } from "../worksheet-helpers.js";
10
- import ee from "./header/header.js";
11
- import ie from "./learnosity-question.js";
12
- import re from "./question-backdrop/question-backdrop.js";
13
- import oe from "./subjective-review.js";
14
- import ne from "./system-intros/advanced-practice-intro.js";
15
- import ce from "./system-intros/basic-practice-intro.js";
16
- import ae from "./system-intros/exit-ticket-intro.js";
17
- import se from "./system-intros/regular-practice-intro.js";
18
- import { QuestionContainerWrapper as le, StimulusReview as me, QuestionContainer as ue, QuestionWrapper as de, LessonOverviewBanner as fe, CueCanvasWrapper as he, Hint as ge, Solution as Ee } from "./worksheet-question-styled.js";
19
- const Oe = Vt(function({
1
+ import { jsxs as L, jsx as i, Fragment as Kt } from "react/jsx-runtime";
2
+ import { memo as Pt, useMemo as _, useState as T, useRef as V, useCallback as Vt, useEffect as $, useLayoutEffect as Xt } from "react";
3
+ import { IMAGES as jt } from "../../../../assets/images/images.js";
4
+ import Gt from "../../../cue-canvas/cue-canvas.js";
5
+ import Yt from "../../../pointer-sync/pointer.js";
6
+ import wt from "../../../ui/layout/flex-view.js";
7
+ import Zt from "../../constants/events.js";
8
+ import { QUESTIONS_GAP as kt, LEARNOSITY_KEYBOARD_HEIGHT as Rt } from "../constants.js";
9
+ import { getPaperColorByQuestion as Jt, isConceptIntroWidget as qt, scrollToQuestion as St } from "../worksheet-helpers.js";
10
+ import te from "./header/header.js";
11
+ import ee from "./learnosity-question.js";
12
+ import ie from "./question-backdrop/question-backdrop.js";
13
+ import re from "./subjective-review.js";
14
+ import oe from "./system-intros/advanced-practice-intro.js";
15
+ import ne from "./system-intros/basic-practice-intro.js";
16
+ import ce from "./system-intros/exit-ticket-intro.js";
17
+ import ae from "./system-intros/regular-practice-intro.js";
18
+ import { QuestionContainerWrapper as se, StimulusReview as le, QuestionContainer as me, QuestionWrapper as ue, LessonOverviewBanner as de, CueCanvasWrapper as fe, Hint as he, Solution as ge } from "./worksheet-question-styled.js";
19
+ const Me = Pt(function({
20
20
  userType: c,
21
21
  signedRequest: Ct,
22
- worksheetCompleted: g,
22
+ worksheetCompleted: p,
23
23
  question: n,
24
24
  response: e,
25
- nextQuestionId: b,
26
- isActive: v,
27
- isHidden: M,
28
- canRender: j,
29
- loggerRef: O,
25
+ nextQuestionId: H,
26
+ isActive: b,
27
+ isHidden: A,
28
+ canRender: X,
29
+ loggerRef: M,
30
30
  appended: a,
31
- maxQuestionWidth: G,
31
+ maxQuestionWidth: j,
32
32
  behavior: S,
33
- layout: N,
33
+ layout: O,
34
34
  actionbarHeight: Wt,
35
35
  learnosity: C,
36
- intersectionObserver: Y,
36
+ intersectionObserver: G,
37
37
  onMediaStateChange: yt,
38
38
  onMarkForReview: Bt,
39
39
  userId: xt,
40
- onPublishStrokes: Z,
41
- onReceiveStrokes: k,
42
- isScribblingEnabled: J,
43
- initialStrokesData: Q,
44
- onPublishMouseMove: q,
45
- onSubscribeMouseMove: tt,
46
- setActiveQuestionId: et,
40
+ onPublishStrokes: Y,
41
+ onReceiveStrokes: Z,
42
+ isScribblingEnabled: k,
43
+ initialStrokesData: N,
44
+ onPublishMouseMove: J,
45
+ onSubscribeMouseMove: q,
46
+ setActiveQuestionId: tt,
47
47
  canResolveDoubt: It,
48
48
  onResolveDoubt: Lt,
49
49
  studentId: Tt,
50
50
  responses: At,
51
- subjectiveProps: it
51
+ subjectiveProps: et
52
52
  }) {
53
- const { background: rt = "paper" } = N, W = p(
54
- () => rt === "paper" ? qt(n) : void 0,
55
- [rt, n]
56
- ), [y, Mt] = A(), [ot, Ot] = A(), {
57
- validation: nt,
58
- review: z,
59
- maximumAttempts: F,
60
- canExceedAttempts: ct,
61
- teacherValidationEnabled: R,
62
- solutionHidden: at
63
- } = S, { minQuestionHeight: Nt, topOffset: st, questionsScrollable: B, renderQuestionHeader: Qt, imageHue: lt } = N, {
64
- type: E,
53
+ const { background: it = "paper" } = O, W = _(
54
+ () => it === "paper" ? Jt(n) : void 0,
55
+ [it, n]
56
+ ), [y, Mt] = T(), [rt, Ot] = T(), {
57
+ validation: ot,
58
+ review: Q,
59
+ maximumAttempts: z,
60
+ canExceedAttempts: nt,
61
+ teacherValidationEnabled: v,
62
+ solutionHidden: ct
63
+ } = S, { minQuestionHeight: Nt, topOffset: at, questionsScrollable: B, renderQuestionHeader: Qt, imageHue: st } = O, {
64
+ type: g,
65
65
  response_id: r,
66
- stimulus_review: _,
66
+ stimulus_review: w,
67
67
  item_type: d,
68
- instructor_stimulus: mt,
69
- metadata: { hints: f, solution: x, widget_reference: ut },
70
- item_reference: dt,
71
- question_number: ft,
72
- item_number: ht,
73
- item_display_number: gt
74
- } = n, zt = !!_, I = d === "overview", m = te(mt), h = mt === "SystemIntro", D = m || h, Et = e == null ? void 0 : e.responseEdited, Ft = p(() => {
68
+ instructor_stimulus: lt,
69
+ metadata: { hints: f, solution: F, widget_reference: mt },
70
+ item_reference: ut,
71
+ question_number: dt,
72
+ item_number: ft,
73
+ item_display_number: ht
74
+ } = n, x = d === "overview", m = qt(lt), h = lt === "SystemIntro", D = m || h, gt = e == null ? void 0 : e.responseEdited, zt = _(() => {
75
75
  const t = [];
76
- return Et && c === "TEACHER" && t.push("attempting"), a || t.push("hidden"), E === "hotspot" && t.push("correct-answers-hidden"), a && R && E === "clozetext" && (!m || c === "STUDENT" ? t.push("response-hidden") : t.push("response-code-hidden")), I && t.push("lesson-overview"), m && t.push("concept-intro"), h && t.push("system-intro"), t.join(" ");
76
+ return gt && c === "TEACHER" && t.push("attempting"), a || t.push("hidden"), g === "hotspot" && t.push("correct-answers-hidden"), a && v && g === "clozetext" && (!m || c === "STUDENT" ? t.push("response-hidden") : t.push("response-code-hidden")), x && t.push("lesson-overview"), m && t.push("concept-intro"), h && t.push("system-intro"), t.join(" ");
77
77
  }, [
78
78
  a,
79
79
  m,
80
- I,
80
+ x,
81
81
  h,
82
- E,
83
- Et,
84
- R,
82
+ g,
83
+ gt,
84
+ v,
85
85
  c
86
- ]), U = X({}), K = (e == null ? void 0 : e.hintsUsed) ?? 0, [_t] = A((e == null ? void 0 : e.validatedByTeacher) ?? !1), L = X(null), P = X(null), V = p(() => f == null ? void 0 : f.slice(0, K), [f, K]), $t = p(() => c === "TEACHER" || g ? !0 : !e || !e.response || e.responseEdited ? !1 : nt, [e, c, nt, g]), pt = p(() => {
86
+ ]), U = V({}), Et = (e == null ? void 0 : e.hintsUsed) ?? 0, [_t] = T((e == null ? void 0 : e.validatedByTeacher) ?? !1), I = V(null), K = V(null), P = _(() => f == null ? void 0 : f.slice(0, Et), [f, Et]), $t = _(() => c === "TEACHER" || p ? !0 : !e || !e.response || e.responseEdited ? !1 : ot, [e, c, ot, p]), pt = _(() => {
87
87
  if (c === "TEACHER") return !0;
88
- if (z) {
88
+ if (Q) {
89
89
  const { attemptsHistory: t } = e ?? {};
90
- return ((t == null ? void 0 : t.length) ?? 0) >= F && !ct;
90
+ return ((t == null ? void 0 : t.length) ?? 0) >= z && !nt;
91
91
  }
92
92
  return !1;
93
- }, [ct, F, e, z, c]), Dt = p(
94
- () => x && g && !at,
95
- [at, x, g]
96
- ), [Ht, Ut] = A({
93
+ }, [nt, z, e, Q, c]), Ft = _(
94
+ () => F && p && !ct,
95
+ [ct, F, p]
96
+ ), [Ht, Dt] = T({
97
97
  width: 0,
98
98
  height: 0
99
- }), Kt = Xt((t) => {
99
+ }), Ut = Vt((t) => {
100
100
  Ot(t);
101
101
  }, []);
102
- return H(() => {
103
- L.current && Y.observe(L.current);
104
- }, [Y]), H(() => {
102
+ return $(() => {
103
+ I.current && G.observe(I.current);
104
+ }, [G]), $(() => {
105
105
  if (a && (n.type === "clozeassociation" || n.type === "association" || n.type === "clozeformula")) {
106
106
  const t = document.querySelectorAll(
107
107
  `.widget-${n.response_id} .lrn_draggable`
@@ -109,35 +109,35 @@ const Oe = Vt(function({
109
109
  let s = 0, o = 0;
110
110
  t.forEach((l) => {
111
111
  s = Math.max(s, l.clientWidth + 33), o = Math.max(o, l.clientHeight + 1);
112
- }), Ut({
112
+ }), Dt({
113
113
  width: n.type !== "association" ? s : 0,
114
114
  height: o
115
115
  });
116
116
  }
117
- }, [a, n.response_id, n.type]), H(() => {
117
+ }, [a, n.response_id, n.type]), $(() => {
118
118
  if (a && $t) {
119
119
  const t = C.question(r);
120
120
  t && t.validate({
121
121
  showCorrectAnswers: pt
122
122
  });
123
123
  }
124
- }, [a, C, r, z, pt, c, $t]), H(() => {
125
- const t = P.current;
126
- if (a && t && O.current && U.current[r] === void 0 && !m && !h) {
124
+ }, [a, C, r, Q, pt, c, $t]), $(() => {
125
+ const t = K.current;
126
+ if (a && t && M.current && U.current[r] === void 0 && !m && !h) {
127
127
  const s = t.clientWidth, o = t.querySelectorAll("*");
128
128
  for (let l = 0; l < o.length; l++) {
129
129
  const u = o[l];
130
130
  if (u != null && u.closest(".resize-sensor"))
131
131
  continue;
132
132
  if (((u == null ? void 0 : u.clientWidth) ?? 0) > s) {
133
- U.current[r] = !0, O.current(kt.WORKSHEET_V3_GREATER_WIDTH_ELEMENT, {
134
- item_reference: dt,
135
- widget_reference: ut,
136
- question_type: E,
137
- question_number: ft,
133
+ U.current[r] = !0, M.current(Zt.WORKSHEET_V3_GREATER_WIDTH_ELEMENT, {
134
+ item_reference: ut,
135
+ widget_reference: mt,
136
+ question_type: g,
137
+ question_number: dt,
138
138
  responseId: r,
139
- item_number: ht,
140
- item_display_number: gt
139
+ item_number: ft,
140
+ item_display_number: ht
141
141
  });
142
142
  break;
143
143
  }
@@ -148,169 +148,169 @@ const Oe = Vt(function({
148
148
  a,
149
149
  m,
150
150
  h,
151
- gt,
152
151
  ht,
153
- dt,
154
- O,
155
- E,
156
152
  ft,
153
+ ut,
154
+ M,
155
+ g,
156
+ dt,
157
157
  r,
158
- ut
159
- ]), H(() => {
160
- const t = L.current, s = (o) => {
158
+ mt
159
+ ]), $(() => {
160
+ const t = I.current, s = (o) => {
161
161
  const l = o.querySelector(".lrn_response_wrapper");
162
162
  if (D || !l)
163
163
  return 0;
164
- const u = o.getBoundingClientRect().bottom, w = l.getBoundingClientRect().bottom, $ = Math.abs(u - w);
165
- return $ < wt ? wt - $ : 0;
164
+ const u = o.getBoundingClientRect().bottom, R = l.getBoundingClientRect().bottom, E = Math.abs(u - R);
165
+ return E < Rt ? Rt - E : 0;
166
166
  };
167
167
  a && t && Mt((o) => {
168
168
  var vt;
169
- const w = ((vt = n.ui_style) == null ? void 0 : vt.type) === "floating-keyboard" && !(R && E === "clozetext"), $ = t.clientHeight;
170
- if ($ === 0)
169
+ const R = ((vt = n.ui_style) == null ? void 0 : vt.type) === "floating-keyboard" && !(v && g === "clozetext"), E = t.clientHeight;
170
+ if (E === 0)
171
171
  return o;
172
172
  if (!o)
173
173
  return Math.ceil(
174
- $ + (w ? s(t) : 0)
174
+ E + (R ? s(t) : 0)
175
175
  );
176
176
  const bt = Math.ceil(
177
- $ + (w ? s(t) : 0)
177
+ E + (R ? s(t) : 0)
178
178
  );
179
179
  return Math.abs(bt - o) > 4 ? bt : o;
180
- }), (K || zt || x && g) && C.renderMath("mathjax");
181
- }), jt(() => {
182
- !B && !M && St(r);
183
- }, [M, B, r, st]), H(() => {
184
- if (R && b && !_t && (e != null && e.validatedByTeacher)) {
180
+ }), C.renderMath("mathjax");
181
+ }), Xt(() => {
182
+ !B && !A && St(r);
183
+ }, [A, B, r, at]), $(() => {
184
+ if (v && H && !_t && (e != null && e.validatedByTeacher)) {
185
185
  const t = setTimeout(() => {
186
- B ? St(b) : et(b);
186
+ B ? St(H) : tt(H);
187
187
  }, 1e3);
188
188
  return () => {
189
189
  clearTimeout(t);
190
190
  };
191
191
  }
192
192
  }, [
193
- b,
194
- R,
193
+ H,
194
+ v,
195
195
  _t,
196
196
  B,
197
- et,
197
+ tt,
198
198
  e == null ? void 0 : e.validatedByTeacher
199
- ]), /* @__PURE__ */ T(
200
- le,
199
+ ]), /* @__PURE__ */ L(
200
+ se,
201
201
  {
202
202
  "data-response-id": r,
203
203
  className: `widget-${r}`,
204
- ref: L,
205
- $topOffset: st,
206
- $flexDirection: _ ? "row" : "column",
207
- $alignItems: _ ? "flex-start" : "center",
208
- $hidden: M,
209
- $marginBottom: Jt,
204
+ ref: I,
205
+ $topOffset: at,
206
+ $flexDirection: w ? "row" : "column",
207
+ $alignItems: w ? "flex-start" : "center",
208
+ $hidden: A,
209
+ $marginBottom: kt,
210
210
  children: [
211
- _ && /* @__PURE__ */ i(
212
- me,
211
+ w && /* @__PURE__ */ i(
212
+ le,
213
213
  {
214
214
  dangerouslySetInnerHTML: {
215
- __html: _
215
+ __html: w
216
216
  }
217
217
  }
218
218
  ),
219
- /* @__PURE__ */ T(
220
- ue,
219
+ /* @__PURE__ */ L(
220
+ me,
221
221
  {
222
- ref: P,
223
- $width: _ ? "50%" : `${G}px`,
224
- $minHeight: y ? Math.max(y - 72, ot ?? 0) : Nt,
225
- $isActive: v,
222
+ ref: K,
223
+ $width: w ? "50%" : `${j}px`,
224
+ $minHeight: y ? Math.max(y - 72, rt ?? 0) : Nt,
225
+ $isActive: b,
226
226
  $paperColor: W,
227
- $opacity: v ? 1 : 0.2,
228
- $imageHue: lt,
227
+ $opacity: b ? 1 : 0.2,
228
+ $imageHue: st,
229
229
  children: [
230
- v && !!q && !!tt && !!S.canvasEnabled && /* @__PURE__ */ i(
231
- Zt,
230
+ b && !!J && !!q && !!S.canvasEnabled && /* @__PURE__ */ i(
231
+ Yt,
232
232
  {
233
- containerRef: P,
234
- onPublish: q,
235
- onSubscribe: tt,
233
+ containerRef: K,
234
+ onPublish: J,
235
+ onSubscribe: q,
236
236
  responseId: r
237
237
  }
238
238
  ),
239
- /* @__PURE__ */ T(
240
- de,
239
+ /* @__PURE__ */ L(
240
+ ue,
241
241
  {
242
- className: Ft,
242
+ className: zt,
243
243
  $dropzoneMinWidth: Ht.width,
244
244
  $dropzoneMinHeight: Ht.height,
245
245
  children: [
246
- Qt && !(I || m || h) && /* @__PURE__ */ i(
247
- ee,
246
+ Qt && !(x || m || h) && /* @__PURE__ */ i(
247
+ te,
248
248
  {
249
249
  userType: c,
250
250
  question: n,
251
251
  response: e,
252
252
  behavior: S,
253
- layout: N,
253
+ layout: O,
254
254
  paperColor: W,
255
255
  onMarkForReview: Bt,
256
256
  actionbarHeight: Wt,
257
257
  canResolveDoubt: It,
258
258
  onResolveDoubt: Lt,
259
- worksheetCompleted: g
259
+ worksheetCompleted: p
260
260
  }
261
261
  ),
262
- I && /* @__PURE__ */ i(fe, { src: Gt.LESSON_OVERVIEW_BANNER }),
263
- m && W && /* @__PURE__ */ i(re, { paperColor: W }),
264
- h ? /* @__PURE__ */ T(Pt, { children: [
265
- d === "practice-basic" && /* @__PURE__ */ i(ce, {}),
266
- d === "practice-regular" && /* @__PURE__ */ i(se, {}),
267
- d === "exit-ticket" && /* @__PURE__ */ i(ae, {}),
268
- (d == null ? void 0 : d.startsWith("advanced-")) && /* @__PURE__ */ i(ne, {})
262
+ x && /* @__PURE__ */ i(de, { src: jt.LESSON_OVERVIEW_BANNER }),
263
+ m && W && /* @__PURE__ */ i(ie, { paperColor: W }),
264
+ h ? /* @__PURE__ */ L(Kt, { children: [
265
+ d === "practice-basic" && /* @__PURE__ */ i(ne, {}),
266
+ d === "practice-regular" && /* @__PURE__ */ i(ae, {}),
267
+ d === "exit-ticket" && /* @__PURE__ */ i(ce, {}),
268
+ (d == null ? void 0 : d.startsWith("advanced-")) && /* @__PURE__ */ i(oe, {})
269
269
  ] }) : void 0,
270
270
  /* @__PURE__ */ i(
271
- ie,
271
+ ee,
272
272
  {
273
273
  signedRequest: Ct,
274
274
  appended: a,
275
275
  question: n,
276
276
  response: e == null ? void 0 : e.response,
277
- canRender: j || v,
277
+ canRender: X || b,
278
278
  learnosity: C,
279
279
  canForceAppend: c === "TEACHER",
280
280
  isConceptIntro: m,
281
281
  simState: e == null ? void 0 : e.simState,
282
282
  onMediaStateChange: yt,
283
- imageHue: lt,
284
- isPuzzle: F === -2
283
+ imageHue: st,
284
+ isPuzzle: z === -2
285
285
  }
286
286
  ),
287
- !D && !!S.canvasEnabled && Z && k && y !== void 0 && /* @__PURE__ */ i(he, { $canScribble: J, children: /* @__PURE__ */ i(
288
- Yt,
287
+ !D && !!S.canvasEnabled && Y && Z && y !== void 0 && /* @__PURE__ */ i(fe, { $canScribble: k, children: /* @__PURE__ */ i(
288
+ Gt,
289
289
  {
290
- canRender: j,
291
- canScribble: J && v,
290
+ canRender: X,
291
+ canScribble: k && b,
292
292
  appended: a,
293
293
  canvasId: r,
294
- width: G,
295
- height: Math.max(y, ot ?? 0),
296
- onUpdateHeight: Kt,
297
- onPublish: Z,
298
- onSubscribe: k,
294
+ width: j,
295
+ height: Math.max(y, rt ?? 0),
296
+ onUpdateHeight: Ut,
297
+ onPublish: Y,
298
+ onSubscribe: Z,
299
299
  userId: xt,
300
- initialData: Q == null ? void 0 : Q[r],
300
+ initialData: N == null ? void 0 : N[r],
301
301
  userType: c
302
302
  }
303
303
  ) }),
304
- !D && V && V.length > 0 && /* @__PURE__ */ i(
305
- Rt,
304
+ !D && P && P.length > 0 && /* @__PURE__ */ i(
305
+ wt,
306
306
  {
307
307
  $background: "BLUE_1",
308
308
  $gutterX: 1,
309
309
  $gapX: 0.5,
310
310
  $borderRadiusX: 0,
311
311
  $borderColor: "BLUE_2",
312
- children: V.map((t, s) => /* @__PURE__ */ i(
313
- ge,
312
+ children: P.map((t, s) => /* @__PURE__ */ i(
313
+ he,
314
314
  {
315
315
  dangerouslySetInnerHTML: {
316
316
  __html: `<span style="color: #DA5107; font-weight: 600;">Hint${((f == null ? void 0 : f.length) ?? 0) > 1 ? ` ${s + 1}` : ""}:</span>&nbsp;${t}`
@@ -320,8 +320,8 @@ const Oe = Vt(function({
320
320
  ))
321
321
  }
322
322
  ),
323
- Dt && /* @__PURE__ */ i(
324
- Rt,
323
+ Ft && /* @__PURE__ */ i(
324
+ wt,
325
325
  {
326
326
  $background: "YELLOW_1",
327
327
  $gutterX: 1,
@@ -329,25 +329,25 @@ const Oe = Vt(function({
329
329
  $borderRadiusX: 0,
330
330
  $borderColor: "YELLOW_2",
331
331
  children: /* @__PURE__ */ i(
332
- Ee,
332
+ ge,
333
333
  {
334
334
  dangerouslySetInnerHTML: {
335
- __html: `<div style="color: #DA5107; font-weight: 600;">Solution:</div>${x}`
335
+ __html: `<div style="color: #DA5107; font-weight: 600;">Solution:</div>${F}`
336
336
  }
337
337
  }
338
338
  )
339
339
  }
340
340
  ),
341
- !!it && /* @__PURE__ */ i(
342
- oe,
341
+ !!et && /* @__PURE__ */ i(
342
+ re,
343
343
  {
344
344
  responses: At,
345
345
  response: e,
346
- nextQuestionId: b,
346
+ nextQuestionId: H,
347
347
  responseId: r,
348
348
  studentId: Tt,
349
349
  userType: c,
350
- ...it
350
+ ...et
351
351
  }
352
352
  )
353
353
  ]
@@ -361,6 +361,6 @@ const Oe = Vt(function({
361
361
  );
362
362
  });
363
363
  export {
364
- Oe as default
364
+ Me as default
365
365
  };
366
366
  //# sourceMappingURL=worksheet-question.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"worksheet-question.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-question/worksheet-question.tsx"],"sourcesContent":["import {\n memo,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type FC,\n} from 'react';\n\nimport { IMAGES } from '../../../../assets/images/images';\nimport CueCanvas from '../../../cue-canvas/cue-canvas';\nimport Pointer from '../../../pointer-sync/pointer';\nimport FlexView from '../../../ui/layout/flex-view';\nimport EVENTS from '../../constants/events';\nimport { LEARNOSITY_KEYBOARD_HEIGHT, QUESTIONS_GAP } from '../constants';\nimport {\n getPaperColorByQuestion,\n isConceptIntroWidget,\n scrollToQuestion,\n} from '../worksheet-helpers';\nimport QuestionHeader from './header/header';\nimport LearnosityQuestion from './learnosity-question';\nimport QuestionBackdrop from './question-backdrop/question-backdrop';\nimport SubjectiveQuestionReview from './subjective-review';\nimport AdvancedPracticeIntro from './system-intros/advanced-practice-intro';\nimport BasicPracticeIntro from './system-intros/basic-practice-intro';\nimport ExitTicketIntro from './system-intros/exit-ticket-intro';\nimport RegularPracticeIntro from './system-intros/regular-practice-intro';\nimport * as Styled from './worksheet-question-styled';\nimport type { IWorksheetQuestionProps } from './worksheet-question-types';\n\nconst WorksheetQuestion: FC<IWorksheetQuestionProps> = memo(function WorksheetQuestion({\n userType,\n signedRequest,\n worksheetCompleted,\n question,\n response,\n nextQuestionId,\n isActive,\n isHidden,\n canRender,\n loggerRef,\n appended,\n maxQuestionWidth,\n behavior,\n layout,\n actionbarHeight,\n learnosity,\n intersectionObserver,\n onMediaStateChange,\n onMarkForReview,\n userId,\n onPublishStrokes,\n onReceiveStrokes,\n isScribblingEnabled,\n initialStrokesData,\n onPublishMouseMove,\n onSubscribeMouseMove,\n setActiveQuestionId,\n canResolveDoubt,\n onResolveDoubt,\n studentId,\n responses,\n subjectiveProps,\n}) {\n const { background = 'paper' } = layout;\n const paperColor = useMemo(\n () => (background === 'paper' ? getPaperColorByQuestion(question) : undefined),\n [background, question],\n );\n const [questionHeight, setQuestionHeight] = useState<number | undefined>();\n const [canvasHeight, setCanvasHeight] = useState<number | undefined>();\n const {\n validation,\n review,\n maximumAttempts,\n canExceedAttempts,\n teacherValidationEnabled,\n solutionHidden,\n } = behavior;\n const { minQuestionHeight, topOffset, questionsScrollable, renderQuestionHeader, imageHue } =\n layout;\n const {\n type: questionType,\n response_id: responseId,\n stimulus_review,\n item_type,\n instructor_stimulus,\n metadata: { hints: hintsAvailable, solution, widget_reference },\n item_reference,\n question_number,\n item_number,\n item_display_number,\n } = question;\n const hasStimulusReview = !!stimulus_review;\n const isLessonOverview = item_type === 'overview';\n const isConceptIntro = isConceptIntroWidget(instructor_stimulus);\n const isSystemIntro = instructor_stimulus === 'SystemIntro';\n const isIntro = isConceptIntro || isSystemIntro;\n const responseEdited = response?.responseEdited;\n const wrapperClasses = useMemo(() => {\n const classes = [];\n\n if (responseEdited && userType === 'TEACHER') {\n classes.push('attempting');\n }\n\n if (!appended) {\n classes.push('hidden');\n }\n\n if (questionType === 'hotspot') {\n classes.push('correct-answers-hidden');\n }\n\n if (appended && teacherValidationEnabled && questionType === 'clozetext') {\n if (!isConceptIntro || userType === 'STUDENT') {\n classes.push('response-hidden');\n } else {\n classes.push('response-code-hidden');\n }\n }\n\n if (isLessonOverview) {\n classes.push('lesson-overview');\n }\n\n if (isConceptIntro) {\n classes.push('concept-intro');\n }\n\n if (isSystemIntro) {\n classes.push('system-intro');\n }\n\n return classes.join(' ');\n }, [\n appended,\n isConceptIntro,\n isLessonOverview,\n isSystemIntro,\n questionType,\n responseEdited,\n teacherValidationEnabled,\n userType,\n ]);\n const overflowDetectedRef = useRef<Record<string, boolean>>({});\n\n const hintsUsed = response?.hintsUsed ?? 0;\n const [validatedByTeacherOnMount] = useState(response?.validatedByTeacher ?? false);\n\n const questionRef = useRef<HTMLDivElement>(null);\n const pointerContainerRef = useRef<HTMLDivElement>(null);\n const hints = useMemo(() => hintsAvailable?.slice(0, hintsUsed), [hintsAvailable, hintsUsed]);\n const validateResponse = useMemo(() => {\n if (userType === 'TEACHER') return true;\n\n if (worksheetCompleted) return true;\n\n if (!response) return false;\n\n if (!response.response) return false;\n\n if (response.responseEdited) return false;\n\n return validation;\n }, [response, userType, validation, worksheetCompleted]);\n\n const showCorrectAnswers = useMemo(() => {\n if (userType === 'TEACHER') return true;\n\n if (review) {\n const { attemptsHistory } = response ?? {};\n const maximumAttemptsReached = (attemptsHistory?.length ?? 0) >= maximumAttempts;\n\n return maximumAttemptsReached && !canExceedAttempts;\n }\n\n return false;\n }, [canExceedAttempts, maximumAttempts, response, review, userType]);\n\n const showSolution = useMemo(\n () => solution && worksheetCompleted && !solutionHidden,\n [solutionHidden, solution, worksheetCompleted],\n );\n\n const [dropZoneDimensions, setDropZoneDimensions] = useState({\n width: 0,\n height: 0,\n });\n\n const onUpdateHeight = useCallback((height: number) => {\n setCanvasHeight(height);\n }, []);\n\n useEffect(() => {\n if (questionRef.current) {\n intersectionObserver.observe(questionRef.current);\n }\n }, [intersectionObserver]);\n\n useEffect(() => {\n if (\n appended &&\n (question.type === 'clozeassociation' ||\n question.type === 'association' ||\n question.type === 'clozeformula')\n ) {\n const draggableElements = document.querySelectorAll(\n `.widget-${question.response_id} .lrn_draggable`,\n );\n\n let minWidth = 0;\n let minHeight = 0;\n\n draggableElements.forEach(draggableElement => {\n minWidth = Math.max(minWidth, draggableElement.clientWidth + 33);\n minHeight = Math.max(minHeight, draggableElement.clientHeight + 1);\n });\n\n setDropZoneDimensions({\n width: question.type !== 'association' ? minWidth : 0,\n height: minHeight,\n });\n }\n }, [appended, question.response_id, question.type]);\n\n useEffect(() => {\n if (appended && validateResponse) {\n const learnosityQuestion = learnosity.question(responseId);\n\n if (learnosityQuestion) {\n learnosityQuestion.validate({\n showCorrectAnswers,\n });\n }\n }\n }, [appended, learnosity, responseId, review, showCorrectAnswers, userType, validateResponse]);\n\n useEffect(() => {\n const $questionEl = pointerContainerRef.current;\n\n if (\n appended &&\n $questionEl &&\n loggerRef.current &&\n overflowDetectedRef.current[responseId] === undefined &&\n !isConceptIntro &&\n !isSystemIntro\n ) {\n const parentWidth = $questionEl.clientWidth;\n const nestedElements = $questionEl.querySelectorAll('*');\n\n for (let i = 0; i < nestedElements.length; i++) {\n const element = nestedElements[i];\n\n if (element?.closest('.resize-sensor')) {\n continue;\n }\n\n const elementWidth = element?.clientWidth ?? 0;\n\n if (elementWidth > parentWidth) {\n overflowDetectedRef.current[responseId] = true;\n loggerRef.current(EVENTS.WORKSHEET_V3_GREATER_WIDTH_ELEMENT, {\n item_reference,\n widget_reference,\n question_type: questionType,\n question_number,\n responseId,\n item_number,\n item_display_number,\n });\n break;\n }\n }\n\n overflowDetectedRef.current[responseId] = false;\n }\n }, [\n appended,\n isConceptIntro,\n isSystemIntro,\n item_display_number,\n item_number,\n item_reference,\n loggerRef,\n questionType,\n question_number,\n responseId,\n widget_reference,\n ]);\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(() => {\n const $questionEl = questionRef.current;\n\n const getExtraSpaceNeedForFloatingKeyboard = (questionEl: HTMLDivElement) => {\n const $responseWrapper = questionEl.querySelector('.lrn_response_wrapper');\n\n if (isIntro || !$responseWrapper) {\n return 0;\n }\n\n const questionBottom = questionEl.getBoundingClientRect().bottom;\n const responseWrapperBottom = $responseWrapper.getBoundingClientRect().bottom;\n const spaceFromResponseToBottom = Math.abs(questionBottom - responseWrapperBottom);\n\n if (spaceFromResponseToBottom < LEARNOSITY_KEYBOARD_HEIGHT) {\n return LEARNOSITY_KEYBOARD_HEIGHT - spaceFromResponseToBottom;\n }\n\n return 0;\n };\n\n if (appended && $questionEl) {\n setQuestionHeight(qHeight => {\n const hasFloatingKeyboard = question.ui_style?.type === 'floating-keyboard';\n const v3CodeHidden = teacherValidationEnabled && questionType === 'clozetext';\n const hasKeyboard = hasFloatingKeyboard && !v3CodeHidden;\n const height = $questionEl.clientHeight;\n\n if (height === 0) {\n return qHeight;\n }\n\n // If the question has a floating keyboard, we need to add the height of the keyboard to the question height\n if (!qHeight) {\n return Math.ceil(\n height + (hasKeyboard ? getExtraSpaceNeedForFloatingKeyboard($questionEl) : 0),\n );\n }\n\n const newQuestionHeight = Math.ceil(\n height + (hasKeyboard ? getExtraSpaceNeedForFloatingKeyboard($questionEl) : 0),\n );\n\n if (Math.abs(newQuestionHeight - qHeight) > 4) {\n return newQuestionHeight;\n }\n\n return qHeight;\n });\n }\n\n //Dirty fix to render mathjax\n if (hintsUsed || hasStimulusReview || (solution && worksheetCompleted)) {\n learnosity.renderMath('mathjax');\n }\n });\n\n useLayoutEffect(() => {\n if (!questionsScrollable && !isHidden) {\n scrollToQuestion(responseId);\n }\n }, [isHidden, questionsScrollable, responseId, topOffset]);\n\n useEffect(() => {\n if (\n teacherValidationEnabled &&\n nextQuestionId &&\n !validatedByTeacherOnMount &&\n response?.validatedByTeacher\n ) {\n const timer = setTimeout(() => {\n if (questionsScrollable) {\n scrollToQuestion(nextQuestionId);\n } else {\n setActiveQuestionId(nextQuestionId);\n }\n }, 1000);\n\n return () => {\n clearTimeout(timer);\n };\n }\n }, [\n nextQuestionId,\n teacherValidationEnabled,\n validatedByTeacherOnMount,\n questionsScrollable,\n setActiveQuestionId,\n response?.validatedByTeacher,\n ]);\n\n return (\n <Styled.QuestionContainerWrapper\n data-response-id={responseId}\n className={`widget-${responseId}`}\n ref={questionRef}\n $topOffset={topOffset}\n $flexDirection={stimulus_review ? 'row' : 'column'}\n $alignItems={stimulus_review ? 'flex-start' : 'center'}\n $hidden={isHidden}\n $marginBottom={QUESTIONS_GAP}\n >\n {stimulus_review && (\n <Styled.StimulusReview\n dangerouslySetInnerHTML={{\n __html: stimulus_review,\n }}\n />\n )}\n <Styled.QuestionContainer\n ref={pointerContainerRef}\n $width={stimulus_review ? '50%' : `${maxQuestionWidth}px`}\n $minHeight={\n questionHeight ? Math.max(questionHeight - 72, canvasHeight ?? 0) : minQuestionHeight\n }\n $isActive={isActive}\n $paperColor={paperColor}\n $opacity={isActive ? 1 : 0.2}\n $imageHue={imageHue}\n >\n {isActive && !!onPublishMouseMove && !!onSubscribeMouseMove && !!behavior.canvasEnabled && (\n <Pointer\n containerRef={pointerContainerRef}\n onPublish={onPublishMouseMove}\n onSubscribe={onSubscribeMouseMove}\n responseId={responseId}\n />\n )}\n <Styled.QuestionWrapper\n className={wrapperClasses}\n $dropzoneMinWidth={dropZoneDimensions.width}\n $dropzoneMinHeight={dropZoneDimensions.height}\n >\n {renderQuestionHeader && !(isLessonOverview || isConceptIntro || isSystemIntro) && (\n <QuestionHeader\n userType={userType}\n question={question}\n response={response}\n behavior={behavior}\n layout={layout}\n paperColor={paperColor}\n onMarkForReview={onMarkForReview}\n actionbarHeight={actionbarHeight}\n canResolveDoubt={canResolveDoubt}\n onResolveDoubt={onResolveDoubt}\n worksheetCompleted={worksheetCompleted}\n />\n )}\n {isLessonOverview && <Styled.LessonOverviewBanner src={IMAGES.LESSON_OVERVIEW_BANNER} />}\n {isConceptIntro && paperColor && <QuestionBackdrop paperColor={paperColor} />}\n {isSystemIntro ? (\n <>\n {item_type === 'practice-basic' && <BasicPracticeIntro />}\n {item_type === 'practice-regular' && <RegularPracticeIntro />}\n {item_type === 'exit-ticket' && <ExitTicketIntro />}\n {item_type?.startsWith('advanced-') && <AdvancedPracticeIntro />}\n </>\n ) : undefined}\n <LearnosityQuestion\n signedRequest={signedRequest}\n appended={appended}\n question={question}\n response={response?.response}\n canRender={canRender || isActive}\n learnosity={learnosity}\n canForceAppend={userType === 'TEACHER'}\n isConceptIntro={isConceptIntro}\n simState={response?.simState}\n onMediaStateChange={onMediaStateChange}\n imageHue={imageHue}\n isPuzzle={maximumAttempts === -2}\n />\n\n {!isIntro &&\n !!behavior.canvasEnabled &&\n onPublishStrokes &&\n onReceiveStrokes &&\n questionHeight !== undefined && (\n <Styled.CueCanvasWrapper $canScribble={isScribblingEnabled}>\n <CueCanvas\n canRender={canRender}\n canScribble={isScribblingEnabled && isActive}\n appended={appended}\n canvasId={responseId}\n width={maxQuestionWidth}\n height={Math.max(questionHeight, canvasHeight ?? 0)}\n onUpdateHeight={onUpdateHeight}\n onPublish={onPublishStrokes}\n onSubscribe={onReceiveStrokes}\n userId={userId}\n initialData={initialStrokesData?.[responseId]}\n userType={userType}\n />\n </Styled.CueCanvasWrapper>\n )}\n {!isIntro && hints && hints.length > 0 && (\n <FlexView\n $background=\"BLUE_1\"\n $gutterX={1}\n $gapX={0.5}\n $borderRadiusX={0}\n $borderColor=\"BLUE_2\"\n >\n {hints.map((hint, index) => (\n <Styled.Hint\n key={hint}\n dangerouslySetInnerHTML={{\n __html: `<span style=\"color: #DA5107; font-weight: 600;\">Hint${\n (hintsAvailable?.length ?? 0) > 1 ? ` ${index + 1}` : ''\n }:</span>&nbsp;${hint}`,\n }}\n />\n ))}\n </FlexView>\n )}\n {showSolution && (\n <FlexView\n $background=\"YELLOW_1\"\n $gutterX={1}\n $gapX={0.875}\n $borderRadiusX={0}\n $borderColor=\"YELLOW_2\"\n >\n <Styled.Solution\n dangerouslySetInnerHTML={{\n __html: `<div style=\"color: #DA5107; font-weight: 600;\">Solution:</div>${solution}`,\n }}\n />\n </FlexView>\n )}\n {!!subjectiveProps && (\n <SubjectiveQuestionReview\n responses={responses}\n response={response}\n nextQuestionId={nextQuestionId}\n responseId={responseId}\n studentId={studentId}\n userType={userType}\n {...subjectiveProps}\n />\n )}\n </Styled.QuestionWrapper>\n </Styled.QuestionContainer>\n </Styled.QuestionContainerWrapper>\n );\n});\n\nexport default WorksheetQuestion;\n"],"names":["WorksheetQuestion","memo","userType","signedRequest","worksheetCompleted","question","response","nextQuestionId","isActive","isHidden","canRender","loggerRef","appended","maxQuestionWidth","behavior","layout","actionbarHeight","learnosity","intersectionObserver","onMediaStateChange","onMarkForReview","userId","onPublishStrokes","onReceiveStrokes","isScribblingEnabled","initialStrokesData","onPublishMouseMove","onSubscribeMouseMove","setActiveQuestionId","canResolveDoubt","onResolveDoubt","studentId","responses","subjectiveProps","background","paperColor","useMemo","getPaperColorByQuestion","questionHeight","setQuestionHeight","useState","canvasHeight","setCanvasHeight","validation","review","maximumAttempts","canExceedAttempts","teacherValidationEnabled","solutionHidden","minQuestionHeight","topOffset","questionsScrollable","renderQuestionHeader","imageHue","questionType","responseId","stimulus_review","item_type","instructor_stimulus","hintsAvailable","solution","widget_reference","item_reference","question_number","item_number","item_display_number","hasStimulusReview","isLessonOverview","isConceptIntro","isConceptIntroWidget","isSystemIntro","isIntro","responseEdited","wrapperClasses","classes","overflowDetectedRef","useRef","hintsUsed","validatedByTeacherOnMount","questionRef","pointerContainerRef","hints","validateResponse","showCorrectAnswers","attemptsHistory","showSolution","dropZoneDimensions","setDropZoneDimensions","onUpdateHeight","useCallback","height","useEffect","draggableElements","minWidth","minHeight","draggableElement","learnosityQuestion","$questionEl","parentWidth","nestedElements","i","element","EVENTS","getExtraSpaceNeedForFloatingKeyboard","questionEl","$responseWrapper","questionBottom","responseWrapperBottom","spaceFromResponseToBottom","LEARNOSITY_KEYBOARD_HEIGHT","qHeight","hasKeyboard","_a","newQuestionHeight","useLayoutEffect","scrollToQuestion","timer","jsxs","Styled.QuestionContainerWrapper","QUESTIONS_GAP","jsx","Styled.StimulusReview","Styled.QuestionContainer","Pointer","Styled.QuestionWrapper","QuestionHeader","Styled.LessonOverviewBanner","IMAGES","QuestionBackdrop","Fragment","BasicPracticeIntro","RegularPracticeIntro","ExitTicketIntro","AdvancedPracticeIntro","LearnosityQuestion","Styled.CueCanvasWrapper","CueCanvas","FlexView","hint","index","Styled.Hint","Styled.Solution","SubjectiveQuestionReview"],"mappings":";;;;;;;;;;;;;;;;;;AAiCM,MAAAA,KAAiDC,GAAK,SAA2B;AAAA,EACrF,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,iBA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BAAAC;AAAA,wBACA,YAAAgD;AAAA,wBACA,WAAAxB;AAAA,wBACA,UAAA7B;AAAA,wBACC,GAAG+B;AAAA,sBAAA;AAAA,oBACN;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAEJ;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
1
+ {"version":3,"file":"worksheet-question.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-question/worksheet-question.tsx"],"sourcesContent":["import {\n memo,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type FC,\n} from 'react';\n\nimport { IMAGES } from '../../../../assets/images/images';\nimport CueCanvas from '../../../cue-canvas/cue-canvas';\nimport Pointer from '../../../pointer-sync/pointer';\nimport FlexView from '../../../ui/layout/flex-view';\nimport EVENTS from '../../constants/events';\nimport { LEARNOSITY_KEYBOARD_HEIGHT, QUESTIONS_GAP } from '../constants';\nimport {\n getPaperColorByQuestion,\n isConceptIntroWidget,\n scrollToQuestion,\n} from '../worksheet-helpers';\nimport QuestionHeader from './header/header';\nimport LearnosityQuestion from './learnosity-question';\nimport QuestionBackdrop from './question-backdrop/question-backdrop';\nimport SubjectiveQuestionReview from './subjective-review';\nimport AdvancedPracticeIntro from './system-intros/advanced-practice-intro';\nimport BasicPracticeIntro from './system-intros/basic-practice-intro';\nimport ExitTicketIntro from './system-intros/exit-ticket-intro';\nimport RegularPracticeIntro from './system-intros/regular-practice-intro';\nimport * as Styled from './worksheet-question-styled';\nimport type { IWorksheetQuestionProps } from './worksheet-question-types';\n\nconst WorksheetQuestion: FC<IWorksheetQuestionProps> = memo(function WorksheetQuestion({\n userType,\n signedRequest,\n worksheetCompleted,\n question,\n response,\n nextQuestionId,\n isActive,\n isHidden,\n canRender,\n loggerRef,\n appended,\n maxQuestionWidth,\n behavior,\n layout,\n actionbarHeight,\n learnosity,\n intersectionObserver,\n onMediaStateChange,\n onMarkForReview,\n userId,\n onPublishStrokes,\n onReceiveStrokes,\n isScribblingEnabled,\n initialStrokesData,\n onPublishMouseMove,\n onSubscribeMouseMove,\n setActiveQuestionId,\n canResolveDoubt,\n onResolveDoubt,\n studentId,\n responses,\n subjectiveProps,\n}) {\n const { background = 'paper' } = layout;\n const paperColor = useMemo(\n () => (background === 'paper' ? getPaperColorByQuestion(question) : undefined),\n [background, question],\n );\n const [questionHeight, setQuestionHeight] = useState<number | undefined>();\n const [canvasHeight, setCanvasHeight] = useState<number | undefined>();\n const {\n validation,\n review,\n maximumAttempts,\n canExceedAttempts,\n teacherValidationEnabled,\n solutionHidden,\n } = behavior;\n const { minQuestionHeight, topOffset, questionsScrollable, renderQuestionHeader, imageHue } =\n layout;\n const {\n type: questionType,\n response_id: responseId,\n stimulus_review,\n item_type,\n instructor_stimulus,\n metadata: { hints: hintsAvailable, solution, widget_reference },\n item_reference,\n question_number,\n item_number,\n item_display_number,\n } = question;\n const isLessonOverview = item_type === 'overview';\n const isConceptIntro = isConceptIntroWidget(instructor_stimulus);\n const isSystemIntro = instructor_stimulus === 'SystemIntro';\n const isIntro = isConceptIntro || isSystemIntro;\n const responseEdited = response?.responseEdited;\n const wrapperClasses = useMemo(() => {\n const classes = [];\n\n if (responseEdited && userType === 'TEACHER') {\n classes.push('attempting');\n }\n\n if (!appended) {\n classes.push('hidden');\n }\n\n if (questionType === 'hotspot') {\n classes.push('correct-answers-hidden');\n }\n\n if (appended && teacherValidationEnabled && questionType === 'clozetext') {\n if (!isConceptIntro || userType === 'STUDENT') {\n classes.push('response-hidden');\n } else {\n classes.push('response-code-hidden');\n }\n }\n\n if (isLessonOverview) {\n classes.push('lesson-overview');\n }\n\n if (isConceptIntro) {\n classes.push('concept-intro');\n }\n\n if (isSystemIntro) {\n classes.push('system-intro');\n }\n\n return classes.join(' ');\n }, [\n appended,\n isConceptIntro,\n isLessonOverview,\n isSystemIntro,\n questionType,\n responseEdited,\n teacherValidationEnabled,\n userType,\n ]);\n const overflowDetectedRef = useRef<Record<string, boolean>>({});\n\n const hintsUsed = response?.hintsUsed ?? 0;\n const [validatedByTeacherOnMount] = useState(response?.validatedByTeacher ?? false);\n\n const questionRef = useRef<HTMLDivElement>(null);\n const pointerContainerRef = useRef<HTMLDivElement>(null);\n const hints = useMemo(() => hintsAvailable?.slice(0, hintsUsed), [hintsAvailable, hintsUsed]);\n const validateResponse = useMemo(() => {\n if (userType === 'TEACHER') return true;\n\n if (worksheetCompleted) return true;\n\n if (!response) return false;\n\n if (!response.response) return false;\n\n if (response.responseEdited) return false;\n\n return validation;\n }, [response, userType, validation, worksheetCompleted]);\n\n const showCorrectAnswers = useMemo(() => {\n if (userType === 'TEACHER') return true;\n\n if (review) {\n const { attemptsHistory } = response ?? {};\n const maximumAttemptsReached = (attemptsHistory?.length ?? 0) >= maximumAttempts;\n\n return maximumAttemptsReached && !canExceedAttempts;\n }\n\n return false;\n }, [canExceedAttempts, maximumAttempts, response, review, userType]);\n\n const showSolution = useMemo(\n () => solution && worksheetCompleted && !solutionHidden,\n [solutionHidden, solution, worksheetCompleted],\n );\n\n const [dropZoneDimensions, setDropZoneDimensions] = useState({\n width: 0,\n height: 0,\n });\n\n const onUpdateHeight = useCallback((height: number) => {\n setCanvasHeight(height);\n }, []);\n\n useEffect(() => {\n if (questionRef.current) {\n intersectionObserver.observe(questionRef.current);\n }\n }, [intersectionObserver]);\n\n useEffect(() => {\n if (\n appended &&\n (question.type === 'clozeassociation' ||\n question.type === 'association' ||\n question.type === 'clozeformula')\n ) {\n const draggableElements = document.querySelectorAll(\n `.widget-${question.response_id} .lrn_draggable`,\n );\n\n let minWidth = 0;\n let minHeight = 0;\n\n draggableElements.forEach(draggableElement => {\n minWidth = Math.max(minWidth, draggableElement.clientWidth + 33);\n minHeight = Math.max(minHeight, draggableElement.clientHeight + 1);\n });\n\n setDropZoneDimensions({\n width: question.type !== 'association' ? minWidth : 0,\n height: minHeight,\n });\n }\n }, [appended, question.response_id, question.type]);\n\n useEffect(() => {\n if (appended && validateResponse) {\n const learnosityQuestion = learnosity.question(responseId);\n\n if (learnosityQuestion) {\n learnosityQuestion.validate({\n showCorrectAnswers,\n });\n }\n }\n }, [appended, learnosity, responseId, review, showCorrectAnswers, userType, validateResponse]);\n\n useEffect(() => {\n const $questionEl = pointerContainerRef.current;\n\n if (\n appended &&\n $questionEl &&\n loggerRef.current &&\n overflowDetectedRef.current[responseId] === undefined &&\n !isConceptIntro &&\n !isSystemIntro\n ) {\n const parentWidth = $questionEl.clientWidth;\n const nestedElements = $questionEl.querySelectorAll('*');\n\n for (let i = 0; i < nestedElements.length; i++) {\n const element = nestedElements[i];\n\n if (element?.closest('.resize-sensor')) {\n continue;\n }\n\n const elementWidth = element?.clientWidth ?? 0;\n\n if (elementWidth > parentWidth) {\n overflowDetectedRef.current[responseId] = true;\n loggerRef.current(EVENTS.WORKSHEET_V3_GREATER_WIDTH_ELEMENT, {\n item_reference,\n widget_reference,\n question_type: questionType,\n question_number,\n responseId,\n item_number,\n item_display_number,\n });\n break;\n }\n }\n\n overflowDetectedRef.current[responseId] = false;\n }\n }, [\n appended,\n isConceptIntro,\n isSystemIntro,\n item_display_number,\n item_number,\n item_reference,\n loggerRef,\n questionType,\n question_number,\n responseId,\n widget_reference,\n ]);\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(() => {\n const $questionEl = questionRef.current;\n\n const getExtraSpaceNeedForFloatingKeyboard = (questionEl: HTMLDivElement) => {\n const $responseWrapper = questionEl.querySelector('.lrn_response_wrapper');\n\n if (isIntro || !$responseWrapper) {\n return 0;\n }\n\n const questionBottom = questionEl.getBoundingClientRect().bottom;\n const responseWrapperBottom = $responseWrapper.getBoundingClientRect().bottom;\n const spaceFromResponseToBottom = Math.abs(questionBottom - responseWrapperBottom);\n\n if (spaceFromResponseToBottom < LEARNOSITY_KEYBOARD_HEIGHT) {\n return LEARNOSITY_KEYBOARD_HEIGHT - spaceFromResponseToBottom;\n }\n\n return 0;\n };\n\n if (appended && $questionEl) {\n setQuestionHeight(qHeight => {\n const hasFloatingKeyboard = question.ui_style?.type === 'floating-keyboard';\n const v3CodeHidden = teacherValidationEnabled && questionType === 'clozetext';\n const hasKeyboard = hasFloatingKeyboard && !v3CodeHidden;\n const height = $questionEl.clientHeight;\n\n if (height === 0) {\n return qHeight;\n }\n\n // If the question has a floating keyboard, we need to add the height of the keyboard to the question height\n if (!qHeight) {\n return Math.ceil(\n height + (hasKeyboard ? getExtraSpaceNeedForFloatingKeyboard($questionEl) : 0),\n );\n }\n\n const newQuestionHeight = Math.ceil(\n height + (hasKeyboard ? getExtraSpaceNeedForFloatingKeyboard($questionEl) : 0),\n );\n\n if (Math.abs(newQuestionHeight - qHeight) > 4) {\n return newQuestionHeight;\n }\n\n return qHeight;\n });\n }\n\n learnosity.renderMath('mathjax');\n });\n\n useLayoutEffect(() => {\n if (!questionsScrollable && !isHidden) {\n scrollToQuestion(responseId);\n }\n }, [isHidden, questionsScrollable, responseId, topOffset]);\n\n useEffect(() => {\n if (\n teacherValidationEnabled &&\n nextQuestionId &&\n !validatedByTeacherOnMount &&\n response?.validatedByTeacher\n ) {\n const timer = setTimeout(() => {\n if (questionsScrollable) {\n scrollToQuestion(nextQuestionId);\n } else {\n setActiveQuestionId(nextQuestionId);\n }\n }, 1000);\n\n return () => {\n clearTimeout(timer);\n };\n }\n }, [\n nextQuestionId,\n teacherValidationEnabled,\n validatedByTeacherOnMount,\n questionsScrollable,\n setActiveQuestionId,\n response?.validatedByTeacher,\n ]);\n\n return (\n <Styled.QuestionContainerWrapper\n data-response-id={responseId}\n className={`widget-${responseId}`}\n ref={questionRef}\n $topOffset={topOffset}\n $flexDirection={stimulus_review ? 'row' : 'column'}\n $alignItems={stimulus_review ? 'flex-start' : 'center'}\n $hidden={isHidden}\n $marginBottom={QUESTIONS_GAP}\n >\n {stimulus_review && (\n <Styled.StimulusReview\n dangerouslySetInnerHTML={{\n __html: stimulus_review,\n }}\n />\n )}\n <Styled.QuestionContainer\n ref={pointerContainerRef}\n $width={stimulus_review ? '50%' : `${maxQuestionWidth}px`}\n $minHeight={\n questionHeight ? Math.max(questionHeight - 72, canvasHeight ?? 0) : minQuestionHeight\n }\n $isActive={isActive}\n $paperColor={paperColor}\n $opacity={isActive ? 1 : 0.2}\n $imageHue={imageHue}\n >\n {isActive && !!onPublishMouseMove && !!onSubscribeMouseMove && !!behavior.canvasEnabled && (\n <Pointer\n containerRef={pointerContainerRef}\n onPublish={onPublishMouseMove}\n onSubscribe={onSubscribeMouseMove}\n responseId={responseId}\n />\n )}\n <Styled.QuestionWrapper\n className={wrapperClasses}\n $dropzoneMinWidth={dropZoneDimensions.width}\n $dropzoneMinHeight={dropZoneDimensions.height}\n >\n {renderQuestionHeader && !(isLessonOverview || isConceptIntro || isSystemIntro) && (\n <QuestionHeader\n userType={userType}\n question={question}\n response={response}\n behavior={behavior}\n layout={layout}\n paperColor={paperColor}\n onMarkForReview={onMarkForReview}\n actionbarHeight={actionbarHeight}\n canResolveDoubt={canResolveDoubt}\n onResolveDoubt={onResolveDoubt}\n worksheetCompleted={worksheetCompleted}\n />\n )}\n {isLessonOverview && <Styled.LessonOverviewBanner src={IMAGES.LESSON_OVERVIEW_BANNER} />}\n {isConceptIntro && paperColor && <QuestionBackdrop paperColor={paperColor} />}\n {isSystemIntro ? (\n <>\n {item_type === 'practice-basic' && <BasicPracticeIntro />}\n {item_type === 'practice-regular' && <RegularPracticeIntro />}\n {item_type === 'exit-ticket' && <ExitTicketIntro />}\n {item_type?.startsWith('advanced-') && <AdvancedPracticeIntro />}\n </>\n ) : undefined}\n <LearnosityQuestion\n signedRequest={signedRequest}\n appended={appended}\n question={question}\n response={response?.response}\n canRender={canRender || isActive}\n learnosity={learnosity}\n canForceAppend={userType === 'TEACHER'}\n isConceptIntro={isConceptIntro}\n simState={response?.simState}\n onMediaStateChange={onMediaStateChange}\n imageHue={imageHue}\n isPuzzle={maximumAttempts === -2}\n />\n\n {!isIntro &&\n !!behavior.canvasEnabled &&\n onPublishStrokes &&\n onReceiveStrokes &&\n questionHeight !== undefined && (\n <Styled.CueCanvasWrapper $canScribble={isScribblingEnabled}>\n <CueCanvas\n canRender={canRender}\n canScribble={isScribblingEnabled && isActive}\n appended={appended}\n canvasId={responseId}\n width={maxQuestionWidth}\n height={Math.max(questionHeight, canvasHeight ?? 0)}\n onUpdateHeight={onUpdateHeight}\n onPublish={onPublishStrokes}\n onSubscribe={onReceiveStrokes}\n userId={userId}\n initialData={initialStrokesData?.[responseId]}\n userType={userType}\n />\n </Styled.CueCanvasWrapper>\n )}\n {!isIntro && hints && hints.length > 0 && (\n <FlexView\n $background=\"BLUE_1\"\n $gutterX={1}\n $gapX={0.5}\n $borderRadiusX={0}\n $borderColor=\"BLUE_2\"\n >\n {hints.map((hint, index) => (\n <Styled.Hint\n key={hint}\n dangerouslySetInnerHTML={{\n __html: `<span style=\"color: #DA5107; font-weight: 600;\">Hint${\n (hintsAvailable?.length ?? 0) > 1 ? ` ${index + 1}` : ''\n }:</span>&nbsp;${hint}`,\n }}\n />\n ))}\n </FlexView>\n )}\n {showSolution && (\n <FlexView\n $background=\"YELLOW_1\"\n $gutterX={1}\n $gapX={0.875}\n $borderRadiusX={0}\n $borderColor=\"YELLOW_2\"\n >\n <Styled.Solution\n dangerouslySetInnerHTML={{\n __html: `<div style=\"color: #DA5107; font-weight: 600;\">Solution:</div>${solution}`,\n }}\n />\n </FlexView>\n )}\n {!!subjectiveProps && (\n <SubjectiveQuestionReview\n responses={responses}\n response={response}\n nextQuestionId={nextQuestionId}\n responseId={responseId}\n studentId={studentId}\n userType={userType}\n {...subjectiveProps}\n />\n )}\n </Styled.QuestionWrapper>\n </Styled.QuestionContainer>\n </Styled.QuestionContainerWrapper>\n );\n});\n\nexport default WorksheetQuestion;\n"],"names":["WorksheetQuestion","memo","userType","signedRequest","worksheetCompleted","question","response","nextQuestionId","isActive","isHidden","canRender","loggerRef","appended","maxQuestionWidth","behavior","layout","actionbarHeight","learnosity","intersectionObserver","onMediaStateChange","onMarkForReview","userId","onPublishStrokes","onReceiveStrokes","isScribblingEnabled","initialStrokesData","onPublishMouseMove","onSubscribeMouseMove","setActiveQuestionId","canResolveDoubt","onResolveDoubt","studentId","responses","subjectiveProps","background","paperColor","useMemo","getPaperColorByQuestion","questionHeight","setQuestionHeight","useState","canvasHeight","setCanvasHeight","validation","review","maximumAttempts","canExceedAttempts","teacherValidationEnabled","solutionHidden","minQuestionHeight","topOffset","questionsScrollable","renderQuestionHeader","imageHue","questionType","responseId","stimulus_review","item_type","instructor_stimulus","hintsAvailable","solution","widget_reference","item_reference","question_number","item_number","item_display_number","isLessonOverview","isConceptIntro","isConceptIntroWidget","isSystemIntro","isIntro","responseEdited","wrapperClasses","classes","overflowDetectedRef","useRef","hintsUsed","validatedByTeacherOnMount","questionRef","pointerContainerRef","hints","validateResponse","showCorrectAnswers","attemptsHistory","showSolution","dropZoneDimensions","setDropZoneDimensions","onUpdateHeight","useCallback","height","useEffect","draggableElements","minWidth","minHeight","draggableElement","learnosityQuestion","$questionEl","parentWidth","nestedElements","i","element","EVENTS","getExtraSpaceNeedForFloatingKeyboard","questionEl","$responseWrapper","questionBottom","responseWrapperBottom","spaceFromResponseToBottom","LEARNOSITY_KEYBOARD_HEIGHT","qHeight","hasKeyboard","_a","newQuestionHeight","useLayoutEffect","scrollToQuestion","timer","jsxs","Styled.QuestionContainerWrapper","QUESTIONS_GAP","jsx","Styled.StimulusReview","Styled.QuestionContainer","Pointer","Styled.QuestionWrapper","QuestionHeader","Styled.LessonOverviewBanner","IMAGES","QuestionBackdrop","Fragment","BasicPracticeIntro","RegularPracticeIntro","ExitTicketIntro","AdvancedPracticeIntro","LearnosityQuestion","Styled.CueCanvasWrapper","CueCanvas","FlexView","hint","index","Styled.Hint","Styled.Solution","SubjectiveQuestionReview"],"mappings":";;;;;;;;;;;;;;;;;;AAiCM,MAAAA,KAAiDC,GAAK,SAA2B;AAAA,EACrF,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,oBAAAC;A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,yBAAyB;AAAA,8BACvB,QAAQ,iEAAiEhF,CAAQ;AAAA,4BACnF;AAAA,0BAAA;AAAA,wBACF;AAAA,sBAAA;AAAA,oBACF;AAAA,oBAED,CAAC,CAAC3B,MACD,gBAAAsF;AAAA,sBAACsB;AAAA,sBAAA;AAAA,wBACC,WAAA7G;AAAA,wBACA,UAAA1B;AAAA,wBACA,gBAAAC;AAAA,wBACA,YAAAgD;AAAA,wBACA,WAAAxB;AAAA,wBACA,UAAA7B;AAAA,wBACC,GAAG+B;AAAA,sBAAA;AAAA,oBACN;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAEJ;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuemath/leap",
3
- "version": "3.5.11",
3
+ "version": "3.5.12",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"