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