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