@burdenoff/microfe-buildmyiq 2026.803.1 → 2026.804.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.
Files changed (43) hide show
  1. package/dist/buildmyiq/hooks/useBuildmyiqApi.d.ts +21 -3
  2. package/dist/buildmyiq/hooks/useBuildmyiqApi.d.ts.map +1 -1
  3. package/dist/buildmyiq/hooks/useBuildmyiqApi.js +116 -62
  4. package/dist/buildmyiq/hooks/useBuildmyiqApi.js.map +1 -1
  5. package/dist/buildmyiq/pages/DashboardPage.d.ts.map +1 -1
  6. package/dist/buildmyiq/pages/DashboardPage.js +3 -4
  7. package/dist/buildmyiq/pages/DashboardPage.js.map +1 -1
  8. package/dist/buildmyiq/pages/assessments/TakeAssessmentPage.d.ts.map +1 -1
  9. package/dist/buildmyiq/pages/assessments/TakeAssessmentPage.js +1 -2
  10. package/dist/buildmyiq/pages/assessments/TakeAssessmentPage.js.map +1 -1
  11. package/dist/buildmyiq/pages/catalog/CourseDetailPage.d.ts.map +1 -1
  12. package/dist/buildmyiq/pages/catalog/CourseDetailPage.js +14 -15
  13. package/dist/buildmyiq/pages/catalog/CourseDetailPage.js.map +1 -1
  14. package/dist/buildmyiq/pages/certificates/CertificatesPage.d.ts.map +1 -1
  15. package/dist/buildmyiq/pages/certificates/CertificatesPage.js +175 -175
  16. package/dist/buildmyiq/pages/certificates/CertificatesPage.js.map +1 -1
  17. package/dist/buildmyiq/pages/learning/MyLearningPage.js +2 -4
  18. package/dist/buildmyiq/pages/learning/MyLearningPage.js.map +1 -1
  19. package/dist/buildmyiq/pages/paths/PathsPage.d.ts.map +1 -1
  20. package/dist/buildmyiq/pages/paths/PathsPage.js +1 -2
  21. package/dist/buildmyiq/pages/paths/PathsPage.js.map +1 -1
  22. package/dist/buildmyiq/pages/submissions/AnswersView.d.ts +6 -0
  23. package/dist/buildmyiq/pages/submissions/AnswersView.d.ts.map +1 -0
  24. package/dist/buildmyiq/pages/submissions/AnswersView.js +41 -0
  25. package/dist/buildmyiq/pages/submissions/AnswersView.js.map +1 -0
  26. package/dist/buildmyiq/pages/submissions/BulkGradingPage.d.ts.map +1 -1
  27. package/dist/buildmyiq/pages/submissions/BulkGradingPage.js +332 -173
  28. package/dist/buildmyiq/pages/submissions/BulkGradingPage.js.map +1 -1
  29. package/dist/buildmyiq/pages/submissions/SubmissionsPage.d.ts.map +1 -1
  30. package/dist/buildmyiq/pages/submissions/SubmissionsPage.js +221 -227
  31. package/dist/buildmyiq/pages/submissions/SubmissionsPage.js.map +1 -1
  32. package/dist/buildmyiq/pages/submissions/aiGrading.d.ts +26 -0
  33. package/dist/buildmyiq/pages/submissions/aiGrading.d.ts.map +1 -0
  34. package/dist/buildmyiq/pages/submissions/aiGrading.js +23 -0
  35. package/dist/buildmyiq/pages/submissions/aiGrading.js.map +1 -0
  36. package/dist/buildmyiq/types/index.d.ts +10 -0
  37. package/dist/buildmyiq/types/index.d.ts.map +1 -1
  38. package/dist/buildmyiq/types/index.js.map +1 -1
  39. package/dist/utils/pageContext.d.ts +8 -0
  40. package/dist/utils/pageContext.d.ts.map +1 -1
  41. package/dist/utils/pageContext.js +8 -0
  42. package/dist/utils/pageContext.js.map +1 -1
  43. package/package.json +2 -1
@@ -15,14 +15,16 @@ import { useCursorPager as v } from "../../hooks/useCursorPager.js";
15
15
  import "../../hooks/index.js";
16
16
  import { BuiPermissionButton as y } from "../../components/BuiPermissionButton.js";
17
17
  import "../../components/index.js";
18
- import { useEffect as b, useMemo as x, useState as S } from "react";
19
- import { BookOpen as C, CheckCircle2 as w, ClipboardList as T, Clock as E, GraduationCap as D, Layers as O, Sparkles as k, Undo2 as A } from "lucide-react";
20
- import { useParams as j } from "react-router";
21
- import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
22
- import { Button as F, Input as I, Label as L, Sheet as ee, SheetContent as te, SheetDescription as R, SheetFooter as z, SheetHeader as B, SheetTitle as V, Switch as H, Textarea as U } from "@burdenoff/fe-libs/ui";
23
- import { useMediaQuery as ne } from "@burdenoff/fe-libs/shared/hooks";
18
+ import { AnswersView as b } from "./AnswersView.js";
19
+ import { isLowConfidence as x } from "./aiGrading.js";
20
+ import { useEffect as S, useMemo as C, useState as w } from "react";
21
+ import { BookOpen as T, CheckCircle2 as E, ClipboardList as D, Clock as O, GraduationCap as k, Layers as A, Sparkles as j, Undo2 as M } from "lucide-react";
22
+ import { useParams as ee } from "react-router";
23
+ import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
24
+ import { Button as I, Input as L, Label as R, Sheet as z, SheetContent as B, SheetDescription as V, SheetFooter as H, SheetHeader as U, SheetTitle as W, Switch as G, Textarea as K } from "@burdenoff/fe-libs/ui";
25
+ import { useMediaQuery as te } from "@burdenoff/fe-libs/shared/hooks";
24
26
  //#region src/buildmyiq/pages/submissions/SubmissionsPage.tsx
