@instructure/platform-rubrics 3.1.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_internal/ViewRubrics/useRubricsQuery.d.ts.map +1 -1
- package/dist/_internal/ViewRubrics/useViewRubrics.d.ts.map +1 -1
- package/dist/_internal/constants/i18n.d.ts +4 -0
- package/dist/_internal/constants/i18n.d.ts.map +1 -1
- package/dist/_internal/utils/i18n.d.ts +4 -0
- package/dist/_internal/utils/i18n.d.ts.map +1 -1
- package/dist/canvas.js +2890 -4843
- package/dist/chunks/{errorPage-B145UIKY.js → errorPage-C2-lUC8H.js} +193 -149
- package/dist/chunks/{useAssignmentRubricState-Cha3tHoC.js → useAssignmentRubricState-DpcMVo45.js} +4013 -2024
- package/dist/foundation/RubricBuilder/RubricBuilder.d.ts.map +1 -1
- package/dist/foundation/RubricBuilder/components/RubricBuilderFooter.d.ts +4 -1
- package/dist/foundation/RubricBuilder/components/RubricBuilderFooter.d.ts.map +1 -1
- package/dist/foundation/RubricBuilder/components/preview/RubricPreviewPanel.d.ts +10 -0
- package/dist/foundation/RubricBuilder/components/preview/RubricPreviewPanel.d.ts.map +1 -0
- package/dist/foundation.js +820 -685
- package/dist/index.js +8 -9
- package/locales/en.json +4 -0
- package/package.json +1 -1
- package/dist/chunks/useLocalStorage-BoUaI48x.js +0 -41
package/dist/foundation.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { g as
|
|
2
|
-
import { D as
|
|
1
|
+
import { g as Br, R as we, h as B, i as ue, j as We, k as je, r as Ir, l as xe, c as Lr } from "./chunks/errorPage-C2-lUC8H.js";
|
|
2
|
+
import { D as zt, a as $t, d as Ut } from "./chunks/errorPage-C2-lUC8H.js";
|
|
3
3
|
import "@instructure/platform-provider";
|
|
4
|
-
import { useState as
|
|
5
|
-
import { jsx as e, jsxs as b, Fragment as
|
|
6
|
-
import { Heading as
|
|
7
|
-
import { View as
|
|
8
|
-
import { Button as H, CloseButton as
|
|
9
|
-
import { Flex as
|
|
10
|
-
import { SimpleSelect as
|
|
11
|
-
import { Spinner as
|
|
4
|
+
import { useState as y, useEffect as N, useRef as F, useMemo as Ae, useCallback as Ke } from "react";
|
|
5
|
+
import { jsx as e, jsxs as b, Fragment as Se } from "react/jsx-runtime";
|
|
6
|
+
import { Heading as V } from "@instructure/ui-heading";
|
|
7
|
+
import { View as P } from "@instructure/ui-view";
|
|
8
|
+
import { Button as H, CloseButton as yr, IconButton as oe } from "@instructure/ui-buttons";
|
|
9
|
+
import { Flex as k } from "@instructure/ui-flex";
|
|
10
|
+
import { SimpleSelect as Ce } from "@instructure/ui-simple-select";
|
|
11
|
+
import { Spinner as kr } from "@instructure/ui-spinner";
|
|
12
12
|
import { Text as G } from "@instructure/ui-text";
|
|
13
|
-
import { useQuery as
|
|
14
|
-
import { u as
|
|
15
|
-
import
|
|
16
|
-
import { LoadingIndicator as
|
|
17
|
-
import { Alert as
|
|
18
|
-
import { IconDragHandleLine as
|
|
19
|
-
import { Checkbox as
|
|
20
|
-
import { Flex as
|
|
21
|
-
import { Modal as
|
|
22
|
-
import { ScreenReaderContent as
|
|
23
|
-
import { Checkbox as
|
|
24
|
-
import { Pill as
|
|
25
|
-
import { TextArea as
|
|
26
|
-
import { TextInput as
|
|
27
|
-
import { NumberInput as
|
|
28
|
-
import { CloseButton as
|
|
29
|
-
import { Heading as
|
|
30
|
-
import { Modal as
|
|
31
|
-
import { Text as
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
13
|
+
import { useQuery as Tr } from "@tanstack/react-query";
|
|
14
|
+
import { u as be, g as Pr, p as Dr, a as Xe, b as Oe, C as Ye, c as Ge, i as Er, d as Qe, e as de, s as Je, K as Ze, P as er, r as Mr, D as rr, S as ir, v as tr, f as xr, h as Ar, j as Or, k as Gr, l as _r, m as Nr, n as Fr, w as _e, o as Hr, q as zr, t as $r, x as Ur, T as Vr, M as qr, y as Wr, z as Ne, A as ve, G as jr, B as Kr, E as Fe, F as Xr, H as He, R as Yr, I as Qr, J as Jr, L as Zr, N as ei, O as ri, Q as ii, U as ti, V as ni, W as ai, X as oi, Y as li } from "./chunks/useAssignmentRubricState-DpcMVo45.js";
|
|
15
|
+
import si from "graphql-tag";
|
|
16
|
+
import { LoadingIndicator as nr } from "@instructure/platform-loading-indicator";
|
|
17
|
+
import { Alert as di } from "@instructure/ui-alerts";
|
|
18
|
+
import { IconDragHandleLine as ar, IconTrashLine as or, IconAddLine as lr, IconArrowOpenDownLine as ci, IconArrowOpenEndLine as ui, IconCommentLine as bi, IconDuplicateLine as mi, IconAiSolid as me, IconLikeSolid as ze, IconLikeLine as $e, IconAiColoredSolid as sr } from "@instructure/ui-icons";
|
|
19
|
+
import { Checkbox as le } from "@instructure/ui-checkbox/v11_7";
|
|
20
|
+
import { Flex as T } from "@instructure/ui-flex/v11_7";
|
|
21
|
+
import { Modal as ne } from "@instructure/ui-modal";
|
|
22
|
+
import { ScreenReaderContent as dr } from "@instructure/ui-a11y-content";
|
|
23
|
+
import { Checkbox as gi } from "@instructure/ui-checkbox";
|
|
24
|
+
import { Pill as cr } from "@instructure/ui-pill";
|
|
25
|
+
import { TextArea as hi } from "@instructure/ui-text-area";
|
|
26
|
+
import { TextInput as X } from "@instructure/ui-text-input";
|
|
27
|
+
import { NumberInput as pi } from "@instructure/ui-number-input";
|
|
28
|
+
import { CloseButton as Be, Button as A, IconButton as Ue } from "@instructure/ui-buttons/v11_7";
|
|
29
|
+
import { Heading as q } from "@instructure/ui-heading/v11_7";
|
|
30
|
+
import { Modal as M } from "@instructure/ui-modal/v11_7";
|
|
31
|
+
import { Text as Y } from "@instructure/ui-text/v11_7";
|
|
32
|
+
import { SimpleSelect as $ } from "@instructure/ui-simple-select/v11_7";
|
|
33
|
+
import { View as Re } from "@instructure/ui-view/v11_7";
|
|
34
|
+
import { RadioInputGroup as fi, RadioInput as Ci } from "@instructure/ui-radio-input";
|
|
35
|
+
import { ProgressBar as vi } from "@instructure/ui-progress/v11_7";
|
|
36
|
+
import { Spinner as Ri } from "@instructure/ui-spinner/v11_7";
|
|
37
37
|
import { TextArea as ce } from "@instructure/ui-text-area/v11_7";
|
|
38
|
-
import { TextInput as
|
|
39
|
-
import { Tooltip as
|
|
40
|
-
import { Alert as
|
|
41
|
-
const
|
|
38
|
+
import { TextInput as wi } from "@instructure/ui-text-input/v11_7";
|
|
39
|
+
import { Tooltip as Si } from "@instructure/ui-tooltip/v11_7";
|
|
40
|
+
import { Alert as Bi } from "@instructure/ui-alerts/v11_7";
|
|
41
|
+
const Gt = () => /* @__PURE__ */ e(P, { as: "div", padding: "small", children: /* @__PURE__ */ e(V, { level: "h2", children: Br("foundation") }) }), Ii = si`
|
|
42
42
|
query CourseRubricsList($courseId: ID!, $first: Int) {
|
|
43
43
|
course(id: $courseId) {
|
|
44
44
|
rubricsConnection(first: $first) {
|
|
@@ -56,13 +56,13 @@ const It = () => /* @__PURE__ */ e(y, { as: "div", padding: "small", children: /
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
`;
|
|
59
|
-
function
|
|
60
|
-
const { executeQuery:
|
|
61
|
-
return
|
|
59
|
+
function Li(r) {
|
|
60
|
+
const { executeQuery: a } = be();
|
|
61
|
+
return Tr({
|
|
62
62
|
queryKey: ["courseRubrics", r],
|
|
63
63
|
queryFn: async () => {
|
|
64
|
-
var
|
|
65
|
-
const { course: s } = await
|
|
64
|
+
var n;
|
|
65
|
+
const { course: s } = await a(Ii, {
|
|
66
66
|
courseId: r,
|
|
67
67
|
first: 50
|
|
68
68
|
}), i = s == null ? void 0 : s.rubricsConnection;
|
|
@@ -70,44 +70,44 @@ function hi(r) {
|
|
|
70
70
|
rubrics: ((i == null ? void 0 : i.nodes) ?? []).filter(
|
|
71
71
|
(l) => l != null
|
|
72
72
|
),
|
|
73
|
-
hasMore: ((
|
|
73
|
+
hasMore: ((n = i == null ? void 0 : i.pageInfo) == null ? void 0 : n.hasNextPage) ?? !1
|
|
74
74
|
};
|
|
75
75
|
},
|
|
76
76
|
enabled: !!r
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
|
-
const
|
|
79
|
+
const _t = (r) => /* @__PURE__ */ e(we, { translations: r.translations, children: /* @__PURE__ */ e(yi, { ...r }) }), yi = ({
|
|
80
80
|
courseId: r,
|
|
81
|
-
value:
|
|
81
|
+
value: a,
|
|
82
82
|
onChange: s
|
|
83
83
|
}) => {
|
|
84
|
-
const { translations: i } =
|
|
85
|
-
return l ? /* @__PURE__ */ b(
|
|
86
|
-
/* @__PURE__ */ e(
|
|
87
|
-
/* @__PURE__ */ e(
|
|
88
|
-
] }) : o ? /* @__PURE__ */ e(
|
|
89
|
-
/* @__PURE__ */ e(
|
|
84
|
+
const { translations: i } = B(), { data: n, isLoading: l, isError: o, refetch: m } = Li(r), t = n == null ? void 0 : n.rubrics;
|
|
85
|
+
return l ? /* @__PURE__ */ b(P, { as: "div", role: "status", "aria-live": "polite", margin: "0 0 medium", children: [
|
|
86
|
+
/* @__PURE__ */ e(kr, { renderTitle: i.rubricSelectorLoading, size: "x-small" }),
|
|
87
|
+
/* @__PURE__ */ e(P, { as: "span", padding: "0 0 0 x-small", children: /* @__PURE__ */ e(G, { size: "small", children: i.rubricSelectorLoading }) })
|
|
88
|
+
] }) : o ? /* @__PURE__ */ e(P, { as: "div", margin: "0 0 medium", children: /* @__PURE__ */ b(k, { gap: "small", alignItems: "center", wrap: "wrap", children: [
|
|
89
|
+
/* @__PURE__ */ e(k.Item, { children: /* @__PURE__ */ b(G, { size: "small", color: "danger", children: [
|
|
90
90
|
i.rubricSelectorErrorTitle,
|
|
91
91
|
". ",
|
|
92
92
|
i.rubricSelectorErrorBody
|
|
93
93
|
] }) }),
|
|
94
|
-
/* @__PURE__ */ e(
|
|
95
|
-
] }) }) : !t || t.length === 0 ? /* @__PURE__ */ e(
|
|
94
|
+
/* @__PURE__ */ e(k.Item, { children: /* @__PURE__ */ e(H, { size: "small", onClick: () => m(), children: i.rubricSelectorRetry }) })
|
|
95
|
+
] }) }) : !t || t.length === 0 ? /* @__PURE__ */ e(P, { as: "div", margin: "0 0 medium", children: /* @__PURE__ */ e(G, { size: "small", children: i.rubricSelectorEmpty }) }) : /* @__PURE__ */ b(P, { as: "div", margin: "0 0 medium", maxWidth: "360px", children: [
|
|
96
96
|
/* @__PURE__ */ b(
|
|
97
|
-
|
|
97
|
+
Ce,
|
|
98
98
|
{
|
|
99
99
|
renderLabel: i.rubricSelectorLabel,
|
|
100
100
|
assistiveText: i.rubricSelectorAssistiveText,
|
|
101
|
-
value:
|
|
101
|
+
value: a ?? "",
|
|
102
102
|
onChange: (c, { value: h }) => {
|
|
103
103
|
if (typeof h != "string" || !h) return;
|
|
104
104
|
const d = t.find((u) => u.id === h);
|
|
105
105
|
s(h, (d == null ? void 0 : d.title) ?? "");
|
|
106
106
|
},
|
|
107
107
|
children: [
|
|
108
|
-
|
|
108
|
+
a === void 0 && /* @__PURE__ */ e(Ce.Option, { id: "rubrics-rubric-selector-placeholder", value: "", children: i.rubricSelectorPlaceholder }),
|
|
109
109
|
t.map((c) => /* @__PURE__ */ e(
|
|
110
|
-
|
|
110
|
+
Ce.Option,
|
|
111
111
|
{
|
|
112
112
|
id: `rubrics-rubric-selector-option-${c.id}`,
|
|
113
113
|
value: c.id,
|
|
@@ -118,30 +118,30 @@ const kt = (r) => /* @__PURE__ */ e(Ce, { translations: r.translations, children
|
|
|
118
118
|
]
|
|
119
119
|
}
|
|
120
120
|
),
|
|
121
|
-
(
|
|
121
|
+
(n == null ? void 0 : n.hasMore) && /* @__PURE__ */ e(P, { as: "div", padding: "xx-small 0 0", children: /* @__PURE__ */ e(G, { size: "x-small", color: "secondary", children: i.rubricSelectorTruncated }) })
|
|
122
122
|
] });
|
|
123
|
-
},
|
|
123
|
+
}, ki = ({
|
|
124
124
|
rubricForm: r,
|
|
125
|
-
canUseForGrading:
|
|
125
|
+
canUseForGrading: a,
|
|
126
126
|
setRubricFormField: s
|
|
127
127
|
}) => {
|
|
128
|
-
const { translations: i } =
|
|
129
|
-
const h =
|
|
128
|
+
const { translations: i } = B(), { hidePoints: n, useForGrading: l, hideScoreTotal: o, hideOutcomeResults: m } = r, t = (c) => {
|
|
129
|
+
const h = Pr(c);
|
|
130
130
|
s("useForGrading", h.useForGrading), s("hideScoreTotal", h.hideScoreTotal);
|
|
131
131
|
};
|
|
132
|
-
return /* @__PURE__ */ b(
|
|
132
|
+
return /* @__PURE__ */ b(T, { direction: "column", gap: "small", "data-testid": "rubric-builder-assignment-settings", children: [
|
|
133
133
|
/* @__PURE__ */ e(
|
|
134
|
-
|
|
134
|
+
le,
|
|
135
135
|
{
|
|
136
136
|
variant: "toggle",
|
|
137
137
|
label: i.hideOutcomeResultsLabel,
|
|
138
|
-
checked:
|
|
138
|
+
checked: m,
|
|
139
139
|
onChange: (c) => s("hideOutcomeResults", c.target.checked),
|
|
140
140
|
"data-testid": "rubric-builder-hide-outcome-results"
|
|
141
141
|
}
|
|
142
142
|
),
|
|
143
|
-
!
|
|
144
|
-
|
|
143
|
+
!n && a && /* @__PURE__ */ e(
|
|
144
|
+
le,
|
|
145
145
|
{
|
|
146
146
|
variant: "toggle",
|
|
147
147
|
label: i.useForGradingLabel,
|
|
@@ -150,8 +150,8 @@ const kt = (r) => /* @__PURE__ */ e(Ce, { translations: r.translations, children
|
|
|
150
150
|
"data-testid": "rubric-builder-use-for-grading"
|
|
151
151
|
}
|
|
152
152
|
),
|
|
153
|
-
!
|
|
154
|
-
|
|
153
|
+
!n && !l && /* @__PURE__ */ e(
|
|
154
|
+
le,
|
|
155
155
|
{
|
|
156
156
|
variant: "toggle",
|
|
157
157
|
label: i.hideScoreTotalLabel,
|
|
@@ -161,21 +161,21 @@ const kt = (r) => /* @__PURE__ */ e(Ce, { translations: r.translations, children
|
|
|
161
161
|
}
|
|
162
162
|
)
|
|
163
163
|
] });
|
|
164
|
-
},
|
|
164
|
+
}, se = ({
|
|
165
165
|
isOpen: r,
|
|
166
|
-
heading:
|
|
166
|
+
heading: a,
|
|
167
167
|
body: s,
|
|
168
168
|
confirmLabel: i,
|
|
169
|
-
cancelLabel:
|
|
169
|
+
cancelLabel: n,
|
|
170
170
|
onConfirm: l,
|
|
171
171
|
onDismiss: o,
|
|
172
|
-
"data-testid":
|
|
172
|
+
"data-testid": m
|
|
173
173
|
}) => {
|
|
174
|
-
const { translations: t } =
|
|
175
|
-
return /* @__PURE__ */ b(
|
|
176
|
-
/* @__PURE__ */ b(
|
|
174
|
+
const { translations: t } = B();
|
|
175
|
+
return /* @__PURE__ */ b(ne, { open: r, onDismiss: o, size: "small", label: a, "data-testid": m, children: [
|
|
176
|
+
/* @__PURE__ */ b(ne.Header, { children: [
|
|
177
177
|
/* @__PURE__ */ e(
|
|
178
|
-
|
|
178
|
+
yr,
|
|
179
179
|
{
|
|
180
180
|
placement: "end",
|
|
181
181
|
offset: "small",
|
|
@@ -183,187 +183,187 @@ const kt = (r) => /* @__PURE__ */ e(Ce, { translations: r.translations, children
|
|
|
183
183
|
screenReaderLabel: t.close
|
|
184
184
|
}
|
|
185
185
|
),
|
|
186
|
-
/* @__PURE__ */ e(
|
|
186
|
+
/* @__PURE__ */ e(V, { level: "h2", children: a })
|
|
187
187
|
] }),
|
|
188
|
-
/* @__PURE__ */ e(
|
|
189
|
-
/* @__PURE__ */ b(
|
|
190
|
-
/* @__PURE__ */ e(H, { onClick: o, margin: "0 x-small 0 0", children:
|
|
188
|
+
/* @__PURE__ */ e(ne.Body, { children: /* @__PURE__ */ e(G, { children: s }) }),
|
|
189
|
+
/* @__PURE__ */ b(ne.Footer, { children: [
|
|
190
|
+
/* @__PURE__ */ e(H, { onClick: o, margin: "0 x-small 0 0", children: n }),
|
|
191
191
|
/* @__PURE__ */ e(H, { color: "primary", onClick: l, "data-testid": "confirm-modal-confirm", children: i })
|
|
192
192
|
] })
|
|
193
193
|
] });
|
|
194
|
-
},
|
|
194
|
+
}, Ti = ({
|
|
195
195
|
criteriaCount: r,
|
|
196
|
-
showMissingCriteriaError:
|
|
196
|
+
showMissingCriteriaError: a,
|
|
197
197
|
actions: s,
|
|
198
198
|
panel: i,
|
|
199
|
-
children:
|
|
199
|
+
children: n
|
|
200
200
|
}) => {
|
|
201
|
-
const { translations: l } =
|
|
202
|
-
return /* @__PURE__ */ b(
|
|
203
|
-
/* @__PURE__ */ b(
|
|
204
|
-
/* @__PURE__ */ e(
|
|
205
|
-
s && /* @__PURE__ */ e(
|
|
201
|
+
const { translations: l } = B();
|
|
202
|
+
return /* @__PURE__ */ b(P, { as: "section", "aria-labelledby": "rubric-builder-criteria-heading", children: [
|
|
203
|
+
/* @__PURE__ */ b(k, { justifyItems: "space-between", alignItems: "center", wrap: "wrap", gap: "small", children: [
|
|
204
|
+
/* @__PURE__ */ e(V, { level: "h3", id: "rubric-builder-criteria-heading", children: l.rubricBuilderCriteriaHeading }),
|
|
205
|
+
s && /* @__PURE__ */ e(k, { gap: "small", wrap: "wrap", children: s })
|
|
206
206
|
] }),
|
|
207
207
|
i,
|
|
208
|
-
/* @__PURE__ */ e(
|
|
209
|
-
/* @__PURE__ */ e("div", { "aria-live": "polite", children:
|
|
208
|
+
/* @__PURE__ */ e(P, { as: "div", margin: "small 0 0", children: r === 0 ? /* @__PURE__ */ e(G, { color: "secondary", children: l.rubricBuilderCriteriaEmpty }) : n }),
|
|
209
|
+
/* @__PURE__ */ e("div", { "aria-live": "polite", children: a && r === 0 && /* @__PURE__ */ e(G, { color: "danger", "data-testid": "rubric-builder-criteria-error", children: l.rubricBuilderAddCriterionError }) })
|
|
210
210
|
] });
|
|
211
|
-
},
|
|
212
|
-
const { translations: s } =
|
|
213
|
-
return
|
|
214
|
-
|
|
211
|
+
}, Pi = ({ points: r, onCommit: a }) => {
|
|
212
|
+
const { translations: s } = B(), [i, n] = y(String(r));
|
|
213
|
+
return N(() => {
|
|
214
|
+
n(String(r));
|
|
215
215
|
}, [r]), /* @__PURE__ */ e(
|
|
216
|
-
|
|
216
|
+
X,
|
|
217
217
|
{
|
|
218
218
|
renderLabel: s.rubricBuilderPointsPossibleLabel,
|
|
219
219
|
width: "8rem",
|
|
220
220
|
value: i,
|
|
221
|
-
onChange: (l) =>
|
|
221
|
+
onChange: (l) => n(l.target.value),
|
|
222
222
|
onBlur: (l) => {
|
|
223
|
-
const o =
|
|
224
|
-
|
|
223
|
+
const o = Dr(l.target.value);
|
|
224
|
+
n(String(o)), o !== r && a(o);
|
|
225
225
|
},
|
|
226
226
|
"data-testid": "rubric-builder-points-possible"
|
|
227
227
|
}
|
|
228
228
|
);
|
|
229
|
-
},
|
|
229
|
+
}, Di = ({
|
|
230
230
|
rating: r,
|
|
231
|
-
sortableId:
|
|
231
|
+
sortableId: a,
|
|
232
232
|
position: s,
|
|
233
233
|
rangeStart: i,
|
|
234
|
-
useRange:
|
|
234
|
+
useRange: n,
|
|
235
235
|
hidePoints: l,
|
|
236
236
|
showNameError: o,
|
|
237
|
-
canRemove:
|
|
237
|
+
canRemove: m,
|
|
238
238
|
onChange: t,
|
|
239
239
|
onPointsBlur: c,
|
|
240
240
|
onRemove: h
|
|
241
241
|
}) => {
|
|
242
|
-
const { translations: d, translate: u } =
|
|
243
|
-
id:
|
|
244
|
-
}), [E, R] =
|
|
245
|
-
|
|
246
|
-
|
|
242
|
+
const { translations: d, translate: u } = B(), { attributes: p, listeners: f, setNodeRef: C, transform: g, transition: v } = Xe({
|
|
243
|
+
id: a
|
|
244
|
+
}), [E, R] = y(String(r.points));
|
|
245
|
+
N(() => {
|
|
246
|
+
Oe(E) !== r.points && R(String(r.points));
|
|
247
247
|
}, [r.points]);
|
|
248
|
-
const
|
|
249
|
-
R(
|
|
248
|
+
const I = (L, D) => {
|
|
249
|
+
R(D), t({ ...r, points: L });
|
|
250
250
|
};
|
|
251
251
|
return /* @__PURE__ */ e(
|
|
252
252
|
"div",
|
|
253
253
|
{
|
|
254
|
-
ref:
|
|
255
|
-
style: { transform:
|
|
254
|
+
ref: C,
|
|
255
|
+
style: { transform: Ye.Transform.toString(g), transition: v },
|
|
256
256
|
"data-testid": "rubric-builder-rating-row",
|
|
257
|
-
children: /* @__PURE__ */ b(
|
|
257
|
+
children: /* @__PURE__ */ b(k, { gap: "small", alignItems: "start", wrap: "wrap", margin: "0 0 small", children: [
|
|
258
258
|
/* @__PURE__ */ e(
|
|
259
|
-
|
|
259
|
+
P,
|
|
260
260
|
{
|
|
261
261
|
as: "div",
|
|
262
262
|
cursor: "grab",
|
|
263
263
|
margin: "medium 0 0",
|
|
264
264
|
"aria-label": u("rubricBuilderReorderRating", { position: s }),
|
|
265
265
|
...p,
|
|
266
|
-
...
|
|
267
|
-
children: /* @__PURE__ */ e(
|
|
266
|
+
...f,
|
|
267
|
+
children: /* @__PURE__ */ e(ar, { "aria-hidden": "true" })
|
|
268
268
|
}
|
|
269
269
|
),
|
|
270
|
-
/* @__PURE__ */ e(
|
|
271
|
-
!l && /* @__PURE__ */ b(
|
|
272
|
-
|
|
270
|
+
/* @__PURE__ */ e(P, { as: "div", minWidth: "1.5rem", margin: "medium 0 0", children: /* @__PURE__ */ e(G, { weight: "bold", "aria-hidden": "true", children: s }) }),
|
|
271
|
+
!l && /* @__PURE__ */ b(k, { gap: "x-small", alignItems: "end", children: [
|
|
272
|
+
n && i !== void 0 && /* @__PURE__ */ e(P, { as: "div", margin: "0 0 x-small", children: /* @__PURE__ */ e(G, { children: u("rangeStartPrefix", { rangeStart: i }) }) }),
|
|
273
273
|
/* @__PURE__ */ e(
|
|
274
|
-
|
|
274
|
+
pi,
|
|
275
275
|
{
|
|
276
|
-
renderLabel:
|
|
276
|
+
renderLabel: n ? d.rubricBuilderPointRangeLabel : d.rubricBuilderPointsLabel,
|
|
277
277
|
allowStringValue: !0,
|
|
278
278
|
showArrows: !1,
|
|
279
279
|
width: "6rem",
|
|
280
280
|
value: E,
|
|
281
|
-
onChange: (
|
|
282
|
-
|
|
281
|
+
onChange: (L, D) => {
|
|
282
|
+
Er(D) && I(Oe(D), D);
|
|
283
283
|
},
|
|
284
284
|
onIncrement: () => {
|
|
285
|
-
const
|
|
286
|
-
|
|
285
|
+
const L = Ge(Math.floor(r.points) + 1);
|
|
286
|
+
I(L, String(L));
|
|
287
287
|
},
|
|
288
288
|
onDecrement: () => {
|
|
289
|
-
const
|
|
290
|
-
|
|
289
|
+
const L = Ge(Math.floor(r.points) - 1);
|
|
290
|
+
I(L, String(L));
|
|
291
291
|
},
|
|
292
292
|
onBlur: c,
|
|
293
293
|
"data-testid": "rubric-builder-rating-points"
|
|
294
294
|
}
|
|
295
295
|
)
|
|
296
296
|
] }),
|
|
297
|
-
/* @__PURE__ */ e(
|
|
298
|
-
|
|
297
|
+
/* @__PURE__ */ e(k.Item, { shouldGrow: !0, shouldShrink: !0, size: "10rem", children: /* @__PURE__ */ e(
|
|
298
|
+
X,
|
|
299
299
|
{
|
|
300
300
|
renderLabel: d.rubricBuilderRatingNameLabel,
|
|
301
301
|
isRequired: !0,
|
|
302
302
|
value: r.description,
|
|
303
|
-
onChange: (
|
|
303
|
+
onChange: (L) => t({ ...r, description: L.target.value }),
|
|
304
304
|
messages: o ? [{ text: d.rubricBuilderRatingNameRequired, type: "error" }] : [],
|
|
305
305
|
"data-testid": "rubric-builder-rating-name"
|
|
306
306
|
}
|
|
307
307
|
) }),
|
|
308
|
-
/* @__PURE__ */ e(
|
|
309
|
-
|
|
308
|
+
/* @__PURE__ */ e(k.Item, { shouldGrow: !0, shouldShrink: !0, size: "14rem", children: /* @__PURE__ */ e(
|
|
309
|
+
X,
|
|
310
310
|
{
|
|
311
311
|
renderLabel: d.rubricBuilderRatingDescriptionLabel,
|
|
312
312
|
value: r.longDescription,
|
|
313
|
-
onChange: (
|
|
313
|
+
onChange: (L) => t({ ...r, longDescription: L.target.value }),
|
|
314
314
|
"data-testid": "rubric-builder-rating-description"
|
|
315
315
|
}
|
|
316
316
|
) }),
|
|
317
|
-
|
|
318
|
-
|
|
317
|
+
m && /* @__PURE__ */ e(P, { as: "div", margin: "medium 0 0", children: /* @__PURE__ */ e(
|
|
318
|
+
oe,
|
|
319
319
|
{
|
|
320
320
|
screenReaderLabel: u("rubricBuilderRemoveRating", { position: s }),
|
|
321
321
|
withBackground: !1,
|
|
322
322
|
withBorder: !1,
|
|
323
323
|
onClick: h,
|
|
324
324
|
"data-testid": "rubric-builder-remove-rating",
|
|
325
|
-
children: /* @__PURE__ */ e(
|
|
325
|
+
children: /* @__PURE__ */ e(or, {})
|
|
326
326
|
}
|
|
327
327
|
) })
|
|
328
328
|
] })
|
|
329
329
|
}
|
|
330
330
|
);
|
|
331
|
-
},
|
|
331
|
+
}, Ei = ({
|
|
332
332
|
ratings: r,
|
|
333
|
-
useRange:
|
|
333
|
+
useRange: a,
|
|
334
334
|
hidePoints: s,
|
|
335
335
|
ratingOrder: i,
|
|
336
|
-
ratingNamesRequired:
|
|
336
|
+
ratingNamesRequired: n,
|
|
337
337
|
onChange: l
|
|
338
338
|
}) => {
|
|
339
|
-
const { translations: o } =
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
), t = r.map(
|
|
343
|
-
return /* @__PURE__ */ b(
|
|
344
|
-
/* @__PURE__ */ e(
|
|
339
|
+
const { translations: o } = B(), m = Qe(
|
|
340
|
+
de(er, { activationConstraint: { distance: 8 } }),
|
|
341
|
+
de(Ze, { coordinateGetter: Je })
|
|
342
|
+
), t = r.map(Mr), c = i === "ascending", h = r.map((u, p) => c ? r.length - 1 - p : p);
|
|
343
|
+
return /* @__PURE__ */ b(P, { as: "div", children: [
|
|
344
|
+
/* @__PURE__ */ e(rr, { sensors: m, onDragEnd: ({ active: u, over: p }) => {
|
|
345
345
|
if (!p || u.id === p.id) return;
|
|
346
|
-
const
|
|
347
|
-
|
|
346
|
+
const f = t.indexOf(String(u.id)), C = t.indexOf(String(p.id));
|
|
347
|
+
f === -1 || C === -1 || l(Nr({ list: r, startIndex: f, endIndex: C }));
|
|
348
348
|
}, children: /* @__PURE__ */ e(
|
|
349
|
-
|
|
349
|
+
ir,
|
|
350
350
|
{
|
|
351
351
|
items: h.map((u) => t[u]),
|
|
352
|
-
strategy:
|
|
352
|
+
strategy: tr,
|
|
353
353
|
children: h.map((u, p) => /* @__PURE__ */ e(
|
|
354
|
-
|
|
354
|
+
Di,
|
|
355
355
|
{
|
|
356
356
|
rating: r[u],
|
|
357
357
|
sortableId: t[u],
|
|
358
358
|
position: p + 1,
|
|
359
|
-
rangeStart:
|
|
360
|
-
useRange:
|
|
359
|
+
rangeStart: xr(r, u),
|
|
360
|
+
useRange: a,
|
|
361
361
|
hidePoints: s,
|
|
362
|
-
showNameError:
|
|
362
|
+
showNameError: n.includes(u),
|
|
363
363
|
canRemove: r.length > 1,
|
|
364
|
-
onChange: (
|
|
365
|
-
onPointsBlur: () => l(
|
|
366
|
-
onRemove: () => l(
|
|
364
|
+
onChange: (f) => l(Gr(r, u, f)),
|
|
365
|
+
onPointsBlur: () => l(Or(r)),
|
|
366
|
+
onRemove: () => l(Ar(r, u))
|
|
367
367
|
},
|
|
368
368
|
t[u]
|
|
369
369
|
))
|
|
@@ -372,179 +372,179 @@ const kt = (r) => /* @__PURE__ */ e(Ce, { translations: r.translations, children
|
|
|
372
372
|
/* @__PURE__ */ e(
|
|
373
373
|
H,
|
|
374
374
|
{
|
|
375
|
-
renderIcon: /* @__PURE__ */ e(
|
|
375
|
+
renderIcon: /* @__PURE__ */ e(lr, {}),
|
|
376
376
|
withBackground: !1,
|
|
377
|
-
onClick: () => l(
|
|
377
|
+
onClick: () => l(_r(r, c ? 0 : r.length)),
|
|
378
378
|
"data-testid": "rubric-builder-add-rating",
|
|
379
379
|
children: o.rubricBuilderAddRatingLevel
|
|
380
380
|
}
|
|
381
381
|
)
|
|
382
382
|
] });
|
|
383
|
-
},
|
|
383
|
+
}, Mi = ({
|
|
384
384
|
criterion: r,
|
|
385
|
-
sortableId:
|
|
385
|
+
sortableId: a,
|
|
386
386
|
position: s,
|
|
387
387
|
hidePoints: i,
|
|
388
|
-
freeFormCriterionComments:
|
|
388
|
+
freeFormCriterionComments: n,
|
|
389
389
|
ratingOrder: l,
|
|
390
390
|
errors: o,
|
|
391
|
-
showErrors:
|
|
391
|
+
showErrors: m,
|
|
392
392
|
shouldFocusName: t,
|
|
393
393
|
shouldFocusHandle: c,
|
|
394
394
|
onNameFocused: h,
|
|
395
395
|
onHandleFocused: d,
|
|
396
396
|
onChange: u,
|
|
397
397
|
onDuplicate: p,
|
|
398
|
-
onDelete:
|
|
398
|
+
onDelete: f
|
|
399
399
|
}) => {
|
|
400
|
-
const { translations:
|
|
401
|
-
id:
|
|
402
|
-
}), [
|
|
403
|
-
return
|
|
404
|
-
|
|
405
|
-
}, [
|
|
406
|
-
var
|
|
407
|
-
t &&
|
|
408
|
-
}, [t,
|
|
409
|
-
var
|
|
410
|
-
c && ((
|
|
400
|
+
const { translations: C, translate: g } = B(), { rubricCriterionRange: v } = ue(), { attributes: E, listeners: R, setNodeRef: I, transform: L, transition: D, isDragging: x } = Xe({
|
|
401
|
+
id: a
|
|
402
|
+
}), [_, O] = y(!r.description.trim()), [Q, W] = y(!1), J = F(null), Z = F(null), U = m && Fr(o), ee = g("rubricBuilderCriterionHeading", { position: s }), j = r.description.trim(), z = j || ee, K = `rubric-builder-criterion-body-${a}`;
|
|
403
|
+
return N(() => {
|
|
404
|
+
U && O(!0);
|
|
405
|
+
}, [U]), N(() => {
|
|
406
|
+
var S;
|
|
407
|
+
t && _ && ((S = J.current) == null || S.focus(), h());
|
|
408
|
+
}, [t, _, h]), N(() => {
|
|
409
|
+
var S;
|
|
410
|
+
c && ((S = Z.current) == null || S.focus(), d());
|
|
411
411
|
}, [c, d]), /* @__PURE__ */ b(
|
|
412
412
|
"div",
|
|
413
413
|
{
|
|
414
|
-
ref:
|
|
415
|
-
style: { transform:
|
|
414
|
+
ref: I,
|
|
415
|
+
style: { transform: Ye.Transform.toString(L), transition: D },
|
|
416
416
|
"data-testid": "rubric-builder-criterion-card",
|
|
417
417
|
children: [
|
|
418
418
|
/* @__PURE__ */ b(
|
|
419
|
-
|
|
419
|
+
P,
|
|
420
420
|
{
|
|
421
421
|
as: "section",
|
|
422
|
-
"aria-label":
|
|
422
|
+
"aria-label": z,
|
|
423
423
|
borderWidth: "small",
|
|
424
424
|
borderRadius: "medium",
|
|
425
425
|
padding: "small medium",
|
|
426
426
|
margin: "0 0 small",
|
|
427
427
|
background: "primary",
|
|
428
|
-
shadow:
|
|
428
|
+
shadow: x ? "above" : "none",
|
|
429
429
|
children: [
|
|
430
|
-
/* @__PURE__ */ b(
|
|
430
|
+
/* @__PURE__ */ b(k, { gap: "small", alignItems: "center", wrap: "wrap", children: [
|
|
431
431
|
/* @__PURE__ */ e(
|
|
432
432
|
"div",
|
|
433
433
|
{
|
|
434
|
-
ref:
|
|
435
|
-
"aria-label":
|
|
434
|
+
ref: Z,
|
|
435
|
+
"aria-label": g("rubricBuilderReorderCriterion", { name: z }),
|
|
436
436
|
"data-testid": "rubric-builder-criterion-drag-handle",
|
|
437
437
|
...E,
|
|
438
438
|
...R,
|
|
439
|
-
children: /* @__PURE__ */ e(
|
|
439
|
+
children: /* @__PURE__ */ e(ar, { "aria-hidden": "true" })
|
|
440
440
|
}
|
|
441
441
|
),
|
|
442
442
|
/* @__PURE__ */ e(
|
|
443
|
-
|
|
443
|
+
oe,
|
|
444
444
|
{
|
|
445
|
-
screenReaderLabel:
|
|
446
|
-
|
|
447
|
-
{ name:
|
|
445
|
+
screenReaderLabel: g(
|
|
446
|
+
_ ? "rubricBuilderCollapseCriterion" : "rubricBuilderExpandCriterion",
|
|
447
|
+
{ name: z }
|
|
448
448
|
),
|
|
449
|
-
"aria-expanded":
|
|
449
|
+
"aria-expanded": _,
|
|
450
450
|
"aria-controls": K,
|
|
451
451
|
withBackground: !1,
|
|
452
452
|
withBorder: !1,
|
|
453
453
|
size: "small",
|
|
454
|
-
onClick: () => O((
|
|
454
|
+
onClick: () => O((S) => !S),
|
|
455
455
|
"data-testid": "rubric-builder-criterion-toggle",
|
|
456
|
-
children:
|
|
456
|
+
children: _ ? /* @__PURE__ */ e(ci, {}) : /* @__PURE__ */ e(ui, {})
|
|
457
457
|
}
|
|
458
458
|
),
|
|
459
|
-
|
|
460
|
-
|
|
459
|
+
n && /* @__PURE__ */ e(
|
|
460
|
+
bi,
|
|
461
461
|
{
|
|
462
|
-
title:
|
|
462
|
+
title: C.rubricBuilderWrittenFeedback,
|
|
463
463
|
"data-testid": "rubric-builder-criterion-written-icon"
|
|
464
464
|
}
|
|
465
465
|
),
|
|
466
|
-
/* @__PURE__ */ e(
|
|
467
|
-
|
|
466
|
+
/* @__PURE__ */ e(k.Item, { shouldGrow: !0, shouldShrink: !0, children: /* @__PURE__ */ b(V, { level: "h4", children: [
|
|
467
|
+
ee,
|
|
468
468
|
j && /* @__PURE__ */ e(G, { weight: "normal", "data-testid": "rubric-builder-criterion-name", children: `: ${j}` })
|
|
469
469
|
] }) }),
|
|
470
|
-
!i && /* @__PURE__ */ e(
|
|
470
|
+
!i && /* @__PURE__ */ e(cr, { "data-testid": "rubric-builder-criterion-max", children: g("rubricBuilderCriterionMaxPoints", { count: r.points }) }),
|
|
471
471
|
/* @__PURE__ */ e(
|
|
472
|
-
|
|
472
|
+
oe,
|
|
473
473
|
{
|
|
474
|
-
screenReaderLabel:
|
|
474
|
+
screenReaderLabel: g("rubricBuilderDuplicateCriterion", { name: z }),
|
|
475
475
|
withBackground: !1,
|
|
476
476
|
withBorder: !1,
|
|
477
477
|
onClick: p,
|
|
478
478
|
"data-testid": "rubric-builder-duplicate-criterion",
|
|
479
|
-
children: /* @__PURE__ */ e(
|
|
479
|
+
children: /* @__PURE__ */ e(mi, {})
|
|
480
480
|
}
|
|
481
481
|
),
|
|
482
482
|
/* @__PURE__ */ e(
|
|
483
|
-
|
|
483
|
+
oe,
|
|
484
484
|
{
|
|
485
|
-
screenReaderLabel:
|
|
485
|
+
screenReaderLabel: g("rubricBuilderDeleteCriterion", { name: z }),
|
|
486
486
|
withBackground: !1,
|
|
487
487
|
withBorder: !1,
|
|
488
488
|
onClick: () => W(!0),
|
|
489
489
|
"data-testid": "rubric-builder-delete-criterion",
|
|
490
|
-
children: /* @__PURE__ */ e(
|
|
490
|
+
children: /* @__PURE__ */ e(or, {})
|
|
491
491
|
}
|
|
492
492
|
)
|
|
493
493
|
] }),
|
|
494
|
-
|
|
494
|
+
_ && /* @__PURE__ */ e(P, { as: "div", id: K, margin: "medium 0 0", children: /* @__PURE__ */ b(k, { direction: "column", gap: "medium", children: [
|
|
495
495
|
/* @__PURE__ */ e(
|
|
496
|
-
|
|
496
|
+
X,
|
|
497
497
|
{
|
|
498
|
-
renderLabel:
|
|
498
|
+
renderLabel: C.rubricBuilderCriterionNameLabel,
|
|
499
499
|
isRequired: !0,
|
|
500
500
|
value: r.description,
|
|
501
|
-
inputRef: (
|
|
502
|
-
|
|
501
|
+
inputRef: (S) => {
|
|
502
|
+
J.current = S;
|
|
503
503
|
},
|
|
504
|
-
onChange: (
|
|
505
|
-
messages:
|
|
504
|
+
onChange: (S) => u({ ...r, description: S.target.value }),
|
|
505
|
+
messages: m && o.nameRequired ? [{ text: C.rubricBuilderCriterionNameRequired, type: "error" }] : [],
|
|
506
506
|
"data-testid": "rubric-builder-criterion-name-input"
|
|
507
507
|
}
|
|
508
508
|
),
|
|
509
509
|
/* @__PURE__ */ e(
|
|
510
|
-
|
|
510
|
+
hi,
|
|
511
511
|
{
|
|
512
|
-
label:
|
|
512
|
+
label: C.rubricBuilderCriterionDescriptionLabel,
|
|
513
513
|
value: r.longDescription ?? "",
|
|
514
|
-
onChange: (
|
|
514
|
+
onChange: (S) => u({ ...r, longDescription: S.target.value }),
|
|
515
515
|
"data-testid": "rubric-builder-criterion-description"
|
|
516
516
|
}
|
|
517
517
|
),
|
|
518
|
-
|
|
519
|
-
|
|
518
|
+
v && !i && !n && /* @__PURE__ */ e(
|
|
519
|
+
gi,
|
|
520
520
|
{
|
|
521
521
|
variant: "toggle",
|
|
522
|
-
label:
|
|
522
|
+
label: C.rubricBuilderEnableRange,
|
|
523
523
|
checked: r.criterionUseRange,
|
|
524
|
-
onChange: (
|
|
524
|
+
onChange: (S) => u({ ...r, criterionUseRange: S.target.checked }),
|
|
525
525
|
"data-testid": "rubric-builder-enable-range"
|
|
526
526
|
}
|
|
527
527
|
),
|
|
528
|
-
|
|
529
|
-
|
|
528
|
+
n ? !i && /* @__PURE__ */ e(
|
|
529
|
+
Pi,
|
|
530
530
|
{
|
|
531
531
|
points: r.points,
|
|
532
|
-
onCommit: (
|
|
533
|
-
|
|
532
|
+
onCommit: (S) => u(
|
|
533
|
+
_e(
|
|
534
534
|
r,
|
|
535
|
-
|
|
535
|
+
Hr(r.ratings, S)
|
|
536
536
|
)
|
|
537
537
|
)
|
|
538
538
|
}
|
|
539
539
|
) : /* @__PURE__ */ e(
|
|
540
|
-
|
|
540
|
+
Ei,
|
|
541
541
|
{
|
|
542
542
|
ratings: r.ratings,
|
|
543
543
|
useRange: r.criterionUseRange && !i,
|
|
544
544
|
hidePoints: i,
|
|
545
545
|
ratingOrder: l,
|
|
546
|
-
ratingNamesRequired:
|
|
547
|
-
onChange: (
|
|
546
|
+
ratingNamesRequired: m ? o.ratingNamesRequired : [],
|
|
547
|
+
onChange: (S) => u(_e(r, S))
|
|
548
548
|
}
|
|
549
549
|
)
|
|
550
550
|
] }) })
|
|
@@ -552,15 +552,15 @@ const kt = (r) => /* @__PURE__ */ e(Ce, { translations: r.translations, children
|
|
|
552
552
|
}
|
|
553
553
|
),
|
|
554
554
|
/* @__PURE__ */ e(
|
|
555
|
-
|
|
555
|
+
se,
|
|
556
556
|
{
|
|
557
|
-
isOpen:
|
|
558
|
-
heading:
|
|
559
|
-
body:
|
|
560
|
-
confirmLabel:
|
|
561
|
-
cancelLabel:
|
|
557
|
+
isOpen: Q,
|
|
558
|
+
heading: C.rubricBuilderCriterionDeleteHeading,
|
|
559
|
+
body: C.rubricBuilderCriterionDeleteBody,
|
|
560
|
+
confirmLabel: C.delete,
|
|
561
|
+
cancelLabel: C.cancel,
|
|
562
562
|
onConfirm: () => {
|
|
563
|
-
W(!1),
|
|
563
|
+
W(!1), f();
|
|
564
564
|
},
|
|
565
565
|
onDismiss: () => W(!1),
|
|
566
566
|
"data-testid": "rubric-builder-delete-criterion-modal"
|
|
@@ -569,15 +569,15 @@ const kt = (r) => /* @__PURE__ */ e(Ce, { translations: r.translations, children
|
|
|
569
569
|
]
|
|
570
570
|
}
|
|
571
571
|
);
|
|
572
|
-
},
|
|
572
|
+
}, xi = ({
|
|
573
573
|
criteria: r,
|
|
574
|
-
hidePoints:
|
|
574
|
+
hidePoints: a,
|
|
575
575
|
freeFormCriterionComments: s,
|
|
576
576
|
ratingOrder: i,
|
|
577
|
-
criteriaValidationErrors:
|
|
577
|
+
criteriaValidationErrors: n,
|
|
578
578
|
showErrors: l,
|
|
579
579
|
focusNameCriterionId: o,
|
|
580
|
-
onFocusedName:
|
|
580
|
+
onFocusedName: m,
|
|
581
581
|
onChangeCriterion: t,
|
|
582
582
|
onDuplicateCriterion: c,
|
|
583
583
|
onDeleteCriterion: h,
|
|
@@ -586,50 +586,50 @@ const kt = (r) => /* @__PURE__ */ e(Ce, { translations: r.translations, children
|
|
|
586
586
|
const {
|
|
587
587
|
sortableIds: u,
|
|
588
588
|
movedCriterionId: p,
|
|
589
|
-
clearMovedCriterion:
|
|
590
|
-
srAnnouncement:
|
|
591
|
-
moveCriterionBySortableId:
|
|
592
|
-
} =
|
|
593
|
-
|
|
594
|
-
|
|
589
|
+
clearMovedCriterion: f,
|
|
590
|
+
srAnnouncement: C,
|
|
591
|
+
moveCriterionBySortableId: g
|
|
592
|
+
} = zr({ criteria: r, onReorderCriteria: d }), v = Qe(
|
|
593
|
+
de(er, { activationConstraint: { distance: 8 } }),
|
|
594
|
+
de(Ze, { coordinateGetter: Je })
|
|
595
595
|
);
|
|
596
|
-
return /* @__PURE__ */ b(
|
|
597
|
-
/* @__PURE__ */ e(
|
|
598
|
-
/* @__PURE__ */ e(
|
|
599
|
-
|
|
600
|
-
}, children: /* @__PURE__ */ e(
|
|
601
|
-
|
|
596
|
+
return /* @__PURE__ */ b(Se, { children: [
|
|
597
|
+
/* @__PURE__ */ e(dr, { children: /* @__PURE__ */ e("div", { "aria-live": "polite", "aria-atomic": "true", children: C }) }),
|
|
598
|
+
/* @__PURE__ */ e(rr, { sensors: v, onDragEnd: ({ active: R, over: I }) => {
|
|
599
|
+
I && g(R.id, I.id);
|
|
600
|
+
}, children: /* @__PURE__ */ e(ir, { items: u, strategy: tr, children: r.map((R, I) => /* @__PURE__ */ e(
|
|
601
|
+
Mi,
|
|
602
602
|
{
|
|
603
603
|
criterion: R,
|
|
604
|
-
sortableId: u[
|
|
605
|
-
position:
|
|
606
|
-
hidePoints:
|
|
604
|
+
sortableId: u[I],
|
|
605
|
+
position: I + 1,
|
|
606
|
+
hidePoints: a,
|
|
607
607
|
freeFormCriterionComments: s,
|
|
608
608
|
ratingOrder: i,
|
|
609
|
-
errors:
|
|
609
|
+
errors: n[I],
|
|
610
610
|
showErrors: l,
|
|
611
611
|
shouldFocusName: R.id === o,
|
|
612
612
|
shouldFocusHandle: R.id === p,
|
|
613
|
-
onNameFocused:
|
|
614
|
-
onHandleFocused:
|
|
613
|
+
onNameFocused: m,
|
|
614
|
+
onHandleFocused: f,
|
|
615
615
|
onChange: t,
|
|
616
616
|
onDuplicate: () => c(R),
|
|
617
617
|
onDelete: () => h(R)
|
|
618
618
|
},
|
|
619
|
-
u[
|
|
619
|
+
u[I]
|
|
620
620
|
)) }) })
|
|
621
621
|
] });
|
|
622
|
-
},
|
|
622
|
+
}, Ai = ({
|
|
623
623
|
isOpen: r,
|
|
624
|
-
assignmentPoints:
|
|
624
|
+
assignmentPoints: a,
|
|
625
625
|
rubricPoints: s,
|
|
626
626
|
onChange: i,
|
|
627
|
-
onLeaveDifferent:
|
|
627
|
+
onLeaveDifferent: n,
|
|
628
628
|
onDismiss: l
|
|
629
629
|
}) => {
|
|
630
|
-
const { translations: o, translate:
|
|
630
|
+
const { translations: o, translate: m } = B(), { locale: t } = be(), c = $r(s, a, t), h = c === null ? m("pointsDifferenceModalBodyZeroAssignmentPoints", { rubricPoints: s }) : m("pointsDifferenceModalBody", { assignmentPoints: a, rubricPoints: s, pointRatio: c });
|
|
631
631
|
return /* @__PURE__ */ b(
|
|
632
|
-
|
|
632
|
+
M,
|
|
633
633
|
{
|
|
634
634
|
open: r,
|
|
635
635
|
onDismiss: l,
|
|
@@ -637,9 +637,9 @@ const kt = (r) => /* @__PURE__ */ e(Ce, { translations: r.translations, children
|
|
|
637
637
|
label: o.pointsDifferenceModalLabel,
|
|
638
638
|
"data-testid": "rubric-builder-points-difference-modal",
|
|
639
639
|
children: [
|
|
640
|
-
/* @__PURE__ */ b(
|
|
640
|
+
/* @__PURE__ */ b(M.Header, { children: [
|
|
641
641
|
/* @__PURE__ */ e(
|
|
642
|
-
|
|
642
|
+
Be,
|
|
643
643
|
{
|
|
644
644
|
placement: "end",
|
|
645
645
|
offset: "small",
|
|
@@ -647,32 +647,137 @@ const kt = (r) => /* @__PURE__ */ e(Ce, { translations: r.translations, children
|
|
|
647
647
|
screenReaderLabel: o.close
|
|
648
648
|
}
|
|
649
649
|
),
|
|
650
|
-
/* @__PURE__ */ e(
|
|
650
|
+
/* @__PURE__ */ e(q, { level: "h2", children: o.confirmToContinueHeader })
|
|
651
651
|
] }),
|
|
652
|
-
/* @__PURE__ */ e(
|
|
653
|
-
/* @__PURE__ */ b(
|
|
652
|
+
/* @__PURE__ */ e(M.Body, { children: /* @__PURE__ */ e(Y, { children: h }) }),
|
|
653
|
+
/* @__PURE__ */ b(M.Footer, { children: [
|
|
654
654
|
/* @__PURE__ */ e(
|
|
655
|
-
|
|
655
|
+
A,
|
|
656
656
|
{
|
|
657
|
-
onClick:
|
|
657
|
+
onClick: n,
|
|
658
658
|
margin: "0 x-small 0 0",
|
|
659
659
|
"data-testid": "rubric-builder-leave-points-different",
|
|
660
660
|
children: o.pointsDifferenceModalLeaveDifferent
|
|
661
661
|
}
|
|
662
662
|
),
|
|
663
|
-
/* @__PURE__ */ e(
|
|
663
|
+
/* @__PURE__ */ e(A, { color: "primary", onClick: i, "data-testid": "rubric-builder-change-points", children: o.pointsDifferenceModalChange })
|
|
664
664
|
] })
|
|
665
665
|
]
|
|
666
666
|
}
|
|
667
667
|
);
|
|
668
|
-
},
|
|
668
|
+
}, ur = "rubric-builder-preview", Ve = "rubric-builder-preview-heading", Oi = ["traditional", "horizontal", "vertical"], qe = () => {
|
|
669
|
+
}, Gi = ({
|
|
670
|
+
rubric: r,
|
|
671
|
+
savePending: a,
|
|
672
|
+
onClose: s,
|
|
673
|
+
onSave: i
|
|
674
|
+
}) => {
|
|
675
|
+
const { translations: n } = B(), l = We(), o = F(null), { currentUserId: m, locale: t } = be(), { viewMode: c, isTraditionalView: h, setViewMode: d } = Ur({
|
|
676
|
+
currentUserId: m ?? ""
|
|
677
|
+
});
|
|
678
|
+
N(() => {
|
|
679
|
+
var f;
|
|
680
|
+
(f = o.current) == null || f.focus();
|
|
681
|
+
}, []);
|
|
682
|
+
const u = {
|
|
683
|
+
traditional: n.assessmentViewModeTraditional,
|
|
684
|
+
horizontal: n.assessmentViewModeHorizontal,
|
|
685
|
+
vertical: n.assessmentViewModeVertical
|
|
686
|
+
}, p = () => r.criteria.length === 0 ? /* @__PURE__ */ e(Y, { children: n.rubricBuilderCriteriaEmpty }) : h ? /* @__PURE__ */ e(
|
|
687
|
+
Vr,
|
|
688
|
+
{
|
|
689
|
+
translations: l,
|
|
690
|
+
criteria: r.criteria,
|
|
691
|
+
hidePoints: r.hidePoints,
|
|
692
|
+
locale: t ?? "en",
|
|
693
|
+
isFreeFormCriterionComments: r.freeFormCriterionComments,
|
|
694
|
+
isPreviewMode: !0,
|
|
695
|
+
ratingOrder: r.ratingOrder,
|
|
696
|
+
rubricAssessmentData: [],
|
|
697
|
+
rubricTitle: r.title,
|
|
698
|
+
onUpdateAssessmentData: qe
|
|
699
|
+
}
|
|
700
|
+
) : /* @__PURE__ */ e(
|
|
701
|
+
qr,
|
|
702
|
+
{
|
|
703
|
+
buttonDisplay: r.buttonDisplay,
|
|
704
|
+
criteria: r.criteria,
|
|
705
|
+
hidePoints: r.hidePoints,
|
|
706
|
+
locale: t ?? "en",
|
|
707
|
+
isPreviewMode: !0,
|
|
708
|
+
isPeerReview: !1,
|
|
709
|
+
isSelfAssessment: !1,
|
|
710
|
+
isFreeFormCriterionComments: r.freeFormCriterionComments,
|
|
711
|
+
ratingOrder: r.ratingOrder,
|
|
712
|
+
rubricAssessmentData: [],
|
|
713
|
+
selectedViewMode: c,
|
|
714
|
+
onUpdateAssessmentData: qe
|
|
715
|
+
}
|
|
716
|
+
);
|
|
717
|
+
return /* @__PURE__ */ e(
|
|
718
|
+
Re,
|
|
719
|
+
{
|
|
720
|
+
as: "section",
|
|
721
|
+
id: ur,
|
|
722
|
+
"aria-labelledby": Ve,
|
|
723
|
+
borderWidth: "small",
|
|
724
|
+
borderRadius: "medium",
|
|
725
|
+
background: "primary",
|
|
726
|
+
"data-testid": "rubric-builder-preview-panel",
|
|
727
|
+
children: /* @__PURE__ */ b(T, { direction: "column", height: "100%", children: [
|
|
728
|
+
/* @__PURE__ */ e(T.Item, { padding: "medium", children: /* @__PURE__ */ b(T, { justifyItems: "space-between", alignItems: "end", gap: "small", wrap: "wrap", children: [
|
|
729
|
+
/* @__PURE__ */ e(
|
|
730
|
+
q,
|
|
731
|
+
{
|
|
732
|
+
level: "h3",
|
|
733
|
+
id: Ve,
|
|
734
|
+
tabIndex: -1,
|
|
735
|
+
elementRef: (f) => {
|
|
736
|
+
o.current = f;
|
|
737
|
+
},
|
|
738
|
+
children: n.rubricBuilderPreviewHeading
|
|
739
|
+
}
|
|
740
|
+
),
|
|
741
|
+
/* @__PURE__ */ e(
|
|
742
|
+
$,
|
|
743
|
+
{
|
|
744
|
+
renderLabel: n.assessmentViewMode,
|
|
745
|
+
width: "10rem",
|
|
746
|
+
value: c,
|
|
747
|
+
onChange: (f, { value: C }) => d(C),
|
|
748
|
+
"data-testid": "rubric-builder-preview-view-mode",
|
|
749
|
+
children: Oi.map((f) => /* @__PURE__ */ e($.Option, { id: `rubric-builder-preview-${f}`, value: f, children: u[f] }, f))
|
|
750
|
+
}
|
|
751
|
+
)
|
|
752
|
+
] }) }),
|
|
753
|
+
/* @__PURE__ */ e(T.Item, { shouldGrow: !0, shouldShrink: !0, padding: "0 medium", overflowX: "auto", overflowY: "auto", children: /* @__PURE__ */ e(Re, { as: "div", "data-testid": "rubric-builder-preview-body", children: p() }) }),
|
|
754
|
+
/* @__PURE__ */ e(T.Item, { as: "footer", padding: "small medium", children: /* @__PURE__ */ b(T, { justifyItems: "end", gap: "small", wrap: "wrap", children: [
|
|
755
|
+
/* @__PURE__ */ e(A, { onClick: s, "data-testid": "rubric-builder-preview-close", children: n.rubricBuilderPreviewClose }),
|
|
756
|
+
/* @__PURE__ */ e(
|
|
757
|
+
A,
|
|
758
|
+
{
|
|
759
|
+
color: "primary",
|
|
760
|
+
onClick: i,
|
|
761
|
+
interaction: a ? "disabled" : "enabled",
|
|
762
|
+
"data-testid": "rubric-builder-preview-save",
|
|
763
|
+
children: n.rubricBuilderPreviewSave
|
|
764
|
+
}
|
|
765
|
+
)
|
|
766
|
+
] }) })
|
|
767
|
+
] })
|
|
768
|
+
}
|
|
769
|
+
);
|
|
770
|
+
}, _i = ({
|
|
669
771
|
savePending: r,
|
|
772
|
+
isPreviewOpen: a,
|
|
773
|
+
previewToggleRef: s,
|
|
774
|
+
onTogglePreview: i,
|
|
670
775
|
onDiscard: n,
|
|
671
|
-
onSave:
|
|
776
|
+
onSave: l
|
|
672
777
|
}) => {
|
|
673
|
-
const { translations:
|
|
778
|
+
const { translations: o } = B();
|
|
674
779
|
return /* @__PURE__ */ e(
|
|
675
|
-
|
|
780
|
+
P,
|
|
676
781
|
{
|
|
677
782
|
as: "footer",
|
|
678
783
|
position: "sticky",
|
|
@@ -681,59 +786,70 @@ const kt = (r) => /* @__PURE__ */ e(Ce, { translations: r.translations, children
|
|
|
681
786
|
borderWidth: "small none none none",
|
|
682
787
|
padding: "small 0",
|
|
683
788
|
stacking: "above",
|
|
684
|
-
children: /* @__PURE__ */ b(
|
|
685
|
-
/* @__PURE__ */ e(
|
|
789
|
+
children: /* @__PURE__ */ b(k, { justifyItems: "end", gap: "small", wrap: "wrap", children: [
|
|
790
|
+
/* @__PURE__ */ e(
|
|
791
|
+
H,
|
|
792
|
+
{
|
|
793
|
+
"aria-expanded": a,
|
|
794
|
+
"aria-controls": ur,
|
|
795
|
+
onClick: i,
|
|
796
|
+
elementRef: (m) => s(m),
|
|
797
|
+
"data-testid": "rubric-builder-preview-toggle",
|
|
798
|
+
children: a ? o.rubricBuilderPreviewClose : o.rubricBuilderPreviewToggle
|
|
799
|
+
}
|
|
800
|
+
),
|
|
801
|
+
/* @__PURE__ */ e(H, { onClick: n, "data-testid": "rubric-builder-discard", children: o.rubricBuilderDiscard }),
|
|
686
802
|
/* @__PURE__ */ e(
|
|
687
803
|
H,
|
|
688
804
|
{
|
|
689
805
|
color: "primary",
|
|
690
|
-
onClick:
|
|
806
|
+
onClick: l,
|
|
691
807
|
interaction: r ? "disabled" : "enabled",
|
|
692
808
|
"data-testid": "rubric-builder-save",
|
|
693
|
-
children:
|
|
809
|
+
children: o.rubricBuilderSave
|
|
694
810
|
}
|
|
695
811
|
)
|
|
696
812
|
] })
|
|
697
813
|
}
|
|
698
814
|
);
|
|
699
|
-
},
|
|
815
|
+
}, Ni = ({
|
|
700
816
|
isNewRubric: r,
|
|
701
|
-
pointsPossible:
|
|
817
|
+
pointsPossible: a,
|
|
702
818
|
hidePoints: s
|
|
703
819
|
}) => {
|
|
704
|
-
const { translations: i, translate:
|
|
705
|
-
return /* @__PURE__ */ b(
|
|
706
|
-
/* @__PURE__ */ e(
|
|
707
|
-
!s && /* @__PURE__ */ e(
|
|
820
|
+
const { translations: i, translate: n } = B();
|
|
821
|
+
return /* @__PURE__ */ b(k, { as: "header", justifyItems: "space-between", alignItems: "center", wrap: "wrap", gap: "small", children: [
|
|
822
|
+
/* @__PURE__ */ e(V, { level: "h2", children: r ? i.rubricBuilderCreateTitle : i.rubricBuilderEditTitle }),
|
|
823
|
+
!s && /* @__PURE__ */ e(cr, { "data-testid": "rubric-builder-current-total", children: n("rubricBuilderCurrentTotal", { count: a }) })
|
|
708
824
|
] });
|
|
709
|
-
},
|
|
710
|
-
|
|
825
|
+
}, ae = ({ name: r, label: a, value: s, options: i, onChange: n }) => /* @__PURE__ */ e(
|
|
826
|
+
fi,
|
|
711
827
|
{
|
|
712
828
|
name: r,
|
|
713
|
-
description:
|
|
829
|
+
description: a,
|
|
714
830
|
variant: "toggle",
|
|
715
831
|
layout: "columns",
|
|
716
832
|
value: s,
|
|
717
|
-
onChange: (l, o) =>
|
|
718
|
-
children: i.map((l) => /* @__PURE__ */ e(
|
|
833
|
+
onChange: (l, o) => n(o),
|
|
834
|
+
children: i.map((l) => /* @__PURE__ */ e(Ci, { value: l.value, label: l.label }, l.value))
|
|
719
835
|
}
|
|
720
|
-
),
|
|
836
|
+
), Fi = ({
|
|
721
837
|
rubricForm: r,
|
|
722
|
-
setRubricFormField:
|
|
838
|
+
setRubricFormField: a,
|
|
723
839
|
validateTitle: s,
|
|
724
840
|
titleError: i,
|
|
725
|
-
titleInputRef:
|
|
841
|
+
titleInputRef: n,
|
|
726
842
|
assignmentSettings: l
|
|
727
843
|
}) => {
|
|
728
|
-
const { translations: o } =
|
|
844
|
+
const { translations: o } = B(), m = (t) => {
|
|
729
845
|
if (t === "unscored" === r.hidePoints) return;
|
|
730
|
-
const { hidePoints: c, hideScoreTotal: h, useForGrading: d, buttonDisplay: u } =
|
|
846
|
+
const { hidePoints: c, hideScoreTotal: h, useForGrading: d, buttonDisplay: u } = Wr(
|
|
731
847
|
r.hidePoints
|
|
732
848
|
);
|
|
733
|
-
|
|
849
|
+
a("hidePoints", c), a("hideScoreTotal", h), a("useForGrading", d), u && a("buttonDisplay", u);
|
|
734
850
|
};
|
|
735
851
|
return /* @__PURE__ */ b(
|
|
736
|
-
|
|
852
|
+
P,
|
|
737
853
|
{
|
|
738
854
|
as: "section",
|
|
739
855
|
"aria-labelledby": "rubric-builder-details-heading",
|
|
@@ -741,24 +857,24 @@ const kt = (r) => /* @__PURE__ */ e(Ce, { translations: r.translations, children
|
|
|
741
857
|
borderRadius: "medium",
|
|
742
858
|
padding: "medium",
|
|
743
859
|
children: [
|
|
744
|
-
/* @__PURE__ */ e(
|
|
745
|
-
/* @__PURE__ */ b(
|
|
860
|
+
/* @__PURE__ */ e(V, { level: "h3", id: "rubric-builder-details-heading", margin: "0 0 medium", children: o.rubricBuilderDetailsHeading }),
|
|
861
|
+
/* @__PURE__ */ b(k, { direction: "column", gap: "medium", children: [
|
|
746
862
|
/* @__PURE__ */ e(
|
|
747
|
-
|
|
863
|
+
X,
|
|
748
864
|
{
|
|
749
865
|
"data-testid": "rubric-builder-name",
|
|
750
866
|
renderLabel: o.rubricBuilderNameLabel,
|
|
751
867
|
isRequired: !0,
|
|
752
868
|
value: r.title,
|
|
753
|
-
inputRef:
|
|
754
|
-
onChange: (t) =>
|
|
869
|
+
inputRef: n,
|
|
870
|
+
onChange: (t) => a("title", t.target.value),
|
|
755
871
|
onBlur: (t) => s(t.target.value),
|
|
756
872
|
messages: i ? [{ text: i, type: "error" }] : []
|
|
757
873
|
}
|
|
758
874
|
),
|
|
759
|
-
/* @__PURE__ */ b(
|
|
875
|
+
/* @__PURE__ */ b(k, { gap: "medium", wrap: "wrap", children: [
|
|
760
876
|
/* @__PURE__ */ e(
|
|
761
|
-
|
|
877
|
+
ae,
|
|
762
878
|
{
|
|
763
879
|
name: "rubric-builder-scoring",
|
|
764
880
|
label: o.scoringTypeSelectLabel,
|
|
@@ -767,11 +883,11 @@ const kt = (r) => /* @__PURE__ */ e(Ce, { translations: r.translations, children
|
|
|
767
883
|
{ value: "scored", label: o.scoringTypeScored },
|
|
768
884
|
{ value: "unscored", label: o.scoringTypeUnscored }
|
|
769
885
|
],
|
|
770
|
-
onChange:
|
|
886
|
+
onChange: m
|
|
771
887
|
}
|
|
772
888
|
),
|
|
773
889
|
!r.hidePoints && !r.freeFormCriterionComments && /* @__PURE__ */ e(
|
|
774
|
-
|
|
890
|
+
ae,
|
|
775
891
|
{
|
|
776
892
|
name: "rubric-builder-display",
|
|
777
893
|
label: o.rubricBuilderDisplayLabel,
|
|
@@ -780,11 +896,11 @@ const kt = (r) => /* @__PURE__ */ e(Ce, { translations: r.translations, children
|
|
|
780
896
|
{ value: "points", label: o.ratingDisplayPoints },
|
|
781
897
|
{ value: "numeric", label: o.ratingDisplayLevel }
|
|
782
898
|
],
|
|
783
|
-
onChange: (t) =>
|
|
899
|
+
onChange: (t) => a("buttonDisplay", t)
|
|
784
900
|
}
|
|
785
901
|
),
|
|
786
902
|
/* @__PURE__ */ e(
|
|
787
|
-
|
|
903
|
+
ae,
|
|
788
904
|
{
|
|
789
905
|
name: "rubric-builder-feedback",
|
|
790
906
|
label: o.rubricBuilderFeedbackLabel,
|
|
@@ -793,11 +909,11 @@ const kt = (r) => /* @__PURE__ */ e(Ce, { translations: r.translations, children
|
|
|
793
909
|
{ value: "scale", label: o.gradingTypeScale },
|
|
794
910
|
{ value: "freeForm", label: o.rubricBuilderFeedbackWrittenOnly }
|
|
795
911
|
],
|
|
796
|
-
onChange: (t) =>
|
|
912
|
+
onChange: (t) => a("freeFormCriterionComments", t === "freeForm")
|
|
797
913
|
}
|
|
798
914
|
),
|
|
799
915
|
!r.freeFormCriterionComments && /* @__PURE__ */ e(
|
|
800
|
-
|
|
916
|
+
ae,
|
|
801
917
|
{
|
|
802
918
|
name: "rubric-builder-rating-order",
|
|
803
919
|
label: o.rubricBuilderRatingOrderLabel,
|
|
@@ -806,7 +922,7 @@ const kt = (r) => /* @__PURE__ */ e(Ce, { translations: r.translations, children
|
|
|
806
922
|
{ value: "ascending", label: o.rubricBuilderRatingOrderLowToHigh },
|
|
807
923
|
{ value: "descending", label: o.rubricBuilderRatingOrderHighToLow }
|
|
808
924
|
],
|
|
809
|
-
onChange: (t) =>
|
|
925
|
+
onChange: (t) => a("ratingOrder", t)
|
|
810
926
|
}
|
|
811
927
|
)
|
|
812
928
|
] }),
|
|
@@ -815,81 +931,81 @@ const kt = (r) => /* @__PURE__ */ e(Ce, { translations: r.translations, children
|
|
|
815
931
|
]
|
|
816
932
|
}
|
|
817
933
|
);
|
|
818
|
-
},
|
|
934
|
+
}, Hi = ({
|
|
819
935
|
options: r,
|
|
820
|
-
maxCriterionCount:
|
|
936
|
+
maxCriterionCount: a,
|
|
821
937
|
maxRatingCount: s,
|
|
822
938
|
rangeEnabled: i,
|
|
823
|
-
isPending:
|
|
939
|
+
isPending: n,
|
|
824
940
|
onChange: l,
|
|
825
941
|
onGenerate: o,
|
|
826
|
-
onCancel:
|
|
942
|
+
onCancel: m
|
|
827
943
|
}) => {
|
|
828
|
-
const { translations: t } =
|
|
944
|
+
const { translations: t } = B(), [c, h] = y(!1), d = (g, v) => l({ ...r, [g]: v }), u = Ne(r.totalPoints), p = r.standard.length > ve, f = r.additionalPromptInfo.length > ve, C = () => {
|
|
829
945
|
if (!u) {
|
|
830
946
|
h(!0);
|
|
831
947
|
return;
|
|
832
948
|
}
|
|
833
949
|
o();
|
|
834
950
|
};
|
|
835
|
-
return /* @__PURE__ */ b(
|
|
836
|
-
/* @__PURE__ */ b(
|
|
837
|
-
/* @__PURE__ */ e(
|
|
838
|
-
|
|
951
|
+
return /* @__PURE__ */ b(T, { direction: "column", gap: "medium", "data-testid": "rubric-builder-generator-form", children: [
|
|
952
|
+
/* @__PURE__ */ b(T, { gap: "small", wrap: "wrap", alignItems: "start", children: [
|
|
953
|
+
/* @__PURE__ */ e(T.Item, { shouldGrow: !0, shouldShrink: !0, size: "12rem", children: /* @__PURE__ */ e(
|
|
954
|
+
$,
|
|
839
955
|
{
|
|
840
956
|
renderLabel: t.rubricBuilderGeneratorDifficultyLabel,
|
|
841
957
|
value: r.gradeLevel,
|
|
842
|
-
onChange: (
|
|
958
|
+
onChange: (g, { value: v }) => v && d("gradeLevel", String(v)),
|
|
843
959
|
"data-testid": "rubric-builder-generator-difficulty",
|
|
844
|
-
children:
|
|
960
|
+
children: jr.map((g) => /* @__PURE__ */ e($.Option, { id: `rubric-builder-grade-level-${g}`, value: g, children: t[Kr[g]] }, g))
|
|
845
961
|
}
|
|
846
962
|
) }),
|
|
847
|
-
/* @__PURE__ */ e(
|
|
848
|
-
|
|
963
|
+
/* @__PURE__ */ e(T.Item, { shouldGrow: !0, shouldShrink: !0, size: "10rem", children: /* @__PURE__ */ e(
|
|
964
|
+
$,
|
|
849
965
|
{
|
|
850
966
|
renderLabel: t.rubricBuilderGeneratorCriteriaCountLabel,
|
|
851
967
|
isRequired: !0,
|
|
852
968
|
value: String(r.criteriaCount),
|
|
853
|
-
onChange: (
|
|
969
|
+
onChange: (g, { value: v }) => v && d("criteriaCount", Number(v)),
|
|
854
970
|
"data-testid": "rubric-builder-generator-criteria-count",
|
|
855
|
-
children:
|
|
856
|
-
|
|
971
|
+
children: Fe(a).map((g) => /* @__PURE__ */ e(
|
|
972
|
+
$.Option,
|
|
857
973
|
{
|
|
858
|
-
id: `rubric-builder-criteria-count-${
|
|
859
|
-
value: String(
|
|
860
|
-
children: String(
|
|
974
|
+
id: `rubric-builder-criteria-count-${g}`,
|
|
975
|
+
value: String(g),
|
|
976
|
+
children: String(g)
|
|
861
977
|
},
|
|
862
|
-
|
|
978
|
+
g
|
|
863
979
|
))
|
|
864
980
|
}
|
|
865
981
|
) }),
|
|
866
|
-
/* @__PURE__ */ e(
|
|
867
|
-
|
|
982
|
+
/* @__PURE__ */ e(T.Item, { shouldGrow: !0, shouldShrink: !0, size: "10rem", children: /* @__PURE__ */ e(
|
|
983
|
+
$,
|
|
868
984
|
{
|
|
869
985
|
renderLabel: t.rubricBuilderGeneratorRatingCountLabel,
|
|
870
986
|
isRequired: !0,
|
|
871
987
|
value: String(r.ratingCount),
|
|
872
|
-
onChange: (
|
|
988
|
+
onChange: (g, { value: v }) => v && d("ratingCount", Number(v)),
|
|
873
989
|
"data-testid": "rubric-builder-generator-rating-count",
|
|
874
|
-
children:
|
|
875
|
-
|
|
990
|
+
children: Fe(s).map((g) => /* @__PURE__ */ e(
|
|
991
|
+
$.Option,
|
|
876
992
|
{
|
|
877
|
-
id: `rubric-builder-rating-count-${
|
|
878
|
-
value: String(
|
|
879
|
-
children: String(
|
|
993
|
+
id: `rubric-builder-rating-count-${g}`,
|
|
994
|
+
value: String(g),
|
|
995
|
+
children: String(g)
|
|
880
996
|
},
|
|
881
|
-
|
|
997
|
+
g
|
|
882
998
|
))
|
|
883
999
|
}
|
|
884
1000
|
) }),
|
|
885
|
-
/* @__PURE__ */ e(
|
|
886
|
-
|
|
1001
|
+
/* @__PURE__ */ e(T.Item, { shouldGrow: !0, shouldShrink: !0, size: "8rem", children: /* @__PURE__ */ e(
|
|
1002
|
+
wi,
|
|
887
1003
|
{
|
|
888
1004
|
renderLabel: t.generateCriteriaTotalPointsLabel,
|
|
889
1005
|
isRequired: !0,
|
|
890
1006
|
value: r.totalPoints,
|
|
891
|
-
onChange: (
|
|
892
|
-
d("totalPoints",
|
|
1007
|
+
onChange: (g, v) => {
|
|
1008
|
+
d("totalPoints", v), Ne(v) && h(!1);
|
|
893
1009
|
},
|
|
894
1010
|
messages: c && !u ? [{ text: t.generateCriteriaTotalPointsError, type: "error" }] : [],
|
|
895
1011
|
"data-testid": "rubric-builder-generator-total-points"
|
|
@@ -897,12 +1013,12 @@ const kt = (r) => /* @__PURE__ */ e(Ce, { translations: r.translations, children
|
|
|
897
1013
|
) })
|
|
898
1014
|
] }),
|
|
899
1015
|
i && /* @__PURE__ */ e(
|
|
900
|
-
|
|
1016
|
+
le,
|
|
901
1017
|
{
|
|
902
1018
|
variant: "toggle",
|
|
903
1019
|
label: t.rubricBuilderEnableRange,
|
|
904
1020
|
checked: r.useRange,
|
|
905
|
-
onChange: (
|
|
1021
|
+
onChange: (g) => d("useRange", g.target.checked),
|
|
906
1022
|
"data-testid": "rubric-builder-generator-use-range"
|
|
907
1023
|
}
|
|
908
1024
|
),
|
|
@@ -912,7 +1028,7 @@ const kt = (r) => /* @__PURE__ */ e(Ce, { translations: r.translations, children
|
|
|
912
1028
|
label: t.rubricBuilderGeneratorStandardLabel,
|
|
913
1029
|
placeholder: t.standardObjectivePlaceholder,
|
|
914
1030
|
value: r.standard,
|
|
915
|
-
onChange: (
|
|
1031
|
+
onChange: (g) => d("standard", g.target.value),
|
|
916
1032
|
messages: p ? [{ text: t.standardObjectiveTooLong, type: "error" }] : [],
|
|
917
1033
|
"data-testid": "rubric-builder-generator-standard"
|
|
918
1034
|
}
|
|
@@ -923,98 +1039,98 @@ const kt = (r) => /* @__PURE__ */ e(Ce, { translations: r.translations, children
|
|
|
923
1039
|
label: t.rubricBuilderGeneratorAdditionalLabel,
|
|
924
1040
|
placeholder: t.generateCriteriaAdditionalPromptPlaceholder,
|
|
925
1041
|
value: r.additionalPromptInfo,
|
|
926
|
-
onChange: (
|
|
927
|
-
messages:
|
|
1042
|
+
onChange: (g) => d("additionalPromptInfo", g.target.value),
|
|
1043
|
+
messages: f ? [{ text: t.generateCriteriaAdditionalPromptTooLong, type: "error" }] : [],
|
|
928
1044
|
"data-testid": "rubric-builder-generator-additional"
|
|
929
1045
|
}
|
|
930
1046
|
),
|
|
931
|
-
/* @__PURE__ */ b(
|
|
1047
|
+
/* @__PURE__ */ b(T, { justifyItems: "end", gap: "small", children: [
|
|
932
1048
|
/* @__PURE__ */ e(
|
|
933
|
-
|
|
1049
|
+
A,
|
|
934
1050
|
{
|
|
935
|
-
onClick:
|
|
936
|
-
disabled:
|
|
1051
|
+
onClick: m,
|
|
1052
|
+
disabled: n,
|
|
937
1053
|
"data-testid": "rubric-builder-generator-cancel",
|
|
938
1054
|
children: t.cancel
|
|
939
1055
|
}
|
|
940
1056
|
),
|
|
941
1057
|
/* @__PURE__ */ e(
|
|
942
|
-
|
|
1058
|
+
A,
|
|
943
1059
|
{
|
|
944
1060
|
color: "ai-primary",
|
|
945
|
-
renderIcon: /* @__PURE__ */ e(
|
|
946
|
-
onClick:
|
|
947
|
-
disabled:
|
|
1061
|
+
renderIcon: /* @__PURE__ */ e(me, {}),
|
|
1062
|
+
onClick: C,
|
|
1063
|
+
disabled: n || p || f,
|
|
948
1064
|
"data-testid": "rubric-builder-generator-generate",
|
|
949
1065
|
children: t.rubricBuilderGeneratorGenerate
|
|
950
1066
|
}
|
|
951
1067
|
)
|
|
952
1068
|
] })
|
|
953
1069
|
] });
|
|
954
|
-
},
|
|
1070
|
+
}, zi = ({
|
|
955
1071
|
courseId: r,
|
|
956
|
-
responseId:
|
|
1072
|
+
responseId: a,
|
|
957
1073
|
responseType: s
|
|
958
1074
|
}) => {
|
|
959
|
-
const { translations: i, translate:
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
}, [
|
|
1075
|
+
const { translations: i, translate: n } = B(), { locale: l } = be(), [o, m] = y(null), [t, c] = y(null), [h, d] = y("");
|
|
1076
|
+
N(() => {
|
|
1077
|
+
m(null), c(null);
|
|
1078
|
+
}, [a]);
|
|
963
1079
|
const u = () => {
|
|
964
1080
|
d(""), c(null);
|
|
965
|
-
}, { submitFeedback: p, isPending:
|
|
1081
|
+
}, { submitFeedback: p, isPending: f } = Xr({
|
|
966
1082
|
courseId: r,
|
|
967
|
-
responseId:
|
|
1083
|
+
responseId: a,
|
|
968
1084
|
responseType: s,
|
|
969
1085
|
onSubmitted: () => {
|
|
970
|
-
|
|
1086
|
+
m(t), u();
|
|
971
1087
|
}
|
|
972
|
-
}),
|
|
1088
|
+
}), C = t ?? o, g = h.length > He, v = t === "positive" ? i.positiveFeedbackLabel : i.negativeFeedbackLabel, E = (R) => {
|
|
973
1089
|
o !== R && c(R);
|
|
974
1090
|
};
|
|
975
|
-
return /* @__PURE__ */ b(
|
|
976
|
-
/* @__PURE__ */ b(
|
|
977
|
-
/* @__PURE__ */ e(
|
|
1091
|
+
return /* @__PURE__ */ b(Se, { children: [
|
|
1092
|
+
/* @__PURE__ */ b(T, { alignItems: "center", gap: "xx-small", "data-testid": "rubric-builder-generator-feedback", children: [
|
|
1093
|
+
/* @__PURE__ */ e(Y, { children: i.generatedCriteriaFeedbackLabel }),
|
|
978
1094
|
/* @__PURE__ */ e(
|
|
979
|
-
|
|
1095
|
+
Ue,
|
|
980
1096
|
{
|
|
981
1097
|
withBackground: !1,
|
|
982
1098
|
withBorder: !1,
|
|
983
1099
|
size: "small",
|
|
984
1100
|
screenReaderLabel: i.positiveFeedbackLabel,
|
|
985
|
-
"aria-pressed":
|
|
1101
|
+
"aria-pressed": C === "positive",
|
|
986
1102
|
onClick: () => E("positive"),
|
|
987
1103
|
"data-testid": "rubric-builder-generator-feedback-positive",
|
|
988
|
-
children:
|
|
1104
|
+
children: C === "positive" ? /* @__PURE__ */ e(ze, {}) : /* @__PURE__ */ e($e, {})
|
|
989
1105
|
}
|
|
990
1106
|
),
|
|
991
1107
|
/* @__PURE__ */ e(
|
|
992
|
-
|
|
1108
|
+
Ue,
|
|
993
1109
|
{
|
|
994
1110
|
withBackground: !1,
|
|
995
1111
|
withBorder: !1,
|
|
996
1112
|
size: "small",
|
|
997
1113
|
screenReaderLabel: i.negativeFeedbackLabel,
|
|
998
|
-
"aria-pressed":
|
|
1114
|
+
"aria-pressed": C === "negative",
|
|
999
1115
|
onClick: () => E("negative"),
|
|
1000
1116
|
"data-testid": "rubric-builder-generator-feedback-negative",
|
|
1001
|
-
children:
|
|
1117
|
+
children: C === "negative" ? /* @__PURE__ */ e(ze, { rotate: "180" }) : /* @__PURE__ */ e($e, { rotate: "180" })
|
|
1002
1118
|
}
|
|
1003
1119
|
)
|
|
1004
1120
|
] }),
|
|
1005
1121
|
/* @__PURE__ */ b(
|
|
1006
|
-
|
|
1122
|
+
M,
|
|
1007
1123
|
{
|
|
1008
1124
|
open: t != null,
|
|
1009
|
-
onDismiss:
|
|
1125
|
+
onDismiss: f ? void 0 : u,
|
|
1010
1126
|
size: "medium",
|
|
1011
|
-
label:
|
|
1127
|
+
label: v,
|
|
1012
1128
|
shouldCloseOnDocumentClick: !1,
|
|
1013
1129
|
"data-testid": "rubric-builder-generator-feedback-modal",
|
|
1014
1130
|
children: [
|
|
1015
|
-
/* @__PURE__ */ b(
|
|
1131
|
+
/* @__PURE__ */ b(M.Header, { children: [
|
|
1016
1132
|
/* @__PURE__ */ e(
|
|
1017
|
-
|
|
1133
|
+
Be,
|
|
1018
1134
|
{
|
|
1019
1135
|
placement: "end",
|
|
1020
1136
|
offset: "small",
|
|
@@ -1022,22 +1138,22 @@ const kt = (r) => /* @__PURE__ */ e(Ce, { translations: r.translations, children
|
|
|
1022
1138
|
screenReaderLabel: i.feedbackModalCancelLabel
|
|
1023
1139
|
}
|
|
1024
1140
|
),
|
|
1025
|
-
/* @__PURE__ */ e(
|
|
1141
|
+
/* @__PURE__ */ e(q, { level: "h2", children: v })
|
|
1026
1142
|
] }),
|
|
1027
|
-
/* @__PURE__ */ b(
|
|
1028
|
-
/* @__PURE__ */ e(
|
|
1143
|
+
/* @__PURE__ */ b(M.Body, { children: [
|
|
1144
|
+
/* @__PURE__ */ e(Y, { as: "p", children: i.feedbackModalDescription }),
|
|
1029
1145
|
/* @__PURE__ */ e(
|
|
1030
1146
|
ce,
|
|
1031
1147
|
{
|
|
1032
1148
|
label: i.feedbackModalCommentLabel,
|
|
1033
1149
|
placeholder: i.feedbackModalCommentPlaceholder,
|
|
1034
1150
|
value: h,
|
|
1035
|
-
disabled:
|
|
1151
|
+
disabled: f,
|
|
1036
1152
|
onChange: (R) => d(R.target.value),
|
|
1037
|
-
messages:
|
|
1153
|
+
messages: g ? [
|
|
1038
1154
|
{
|
|
1039
|
-
text:
|
|
1040
|
-
limit: new Intl.NumberFormat(l).format(
|
|
1155
|
+
text: n("feedbackModalCommentTooLong", {
|
|
1156
|
+
limit: new Intl.NumberFormat(l).format(He)
|
|
1041
1157
|
}),
|
|
1042
1158
|
type: "error"
|
|
1043
1159
|
}
|
|
@@ -1046,16 +1162,16 @@ const kt = (r) => /* @__PURE__ */ e(Ce, { translations: r.translations, children
|
|
|
1046
1162
|
}
|
|
1047
1163
|
)
|
|
1048
1164
|
] }),
|
|
1049
|
-
/* @__PURE__ */ b(
|
|
1050
|
-
/* @__PURE__ */ e(
|
|
1165
|
+
/* @__PURE__ */ b(M.Footer, { children: [
|
|
1166
|
+
/* @__PURE__ */ e(A, { onClick: u, disabled: f, margin: "0 x-small 0 0", children: i.cancel }),
|
|
1051
1167
|
/* @__PURE__ */ e(
|
|
1052
|
-
|
|
1168
|
+
A,
|
|
1053
1169
|
{
|
|
1054
1170
|
color: "primary",
|
|
1055
|
-
disabled:
|
|
1171
|
+
disabled: g || f,
|
|
1056
1172
|
onClick: () => t && p({ feedbackType: t, comment: h }),
|
|
1057
1173
|
"data-testid": "rubric-builder-generator-feedback-submit",
|
|
1058
|
-
children:
|
|
1174
|
+
children: f ? i.feedbackModalSubmitting : i.feedbackModalSubmit
|
|
1059
1175
|
}
|
|
1060
1176
|
)
|
|
1061
1177
|
] })
|
|
@@ -1063,31 +1179,31 @@ const kt = (r) => /* @__PURE__ */ e(Ce, { translations: r.translations, children
|
|
|
1063
1179
|
}
|
|
1064
1180
|
)
|
|
1065
1181
|
] });
|
|
1066
|
-
},
|
|
1182
|
+
}, $i = ({
|
|
1067
1183
|
isOpen: r,
|
|
1068
|
-
onRegenerate:
|
|
1184
|
+
onRegenerate: a,
|
|
1069
1185
|
onDismiss: s
|
|
1070
1186
|
}) => {
|
|
1071
|
-
const { translations: i } =
|
|
1187
|
+
const { translations: i } = B(), n = F(null), [l, o] = y(""), m = l.length > ve, t = () => {
|
|
1072
1188
|
o(""), s();
|
|
1073
1189
|
};
|
|
1074
1190
|
return /* @__PURE__ */ b(
|
|
1075
|
-
|
|
1191
|
+
M,
|
|
1076
1192
|
{
|
|
1077
1193
|
open: r,
|
|
1078
1194
|
onDismiss: t,
|
|
1079
1195
|
size: "medium",
|
|
1080
1196
|
label: i.regenerateModalCriteriaLabel,
|
|
1081
1197
|
shouldCloseOnDocumentClick: !1,
|
|
1082
|
-
defaultFocusElement: () =>
|
|
1198
|
+
defaultFocusElement: () => n.current,
|
|
1083
1199
|
"data-testid": "rubric-builder-regenerate-modal",
|
|
1084
1200
|
children: [
|
|
1085
|
-
/* @__PURE__ */ b(
|
|
1086
|
-
/* @__PURE__ */ e(
|
|
1087
|
-
/* @__PURE__ */ e(
|
|
1201
|
+
/* @__PURE__ */ b(M.Header, { children: [
|
|
1202
|
+
/* @__PURE__ */ e(Be, { placement: "end", offset: "small", onClick: t, screenReaderLabel: i.close }),
|
|
1203
|
+
/* @__PURE__ */ e(q, { level: "h2", children: i.regenerateModalCriteriaLabel })
|
|
1088
1204
|
] }),
|
|
1089
|
-
/* @__PURE__ */ b(
|
|
1090
|
-
/* @__PURE__ */ e(
|
|
1205
|
+
/* @__PURE__ */ b(M.Body, { children: [
|
|
1206
|
+
/* @__PURE__ */ e(Y, { as: "p", children: i.regenerateModalDescriptionCriteria }),
|
|
1091
1207
|
/* @__PURE__ */ e(
|
|
1092
1208
|
ce,
|
|
1093
1209
|
{
|
|
@@ -1095,24 +1211,24 @@ const kt = (r) => /* @__PURE__ */ e(Ce, { translations: r.translations, children
|
|
|
1095
1211
|
placeholder: i.regenerateModalPromptPlaceholder,
|
|
1096
1212
|
value: l,
|
|
1097
1213
|
textareaRef: (c) => {
|
|
1098
|
-
|
|
1214
|
+
n.current = c;
|
|
1099
1215
|
},
|
|
1100
1216
|
onChange: (c) => o(c.target.value),
|
|
1101
|
-
messages:
|
|
1217
|
+
messages: m ? [{ text: i.regenerateModalPromptTooLong, type: "error" }] : [],
|
|
1102
1218
|
"data-testid": "rubric-builder-regenerate-prompt"
|
|
1103
1219
|
}
|
|
1104
1220
|
)
|
|
1105
1221
|
] }),
|
|
1106
|
-
/* @__PURE__ */ b(
|
|
1107
|
-
/* @__PURE__ */ e(
|
|
1222
|
+
/* @__PURE__ */ b(M.Footer, { children: [
|
|
1223
|
+
/* @__PURE__ */ e(A, { onClick: t, margin: "0 x-small 0 0", children: i.cancel }),
|
|
1108
1224
|
/* @__PURE__ */ e(
|
|
1109
|
-
|
|
1225
|
+
A,
|
|
1110
1226
|
{
|
|
1111
1227
|
color: "ai-primary",
|
|
1112
|
-
renderIcon: /* @__PURE__ */ e(
|
|
1113
|
-
disabled:
|
|
1228
|
+
renderIcon: /* @__PURE__ */ e(me, {}),
|
|
1229
|
+
disabled: m,
|
|
1114
1230
|
onClick: () => {
|
|
1115
|
-
|
|
1231
|
+
a(l), t();
|
|
1116
1232
|
},
|
|
1117
1233
|
"data-testid": "rubric-builder-regenerate-submit",
|
|
1118
1234
|
children: i.regenerateButtonLabel
|
|
@@ -1122,55 +1238,55 @@ const kt = (r) => /* @__PURE__ */ e(Ce, { translations: r.translations, children
|
|
|
1122
1238
|
]
|
|
1123
1239
|
}
|
|
1124
1240
|
);
|
|
1125
|
-
},
|
|
1241
|
+
}, Ui = ({
|
|
1126
1242
|
courseId: r,
|
|
1127
|
-
responseId:
|
|
1243
|
+
responseId: a,
|
|
1128
1244
|
responseType: s,
|
|
1129
1245
|
canRegenerate: i,
|
|
1130
|
-
isPending:
|
|
1246
|
+
isPending: n,
|
|
1131
1247
|
onRegenerate: l
|
|
1132
1248
|
}) => {
|
|
1133
|
-
const { translations: o } =
|
|
1134
|
-
|
|
1249
|
+
const { translations: o } = B(), m = F(null), [t, c] = y(!1);
|
|
1250
|
+
N(() => {
|
|
1135
1251
|
var d;
|
|
1136
|
-
(d =
|
|
1252
|
+
(d = m.current) == null || d.focus();
|
|
1137
1253
|
}, []);
|
|
1138
1254
|
const h = /* @__PURE__ */ e(
|
|
1139
|
-
|
|
1255
|
+
A,
|
|
1140
1256
|
{
|
|
1141
1257
|
color: "ai-secondary",
|
|
1142
|
-
renderIcon: /* @__PURE__ */ e(
|
|
1143
|
-
disabled:
|
|
1258
|
+
renderIcon: /* @__PURE__ */ e(me, {}),
|
|
1259
|
+
disabled: n || !i,
|
|
1144
1260
|
onClick: () => c(!0),
|
|
1145
1261
|
"data-testid": "rubric-builder-generator-regenerate",
|
|
1146
1262
|
children: o.regenerateButtonLabel
|
|
1147
1263
|
}
|
|
1148
1264
|
);
|
|
1149
|
-
return /* @__PURE__ */ b(
|
|
1265
|
+
return /* @__PURE__ */ b(T, { direction: "column", gap: "small", "data-testid": "rubric-builder-generator-summary", children: [
|
|
1150
1266
|
/* @__PURE__ */ e(
|
|
1151
|
-
|
|
1267
|
+
q,
|
|
1152
1268
|
{
|
|
1153
1269
|
level: "h4",
|
|
1154
1270
|
elementRef: (d) => {
|
|
1155
|
-
|
|
1271
|
+
m.current = d;
|
|
1156
1272
|
},
|
|
1157
1273
|
tabIndex: -1,
|
|
1158
1274
|
children: o.rubricBuilderGeneratorDoneHeading
|
|
1159
1275
|
}
|
|
1160
1276
|
),
|
|
1161
|
-
/* @__PURE__ */ b(
|
|
1162
|
-
|
|
1163
|
-
|
|
1277
|
+
/* @__PURE__ */ b(T, { justifyItems: "space-between", alignItems: "center", wrap: "wrap", gap: "small", children: [
|
|
1278
|
+
a ? /* @__PURE__ */ e(
|
|
1279
|
+
zi,
|
|
1164
1280
|
{
|
|
1165
1281
|
courseId: r,
|
|
1166
|
-
responseId:
|
|
1282
|
+
responseId: a,
|
|
1167
1283
|
responseType: s
|
|
1168
1284
|
}
|
|
1169
1285
|
) : /* @__PURE__ */ e("span", {}),
|
|
1170
|
-
i ? h : /* @__PURE__ */ e(
|
|
1286
|
+
i ? h : /* @__PURE__ */ e(Si, { renderTip: o.noCriteriaForRegenerationTooltip, children: h })
|
|
1171
1287
|
] }),
|
|
1172
1288
|
/* @__PURE__ */ e(
|
|
1173
|
-
|
|
1289
|
+
$i,
|
|
1174
1290
|
{
|
|
1175
1291
|
isOpen: t,
|
|
1176
1292
|
onRegenerate: l,
|
|
@@ -1178,17 +1294,17 @@ const kt = (r) => /* @__PURE__ */ e(Ce, { translations: r.translations, children
|
|
|
1178
1294
|
}
|
|
1179
1295
|
)
|
|
1180
1296
|
] });
|
|
1181
|
-
},
|
|
1297
|
+
}, br = "rubric-builder-generator", Vi = ({
|
|
1182
1298
|
courseId: r,
|
|
1183
|
-
generator:
|
|
1299
|
+
generator: a,
|
|
1184
1300
|
onCancel: s
|
|
1185
1301
|
}) => {
|
|
1186
|
-
const { translations: i } =
|
|
1302
|
+
const { translations: i } = B(), { aiRubricsMaxCriterionCount: n, aiRubricsMaxRatingCount: l, rubricCriterionRange: o } = ue(), { isPending: m, progress: t } = a, c = t == null ? void 0 : t.completion;
|
|
1187
1303
|
return /* @__PURE__ */ e(
|
|
1188
|
-
|
|
1304
|
+
Re,
|
|
1189
1305
|
{
|
|
1190
1306
|
as: "section",
|
|
1191
|
-
id:
|
|
1307
|
+
id: br,
|
|
1192
1308
|
"aria-labelledby": "rubric-builder-generator-heading",
|
|
1193
1309
|
borderWidth: "small",
|
|
1194
1310
|
borderRadius: "medium",
|
|
@@ -1196,14 +1312,14 @@ const kt = (r) => /* @__PURE__ */ e(Ce, { translations: r.translations, children
|
|
|
1196
1312
|
margin: "small 0 0",
|
|
1197
1313
|
background: "secondary",
|
|
1198
1314
|
"data-testid": "rubric-builder-generator-panel",
|
|
1199
|
-
children: /* @__PURE__ */ b(
|
|
1200
|
-
/* @__PURE__ */ b(
|
|
1201
|
-
/* @__PURE__ */ e(
|
|
1202
|
-
/* @__PURE__ */ e(
|
|
1203
|
-
/* @__PURE__ */ e(
|
|
1315
|
+
children: /* @__PURE__ */ b(T, { direction: "column", gap: "medium", children: [
|
|
1316
|
+
/* @__PURE__ */ b(T, { alignItems: "center", gap: "small", children: [
|
|
1317
|
+
/* @__PURE__ */ e(sr, {}),
|
|
1318
|
+
/* @__PURE__ */ e(q, { level: "h4", id: "rubric-builder-generator-heading", children: i.rubricBuilderGeneratorToggle }),
|
|
1319
|
+
/* @__PURE__ */ e(Yr, { enabled: !0 })
|
|
1204
1320
|
] }),
|
|
1205
|
-
|
|
1206
|
-
|
|
1321
|
+
m && (typeof c == "number" ? /* @__PURE__ */ e(
|
|
1322
|
+
vi,
|
|
1207
1323
|
{
|
|
1208
1324
|
screenReaderLabel: i.rubricBuilderGeneratorGenerating,
|
|
1209
1325
|
valueNow: c,
|
|
@@ -1211,428 +1327,447 @@ const kt = (r) => /* @__PURE__ */ e(Ce, { translations: r.translations, children
|
|
|
1211
1327
|
"data-testid": "rubric-builder-generator-progress"
|
|
1212
1328
|
}
|
|
1213
1329
|
) : /* @__PURE__ */ e(
|
|
1214
|
-
|
|
1330
|
+
Ri,
|
|
1215
1331
|
{
|
|
1216
1332
|
size: "small",
|
|
1217
1333
|
renderTitle: i.rubricBuilderGeneratorGenerating,
|
|
1218
1334
|
"data-testid": "rubric-builder-generator-progress"
|
|
1219
1335
|
}
|
|
1220
1336
|
)),
|
|
1221
|
-
|
|
1222
|
-
|
|
1337
|
+
a.isGenerated ? /* @__PURE__ */ e(
|
|
1338
|
+
Ui,
|
|
1223
1339
|
{
|
|
1224
1340
|
courseId: r,
|
|
1225
|
-
responseId:
|
|
1226
|
-
responseType:
|
|
1227
|
-
canRegenerate:
|
|
1228
|
-
isPending:
|
|
1229
|
-
onRegenerate:
|
|
1341
|
+
responseId: a.feedbackResponseId,
|
|
1342
|
+
responseType: a.feedbackResponseType,
|
|
1343
|
+
canRegenerate: a.canRegenerate,
|
|
1344
|
+
isPending: m,
|
|
1345
|
+
onRegenerate: a.regenerateAll
|
|
1230
1346
|
}
|
|
1231
1347
|
) : /* @__PURE__ */ e(
|
|
1232
|
-
|
|
1348
|
+
Hi,
|
|
1233
1349
|
{
|
|
1234
|
-
options:
|
|
1235
|
-
maxCriterionCount:
|
|
1350
|
+
options: a.options,
|
|
1351
|
+
maxCriterionCount: n,
|
|
1236
1352
|
maxRatingCount: l,
|
|
1237
1353
|
rangeEnabled: o,
|
|
1238
|
-
isPending:
|
|
1239
|
-
onChange:
|
|
1240
|
-
onGenerate:
|
|
1354
|
+
isPending: m,
|
|
1355
|
+
onChange: a.setOptions,
|
|
1356
|
+
onGenerate: a.generate,
|
|
1241
1357
|
onCancel: s
|
|
1242
1358
|
}
|
|
1243
1359
|
)
|
|
1244
1360
|
] })
|
|
1245
1361
|
}
|
|
1246
1362
|
);
|
|
1247
|
-
},
|
|
1248
|
-
const { translations:
|
|
1249
|
-
return /* @__PURE__ */ e(
|
|
1250
|
-
},
|
|
1363
|
+
}, qi = ({ generator: r }) => {
|
|
1364
|
+
const { translations: a, translate: s } = B(), { isPending: i, lastResult: n } = r, l = i ? a.rubricBuilderGeneratorGenerating : (n == null ? void 0 : n.kind) === "generated" ? s("rubricBuilderGeneratorAdded", { count: n.count }) : (n == null ? void 0 : n.kind) === "regenerated" ? a.rubricBuilderGeneratorRegenerated : "";
|
|
1365
|
+
return /* @__PURE__ */ e(dr, { children: /* @__PURE__ */ e("div", { "aria-live": "polite", "aria-atomic": "true", "data-testid": "rubric-builder-generator-status", children: l }) });
|
|
1366
|
+
}, Wi = (r) => {
|
|
1251
1367
|
try {
|
|
1252
|
-
return
|
|
1368
|
+
return ri(r).criteria.length;
|
|
1253
1369
|
} catch {
|
|
1254
1370
|
return 0;
|
|
1255
1371
|
}
|
|
1256
|
-
},
|
|
1372
|
+
}, ji = ({
|
|
1257
1373
|
courseId: r,
|
|
1258
|
-
assignmentId:
|
|
1374
|
+
assignmentId: a,
|
|
1259
1375
|
assignmentPointsPossible: s,
|
|
1260
1376
|
criteria: i,
|
|
1261
|
-
criteriaRef:
|
|
1377
|
+
criteriaRef: n,
|
|
1262
1378
|
setRubricFormField: l
|
|
1263
1379
|
}) => {
|
|
1264
|
-
const { aiRubricsMaxCriterionCount: o, aiRubricsMaxRatingCount:
|
|
1265
|
-
() =>
|
|
1380
|
+
const { aiRubricsMaxCriterionCount: o, aiRubricsMaxRatingCount: m } = ue(), t = Ae(
|
|
1381
|
+
() => Qr({
|
|
1266
1382
|
maxCriterionCount: o,
|
|
1267
|
-
maxRatingCount:
|
|
1383
|
+
maxRatingCount: m,
|
|
1268
1384
|
assignmentPointsPossible: s
|
|
1269
1385
|
}),
|
|
1270
|
-
[o,
|
|
1271
|
-
), [c, h] =
|
|
1386
|
+
[o, m, s]
|
|
1387
|
+
), [c, h] = y(t), d = Ke(() => h(t), [t]), {
|
|
1272
1388
|
generateCriteriaProgress: u,
|
|
1273
1389
|
generateCriteriaIsPending: p,
|
|
1274
|
-
generateCriteriaIsSuccess:
|
|
1275
|
-
generateCriteriaMutation:
|
|
1276
|
-
generateResponseId:
|
|
1277
|
-
} =
|
|
1390
|
+
generateCriteriaIsSuccess: f,
|
|
1391
|
+
generateCriteriaMutation: C,
|
|
1392
|
+
generateResponseId: g
|
|
1393
|
+
} = Jr({
|
|
1278
1394
|
courseId: r,
|
|
1279
|
-
assignmentId:
|
|
1395
|
+
assignmentId: a,
|
|
1280
1396
|
generateOptions: c,
|
|
1281
|
-
criteriaRef:
|
|
1397
|
+
criteriaRef: n,
|
|
1282
1398
|
setRubricFormField: l
|
|
1283
1399
|
}), {
|
|
1284
|
-
regeneratedCriteriaProgress:
|
|
1400
|
+
regeneratedCriteriaProgress: v,
|
|
1285
1401
|
regenerateCriteriaIsPending: E,
|
|
1286
1402
|
regenerateCriteriaIsSuccess: R,
|
|
1287
|
-
regenerateAllCriteria:
|
|
1288
|
-
regenerateResponseId:
|
|
1289
|
-
regenerateResponseType:
|
|
1290
|
-
} =
|
|
1403
|
+
regenerateAllCriteria: I,
|
|
1404
|
+
regenerateResponseId: L,
|
|
1405
|
+
regenerateResponseType: D
|
|
1406
|
+
} = Zr({
|
|
1291
1407
|
courseId: r,
|
|
1292
|
-
assignmentId:
|
|
1293
|
-
criteriaRef:
|
|
1408
|
+
assignmentId: a,
|
|
1409
|
+
criteriaRef: n,
|
|
1294
1410
|
generateOptions: c,
|
|
1295
1411
|
setRubricFormField: l
|
|
1296
|
-
}),
|
|
1297
|
-
() =>
|
|
1298
|
-
[
|
|
1412
|
+
}), x = Ae(
|
|
1413
|
+
() => f ? Wi(u == null ? void 0 : u.results) : 0,
|
|
1414
|
+
[f, u]
|
|
1299
1415
|
);
|
|
1300
1416
|
return {
|
|
1301
1417
|
options: c,
|
|
1302
1418
|
setOptions: h,
|
|
1303
1419
|
resetOptions: d,
|
|
1304
|
-
generate: () =>
|
|
1305
|
-
regenerateAll:
|
|
1420
|
+
generate: () => C(),
|
|
1421
|
+
regenerateAll: I,
|
|
1306
1422
|
isPending: p || E,
|
|
1307
|
-
progress: E ?
|
|
1308
|
-
isGenerated:
|
|
1309
|
-
lastResult: R ? { kind: "regenerated" } :
|
|
1423
|
+
progress: E ? v : u,
|
|
1424
|
+
isGenerated: f,
|
|
1425
|
+
lastResult: R ? { kind: "regenerated" } : f ? { kind: "generated", count: x } : null,
|
|
1310
1426
|
// Outcome-linked criteria can't be regenerated, so there must be another one.
|
|
1311
1427
|
canRegenerate: i.some((O) => !O.learningOutcomeId),
|
|
1312
|
-
feedbackResponseId:
|
|
1313
|
-
feedbackResponseType:
|
|
1428
|
+
feedbackResponseId: L ?? g ?? "",
|
|
1429
|
+
feedbackResponseType: D ?? ei.GENERATE_CRITERIA
|
|
1314
1430
|
};
|
|
1315
|
-
},
|
|
1316
|
-
|
|
1431
|
+
}, Ki = (r) => /* @__PURE__ */ e(we, { translations: r.translations, children: /* @__PURE__ */ e(
|
|
1432
|
+
je,
|
|
1317
1433
|
{
|
|
1318
1434
|
courseId: r.courseId,
|
|
1319
1435
|
accountId: r.accountId,
|
|
1320
1436
|
featureFlags: r.featureFlags,
|
|
1321
1437
|
aiLimits: r.aiLimits,
|
|
1322
|
-
children: /* @__PURE__ */ e(
|
|
1438
|
+
children: /* @__PURE__ */ e(Xi, { ...r })
|
|
1323
1439
|
}
|
|
1324
|
-
) }),
|
|
1440
|
+
) }), Xi = ({
|
|
1325
1441
|
rubricId: r,
|
|
1326
|
-
rubric:
|
|
1442
|
+
rubric: a,
|
|
1327
1443
|
rubricAssociation: s,
|
|
1328
1444
|
assignmentId: i,
|
|
1329
|
-
assignmentPointsPossible:
|
|
1445
|
+
assignmentPointsPossible: n,
|
|
1330
1446
|
canUseForGrading: l = !0,
|
|
1331
1447
|
accountId: o,
|
|
1332
|
-
courseId:
|
|
1448
|
+
courseId: m,
|
|
1333
1449
|
canManageRubrics: t,
|
|
1334
1450
|
onSaveRubric: c,
|
|
1335
1451
|
onDiscard: h
|
|
1336
1452
|
}) => {
|
|
1337
|
-
var
|
|
1338
|
-
const { translations: d } =
|
|
1453
|
+
var Me;
|
|
1454
|
+
const { translations: d } = B(), { aiRubricsEnabled: u } = ue(), {
|
|
1339
1455
|
rubricForm: p,
|
|
1340
|
-
criteriaRef:
|
|
1341
|
-
setRubricFormField:
|
|
1342
|
-
validateField:
|
|
1343
|
-
validationErrors:
|
|
1456
|
+
criteriaRef: f,
|
|
1457
|
+
setRubricFormField: C,
|
|
1458
|
+
validateField: g,
|
|
1459
|
+
validationErrors: v,
|
|
1344
1460
|
isNewRubric: E,
|
|
1345
|
-
load: { data: R, isLoading:
|
|
1346
|
-
savePending:
|
|
1347
|
-
saveError:
|
|
1461
|
+
load: { data: R, isLoading: I, isError: L, isSuccess: D },
|
|
1462
|
+
savePending: x,
|
|
1463
|
+
saveError: _,
|
|
1348
1464
|
save: O,
|
|
1349
|
-
saveAction:
|
|
1465
|
+
saveAction: Q,
|
|
1350
1466
|
isDirty: W,
|
|
1351
|
-
criteriaValid:
|
|
1352
|
-
criteriaValidationErrors:
|
|
1353
|
-
saveCriterion:
|
|
1354
|
-
deleteCriterion:
|
|
1467
|
+
criteriaValid: J,
|
|
1468
|
+
criteriaValidationErrors: Z,
|
|
1469
|
+
saveCriterion: U,
|
|
1470
|
+
deleteCriterion: ee,
|
|
1355
1471
|
reorderCriteria: j
|
|
1356
|
-
} =
|
|
1472
|
+
} = ii({
|
|
1357
1473
|
rubricId: r,
|
|
1358
|
-
rubric:
|
|
1474
|
+
rubric: a,
|
|
1359
1475
|
rubricAssociation: s,
|
|
1360
1476
|
assignmentId: i,
|
|
1361
|
-
assignmentPointsPossible:
|
|
1477
|
+
assignmentPointsPossible: n,
|
|
1362
1478
|
accountId: o,
|
|
1363
|
-
courseId:
|
|
1479
|
+
courseId: m,
|
|
1364
1480
|
canManageRubrics: t,
|
|
1365
1481
|
onSaveRubric: c
|
|
1366
|
-
}),
|
|
1367
|
-
courseId:
|
|
1482
|
+
}), z = F(null), [K, S] = y(!1), [mr, Ie] = y(!1), [gr, ge] = y(!1), [hr, he] = y(!1), [pr, re] = y(!1), [fr, Le] = y(), Cr = ti(), vr = Ke(() => Le(void 0), []), ie = ji({
|
|
1483
|
+
courseId: m,
|
|
1368
1484
|
assignmentId: i,
|
|
1369
|
-
assignmentPointsPossible:
|
|
1485
|
+
assignmentPointsPossible: n,
|
|
1370
1486
|
criteria: p.criteria,
|
|
1371
|
-
criteriaRef:
|
|
1372
|
-
setRubricFormField:
|
|
1373
|
-
}), [
|
|
1374
|
-
if (r &&
|
|
1375
|
-
return /* @__PURE__ */ e(
|
|
1376
|
-
if (r &&
|
|
1377
|
-
return
|
|
1378
|
-
errorImageUrl:
|
|
1487
|
+
criteriaRef: f,
|
|
1488
|
+
setRubricFormField: C
|
|
1489
|
+
}), [te, ye] = y(!1), ke = F(null), pe = u && E && !!m, [fe, Te] = y(!1), Pe = F(null);
|
|
1490
|
+
if (r && I)
|
|
1491
|
+
return /* @__PURE__ */ e(nr, {});
|
|
1492
|
+
if (r && L)
|
|
1493
|
+
return Ir({
|
|
1494
|
+
errorImageUrl: ni,
|
|
1379
1495
|
errorCategory: d.rubricErrorPageCategory,
|
|
1380
|
-
translations:
|
|
1496
|
+
translations: xe(d)
|
|
1381
1497
|
});
|
|
1382
|
-
if (r &&
|
|
1383
|
-
return
|
|
1384
|
-
const
|
|
1385
|
-
var
|
|
1386
|
-
if (
|
|
1387
|
-
(
|
|
1498
|
+
if (r && D && !R)
|
|
1499
|
+
return Lr({ translations: xe(d) });
|
|
1500
|
+
const De = () => {
|
|
1501
|
+
var w;
|
|
1502
|
+
if (S(!0), !g("title", p.title)) {
|
|
1503
|
+
(w = z.current) == null || w.focus();
|
|
1388
1504
|
return;
|
|
1389
1505
|
}
|
|
1390
|
-
if (!(p.criteria.length === 0 || !
|
|
1391
|
-
switch (
|
|
1506
|
+
if (!(p.criteria.length === 0 || !J))
|
|
1507
|
+
switch (Q) {
|
|
1392
1508
|
case "confirmPointsDifference":
|
|
1393
|
-
|
|
1509
|
+
re(!0);
|
|
1394
1510
|
break;
|
|
1395
1511
|
case "confirmAssessedEdit":
|
|
1396
|
-
|
|
1512
|
+
he(!0);
|
|
1397
1513
|
break;
|
|
1398
1514
|
case "confirmSave":
|
|
1399
|
-
|
|
1515
|
+
ge(!0);
|
|
1400
1516
|
break;
|
|
1401
1517
|
case "save":
|
|
1402
1518
|
O();
|
|
1403
1519
|
break;
|
|
1404
1520
|
default: {
|
|
1405
|
-
const
|
|
1406
|
-
throw new Error(`Unhandled save action: ${
|
|
1521
|
+
const Sr = Q;
|
|
1522
|
+
throw new Error(`Unhandled save action: ${Sr}`);
|
|
1407
1523
|
}
|
|
1408
1524
|
}
|
|
1409
|
-
},
|
|
1410
|
-
const
|
|
1411
|
-
|
|
1412
|
-
},
|
|
1413
|
-
|
|
1525
|
+
}, Rr = () => {
|
|
1526
|
+
const w = oi(Cr());
|
|
1527
|
+
U(w), Le(w.id);
|
|
1528
|
+
}, Ee = () => {
|
|
1529
|
+
var w;
|
|
1530
|
+
Te(!1), (w = Pe.current) == null || w.focus();
|
|
1531
|
+
}, wr = () => {
|
|
1532
|
+
W ? Ie(!0) : h();
|
|
1414
1533
|
};
|
|
1415
|
-
return /* @__PURE__ */ b(
|
|
1416
|
-
/* @__PURE__ */ b(
|
|
1417
|
-
/* @__PURE__ */ e(
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
rubricForm: p,
|
|
1440
|
-
canUseForGrading: l,
|
|
1441
|
-
setRubricFormField: f
|
|
1442
|
-
}
|
|
1443
|
-
)
|
|
1444
|
-
}
|
|
1445
|
-
),
|
|
1446
|
-
/* @__PURE__ */ e(
|
|
1447
|
-
Ci,
|
|
1448
|
-
{
|
|
1449
|
-
criteriaCount: p.criteria.length,
|
|
1450
|
-
showMissingCriteriaError: K,
|
|
1451
|
-
actions: /* @__PURE__ */ b(ve, { children: [
|
|
1452
|
-
he && /* @__PURE__ */ e(
|
|
1453
|
-
H,
|
|
1534
|
+
return /* @__PURE__ */ b(P, { as: "div", "data-testid": "rubric-builder", children: [
|
|
1535
|
+
/* @__PURE__ */ b(k, { gap: "medium", wrap: "wrap", alignItems: "start", padding: "medium 0", children: [
|
|
1536
|
+
/* @__PURE__ */ e(k.Item, { shouldGrow: !0, shouldShrink: !0, size: "20rem", children: /* @__PURE__ */ b(k, { direction: "column", gap: "medium", children: [
|
|
1537
|
+
/* @__PURE__ */ e(
|
|
1538
|
+
Ni,
|
|
1539
|
+
{
|
|
1540
|
+
isNewRubric: E,
|
|
1541
|
+
pointsPossible: p.pointsPossible,
|
|
1542
|
+
hidePoints: p.hidePoints
|
|
1543
|
+
}
|
|
1544
|
+
),
|
|
1545
|
+
_ && /* @__PURE__ */ e(di, { variant: "error", margin: "0", children: d.rubricFormSaveError }),
|
|
1546
|
+
/* @__PURE__ */ e(
|
|
1547
|
+
Fi,
|
|
1548
|
+
{
|
|
1549
|
+
rubricForm: p,
|
|
1550
|
+
setRubricFormField: C,
|
|
1551
|
+
validateTitle: (w) => g("title", w),
|
|
1552
|
+
titleError: (Me = v.title) == null ? void 0 : Me.message,
|
|
1553
|
+
titleInputRef: (w) => {
|
|
1554
|
+
z.current = w;
|
|
1555
|
+
},
|
|
1556
|
+
assignmentSettings: /* @__PURE__ */ e(
|
|
1557
|
+
ki,
|
|
1454
1558
|
{
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
"aria-controls": ir,
|
|
1459
|
-
onClick: () => Ie((D) => !D),
|
|
1460
|
-
elementRef: (D) => {
|
|
1461
|
-
ke.current = D;
|
|
1462
|
-
},
|
|
1463
|
-
"data-testid": "rubric-builder-generator-toggle",
|
|
1464
|
-
children: d.rubricBuilderGeneratorToggle
|
|
1559
|
+
rubricForm: p,
|
|
1560
|
+
canUseForGrading: l,
|
|
1561
|
+
setRubricFormField: C
|
|
1465
1562
|
}
|
|
1466
|
-
)
|
|
1467
|
-
|
|
1468
|
-
|
|
1563
|
+
)
|
|
1564
|
+
}
|
|
1565
|
+
),
|
|
1566
|
+
/* @__PURE__ */ e(
|
|
1567
|
+
Ti,
|
|
1568
|
+
{
|
|
1569
|
+
criteriaCount: p.criteria.length,
|
|
1570
|
+
showMissingCriteriaError: K,
|
|
1571
|
+
actions: /* @__PURE__ */ b(Se, { children: [
|
|
1572
|
+
pe && /* @__PURE__ */ e(
|
|
1573
|
+
H,
|
|
1574
|
+
{
|
|
1575
|
+
color: te ? "ai-primary" : "ai-secondary",
|
|
1576
|
+
renderIcon: te ? /* @__PURE__ */ e(me, {}) : /* @__PURE__ */ e(sr, {}),
|
|
1577
|
+
"aria-expanded": te,
|
|
1578
|
+
"aria-controls": br,
|
|
1579
|
+
onClick: () => ye((w) => !w),
|
|
1580
|
+
elementRef: (w) => {
|
|
1581
|
+
ke.current = w;
|
|
1582
|
+
},
|
|
1583
|
+
"data-testid": "rubric-builder-generator-toggle",
|
|
1584
|
+
children: d.rubricBuilderGeneratorToggle
|
|
1585
|
+
}
|
|
1586
|
+
),
|
|
1587
|
+
/* @__PURE__ */ e(
|
|
1588
|
+
H,
|
|
1589
|
+
{
|
|
1590
|
+
renderIcon: /* @__PURE__ */ e(lr, {}),
|
|
1591
|
+
onClick: Rr,
|
|
1592
|
+
disabled: ie.isPending,
|
|
1593
|
+
"data-testid": "rubric-builder-add-criterion",
|
|
1594
|
+
children: d.rubricBuilderAddCriterion
|
|
1595
|
+
}
|
|
1596
|
+
)
|
|
1597
|
+
] }),
|
|
1598
|
+
panel: pe && m && // Hidden rather than unmounted, so a run and its result survive a collapse.
|
|
1599
|
+
/* @__PURE__ */ e("div", { hidden: !te, children: /* @__PURE__ */ e(
|
|
1600
|
+
Vi,
|
|
1469
1601
|
{
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1602
|
+
courseId: m,
|
|
1603
|
+
generator: ie,
|
|
1604
|
+
onCancel: () => {
|
|
1605
|
+
var w;
|
|
1606
|
+
ie.resetOptions(), ye(!1), (w = ke.current) == null || w.focus();
|
|
1607
|
+
}
|
|
1475
1608
|
}
|
|
1476
|
-
)
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1609
|
+
) }),
|
|
1610
|
+
children: /* @__PURE__ */ e(
|
|
1611
|
+
xi,
|
|
1612
|
+
{
|
|
1613
|
+
criteria: p.criteria,
|
|
1614
|
+
hidePoints: p.hidePoints,
|
|
1615
|
+
freeFormCriterionComments: p.freeFormCriterionComments,
|
|
1616
|
+
ratingOrder: p.ratingOrder,
|
|
1617
|
+
criteriaValidationErrors: Z,
|
|
1618
|
+
showErrors: K,
|
|
1619
|
+
focusNameCriterionId: fr,
|
|
1620
|
+
onFocusedName: vr,
|
|
1621
|
+
onChangeCriterion: U,
|
|
1622
|
+
onDuplicateCriterion: (w) => U(ai(w)),
|
|
1623
|
+
onDeleteCriterion: ee,
|
|
1624
|
+
onReorderCriteria: j
|
|
1487
1625
|
}
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
onFocusedName: dr,
|
|
1501
|
-
onChangeCriterion: z,
|
|
1502
|
-
onDuplicateCriterion: (D) => z(Vr(D)),
|
|
1503
|
-
onDeleteCriterion: Z,
|
|
1504
|
-
onReorderCriteria: j
|
|
1505
|
-
}
|
|
1506
|
-
)
|
|
1626
|
+
)
|
|
1627
|
+
}
|
|
1628
|
+
),
|
|
1629
|
+
pe && /* @__PURE__ */ e(qi, { generator: ie })
|
|
1630
|
+
] }) }),
|
|
1631
|
+
fe && /* @__PURE__ */ e(k.Item, { shouldGrow: !0, shouldShrink: !0, size: "24rem", children: /* @__PURE__ */ e(
|
|
1632
|
+
Gi,
|
|
1633
|
+
{
|
|
1634
|
+
rubric: p,
|
|
1635
|
+
savePending: x,
|
|
1636
|
+
onClose: Ee,
|
|
1637
|
+
onSave: De
|
|
1507
1638
|
}
|
|
1508
|
-
)
|
|
1509
|
-
he && /* @__PURE__ */ e(Ai, { generator: re })
|
|
1639
|
+
) })
|
|
1510
1640
|
] }),
|
|
1511
1641
|
/* @__PURE__ */ e(
|
|
1512
|
-
|
|
1642
|
+
_i,
|
|
1513
1643
|
{
|
|
1514
|
-
savePending:
|
|
1515
|
-
|
|
1516
|
-
|
|
1644
|
+
savePending: x,
|
|
1645
|
+
isPreviewOpen: fe,
|
|
1646
|
+
previewToggleRef: (w) => {
|
|
1647
|
+
Pe.current = w;
|
|
1648
|
+
},
|
|
1649
|
+
onTogglePreview: () => fe ? Ee() : Te(!0),
|
|
1650
|
+
onDiscard: wr,
|
|
1651
|
+
onSave: De
|
|
1517
1652
|
}
|
|
1518
1653
|
),
|
|
1519
1654
|
/* @__PURE__ */ e(
|
|
1520
|
-
|
|
1655
|
+
se,
|
|
1521
1656
|
{
|
|
1522
|
-
isOpen:
|
|
1657
|
+
isOpen: mr,
|
|
1523
1658
|
heading: d.rubricBuilderDiscardHeading,
|
|
1524
1659
|
body: d.rubricBuilderDiscardBody,
|
|
1525
1660
|
confirmLabel: d.rubricBuilderDiscard,
|
|
1526
1661
|
cancelLabel: d.rubricBuilderKeepEditing,
|
|
1527
1662
|
onConfirm: h,
|
|
1528
|
-
onDismiss: () =>
|
|
1663
|
+
onDismiss: () => Ie(!1),
|
|
1529
1664
|
"data-testid": "rubric-builder-discard-modal"
|
|
1530
1665
|
}
|
|
1531
1666
|
),
|
|
1532
1667
|
/* @__PURE__ */ e(
|
|
1533
|
-
|
|
1668
|
+
se,
|
|
1534
1669
|
{
|
|
1535
|
-
isOpen:
|
|
1670
|
+
isOpen: gr,
|
|
1536
1671
|
heading: d.confirmToContinueHeader,
|
|
1537
1672
|
body: d.gradingHistoryWarning,
|
|
1538
1673
|
confirmLabel: d.saveConfirmModalSave,
|
|
1539
1674
|
cancelLabel: d.cancel,
|
|
1540
1675
|
onConfirm: () => {
|
|
1541
|
-
|
|
1676
|
+
ge(!1), O();
|
|
1542
1677
|
},
|
|
1543
|
-
onDismiss: () =>
|
|
1678
|
+
onDismiss: () => ge(!1),
|
|
1544
1679
|
"data-testid": "rubric-builder-save-confirm-modal"
|
|
1545
1680
|
}
|
|
1546
1681
|
),
|
|
1547
1682
|
/* @__PURE__ */ e(
|
|
1548
|
-
|
|
1683
|
+
se,
|
|
1549
1684
|
{
|
|
1550
|
-
isOpen:
|
|
1685
|
+
isOpen: hr,
|
|
1551
1686
|
heading: d.confirmToContinueHeader,
|
|
1552
1687
|
body: d.gradingHistoryWarning,
|
|
1553
1688
|
confirmLabel: d.editConfirmModalConfirm,
|
|
1554
1689
|
cancelLabel: d.cancel,
|
|
1555
1690
|
onConfirm: () => {
|
|
1556
|
-
|
|
1691
|
+
he(!1), O();
|
|
1557
1692
|
},
|
|
1558
|
-
onDismiss: () =>
|
|
1693
|
+
onDismiss: () => he(!1),
|
|
1559
1694
|
"data-testid": "rubric-builder-assessed-edit-modal"
|
|
1560
1695
|
}
|
|
1561
1696
|
),
|
|
1562
1697
|
/* @__PURE__ */ e(
|
|
1563
|
-
|
|
1698
|
+
Ai,
|
|
1564
1699
|
{
|
|
1565
|
-
isOpen:
|
|
1566
|
-
assignmentPoints:
|
|
1700
|
+
isOpen: pr,
|
|
1701
|
+
assignmentPoints: n ?? 0,
|
|
1567
1702
|
rubricPoints: p.pointsPossible,
|
|
1568
1703
|
onChange: () => {
|
|
1569
|
-
|
|
1704
|
+
re(!1), O(!1);
|
|
1570
1705
|
},
|
|
1571
1706
|
onLeaveDifferent: () => {
|
|
1572
|
-
|
|
1707
|
+
re(!1), O(!0);
|
|
1573
1708
|
},
|
|
1574
|
-
onDismiss: () =>
|
|
1709
|
+
onDismiss: () => re(!1)
|
|
1575
1710
|
}
|
|
1576
1711
|
)
|
|
1577
1712
|
] });
|
|
1578
|
-
},
|
|
1579
|
-
|
|
1713
|
+
}, Nt = (r) => /* @__PURE__ */ e(we, { translations: r.translations, children: /* @__PURE__ */ e(
|
|
1714
|
+
je,
|
|
1580
1715
|
{
|
|
1581
1716
|
courseId: r.courseId,
|
|
1582
1717
|
featureFlags: r.featureFlags,
|
|
1583
1718
|
aiLimits: r.aiLimits,
|
|
1584
|
-
children: /* @__PURE__ */ e(
|
|
1719
|
+
children: /* @__PURE__ */ e(Yi, { ...r })
|
|
1585
1720
|
}
|
|
1586
|
-
) }),
|
|
1721
|
+
) }), Yi = ({
|
|
1587
1722
|
courseId: r,
|
|
1588
|
-
assignmentId:
|
|
1723
|
+
assignmentId: a,
|
|
1589
1724
|
assignmentPointsPossible: s,
|
|
1590
1725
|
canManageRubrics: i,
|
|
1591
|
-
canUseForGrading:
|
|
1726
|
+
canUseForGrading: n = !0,
|
|
1592
1727
|
featureFlags: l,
|
|
1593
1728
|
aiLimits: o,
|
|
1594
|
-
onAssignmentPointsPossibleChange:
|
|
1729
|
+
onAssignmentPointsPossibleChange: m,
|
|
1595
1730
|
onRubricChange: t
|
|
1596
1731
|
}) => {
|
|
1597
|
-
const { translations: c } =
|
|
1732
|
+
const { translations: c } = B(), h = We(), { rubric: d, rubricAssociation: u, isLoading: p, error: f, applySavedRubric: C, reload: g } = li({
|
|
1598
1733
|
courseId: r,
|
|
1599
|
-
assignmentId:
|
|
1600
|
-
canUseForGrading:
|
|
1601
|
-
onAssignmentPointsPossibleChange:
|
|
1734
|
+
assignmentId: a,
|
|
1735
|
+
canUseForGrading: n,
|
|
1736
|
+
onAssignmentPointsPossibleChange: m,
|
|
1602
1737
|
onRubricChange: t
|
|
1603
|
-
}), [
|
|
1604
|
-
|
|
1605
|
-
var
|
|
1606
|
-
|
|
1607
|
-
}, [
|
|
1608
|
-
const
|
|
1609
|
-
|
|
1738
|
+
}), [v, E] = y(0), R = F(null), I = () => E((D) => D + 1);
|
|
1739
|
+
N(() => {
|
|
1740
|
+
var D, x;
|
|
1741
|
+
v > 0 && ((x = (D = R.current) == null ? void 0 : D.querySelector('input[data-testid="rubric-builder-name"]')) == null || x.focus());
|
|
1742
|
+
}, [v]);
|
|
1743
|
+
const L = (D, x) => C(D, x, () => {
|
|
1744
|
+
g().finally(I);
|
|
1610
1745
|
});
|
|
1611
|
-
return p ? /* @__PURE__ */ e(
|
|
1612
|
-
|
|
1746
|
+
return p ? /* @__PURE__ */ e(nr, {}) : f ? /* @__PURE__ */ e(Bi, { variant: "error", children: c.rubricAssignmentContainerLoadError }) : /* @__PURE__ */ e("div", { ref: R, children: /* @__PURE__ */ e(
|
|
1747
|
+
Ki,
|
|
1613
1748
|
{
|
|
1614
1749
|
translations: h,
|
|
1615
1750
|
courseId: r,
|
|
1616
1751
|
featureFlags: l,
|
|
1617
1752
|
aiLimits: o,
|
|
1618
|
-
assignmentId:
|
|
1753
|
+
assignmentId: a,
|
|
1619
1754
|
assignmentPointsPossible: s,
|
|
1620
1755
|
rubric: d,
|
|
1621
1756
|
rubricAssociation: u,
|
|
1622
|
-
canUseForGrading:
|
|
1757
|
+
canUseForGrading: n,
|
|
1623
1758
|
canManageRubrics: i,
|
|
1624
|
-
onSaveRubric:
|
|
1625
|
-
onDiscard:
|
|
1759
|
+
onSaveRubric: L,
|
|
1760
|
+
onDiscard: I
|
|
1626
1761
|
},
|
|
1627
|
-
|
|
1762
|
+
v
|
|
1628
1763
|
) });
|
|
1629
1764
|
};
|
|
1630
1765
|
export {
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1766
|
+
zt as DEFAULT_AI_MAX_CRITERION_COUNT,
|
|
1767
|
+
$t as DEFAULT_AI_MAX_RATING_COUNT,
|
|
1768
|
+
Gt as HelloWorld,
|
|
1769
|
+
Nt as RubricAssignmentBuilder,
|
|
1770
|
+
Ki as RubricBuilder,
|
|
1771
|
+
_t as RubricSelector,
|
|
1772
|
+
Ut as defaultRubricsTranslations
|
|
1638
1773
|
};
|