25
- var W = 24, re = [
27
+ var q = 24, ne = [
26
28
  {
27
29
  value: "ALL",
28
30
  label: "All"
@@ -43,97 +45,67 @@ var W = 24, re = [
43
45
  value: "RETURNED",
44
46
  label: "Returned"
45
47
  }
46
- ], G = [{
48
+ ], J = [{
47
49
  value: "submission",
48
50
  label: "Submission"
49
51
  }, {
50
52
  value: "details",
51
53
  label: "Details"
52
- }], K = (e) => e.length > 10 ? `${e.slice(0, 8)}…` : e, ie = (e) => r(e, {
54
+ }], Y = (e) => e.length > 10 ? `${e.slice(0, 8)}…` : e, re = (e) => r(e, {
53
55
  day: void 0,
54
56
  month: void 0,
55
57
  year: void 0,
56
58
  hour: "numeric",
57
59
  minute: "2-digit"
58
- }), q = (e) => typeof e == "object" && !!e && !Array.isArray(e), J = (e) => e == null ? "—" : typeof e == "string" ? e : typeof e == "number" || typeof e == "boolean" ? String(e) : JSON.stringify(e, null, 2), Y = ({ answers: e }) => {
59
- if (e == null) return /* @__PURE__ */ N("p", {
60
- className: "text-sm text-text-secondary",
61
- children: "No answers were submitted."
62
- });
63
- if (q(e)) {
64
- let t = Object.entries(e);
65
- return t.length === 0 ? /* @__PURE__ */ N("p", {
66
- className: "text-sm text-text-secondary",
67
- children: "No answers were submitted."
68
- }) : /* @__PURE__ */ N("ol", {
69
- className: "grid gap-2.5",
70
- children: t.map(([e, t], n) => /* @__PURE__ */ P("li", {
71
- className: "grid gap-1 rounded-lg border border-border-seam/70 bg-bg-surface/60 p-3 sm:grid-cols-[minmax(0,7rem)_1fr] sm:gap-3",
72
- children: [/* @__PURE__ */ P("div", {
73
- className: "flex items-baseline gap-2 sm:col-span-1",
74
- children: [/* @__PURE__ */ P("span", {
75
- className: "shrink-0 text-xs font-semibold text-[var(--color-accent-teal)] tabular-nums",
76
- children: ["Q", n + 1]
77
- }), /* @__PURE__ */ N("span", {
78
- className: "break-words font-mono text-xs text-text-secondary",
79
- children: e
80
- })]
81
- }), /* @__PURE__ */ N("span", {
82
- className: "whitespace-pre-wrap break-words text-sm text-text-primary sm:col-span-1",
83
- children: J(t)
84
- })]
85
- }, e))
86
- });
87
- }
88
- return /* @__PURE__ */ N("pre", {
89
- className: "overflow-x-auto whitespace-pre-wrap break-words rounded-lg border border-border-seam/70 bg-bg-surface/60 p-3 text-xs text-text-primary",
90
- children: JSON.stringify(e, null, 2)
91
- });
92
- }, X = ({ label: e, children: t }) => /* @__PURE__ */ P("div", {
60
+ }), X = ({ label: e, children: t }) => /* @__PURE__ */ F("div", {
93
61
  className: "min-w-0",
94
- children: [/* @__PURE__ */ N("p", {
62
+ children: [/* @__PURE__ */ P("p", {
95
63
  className: "text-xs font-medium uppercase tracking-wide text-text-secondary",
96
64
  children: e
97
- }), /* @__PURE__ */ N("div", {
65
+ }), /* @__PURE__ */ P("div", {
98
66
  className: "mt-0.5 text-sm text-text-primary",
99
67
  children: t
100
68
  })]
101
69
  }), Z = ({ submissionId: e, onUseSuggestion: t }) => {
102
- let n = _(), r = m(), [i, a] = S(null), [o, s] = S(!1);
103
- return o && !i ? null : i ? /* @__PURE__ */ P("div", {
70
+ let n = _(), r = m(), [i, a] = w(null), [o, s] = w(!1);
71
+ return o && !i ? null : i ? /* @__PURE__ */ F("div", {
104
72
  className: "mb-4 rounded-xl border border-[var(--color-accent-teal)]/30 bg-[color-mix(in_srgb,var(--color-accent-teal)_8%,transparent)] p-3.5",
105
73
  children: [
106
- /* @__PURE__ */ P("div", {
74
+ /* @__PURE__ */ F("div", {
107
75
  className: "mb-2 flex items-center gap-2",
108
76
  children: [
109
- /* @__PURE__ */ N(k, { className: "h-4 w-4 shrink-0 text-[var(--color-accent-teal)]" }),
110
- /* @__PURE__ */ P("p", {
77
+ /* @__PURE__ */ P(j, { className: "h-4 w-4 shrink-0 text-[var(--color-accent-teal)]" }),
78
+ /* @__PURE__ */ F("p", {
111
79
  className: "text-sm font-semibold text-text-primary",
112
80
  children: [
113
81
  "AI-suggested score:",
114
82
  " ",
115
- /* @__PURE__ */ N("span", {
83
+ /* @__PURE__ */ P("span", {
116
84
  className: "tabular-nums",
117
85
  children: i.proposedScore.toFixed(1)
118
86
  })
119
87
  ]
120
88
  }),
121
- /* @__PURE__ */ P("span", {
122
- className: "ml-auto text-xs text-text-tertiary",
89
+ /* @__PURE__ */ F("span", {
90
+ className: `ml-auto text-xs ${x(i.confidence) ? "font-semibold text-status-warning-text" : "text-text-tertiary"}`,
123
91
  children: [Math.round(i.confidence * 100), "% confidence"]
124
92
  })
125
93
  ]
126
94
  }),
127
- i.perQuestionFeedback.length > 0 && /* @__PURE__ */ N("ul", {
95
+ x(i.confidence) && /* @__PURE__ */ P("p", {
96
+ className: "mb-2 rounded-lg border border-status-warning-border bg-status-warning-bg-subtle p-2 text-xs text-status-warning-text",
97
+ children: "Low AI confidence — review this suggestion especially carefully before using it."
98
+ }),
99
+ i.perQuestionFeedback.length > 0 && /* @__PURE__ */ P("ul", {
128
100
  className: "mb-3 flex flex-col gap-1.5",
129
- children: i.perQuestionFeedback.map((e, t) => /* @__PURE__ */ P("li", {
101
+ children: i.perQuestionFeedback.map((e, t) => /* @__PURE__ */ F("li", {
130
102
  className: "text-xs text-text-secondary",
131
103
  children: [
132
- /* @__PURE__ */ P("span", {
104
+ /* @__PURE__ */ F("span", {
133
105
  className: "font-medium text-text-primary",
134
106
  children: ["Q", t + 1]
135
107
  }),
136
- e.suggestedPoints != null && /* @__PURE__ */ P("span", {
108
+ e.suggestedPoints != null && /* @__PURE__ */ F("span", {
137
109
  className: "tabular-nums",
138
110
  children: [
139
111
  " (",
@@ -142,17 +114,39 @@ var W = 24, re = [
142
114
  ]
143
115
  }),
144
116
  ": ",
145
- e.feedback
117
+ e.feedback,
118
+ e.criterionScores && e.criterionScores.length > 0 && /* @__PURE__ */ P("ul", {
119
+ className: "mt-1 flex flex-col gap-0.5 border-l border-border-seam/70 pl-3",
120
+ children: e.criterionScores.map((e) => /* @__PURE__ */ F("li", {
121
+ className: "text-text-tertiary",
122
+ children: [
123
+ /* @__PURE__ */ P("span", {
124
+ className: "font-medium text-text-secondary",
125
+ children: e.title
126
+ }),
127
+ " ",
128
+ /* @__PURE__ */ F("span", {
129
+ className: "tabular-nums",
130
+ children: [
131
+ e.suggestedPoints,
132
+ "/",
133
+ e.maxPoints
134
+ ]
135
+ }),
136
+ e.comment ? ` — ${e.comment}` : ""
137
+ ]
138
+ }, e.criterionId))
139
+ })
146
140
  ]
147
141
  }, e.questionId))
148
142
  }),
149
- /* @__PURE__ */ N("p", {
143
+ /* @__PURE__ */ P("p", {
150
144
  className: "mb-3 text-xs text-text-tertiary",
151
145
  children: "This is a suggestion, not a grade — nothing is saved until you review it and click “Grade submission” below."
152
146
  }),
153
- /* @__PURE__ */ P("div", {
147
+ /* @__PURE__ */ F("div", {
154
148
  className: "flex gap-2",
155
- children: [/* @__PURE__ */ N(F, {
149
+ children: [/* @__PURE__ */ P(I, {
156
150
  type: "button",
157
151
  size: "sm",
158
152
  onClick: () => {
@@ -164,7 +158,7 @@ var W = 24, re = [
164
158
  }), s(!0);
165
159
  },
166
160
  children: "Use this suggestion"
167
- }), /* @__PURE__ */ N(F, {
161
+ }), /* @__PURE__ */ P(I, {
168
162
  type: "button",
169
163
  variant: "ghost",
170
164
  size: "sm",
@@ -178,10 +172,10 @@ var W = 24, re = [
178
172
  })]
179
173
  })
180
174
  ]
181
- }) : /* @__PURE__ */ P("div", {
175
+ }) : /* @__PURE__ */ F("div", {
182
176
  className: "mb-4 rounded-xl border border-dashed border-border-seam bg-bg-sunken/40 p-3",
183
177
  children: [
184
- /* @__PURE__ */ P(F, {
178
+ /* @__PURE__ */ F(I, {
185
179
  type: "button",
186
180
  variant: "outline",
187
181
  size: "sm",
@@ -192,44 +186,44 @@ var W = 24, re = [
192
186
  } catch {}
193
187
  },
194
188
  disabled: n.isPending,
195
- children: [/* @__PURE__ */ N(k, { className: "mr-1.5 h-4 w-4" }), n.isPending ? "Asking the AI grader…" : "Suggest with AI"]
189
+ children: [/* @__PURE__ */ P(j, { className: "mr-1.5 h-4 w-4" }), n.isPending ? "Asking the AI grader…" : "Suggest with AI"]
196
190
  }),
197
- n.isError && /* @__PURE__ */ N("p", {
191
+ n.isError && /* @__PURE__ */ P("p", {
198
192
  className: "mt-2 text-xs text-status-error-text",
199
193
  children: n.error instanceof Error ? n.error.message : "The AI grading assistant is unavailable right now."
200
194
  }),
201
- /* @__PURE__ */ N("p", {
195
+ /* @__PURE__ */ P("p", {
202
196
  className: "mt-1.5 text-xs text-text-tertiary",
203
197
  children: "Proposes a score + feedback for open-ended answers. You always review before it counts."
204
198
  })
205
199
  ]
206
200
  });
207
- }, ae = ({ submission: e, currentUser: t, meName: n, isMe: r, learnerLabel: o, gradeSubmission: s, onClose: c }) => {
208
- let [l, d] = S("submission"), [p, m] = S(!1), [h, g] = S(e.score == null ? "" : String(e.score)), [_, v] = S(e.passed ?? !1), [b, x] = S(e.feedback ?? ""), [C, w] = S(null), T = e.status === "SUBMITTED" || e.status === "GRADING", E = e.status === "GRADED" || e.status === "RETURNED", D = e.status === "IN_PROGRESS", O = T || p;
209
- return /* @__PURE__ */ P(M, { children: [
210
- /* @__PURE__ */ P(B, {
201
+ }, ie = ({ submission: e, currentUser: t, meName: n, isMe: r, learnerLabel: o, gradeSubmission: s, onClose: c }) => {
202
+ let [l, d] = w("submission"), [p, m] = w(!1), [h, g] = w(e.score == null ? "" : String(e.score)), [_, v] = w(e.passed ?? !1), [x, S] = w(e.feedback ?? ""), [C, T] = w(null), E = e.status === "SUBMITTED" || e.status === "GRADING", D = e.status === "GRADED" || e.status === "RETURNED", O = e.status === "IN_PROGRESS", k = E || p;
203
+ return /* @__PURE__ */ F(N, { children: [
204
+ /* @__PURE__ */ F(U, {
211
205
  className: "border-b border-border-seam p-5 pr-12",
212
206
  children: [
213
- /* @__PURE__ */ P("div", {
207
+ /* @__PURE__ */ F("div", {
214
208
  className: "flex items-center gap-3",
215
- children: [/* @__PURE__ */ N(f, {
209
+ children: [/* @__PURE__ */ P(f, {
216
210
  size: "md",
217
211
  name: r(e.learnerId) ? n : void 0,
218
212
  seed: e.learnerId,
219
213
  src: r(e.learnerId) ? t?.avatar : void 0
220
- }), /* @__PURE__ */ P("div", {
214
+ }), /* @__PURE__ */ F("div", {
221
215
  className: "min-w-0",
222
- children: [/* @__PURE__ */ N(V, {
216
+ children: [/* @__PURE__ */ P(W, {
223
217
  className: "truncate text-lg",
224
218
  children: o(e.learnerId)
225
- }), /* @__PURE__ */ P(R, {
219
+ }), /* @__PURE__ */ F(V, {
226
220
  className: "truncate font-mono text-xs",
227
221
  title: e.assessmentId,
228
- children: ["Assessment ", K(e.assessmentId)]
222
+ children: ["Assessment ", Y(e.assessmentId)]
229
223
  })]
230
224
  })]
231
225
  }),
232
- /* @__PURE__ */ P("p", {
226
+ /* @__PURE__ */ F("p", {
233
227
  className: "text-xs text-text-secondary",
234
228
  children: [
235
229
  "Attempt #",
@@ -238,134 +232,134 @@ var W = 24, re = [
238
232
  i(e.submittedAt)
239
233
  ]
240
234
  }),
241
- /* @__PURE__ */ N("div", {
235
+ /* @__PURE__ */ P("div", {
242
236
  className: "pt-1",
243
- children: /* @__PURE__ */ N(a, { status: e.status })
237
+ children: /* @__PURE__ */ P(a, { status: e.status })
244
238
  })
245
239
  ]
246
240
  }),
247
- /* @__PURE__ */ P("div", {
241
+ /* @__PURE__ */ F("div", {
248
242
  className: "flex-1 overflow-y-auto px-5 py-4",
249
243
  children: [
250
- /* @__PURE__ */ N(u, {
251
- items: G,
244
+ /* @__PURE__ */ P(u, {
245
+ items: J,
252
246
  value: l,
253
247
  onChange: d,
254
248
  className: "mb-4"
255
249
  }),
256
- l === "submission" ? /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ P("p", {
250
+ l === "submission" ? /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ F("p", {
257
251
  className: "mb-2 text-sm font-semibold text-text-primary",
258
- children: ["Answers ", /* @__PURE__ */ N("span", {
252
+ children: ["Answers ", /* @__PURE__ */ P("span", {
259
253
  className: "font-normal text-text-secondary",
260
254
  children: "(read-only)"
261
255
  })]
262
- }), /* @__PURE__ */ N(Y, { answers: e.answers })] }) : /* @__PURE__ */ P("div", {
256
+ }), /* @__PURE__ */ P(b, { answers: e.answers })] }) : /* @__PURE__ */ F("div", {
263
257
  className: "grid grid-cols-2 gap-4 rounded-xl bg-bg-sunken/60 p-4",
264
258
  children: [
265
- /* @__PURE__ */ N(X, {
259
+ /* @__PURE__ */ P(X, {
266
260
  label: "Status",
267
- children: /* @__PURE__ */ N(a, { status: e.status })
261
+ children: /* @__PURE__ */ P(a, { status: e.status })
268
262
  }),
269
- /* @__PURE__ */ N(X, {
263
+ /* @__PURE__ */ P(X, {
270
264
  label: "Attempt",
271
- children: /* @__PURE__ */ P("span", {
265
+ children: /* @__PURE__ */ F("span", {
272
266
  className: "tabular-nums",
273
267
  children: ["#", e.attempt]
274
268
  })
275
269
  }),
276
- /* @__PURE__ */ N(X, {
270
+ /* @__PURE__ */ P(X, {
277
271
  label: "Submitted",
278
272
  children: i(e.submittedAt)
279
273
  }),
280
- /* @__PURE__ */ N(X, {
274
+ /* @__PURE__ */ P(X, {
281
275
  label: "Assessment",
282
- children: /* @__PURE__ */ N("span", {
276
+ children: /* @__PURE__ */ P("span", {
283
277
  className: "font-mono text-xs",
284
278
  title: e.assessmentId,
285
- children: K(e.assessmentId)
279
+ children: Y(e.assessmentId)
286
280
  })
287
281
  }),
288
- e.enrollmentId && /* @__PURE__ */ N(X, {
282
+ e.enrollmentId && /* @__PURE__ */ P(X, {
289
283
  label: "Enrollment",
290
- children: /* @__PURE__ */ N("span", {
284
+ children: /* @__PURE__ */ P("span", {
291
285
  className: "font-mono text-xs",
292
286
  title: e.enrollmentId,
293
- children: K(e.enrollmentId)
287
+ children: Y(e.enrollmentId)
294
288
  })
295
289
  }),
296
- e.gradedAt && /* @__PURE__ */ N(X, {
290
+ e.gradedAt && /* @__PURE__ */ P(X, {
297
291
  label: "Graded",
298
292
  children: i(e.gradedAt)
299
293
  })
300
294
  ]
301
295
  }),
302
- /* @__PURE__ */ P("div", {
296
+ /* @__PURE__ */ F("div", {
303
297
  className: "mt-6 border-t border-border-seam pt-5",
304
298
  children: [
305
- /* @__PURE__ */ N("p", {
299
+ /* @__PURE__ */ P("p", {
306
300
  className: "mb-3 text-sm font-semibold text-text-primary",
307
301
  children: "Grade"
308
302
  }),
309
- D && /* @__PURE__ */ N("p", {
303
+ O && /* @__PURE__ */ P("p", {
310
304
  className: "rounded-lg bg-bg-sunken/60 px-4 py-3 text-sm text-text-secondary",
311
305
  children: "This attempt is still in progress — there is nothing to grade until the learner submits."
312
306
  }),
313
- E && !p && /* @__PURE__ */ P("div", {
307
+ D && !p && /* @__PURE__ */ F("div", {
314
308
  className: "rounded-xl border border-border-seam p-4",
315
- children: [/* @__PURE__ */ P("div", {
309
+ children: [/* @__PURE__ */ F("div", {
316
310
  className: "flex items-start justify-between gap-3",
317
- children: [/* @__PURE__ */ P("div", {
311
+ children: [/* @__PURE__ */ F("div", {
318
312
  className: "grid grid-cols-2 gap-4",
319
- children: [/* @__PURE__ */ N(X, {
313
+ children: [/* @__PURE__ */ P(X, {
320
314
  label: "Score",
321
- children: /* @__PURE__ */ N("span", {
315
+ children: /* @__PURE__ */ P("span", {
322
316
  className: "tabular-nums font-semibold",
323
317
  children: e.score ?? "—"
324
318
  })
325
- }), /* @__PURE__ */ N(X, {
319
+ }), /* @__PURE__ */ P(X, {
326
320
  label: "Result",
327
- children: e.passed == null ? /* @__PURE__ */ N("span", {
321
+ children: e.passed == null ? /* @__PURE__ */ P("span", {
328
322
  className: "text-text-secondary",
329
323
  children: "—"
330
- }) : /* @__PURE__ */ N(a, { status: e.passed ? "GRADED" : "RETURNED" })
324
+ }) : /* @__PURE__ */ P(a, { status: e.passed ? "GRADED" : "RETURNED" })
331
325
  })]
332
- }), /* @__PURE__ */ N(F, {
326
+ }), /* @__PURE__ */ P(I, {
333
327
  variant: "outline",
334
328
  size: "sm",
335
329
  onClick: () => m(!0),
336
330
  children: "Re-grade"
337
331
  })]
338
- }), /* @__PURE__ */ N("div", {
332
+ }), /* @__PURE__ */ P("div", {
339
333
  className: "mt-3",
340
- children: /* @__PURE__ */ N(X, {
334
+ children: /* @__PURE__ */ P(X, {
341
335
  label: "Feedback",
342
- children: e.feedback ? /* @__PURE__ */ N("span", {
336
+ children: e.feedback ? /* @__PURE__ */ P("span", {
343
337
  className: "whitespace-pre-wrap",
344
338
  children: e.feedback
345
- }) : /* @__PURE__ */ N("span", {
339
+ }) : /* @__PURE__ */ P("span", {
346
340
  className: "text-text-secondary",
347
341
  children: "No feedback provided."
348
342
  })
349
343
  })
350
344
  })]
351
345
  }),
352
- O && /* @__PURE__ */ P("div", {
346
+ k && /* @__PURE__ */ F("div", {
353
347
  className: "grid gap-4",
354
348
  children: [
355
- /* @__PURE__ */ N(Z, {
349
+ /* @__PURE__ */ P(Z, {
356
350
  submissionId: e.id,
357
351
  onUseSuggestion: (e, t) => {
358
- g(String(e)), x(t);
352
+ g(String(e)), S(t);
359
353
  }
360
354
  }),
361
- /* @__PURE__ */ P("div", {
355
+ /* @__PURE__ */ F("div", {
362
356
  className: "grid gap-4 sm:grid-cols-2",
363
- children: [/* @__PURE__ */ P("div", {
357
+ children: [/* @__PURE__ */ F("div", {
364
358
  className: "grid gap-1.5",
365
- children: [/* @__PURE__ */ N(L, {
359
+ children: [/* @__PURE__ */ P(R, {
366
360
  htmlFor: "grade-score",
367
361
  children: "Score"
368
- }), /* @__PURE__ */ N(I, {
362
+ }), /* @__PURE__ */ P(L, {
369
363
  id: "grade-score",
370
364
  type: "number",
371
365
  min: "0",
@@ -374,38 +368,38 @@ var W = 24, re = [
374
368
  onChange: (e) => g(e.target.value),
375
369
  placeholder: "e.g. 85"
376
370
  })]
377
- }), /* @__PURE__ */ P("div", {
371
+ }), /* @__PURE__ */ F("div", {
378
372
  className: "grid gap-1.5",
379
- children: [/* @__PURE__ */ N(L, {
373
+ children: [/* @__PURE__ */ P(R, {
380
374
  htmlFor: "grade-passed",
381
375
  children: "Result"
382
- }), /* @__PURE__ */ P("div", {
376
+ }), /* @__PURE__ */ F("div", {
383
377
  className: "flex h-10 items-center gap-3",
384
- children: [/* @__PURE__ */ N(H, {
378
+ children: [/* @__PURE__ */ P(G, {
385
379
  id: "grade-passed",
386
380
  checked: _,
387
381
  onCheckedChange: v
388
- }), /* @__PURE__ */ N("span", {
382
+ }), /* @__PURE__ */ P("span", {
389
383
  className: "text-sm text-text-secondary",
390
384
  children: _ ? "Passed" : "Not passed"
391
385
  })]
392
386
  })]
393
387
  })]
394
388
  }),
395
- /* @__PURE__ */ P("div", {
389
+ /* @__PURE__ */ F("div", {
396
390
  className: "grid gap-1.5",
397
- children: [/* @__PURE__ */ N(L, {
391
+ children: [/* @__PURE__ */ P(R, {
398
392
  htmlFor: "grade-feedback",
399
393
  children: "Feedback"
400
- }), /* @__PURE__ */ N(U, {
394
+ }), /* @__PURE__ */ P(K, {
401
395
  id: "grade-feedback",
402
- value: b,
403
- onChange: (e) => x(e.target.value),
396
+ value: x,
397
+ onChange: (e) => S(e.target.value),
404
398
  placeholder: "Notes, corrections or encouragement for the learner (optional).",
405
399
  rows: 4
406
400
  })]
407
401
  }),
408
- C && /* @__PURE__ */ N("p", {
402
+ C && /* @__PURE__ */ P("p", {
409
403
  className: "text-sm text-status-error-text",
410
404
  children: C
411
405
  })
@@ -415,25 +409,25 @@ var W = 24, re = [
415
409
  })
416
410
  ]
417
411
  }),
418
- /* @__PURE__ */ P(z, {
412
+ /* @__PURE__ */ F(H, {
419
413
  className: "flex-row justify-end gap-3 border-t border-border-seam p-4",
420
- children: [/* @__PURE__ */ N(F, {
414
+ children: [/* @__PURE__ */ P(I, {
421
415
  variant: "outline",
422
416
  onClick: c,
423
- children: O ? "Cancel" : "Close"
424
- }), O && /* @__PURE__ */ N(y, {
417
+ children: k ? "Cancel" : "Close"
418
+ }), k && /* @__PURE__ */ P(y, {
425
419
  resource: "buildmyiq-submission",
426
420
  action: "update",
427
421
  deniedBehavior: "hide",
428
- children: /* @__PURE__ */ N(F, {
422
+ children: /* @__PURE__ */ P(I, {
429
423
  onClick: async () => {
430
424
  let t = h.trim(), n = Number(t);
431
425
  if (t === "" || Number.isNaN(n)) {
432
- w("Enter a numeric score.");
426
+ T("Enter a numeric score.");
433
427
  return;
434
428
  }
435
429
  if (n < 0) {
436
- w("Score cannot be negative.");
430
+ T("Score cannot be negative.");
437
431
  return;
438
432
  }
439
433
  try {
@@ -442,130 +436,130 @@ var W = 24, re = [
442
436
  input: {
443
437
  score: n,
444
438
  passed: _,
445
- feedback: b.trim() || void 0
439
+ feedback: x.trim() || void 0
446
440
  }
447
441
  }), c();
448
442
  } catch (e) {
449
- w(e instanceof Error ? e.message : "Failed to save grade.");
443
+ T(e instanceof Error ? e.message : "Failed to save grade.");
450
444
  }
451
445
  },
452
446
  disabled: s.isPending,
453
- children: s.isPending ? "Saving…" : E ? "Update grade" : "Grade submission"
447
+ children: s.isPending ? "Saving…" : D ? "Update grade" : "Grade submission"
454
448
  })
455
449
  })]
456
450
  })
457
451
  ] });
458
452
  }, Q = () => {
459
- let { currentUser: i, navigateTo: m } = e(), { submissionId: _ } = j(), y = ne("(min-width: 768px)"), [k, M] = S("ALL"), I = v(), { data: L, isLoading: R, isError: z, refetch: B } = g({
460
- status: k === "ALL" ? void 0 : k,
461
- cursor: I.cursor,
462
- limit: W
463
- }), V = p(), H = h(_), U = x(() => L?.items ?? [], [L]), G = _ ?? null, q = x(() => G ? U.find((e) => e.id === G) ?? (H.data?.id === G ? H.data : null) : null, [
453
+ let { currentUser: i, navigateTo: m } = e(), { submissionId: _ } = ee(), y = te("(min-width: 768px)"), [b, x] = w("ALL"), j = v(), { data: N, isLoading: L, isError: R, refetch: V } = g({
454
+ status: b === "ALL" ? void 0 : b,
455
+ cursor: j.cursor,
456
+ limit: q
457
+ }), H = p(), U = h(_), W = C(() => N?.items ?? [], [N]), G = _ ?? null, K = C(() => G ? W.find((e) => e.id === G) ?? (U.data?.id === G ? U.data : null) : null, [
464
458
  G,
465
- U,
466
- H.data
467
- ]), J = x(() => {
459
+ W,
460
+ U.data
461
+ ]), J = C(() => {
468
462
  if (!i) return;
469
463
  let e = [i.firstName, i.lastName].filter(Boolean).join(" ").trim();
470
464
  return i.name?.trim() || e || i.username || i.email;
471
- }, [i]), Y = x(() => {
465
+ }, [i]), X = C(() => {
472
466
  let e = {
473
- total: U.length,
467
+ total: W.length,
474
468
  awaiting: 0,
475
469
  graded: 0,
476
470
  returned: 0
477
471
  };
478
- for (let t of U) t.status === "SUBMITTED" || t.status === "GRADING" ? e.awaiting += 1 : t.status === "GRADED" ? e.graded += 1 : t.status === "RETURNED" && (e.returned += 1);
472
+ for (let t of W) t.status === "SUBMITTED" || t.status === "GRADING" ? e.awaiting += 1 : t.status === "GRADED" ? e.graded += 1 : t.status === "RETURNED" && (e.returned += 1);
479
473
  return e;
480
- }, [U]), X = (e) => e === i?.id, Z = (e) => X(e) ? "You" : `Learner ${K(e)}`, Q = (e) => m(`submissions/${e.id}`), $ = () => m("submissions");
481
- return b(() => {
482
- !G || q || !H.isLoading && (H.isError || H.data === null) && m("submissions");
474
+ }, [W]), Z = (e) => e === i?.id, Q = (e) => Z(e) ? "You" : `Learner ${Y(e)}`, ae = (e) => m(`submissions/${e.id}`), $ = () => m("submissions");
475
+ return S(() => {
476
+ !G || K || !U.isLoading && (U.isError || U.data === null) && m("submissions");
483
477
  }, [
484
478
  G,
485
- q,
486
- H.isLoading,
487
- H.isError,
488
- H.data,
479
+ K,
480
+ U.isLoading,
481
+ U.isError,
482
+ U.data,
489
483
  m
490
- ]), /* @__PURE__ */ P(t, {
484
+ ]), /* @__PURE__ */ F(t, {
491
485
  title: "Grading",
492
486
  description: "Review and grade assessment submissions across every course in your workspace.",
493
487
  titleGradient: !0,
494
488
  aurora: !0,
495
- actions: /* @__PURE__ */ P(F, {
489
+ actions: /* @__PURE__ */ F(I, {
496
490
  variant: "outline",
497
491
  onClick: () => m("submissions/bulk"),
498
- children: [/* @__PURE__ */ N(O, { className: "mr-1.5 h-4 w-4" }), " Bulk grade"]
492
+ children: [/* @__PURE__ */ P(A, { className: "mr-1.5 h-4 w-4" }), " Bulk grade"]
499
493
  }),
500
- children: [/* @__PURE__ */ P("div", {
494
+ children: [/* @__PURE__ */ F("div", {
501
495
  className: "flex flex-col gap-6",
502
496
  children: [
503
- /* @__PURE__ */ P("div", {
497
+ /* @__PURE__ */ F("div", {
504
498
  className: "grid grid-cols-2 gap-4 xl:grid-cols-4",
505
499
  children: [
506
- /* @__PURE__ */ N(n, {
507
- icon: /* @__PURE__ */ N(T, { className: "h-5 w-5" }),
508
- value: Y.total,
500
+ /* @__PURE__ */ P(n, {
501
+ icon: /* @__PURE__ */ P(D, { className: "h-5 w-5" }),
502
+ value: X.total,
509
503
  label: "Submissions (this page)",
510
504
  featured: !0
511
505
  }),
512
- /* @__PURE__ */ N(n, {
513
- icon: /* @__PURE__ */ N(E, { className: "h-5 w-5" }),
514
- value: Y.awaiting,
506
+ /* @__PURE__ */ P(n, {
507
+ icon: /* @__PURE__ */ P(O, { className: "h-5 w-5" }),
508
+ value: X.awaiting,
515
509
  label: "Awaiting grade (this page)",
516
510
  accent: "warning"
517
511
  }),
518
- /* @__PURE__ */ N(n, {
519
- icon: /* @__PURE__ */ N(w, { className: "h-5 w-5" }),
520
- value: Y.graded,
512
+ /* @__PURE__ */ P(n, {
513
+ icon: /* @__PURE__ */ P(E, { className: "h-5 w-5" }),
514
+ value: X.graded,
521
515
  label: "Graded (this page)",
522
516
  accent: "success"
523
517
  }),
524
- /* @__PURE__ */ N(n, {
525
- icon: /* @__PURE__ */ N(A, { className: "h-5 w-5" }),
526
- value: Y.returned,
518
+ /* @__PURE__ */ P(n, {
519
+ icon: /* @__PURE__ */ P(M, { className: "h-5 w-5" }),
520
+ value: X.returned,
527
521
  label: "Returned (this page)"
528
522
  })
529
523
  ]
530
524
  }),
531
- /* @__PURE__ */ N(u, {
532
- items: re,
533
- value: k,
525
+ /* @__PURE__ */ P(u, {
526
+ items: ne,
527
+ value: b,
534
528
  onChange: (e) => {
535
- M(e), I.reset();
529
+ x(e), j.reset();
536
530
  }
537
531
  }),
538
- R ? /* @__PURE__ */ N(c, { label: "Loading submissions…" }) : z ? /* @__PURE__ */ N(s, {
532
+ L ? /* @__PURE__ */ P(c, { label: "Loading submissions…" }) : R ? /* @__PURE__ */ P(s, {
539
533
  title: "Couldn't load submissions",
540
534
  message: "The grading queue failed to load.",
541
- onRetry: () => B()
542
- }) : U.length === 0 ? /* @__PURE__ */ N(o, {
535
+ onRetry: () => V()
536
+ }) : W.length === 0 ? /* @__PURE__ */ P(o, {
543
537
  illustration: "empty-data",
544
- icon: /* @__PURE__ */ N(D, { className: "h-10 w-10" }),
545
- title: k === "ALL" ? "No submissions yet" : "Nothing in this status",
546
- description: k === "ALL" ? "When learners submit assessments, their attempts will appear here for grading." : "No submissions currently match this status filter."
547
- }) : /* @__PURE__ */ P("div", {
538
+ icon: /* @__PURE__ */ P(k, { className: "h-10 w-10" }),
539
+ title: b === "ALL" ? "No submissions yet" : "Nothing in this status",
540
+ description: b === "ALL" ? "When learners submit assessments, their attempts will appear here for grading." : "No submissions currently match this status filter."
541
+ }) : /* @__PURE__ */ F("div", {
548
542
  className: "flex flex-col gap-4",
549
- children: [/* @__PURE__ */ N(l, {
543
+ children: [/* @__PURE__ */ P(l, {
550
544
  columns: [
551
545
  {
552
546
  key: "learner",
553
547
  header: "Learner",
554
- sortValue: (e) => X(e.learnerId) ? "" : e.learnerId,
555
- render: (e) => /* @__PURE__ */ P("div", {
548
+ sortValue: (e) => Z(e.learnerId) ? "" : e.learnerId,
549
+ render: (e) => /* @__PURE__ */ F("div", {
556
550
  className: "flex items-center gap-3",
557
- children: [/* @__PURE__ */ N(f, {
551
+ children: [/* @__PURE__ */ P(f, {
558
552
  size: "sm",
559
- name: X(e.learnerId) ? J : void 0,
553
+ name: Z(e.learnerId) ? J : void 0,
560
554
  seed: e.learnerId,
561
- src: X(e.learnerId) ? i?.avatar : void 0
562
- }), /* @__PURE__ */ P("div", {
555
+ src: Z(e.learnerId) ? i?.avatar : void 0
556
+ }), /* @__PURE__ */ F("div", {
563
557
  className: "min-w-0",
564
- children: [/* @__PURE__ */ N("span", {
558
+ children: [/* @__PURE__ */ P("span", {
565
559
  className: "block truncate font-medium text-text-primary",
566
560
  title: e.learnerId,
567
- children: X(e.learnerId) ? "You" : K(e.learnerId)
568
- }), X(e.learnerId) && J && /* @__PURE__ */ N("span", {
561
+ children: Z(e.learnerId) ? "You" : Y(e.learnerId)
562
+ }), Z(e.learnerId) && J && /* @__PURE__ */ P("span", {
569
563
  className: "block truncate text-xs text-text-secondary",
570
564
  children: J
571
565
  })]
@@ -576,12 +570,12 @@ var W = 24, re = [
576
570
  key: "assessment",
577
571
  header: "Assessment",
578
572
  hideOnMobile: !0,
579
- render: (e) => /* @__PURE__ */ P("span", {
573
+ render: (e) => /* @__PURE__ */ F("span", {
580
574
  className: "inline-flex items-center gap-2 text-text-secondary",
581
- children: [/* @__PURE__ */ N(C, { className: "h-4 w-4 shrink-0 opacity-70" }), /* @__PURE__ */ N("span", {
575
+ children: [/* @__PURE__ */ P(T, { className: "h-4 w-4 shrink-0 opacity-70" }), /* @__PURE__ */ P("span", {
582
576
  className: "font-mono text-xs",
583
577
  title: e.assessmentId,
584
- children: K(e.assessmentId)
578
+ children: Y(e.assessmentId)
585
579
  })]
586
580
  })
587
581
  },
@@ -591,7 +585,7 @@ var W = 24, re = [
591
585
  align: "right",
592
586
  hideOnMobile: !0,
593
587
  sortValue: (e) => e.attempt,
594
- render: (e) => /* @__PURE__ */ P("span", {
588
+ render: (e) => /* @__PURE__ */ F("span", {
595
589
  className: "tabular-nums text-text-secondary",
596
590
  children: ["#", e.attempt]
597
591
  })
@@ -600,17 +594,17 @@ var W = 24, re = [
600
594
  key: "status",
601
595
  header: "Status",
602
596
  sortValue: (e) => e.status,
603
- render: (e) => /* @__PURE__ */ N(a, { status: e.status })
597
+ render: (e) => /* @__PURE__ */ P(a, { status: e.status })
604
598
  },
605
599
  {
606
600
  key: "score",
607
601
  header: "Score",
608
602
  align: "right",
609
603
  sortValue: (e) => e.score ?? -1,
610
- render: (e) => e.score == null ? /* @__PURE__ */ N("span", {
604
+ render: (e) => e.score == null ? /* @__PURE__ */ P("span", {
611
605
  className: "text-text-secondary",
612
606
  children: "—"
613
- }) : /* @__PURE__ */ N("span", {
607
+ }) : /* @__PURE__ */ P("span", {
614
608
  className: "tabular-nums font-semibold text-text-primary",
615
609
  children: e.score
616
610
  })
@@ -621,53 +615,53 @@ var W = 24, re = [
621
615
  align: "right",
622
616
  hideOnMobile: !0,
623
617
  sortValue: (e) => e.submittedAt ?? e.createdAt,
624
- render: (e) => /* @__PURE__ */ P("div", {
618
+ render: (e) => /* @__PURE__ */ F("div", {
625
619
  className: "whitespace-nowrap text-right",
626
- children: [/* @__PURE__ */ N("div", {
620
+ children: [/* @__PURE__ */ P("div", {
627
621
  className: "text-text-primary",
628
622
  children: r(e.submittedAt)
629
- }), e.submittedAt && /* @__PURE__ */ N("div", {
623
+ }), e.submittedAt && /* @__PURE__ */ P("div", {
630
624
  className: "text-xs text-text-secondary",
631
- children: ie(e.submittedAt)
625
+ children: re(e.submittedAt)
632
626
  })]
633
627
  })
634
628
  }
635
629
  ],
636
- rows: U,
630
+ rows: W,
637
631
  rowKey: (e) => e.id,
638
- onRowClick: Q,
632
+ onRowClick: ae,
639
633
  defaultSort: {
640
634
  key: "submittedAt",
641
635
  dir: "desc"
642
636
  }
643
- }), /* @__PURE__ */ N(d, {
644
- page: I.page,
645
- pageSize: W,
646
- itemCount: U.length,
647
- hasMore: L?.pageInfo?.hasMore ?? !1,
648
- onPageChange: (e) => I.onPageChange(e, L?.pageInfo?.cursor)
637
+ }), /* @__PURE__ */ P(d, {
638
+ page: j.page,
639
+ pageSize: q,
640
+ itemCount: W.length,
641
+ hasMore: N?.pageInfo?.hasMore ?? !1,
642
+ onPageChange: (e) => j.onPageChange(e, N?.pageInfo?.cursor)
649
643
  })]
650
644
  })
651
645
  ]
652
- }), /* @__PURE__ */ N(ee, {
646
+ }), /* @__PURE__ */ P(z, {
653
647
  open: G != null,
654
648
  onOpenChange: (e) => {
655
649
  e || $();
656
650
  },
657
- children: /* @__PURE__ */ N(te, {
651
+ children: /* @__PURE__ */ P(B, {
658
652
  side: y ? "right" : "bottom",
659
653
  className: y ? "flex w-full max-w-none flex-col gap-0 p-0 sm:max-w-xl" : "flex max-h-[92vh] w-full flex-col gap-0 rounded-t-2xl p-0",
660
- children: q ? /* @__PURE__ */ N(ae, {
661
- submission: q,
654
+ children: K ? /* @__PURE__ */ P(ie, {
655
+ submission: K,
662
656
  currentUser: i,
663
657
  meName: J,
664
- isMe: X,
665
- learnerLabel: Z,
666
- gradeSubmission: V,
658
+ isMe: Z,
659
+ learnerLabel: Q,
660
+ gradeSubmission: H,
667
661
  onClose: $
668
- }, q.id) : G ? /* @__PURE__ */ N("div", {
662
+ }, K.id) : G ? /* @__PURE__ */ P("div", {
669
663
  className: "flex min-h-[300px] items-center justify-center p-5",
670
- children: /* @__PURE__ */ N(c, { label: "Loading submission…" })
664
+ children: /* @__PURE__ */ P(c, { label: "Loading submission…" })
671
665
  }) : null
672
666
  })
673
667
  })]