@instructure/platform-rubrics 3.0.1 → 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/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 +18 -0
- package/dist/_internal/constants/i18n.d.ts.map +1 -1
- package/dist/_internal/utils/i18n.d.ts +18 -0
- package/dist/_internal/utils/i18n.d.ts.map +1 -1
- package/dist/canvas.js +3679 -9389
- package/dist/chunks/{errorPage-CYyehhNJ.js → errorPage-C2-lUC8H.js} +209 -151
- package/dist/chunks/useAssignmentRubricState-DpcMVo45.js +10497 -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/RubricBuilderFooter.d.ts +4 -1
- package/dist/foundation/RubricBuilder/components/RubricBuilderFooter.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/components/preview/RubricPreviewPanel.d.ts +10 -0
- package/dist/foundation/RubricBuilder/components/preview/RubricPreviewPanel.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 +1304 -571
- package/dist/index.js +8 -9
- package/locales/en.json +18 -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/chunks/useLocalStorage-BoUaI48x.js +0 -41
- /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 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
|
|
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 {
|
|
33
|
-
|
|
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
|
+
import { Text as G } from "@instructure/ui-text";
|
|
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
|
+
import { TextArea as ce } from "@instructure/ui-text-area/v11_7";
|
|
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`
|
|
34
42
|
query CourseRubricsList($courseId: ID!, $first: Int) {
|
|
35
43
|
course(id: $courseId) {
|
|
36
44
|
rubricsConnection(first: $first) {
|
|
@@ -48,493 +56,495 @@ 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 Li(r) {
|
|
60
|
+
const { executeQuery: a } = be();
|
|
61
|
+
return Tr({
|
|
54
62
|
queryKey: ["courseRubrics", r],
|
|
55
63
|
queryFn: async () => {
|
|
56
|
-
var
|
|
57
|
-
const { course: s } = await
|
|
64
|
+
var n;
|
|
65
|
+
const { course: s } = await a(Ii, {
|
|
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
|
-
hasMore: ((
|
|
73
|
+
hasMore: ((n = i == null ? void 0 : i.pageInfo) == null ? void 0 : n.hasNextPage) ?? !1
|
|
66
74
|
};
|
|
67
75
|
},
|
|
68
76
|
enabled: !!r
|
|
69
77
|
});
|
|
70
78
|
}
|
|
71
|
-
const
|
|
79
|
+
const _t = (r) => /* @__PURE__ */ e(we, { translations: r.translations, children: /* @__PURE__ */ e(yi, { ...r }) }), yi = ({
|
|
72
80
|
courseId: r,
|
|
73
|
-
value:
|
|
81
|
+
value: a,
|
|
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 } = 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: [
|
|
82
90
|
i.rubricSelectorErrorTitle,
|
|
83
91
|
". ",
|
|
84
92
|
i.rubricSelectorErrorBody
|
|
85
93
|
] }) }),
|
|
86
|
-
/* @__PURE__ */ e(
|
|
87
|
-
] }) }) : !
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
-
|
|
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
|
+
/* @__PURE__ */ b(
|
|
97
|
+
Ce,
|
|
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: a ?? "",
|
|
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
|
+
a === void 0 && /* @__PURE__ */ e(Ce.Option, { id: "rubrics-rubric-selector-placeholder", value: "", children: i.rubricSelectorPlaceholder }),
|
|
109
|
+
t.map((c) => /* @__PURE__ */ e(
|
|
110
|
+
Ce.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
|
-
(
|
|
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 }) })
|
|
114
122
|
] });
|
|
115
|
-
},
|
|
123
|
+
}, ki = ({
|
|
116
124
|
rubricForm: r,
|
|
117
|
-
canUseForGrading:
|
|
125
|
+
canUseForGrading: a,
|
|
118
126
|
setRubricFormField: s
|
|
119
127
|
}) => {
|
|
120
|
-
const { translations: i } =
|
|
121
|
-
const
|
|
122
|
-
s("useForGrading",
|
|
128
|
+
const { translations: i } = B(), { hidePoints: n, useForGrading: l, hideScoreTotal: o, hideOutcomeResults: m } = r, t = (c) => {
|
|
129
|
+
const h = Pr(c);
|
|
130
|
+
s("useForGrading", h.useForGrading), s("hideScoreTotal", h.hideScoreTotal);
|
|
123
131
|
};
|
|
124
|
-
return /* @__PURE__ */
|
|
132
|
+
return /* @__PURE__ */ b(T, { direction: "column", gap: "small", "data-testid": "rubric-builder-assignment-settings", children: [
|
|
125
133
|
/* @__PURE__ */ e(
|
|
126
|
-
|
|
134
|
+
le,
|
|
127
135
|
{
|
|
128
136
|
variant: "toggle",
|
|
129
137
|
label: i.hideOutcomeResultsLabel,
|
|
130
|
-
checked:
|
|
131
|
-
onChange: (
|
|
138
|
+
checked: m,
|
|
139
|
+
onChange: (c) => s("hideOutcomeResults", c.target.checked),
|
|
132
140
|
"data-testid": "rubric-builder-hide-outcome-results"
|
|
133
141
|
}
|
|
134
142
|
),
|
|
135
|
-
!
|
|
136
|
-
|
|
143
|
+
!n && a && /* @__PURE__ */ e(
|
|
144
|
+
le,
|
|
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
|
-
!
|
|
146
|
-
|
|
153
|
+
!n && !l && /* @__PURE__ */ e(
|
|
154
|
+
le,
|
|
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
|
+
}, se = ({
|
|
157
165
|
isOpen: r,
|
|
158
|
-
heading:
|
|
166
|
+
heading: a,
|
|
159
167
|
body: s,
|
|
160
168
|
confirmLabel: i,
|
|
161
|
-
cancelLabel:
|
|
162
|
-
onConfirm:
|
|
163
|
-
onDismiss:
|
|
164
|
-
"data-testid":
|
|
169
|
+
cancelLabel: n,
|
|
170
|
+
onConfirm: l,
|
|
171
|
+
onDismiss: o,
|
|
172
|
+
"data-testid": m
|
|
165
173
|
}) => {
|
|
166
|
-
const { translations:
|
|
167
|
-
return /* @__PURE__ */
|
|
168
|
-
/* @__PURE__ */
|
|
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: [
|
|
169
177
|
/* @__PURE__ */ e(
|
|
170
|
-
|
|
178
|
+
yr,
|
|
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(V, { level: "h2", children: a })
|
|
179
187
|
] }),
|
|
180
|
-
/* @__PURE__ */ e(
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
/* @__PURE__ */ e(
|
|
183
|
-
/* @__PURE__ */ e(
|
|
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
|
+
/* @__PURE__ */ e(H, { color: "primary", onClick: l, "data-testid": "confirm-modal-confirm", children: i })
|
|
184
192
|
] })
|
|
185
193
|
] });
|
|
186
|
-
},
|
|
194
|
+
}, Ti = ({
|
|
187
195
|
criteriaCount: r,
|
|
188
|
-
showMissingCriteriaError:
|
|
196
|
+
showMissingCriteriaError: a,
|
|
189
197
|
actions: s,
|
|
190
|
-
|
|
198
|
+
panel: i,
|
|
199
|
+
children: n
|
|
191
200
|
}) => {
|
|
192
|
-
const { translations:
|
|
193
|
-
return /* @__PURE__ */
|
|
194
|
-
/* @__PURE__ */
|
|
195
|
-
/* @__PURE__ */ e(
|
|
196
|
-
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 })
|
|
197
206
|
] }),
|
|
198
|
-
|
|
199
|
-
/* @__PURE__ */ e(
|
|
207
|
+
i,
|
|
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 }) })
|
|
200
210
|
] });
|
|
201
|
-
},
|
|
202
|
-
const { translations: s } =
|
|
203
|
-
return
|
|
204
|
-
|
|
211
|
+
}, Pi = ({ points: r, onCommit: a }) => {
|
|
212
|
+
const { translations: s } = B(), [i, n] = y(String(r));
|
|
213
|
+
return N(() => {
|
|
214
|
+
n(String(r));
|
|
205
215
|
}, [r]), /* @__PURE__ */ e(
|
|
206
|
-
|
|
216
|
+
X,
|
|
207
217
|
{
|
|
208
218
|
renderLabel: s.rubricBuilderPointsPossibleLabel,
|
|
209
219
|
width: "8rem",
|
|
210
220
|
value: i,
|
|
211
|
-
onChange: (
|
|
212
|
-
onBlur: (
|
|
213
|
-
const
|
|
214
|
-
|
|
221
|
+
onChange: (l) => n(l.target.value),
|
|
222
|
+
onBlur: (l) => {
|
|
223
|
+
const o = Dr(l.target.value);
|
|
224
|
+
n(String(o)), o !== r && a(o);
|
|
215
225
|
},
|
|
216
226
|
"data-testid": "rubric-builder-points-possible"
|
|
217
227
|
}
|
|
218
228
|
);
|
|
219
|
-
},
|
|
229
|
+
}, Di = ({
|
|
220
230
|
rating: r,
|
|
221
|
-
sortableId:
|
|
231
|
+
sortableId: a,
|
|
222
232
|
position: s,
|
|
223
233
|
rangeStart: i,
|
|
224
|
-
useRange:
|
|
225
|
-
hidePoints:
|
|
226
|
-
showNameError:
|
|
227
|
-
canRemove:
|
|
228
|
-
onChange:
|
|
229
|
-
onPointsBlur:
|
|
230
|
-
onRemove:
|
|
234
|
+
useRange: n,
|
|
235
|
+
hidePoints: l,
|
|
236
|
+
showNameError: o,
|
|
237
|
+
canRemove: m,
|
|
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 } = 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));
|
|
237
247
|
}, [r.points]);
|
|
238
|
-
const
|
|
239
|
-
|
|
248
|
+
const I = (L, D) => {
|
|
249
|
+
R(D), t({ ...r, points: L });
|
|
240
250
|
};
|
|
241
251
|
return /* @__PURE__ */ e(
|
|
242
252
|
"div",
|
|
243
253
|
{
|
|
244
|
-
ref:
|
|
245
|
-
style: { transform:
|
|
254
|
+
ref: C,
|
|
255
|
+
style: { transform: Ye.Transform.toString(g), transition: v },
|
|
246
256
|
"data-testid": "rubric-builder-rating-row",
|
|
247
|
-
children: /* @__PURE__ */
|
|
257
|
+
children: /* @__PURE__ */ b(k, { gap: "small", alignItems: "start", wrap: "wrap", margin: "0 0 small", children: [
|
|
248
258
|
/* @__PURE__ */ e(
|
|
249
|
-
|
|
259
|
+
P,
|
|
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
|
+
...f,
|
|
267
|
+
children: /* @__PURE__ */ e(ar, { "aria-hidden": "true" })
|
|
258
268
|
}
|
|
259
269
|
),
|
|
260
|
-
/* @__PURE__ */ e(
|
|
261
|
-
!
|
|
262
|
-
|
|
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 }) }) }),
|
|
263
273
|
/* @__PURE__ */ e(
|
|
264
|
-
|
|
274
|
+
pi,
|
|
265
275
|
{
|
|
266
|
-
renderLabel:
|
|
276
|
+
renderLabel: n ? 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: (L, D) => {
|
|
282
|
+
Er(D) && I(Oe(D), D);
|
|
273
283
|
},
|
|
274
284
|
onIncrement: () => {
|
|
275
|
-
const
|
|
276
|
-
|
|
285
|
+
const L = Ge(Math.floor(r.points) + 1);
|
|
286
|
+
I(L, String(L));
|
|
277
287
|
},
|
|
278
288
|
onDecrement: () => {
|
|
279
|
-
const
|
|
280
|
-
|
|
289
|
+
const L = Ge(Math.floor(r.points) - 1);
|
|
290
|
+
I(L, String(L));
|
|
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(k.Item, { shouldGrow: !0, shouldShrink: !0, size: "10rem", children: /* @__PURE__ */ e(
|
|
298
|
+
X,
|
|
289
299
|
{
|
|
290
|
-
renderLabel:
|
|
300
|
+
renderLabel: d.rubricBuilderRatingNameLabel,
|
|
291
301
|
isRequired: !0,
|
|
292
302
|
value: r.description,
|
|
293
|
-
onChange: (
|
|
294
|
-
messages:
|
|
303
|
+
onChange: (L) => t({ ...r, description: L.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(k.Item, { shouldGrow: !0, shouldShrink: !0, size: "14rem", children: /* @__PURE__ */ e(
|
|
309
|
+
X,
|
|
300
310
|
{
|
|
301
|
-
renderLabel:
|
|
311
|
+
renderLabel: d.rubricBuilderRatingDescriptionLabel,
|
|
302
312
|
value: r.longDescription,
|
|
303
|
-
onChange: (
|
|
313
|
+
onChange: (L) => t({ ...r, longDescription: L.target.value }),
|
|
304
314
|
"data-testid": "rubric-builder-rating-description"
|
|
305
315
|
}
|
|
306
316
|
) }),
|
|
307
|
-
|
|
308
|
-
|
|
317
|
+
m && /* @__PURE__ */ e(P, { as: "div", margin: "medium 0 0", children: /* @__PURE__ */ e(
|
|
318
|
+
oe,
|
|
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(or, {})
|
|
316
326
|
}
|
|
317
327
|
) })
|
|
318
328
|
] })
|
|
319
329
|
}
|
|
320
330
|
);
|
|
321
|
-
},
|
|
331
|
+
}, Ei = ({
|
|
322
332
|
ratings: r,
|
|
323
|
-
useRange:
|
|
333
|
+
useRange: a,
|
|
324
334
|
hidePoints: s,
|
|
325
335
|
ratingOrder: i,
|
|
326
|
-
ratingNamesRequired:
|
|
327
|
-
onChange:
|
|
336
|
+
ratingNamesRequired: n,
|
|
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 } = 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
|
+
if (!p || u.id === p.id) return;
|
|
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 }));
|
|
338
348
|
}, children: /* @__PURE__ */ e(
|
|
339
|
-
|
|
349
|
+
ir,
|
|
340
350
|
{
|
|
341
|
-
items:
|
|
342
|
-
strategy:
|
|
343
|
-
children:
|
|
344
|
-
|
|
351
|
+
items: h.map((u) => t[u]),
|
|
352
|
+
strategy: tr,
|
|
353
|
+
children: h.map((u, p) => /* @__PURE__ */ e(
|
|
354
|
+
Di,
|
|
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: xr(r, u),
|
|
360
|
+
useRange: a,
|
|
351
361
|
hidePoints: s,
|
|
352
|
-
showNameError:
|
|
362
|
+
showNameError: n.includes(u),
|
|
353
363
|
canRemove: r.length > 1,
|
|
354
|
-
onChange: (
|
|
355
|
-
onPointsBlur: () =>
|
|
356
|
-
onRemove: () =>
|
|
364
|
+
onChange: (f) => l(Gr(r, u, f)),
|
|
365
|
+
onPointsBlur: () => l(Or(r)),
|
|
366
|
+
onRemove: () => l(Ar(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(lr, {}),
|
|
366
376
|
withBackground: !1,
|
|
367
|
-
onClick: () =>
|
|
377
|
+
onClick: () => l(_r(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
|
+
}, Mi = ({
|
|
374
384
|
criterion: r,
|
|
375
|
-
sortableId:
|
|
385
|
+
sortableId: a,
|
|
376
386
|
position: s,
|
|
377
387
|
hidePoints: i,
|
|
378
|
-
freeFormCriterionComments:
|
|
379
|
-
ratingOrder:
|
|
380
|
-
errors:
|
|
381
|
-
showErrors:
|
|
382
|
-
shouldFocusName:
|
|
383
|
-
shouldFocusHandle:
|
|
384
|
-
onNameFocused:
|
|
385
|
-
onHandleFocused:
|
|
386
|
-
onChange:
|
|
387
|
-
onDuplicate:
|
|
388
|
-
onDelete:
|
|
388
|
+
freeFormCriterionComments: n,
|
|
389
|
+
ratingOrder: l,
|
|
390
|
+
errors: o,
|
|
391
|
+
showErrors: m,
|
|
392
|
+
shouldFocusName: t,
|
|
393
|
+
shouldFocusHandle: c,
|
|
394
|
+
onNameFocused: h,
|
|
395
|
+
onHandleFocused: d,
|
|
396
|
+
onChange: u,
|
|
397
|
+
onDuplicate: p,
|
|
398
|
+
onDelete: f
|
|
389
399
|
}) => {
|
|
390
|
-
const { translations:
|
|
391
|
-
id:
|
|
392
|
-
}), [
|
|
393
|
-
return
|
|
394
|
-
|
|
395
|
-
}, [
|
|
396
|
-
var
|
|
397
|
-
|
|
398
|
-
}, [
|
|
399
|
-
var
|
|
400
|
-
|
|
401
|
-
}, [
|
|
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
|
+
}, [c, d]), /* @__PURE__ */ b(
|
|
402
412
|
"div",
|
|
403
413
|
{
|
|
404
|
-
ref:
|
|
405
|
-
style: { transform:
|
|
414
|
+
ref: I,
|
|
415
|
+
style: { transform: Ye.Transform.toString(L), transition: D },
|
|
406
416
|
"data-testid": "rubric-builder-criterion-card",
|
|
407
417
|
children: [
|
|
408
|
-
/* @__PURE__ */
|
|
409
|
-
|
|
418
|
+
/* @__PURE__ */ b(
|
|
419
|
+
P,
|
|
410
420
|
{
|
|
411
421
|
as: "section",
|
|
412
|
-
"aria-label":
|
|
422
|
+
"aria-label": z,
|
|
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: x ? "above" : "none",
|
|
419
429
|
children: [
|
|
420
|
-
/* @__PURE__ */
|
|
430
|
+
/* @__PURE__ */ b(k, { gap: "small", alignItems: "center", wrap: "wrap", children: [
|
|
421
431
|
/* @__PURE__ */ e(
|
|
422
432
|
"div",
|
|
423
433
|
{
|
|
424
|
-
ref:
|
|
425
|
-
"aria-label":
|
|
434
|
+
ref: Z,
|
|
435
|
+
"aria-label": g("rubricBuilderReorderCriterion", { name: z }),
|
|
426
436
|
"data-testid": "rubric-builder-criterion-drag-handle",
|
|
427
437
|
...E,
|
|
428
|
-
...
|
|
429
|
-
children: /* @__PURE__ */ e(
|
|
438
|
+
...R,
|
|
439
|
+
children: /* @__PURE__ */ e(ar, { "aria-hidden": "true" })
|
|
430
440
|
}
|
|
431
441
|
),
|
|
432
442
|
/* @__PURE__ */ e(
|
|
433
|
-
|
|
443
|
+
oe,
|
|
434
444
|
{
|
|
435
|
-
screenReaderLabel:
|
|
436
|
-
|
|
437
|
-
{ name:
|
|
445
|
+
screenReaderLabel: g(
|
|
446
|
+
_ ? "rubricBuilderCollapseCriterion" : "rubricBuilderExpandCriterion",
|
|
447
|
+
{ name: z }
|
|
438
448
|
),
|
|
439
|
-
"aria-expanded":
|
|
440
|
-
"aria-controls":
|
|
449
|
+
"aria-expanded": _,
|
|
450
|
+
"aria-controls": K,
|
|
441
451
|
withBackground: !1,
|
|
442
452
|
withBorder: !1,
|
|
443
453
|
size: "small",
|
|
444
|
-
onClick: () =>
|
|
454
|
+
onClick: () => O((S) => !S),
|
|
445
455
|
"data-testid": "rubric-builder-criterion-toggle",
|
|
446
|
-
children:
|
|
456
|
+
children: _ ? /* @__PURE__ */ e(ci, {}) : /* @__PURE__ */ e(ui, {})
|
|
447
457
|
}
|
|
448
458
|
),
|
|
449
|
-
|
|
450
|
-
|
|
459
|
+
n && /* @__PURE__ */ e(
|
|
460
|
+
bi,
|
|
451
461
|
{
|
|
452
|
-
title:
|
|
462
|
+
title: C.rubricBuilderWrittenFeedback,
|
|
453
463
|
"data-testid": "rubric-builder-criterion-written-icon"
|
|
454
464
|
}
|
|
455
465
|
),
|
|
456
|
-
/* @__PURE__ */ e(
|
|
457
|
-
|
|
458
|
-
|
|
466
|
+
/* @__PURE__ */ e(k.Item, { shouldGrow: !0, shouldShrink: !0, children: /* @__PURE__ */ b(V, { level: "h4", children: [
|
|
467
|
+
ee,
|
|
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(cr, { "data-testid": "rubric-builder-criterion-max", children: g("rubricBuilderCriterionMaxPoints", { count: r.points }) }),
|
|
461
471
|
/* @__PURE__ */ e(
|
|
462
|
-
|
|
472
|
+
oe,
|
|
463
473
|
{
|
|
464
|
-
screenReaderLabel:
|
|
474
|
+
screenReaderLabel: g("rubricBuilderDuplicateCriterion", { name: z }),
|
|
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(mi, {})
|
|
470
480
|
}
|
|
471
481
|
),
|
|
472
482
|
/* @__PURE__ */ e(
|
|
473
|
-
|
|
483
|
+
oe,
|
|
474
484
|
{
|
|
475
|
-
screenReaderLabel:
|
|
485
|
+
screenReaderLabel: g("rubricBuilderDeleteCriterion", { name: z }),
|
|
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(or, {})
|
|
481
491
|
}
|
|
482
492
|
)
|
|
483
493
|
] }),
|
|
484
|
-
|
|
494
|
+
_ && /* @__PURE__ */ e(P, { as: "div", id: K, margin: "medium 0 0", children: /* @__PURE__ */ b(k, { direction: "column", gap: "medium", children: [
|
|
485
495
|
/* @__PURE__ */ e(
|
|
486
|
-
|
|
496
|
+
X,
|
|
487
497
|
{
|
|
488
|
-
renderLabel:
|
|
498
|
+
renderLabel: C.rubricBuilderCriterionNameLabel,
|
|
489
499
|
isRequired: !0,
|
|
490
500
|
value: r.description,
|
|
491
|
-
inputRef: (
|
|
492
|
-
|
|
501
|
+
inputRef: (S) => {
|
|
502
|
+
J.current = S;
|
|
493
503
|
},
|
|
494
|
-
onChange: (
|
|
495
|
-
messages:
|
|
504
|
+
onChange: (S) => u({ ...r, description: S.target.value }),
|
|
505
|
+
messages: m && o.nameRequired ? [{ text: C.rubricBuilderCriterionNameRequired, type: "error" }] : [],
|
|
496
506
|
"data-testid": "rubric-builder-criterion-name-input"
|
|
497
507
|
}
|
|
498
508
|
),
|
|
499
509
|
/* @__PURE__ */ e(
|
|
500
|
-
|
|
510
|
+
hi,
|
|
501
511
|
{
|
|
502
|
-
label:
|
|
512
|
+
label: C.rubricBuilderCriterionDescriptionLabel,
|
|
503
513
|
value: r.longDescription ?? "",
|
|
504
|
-
onChange: (
|
|
514
|
+
onChange: (S) => u({ ...r, longDescription: S.target.value }),
|
|
505
515
|
"data-testid": "rubric-builder-criterion-description"
|
|
506
516
|
}
|
|
507
517
|
),
|
|
508
|
-
|
|
509
|
-
|
|
518
|
+
v && !i && !n && /* @__PURE__ */ e(
|
|
519
|
+
gi,
|
|
510
520
|
{
|
|
511
521
|
variant: "toggle",
|
|
512
|
-
label:
|
|
522
|
+
label: C.rubricBuilderEnableRange,
|
|
513
523
|
checked: r.criterionUseRange,
|
|
514
|
-
onChange: (
|
|
524
|
+
onChange: (S) => u({ ...r, criterionUseRange: S.target.checked }),
|
|
515
525
|
"data-testid": "rubric-builder-enable-range"
|
|
516
526
|
}
|
|
517
527
|
),
|
|
518
|
-
|
|
519
|
-
|
|
528
|
+
n ? !i && /* @__PURE__ */ e(
|
|
529
|
+
Pi,
|
|
520
530
|
{
|
|
521
531
|
points: r.points,
|
|
522
|
-
onCommit: (
|
|
523
|
-
|
|
532
|
+
onCommit: (S) => u(
|
|
533
|
+
_e(
|
|
524
534
|
r,
|
|
525
|
-
|
|
535
|
+
Hr(r.ratings, S)
|
|
526
536
|
)
|
|
527
537
|
)
|
|
528
538
|
}
|
|
529
539
|
) : /* @__PURE__ */ e(
|
|
530
|
-
|
|
540
|
+
Ei,
|
|
531
541
|
{
|
|
532
542
|
ratings: r.ratings,
|
|
533
543
|
useRange: r.criterionUseRange && !i,
|
|
534
544
|
hidePoints: i,
|
|
535
|
-
ratingOrder:
|
|
536
|
-
ratingNamesRequired:
|
|
537
|
-
onChange: (
|
|
545
|
+
ratingOrder: l,
|
|
546
|
+
ratingNamesRequired: m ? o.ratingNamesRequired : [],
|
|
547
|
+
onChange: (S) => u(_e(r, S))
|
|
538
548
|
}
|
|
539
549
|
)
|
|
540
550
|
] }) })
|
|
@@ -542,127 +552,232 @@ const Di = (r) => /* @__PURE__ */ e(be, { translations: r.translations, children
|
|
|
542
552
|
}
|
|
543
553
|
),
|
|
544
554
|
/* @__PURE__ */ e(
|
|
545
|
-
|
|
555
|
+
se,
|
|
546
556
|
{
|
|
547
|
-
isOpen:
|
|
548
|
-
heading:
|
|
549
|
-
body:
|
|
550
|
-
confirmLabel:
|
|
551
|
-
cancelLabel:
|
|
557
|
+
isOpen: Q,
|
|
558
|
+
heading: C.rubricBuilderCriterionDeleteHeading,
|
|
559
|
+
body: C.rubricBuilderCriterionDeleteBody,
|
|
560
|
+
confirmLabel: C.delete,
|
|
561
|
+
cancelLabel: C.cancel,
|
|
552
562
|
onConfirm: () => {
|
|
553
|
-
|
|
563
|
+
W(!1), f();
|
|
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
|
+
}, xi = ({
|
|
563
573
|
criteria: r,
|
|
564
|
-
hidePoints:
|
|
574
|
+
hidePoints: a,
|
|
565
575
|
freeFormCriterionComments: s,
|
|
566
576
|
ratingOrder: i,
|
|
567
|
-
criteriaValidationErrors:
|
|
568
|
-
showErrors:
|
|
569
|
-
focusNameCriterionId:
|
|
570
|
-
onFocusedName:
|
|
571
|
-
onChangeCriterion:
|
|
572
|
-
onDuplicateCriterion:
|
|
573
|
-
onDeleteCriterion:
|
|
574
|
-
onReorderCriteria:
|
|
577
|
+
criteriaValidationErrors: n,
|
|
578
|
+
showErrors: l,
|
|
579
|
+
focusNameCriterionId: o,
|
|
580
|
+
onFocusedName: m,
|
|
581
|
+
onChangeCriterion: t,
|
|
582
|
+
onDuplicateCriterion: c,
|
|
583
|
+
onDeleteCriterion: h,
|
|
584
|
+
onReorderCriteria: d
|
|
575
585
|
}) => {
|
|
576
586
|
const {
|
|
577
|
-
sortableIds:
|
|
578
|
-
movedCriterionId:
|
|
579
|
-
clearMovedCriterion:
|
|
580
|
-
srAnnouncement:
|
|
581
|
-
moveCriterionBySortableId:
|
|
582
|
-
} =
|
|
583
|
-
|
|
584
|
-
|
|
587
|
+
sortableIds: u,
|
|
588
|
+
movedCriterionId: p,
|
|
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 })
|
|
585
595
|
);
|
|
586
|
-
return /* @__PURE__ */
|
|
587
|
-
/* @__PURE__ */ e(
|
|
588
|
-
/* @__PURE__ */ e(
|
|
589
|
-
|
|
590
|
-
}, children: /* @__PURE__ */ e(
|
|
591
|
-
|
|
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,
|
|
592
602
|
{
|
|
593
|
-
criterion:
|
|
594
|
-
sortableId:
|
|
595
|
-
position:
|
|
596
|
-
hidePoints:
|
|
603
|
+
criterion: R,
|
|
604
|
+
sortableId: u[I],
|
|
605
|
+
position: I + 1,
|
|
606
|
+
hidePoints: a,
|
|
597
607
|
freeFormCriterionComments: s,
|
|
598
608
|
ratingOrder: i,
|
|
599
|
-
errors:
|
|
600
|
-
showErrors:
|
|
601
|
-
shouldFocusName:
|
|
602
|
-
shouldFocusHandle:
|
|
603
|
-
onNameFocused:
|
|
604
|
-
onHandleFocused:
|
|
605
|
-
onChange:
|
|
606
|
-
onDuplicate: () =>
|
|
607
|
-
onDelete: () =>
|
|
609
|
+
errors: n[I],
|
|
610
|
+
showErrors: l,
|
|
611
|
+
shouldFocusName: R.id === o,
|
|
612
|
+
shouldFocusHandle: R.id === p,
|
|
613
|
+
onNameFocused: m,
|
|
614
|
+
onHandleFocused: f,
|
|
615
|
+
onChange: t,
|
|
616
|
+
onDuplicate: () => c(R),
|
|
617
|
+
onDelete: () => h(R)
|
|
608
618
|
},
|
|
609
|
-
|
|
619
|
+
u[I]
|
|
610
620
|
)) }) })
|
|
611
621
|
] });
|
|
612
|
-
},
|
|
622
|
+
}, Ai = ({
|
|
613
623
|
isOpen: r,
|
|
614
|
-
assignmentPoints:
|
|
624
|
+
assignmentPoints: a,
|
|
615
625
|
rubricPoints: s,
|
|
616
626
|
onChange: i,
|
|
617
|
-
onLeaveDifferent:
|
|
618
|
-
onDismiss:
|
|
627
|
+
onLeaveDifferent: n,
|
|
628
|
+
onDismiss: l
|
|
619
629
|
}) => {
|
|
620
|
-
const { translations:
|
|
621
|
-
return /* @__PURE__ */
|
|
622
|
-
|
|
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
|
+
return /* @__PURE__ */ b(
|
|
632
|
+
M,
|
|
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(M.Header, { children: [
|
|
631
641
|
/* @__PURE__ */ e(
|
|
632
|
-
|
|
642
|
+
Be,
|
|
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(M.Body, { children: /* @__PURE__ */ e(Y, { children: h }) }),
|
|
653
|
+
/* @__PURE__ */ b(M.Footer, { children: [
|
|
644
654
|
/* @__PURE__ */ e(
|
|
645
|
-
|
|
655
|
+
A,
|
|
646
656
|
{
|
|
647
|
-
onClick:
|
|
657
|
+
onClick: n,
|
|
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(A, { color: "primary", onClick: i, "data-testid": "rubric-builder-change-points", children: o.pointsDifferenceModalChange })
|
|
654
664
|
] })
|
|
655
665
|
]
|
|
656
666
|
}
|
|
657
667
|
);
|
|
658
|
-
},
|
|
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 = ({
|
|
659
771
|
savePending: r,
|
|
660
|
-
|
|
661
|
-
|
|
772
|
+
isPreviewOpen: a,
|
|
773
|
+
previewToggleRef: s,
|
|
774
|
+
onTogglePreview: i,
|
|
775
|
+
onDiscard: n,
|
|
776
|
+
onSave: l
|
|
662
777
|
}) => {
|
|
663
|
-
const { translations:
|
|
778
|
+
const { translations: o } = B();
|
|
664
779
|
return /* @__PURE__ */ e(
|
|
665
|
-
|
|
780
|
+
P,
|
|
666
781
|
{
|
|
667
782
|
as: "footer",
|
|
668
783
|
position: "sticky",
|
|
@@ -671,59 +786,70 @@ const Di = (r) => /* @__PURE__ */ e(be, { translations: r.translations, children
|
|
|
671
786
|
borderWidth: "small none none none",
|
|
672
787
|
padding: "small 0",
|
|
673
788
|
stacking: "above",
|
|
674
|
-
children: /* @__PURE__ */
|
|
675
|
-
/* @__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 }),
|
|
676
802
|
/* @__PURE__ */ e(
|
|
677
|
-
|
|
803
|
+
H,
|
|
678
804
|
{
|
|
679
805
|
color: "primary",
|
|
680
|
-
onClick:
|
|
806
|
+
onClick: l,
|
|
681
807
|
interaction: r ? "disabled" : "enabled",
|
|
682
808
|
"data-testid": "rubric-builder-save",
|
|
683
|
-
children:
|
|
809
|
+
children: o.rubricBuilderSave
|
|
684
810
|
}
|
|
685
811
|
)
|
|
686
812
|
] })
|
|
687
813
|
}
|
|
688
814
|
);
|
|
689
|
-
},
|
|
815
|
+
}, Ni = ({
|
|
690
816
|
isNewRubric: r,
|
|
691
|
-
pointsPossible:
|
|
817
|
+
pointsPossible: a,
|
|
692
818
|
hidePoints: s
|
|
693
819
|
}) => {
|
|
694
|
-
const { translations: i, translate:
|
|
695
|
-
return /* @__PURE__ */
|
|
696
|
-
/* @__PURE__ */ e(
|
|
697
|
-
!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 }) })
|
|
698
824
|
] });
|
|
699
|
-
},
|
|
700
|
-
|
|
825
|
+
}, ae = ({ name: r, label: a, value: s, options: i, onChange: n }) => /* @__PURE__ */ e(
|
|
826
|
+
fi,
|
|
701
827
|
{
|
|
702
828
|
name: r,
|
|
703
|
-
description:
|
|
829
|
+
description: a,
|
|
704
830
|
variant: "toggle",
|
|
705
831
|
layout: "columns",
|
|
706
832
|
value: s,
|
|
707
|
-
onChange: (
|
|
708
|
-
children: i.map((
|
|
833
|
+
onChange: (l, o) => n(o),
|
|
834
|
+
children: i.map((l) => /* @__PURE__ */ e(Ci, { value: l.value, label: l.label }, l.value))
|
|
709
835
|
}
|
|
710
|
-
),
|
|
836
|
+
), Fi = ({
|
|
711
837
|
rubricForm: r,
|
|
712
|
-
setRubricFormField:
|
|
838
|
+
setRubricFormField: a,
|
|
713
839
|
validateTitle: s,
|
|
714
840
|
titleError: i,
|
|
715
|
-
titleInputRef:
|
|
716
|
-
assignmentSettings:
|
|
841
|
+
titleInputRef: n,
|
|
842
|
+
assignmentSettings: l
|
|
717
843
|
}) => {
|
|
718
|
-
const { translations:
|
|
719
|
-
if (
|
|
720
|
-
const { hidePoints:
|
|
844
|
+
const { translations: o } = B(), m = (t) => {
|
|
845
|
+
if (t === "unscored" === r.hidePoints) return;
|
|
846
|
+
const { hidePoints: c, hideScoreTotal: h, useForGrading: d, buttonDisplay: u } = Wr(
|
|
721
847
|
r.hidePoints
|
|
722
848
|
);
|
|
723
|
-
|
|
849
|
+
a("hidePoints", c), a("hideScoreTotal", h), a("useForGrading", d), u && a("buttonDisplay", u);
|
|
724
850
|
};
|
|
725
|
-
return /* @__PURE__ */
|
|
726
|
-
|
|
851
|
+
return /* @__PURE__ */ b(
|
|
852
|
+
P,
|
|
727
853
|
{
|
|
728
854
|
as: "section",
|
|
729
855
|
"aria-labelledby": "rubric-builder-details-heading",
|
|
@@ -731,310 +857,917 @@ const Di = (r) => /* @__PURE__ */ e(be, { translations: r.translations, children
|
|
|
731
857
|
borderRadius: "medium",
|
|
732
858
|
padding: "medium",
|
|
733
859
|
children: [
|
|
734
|
-
/* @__PURE__ */ e(
|
|
735
|
-
/* @__PURE__ */
|
|
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: [
|
|
736
862
|
/* @__PURE__ */ e(
|
|
737
|
-
|
|
863
|
+
X,
|
|
738
864
|
{
|
|
739
865
|
"data-testid": "rubric-builder-name",
|
|
740
|
-
renderLabel:
|
|
866
|
+
renderLabel: o.rubricBuilderNameLabel,
|
|
741
867
|
isRequired: !0,
|
|
742
868
|
value: r.title,
|
|
743
|
-
inputRef:
|
|
744
|
-
onChange: (
|
|
745
|
-
onBlur: (
|
|
869
|
+
inputRef: n,
|
|
870
|
+
onChange: (t) => a("title", t.target.value),
|
|
871
|
+
onBlur: (t) => s(t.target.value),
|
|
746
872
|
messages: i ? [{ text: i, type: "error" }] : []
|
|
747
873
|
}
|
|
748
874
|
),
|
|
749
|
-
/* @__PURE__ */
|
|
875
|
+
/* @__PURE__ */ b(k, { gap: "medium", wrap: "wrap", children: [
|
|
750
876
|
/* @__PURE__ */ e(
|
|
751
|
-
|
|
877
|
+
ae,
|
|
752
878
|
{
|
|
753
879
|
name: "rubric-builder-scoring",
|
|
754
|
-
label:
|
|
880
|
+
label: o.scoringTypeSelectLabel,
|
|
755
881
|
value: r.hidePoints ? "unscored" : "scored",
|
|
756
882
|
options: [
|
|
757
|
-
{ value: "scored", label:
|
|
758
|
-
{ value: "unscored", label:
|
|
883
|
+
{ value: "scored", label: o.scoringTypeScored },
|
|
884
|
+
{ value: "unscored", label: o.scoringTypeUnscored }
|
|
759
885
|
],
|
|
760
|
-
onChange:
|
|
886
|
+
onChange: m
|
|
761
887
|
}
|
|
762
888
|
),
|
|
763
889
|
!r.hidePoints && !r.freeFormCriterionComments && /* @__PURE__ */ e(
|
|
764
|
-
|
|
890
|
+
ae,
|
|
765
891
|
{
|
|
766
892
|
name: "rubric-builder-display",
|
|
767
|
-
label:
|
|
893
|
+
label: o.rubricBuilderDisplayLabel,
|
|
768
894
|
value: r.buttonDisplay,
|
|
769
895
|
options: [
|
|
770
|
-
{ value: "points", label:
|
|
771
|
-
{ value: "numeric", label:
|
|
896
|
+
{ value: "points", label: o.ratingDisplayPoints },
|
|
897
|
+
{ value: "numeric", label: o.ratingDisplayLevel }
|
|
772
898
|
],
|
|
773
|
-
onChange: (
|
|
899
|
+
onChange: (t) => a("buttonDisplay", t)
|
|
774
900
|
}
|
|
775
901
|
),
|
|
776
902
|
/* @__PURE__ */ e(
|
|
777
|
-
|
|
903
|
+
ae,
|
|
778
904
|
{
|
|
779
905
|
name: "rubric-builder-feedback",
|
|
780
|
-
label:
|
|
906
|
+
label: o.rubricBuilderFeedbackLabel,
|
|
781
907
|
value: r.freeFormCriterionComments ? "freeForm" : "scale",
|
|
782
908
|
options: [
|
|
783
|
-
{ value: "scale", label:
|
|
784
|
-
{ value: "freeForm", label:
|
|
909
|
+
{ value: "scale", label: o.gradingTypeScale },
|
|
910
|
+
{ value: "freeForm", label: o.rubricBuilderFeedbackWrittenOnly }
|
|
785
911
|
],
|
|
786
|
-
onChange: (
|
|
912
|
+
onChange: (t) => a("freeFormCriterionComments", t === "freeForm")
|
|
787
913
|
}
|
|
788
914
|
),
|
|
789
915
|
!r.freeFormCriterionComments && /* @__PURE__ */ e(
|
|
790
|
-
|
|
916
|
+
ae,
|
|
791
917
|
{
|
|
792
918
|
name: "rubric-builder-rating-order",
|
|
793
|
-
label:
|
|
919
|
+
label: o.rubricBuilderRatingOrderLabel,
|
|
794
920
|
value: r.ratingOrder,
|
|
795
921
|
options: [
|
|
796
|
-
{ value: "ascending", label:
|
|
797
|
-
{ value: "descending", label:
|
|
922
|
+
{ value: "ascending", label: o.rubricBuilderRatingOrderLowToHigh },
|
|
923
|
+
{ value: "descending", label: o.rubricBuilderRatingOrderHighToLow }
|
|
798
924
|
],
|
|
799
|
-
onChange: (
|
|
925
|
+
onChange: (t) => a("ratingOrder", t)
|
|
800
926
|
}
|
|
801
927
|
)
|
|
802
928
|
] }),
|
|
803
|
-
|
|
929
|
+
l
|
|
804
930
|
] })
|
|
805
931
|
]
|
|
806
932
|
}
|
|
807
933
|
);
|
|
808
|
-
},
|
|
809
|
-
|
|
934
|
+
}, Hi = ({
|
|
935
|
+
options: r,
|
|
936
|
+
maxCriterionCount: a,
|
|
937
|
+
maxRatingCount: s,
|
|
938
|
+
rangeEnabled: i,
|
|
939
|
+
isPending: n,
|
|
940
|
+
onChange: l,
|
|
941
|
+
onGenerate: o,
|
|
942
|
+
onCancel: m
|
|
943
|
+
}) => {
|
|
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 = () => {
|
|
945
|
+
if (!u) {
|
|
946
|
+
h(!0);
|
|
947
|
+
return;
|
|
948
|
+
}
|
|
949
|
+
o();
|
|
950
|
+
};
|
|
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
|
+
$,
|
|
955
|
+
{
|
|
956
|
+
renderLabel: t.rubricBuilderGeneratorDifficultyLabel,
|
|
957
|
+
value: r.gradeLevel,
|
|
958
|
+
onChange: (g, { value: v }) => v && d("gradeLevel", String(v)),
|
|
959
|
+
"data-testid": "rubric-builder-generator-difficulty",
|
|
960
|
+
children: jr.map((g) => /* @__PURE__ */ e($.Option, { id: `rubric-builder-grade-level-${g}`, value: g, children: t[Kr[g]] }, g))
|
|
961
|
+
}
|
|
962
|
+
) }),
|
|
963
|
+
/* @__PURE__ */ e(T.Item, { shouldGrow: !0, shouldShrink: !0, size: "10rem", children: /* @__PURE__ */ e(
|
|
964
|
+
$,
|
|
965
|
+
{
|
|
966
|
+
renderLabel: t.rubricBuilderGeneratorCriteriaCountLabel,
|
|
967
|
+
isRequired: !0,
|
|
968
|
+
value: String(r.criteriaCount),
|
|
969
|
+
onChange: (g, { value: v }) => v && d("criteriaCount", Number(v)),
|
|
970
|
+
"data-testid": "rubric-builder-generator-criteria-count",
|
|
971
|
+
children: Fe(a).map((g) => /* @__PURE__ */ e(
|
|
972
|
+
$.Option,
|
|
973
|
+
{
|
|
974
|
+
id: `rubric-builder-criteria-count-${g}`,
|
|
975
|
+
value: String(g),
|
|
976
|
+
children: String(g)
|
|
977
|
+
},
|
|
978
|
+
g
|
|
979
|
+
))
|
|
980
|
+
}
|
|
981
|
+
) }),
|
|
982
|
+
/* @__PURE__ */ e(T.Item, { shouldGrow: !0, shouldShrink: !0, size: "10rem", children: /* @__PURE__ */ e(
|
|
983
|
+
$,
|
|
984
|
+
{
|
|
985
|
+
renderLabel: t.rubricBuilderGeneratorRatingCountLabel,
|
|
986
|
+
isRequired: !0,
|
|
987
|
+
value: String(r.ratingCount),
|
|
988
|
+
onChange: (g, { value: v }) => v && d("ratingCount", Number(v)),
|
|
989
|
+
"data-testid": "rubric-builder-generator-rating-count",
|
|
990
|
+
children: Fe(s).map((g) => /* @__PURE__ */ e(
|
|
991
|
+
$.Option,
|
|
992
|
+
{
|
|
993
|
+
id: `rubric-builder-rating-count-${g}`,
|
|
994
|
+
value: String(g),
|
|
995
|
+
children: String(g)
|
|
996
|
+
},
|
|
997
|
+
g
|
|
998
|
+
))
|
|
999
|
+
}
|
|
1000
|
+
) }),
|
|
1001
|
+
/* @__PURE__ */ e(T.Item, { shouldGrow: !0, shouldShrink: !0, size: "8rem", children: /* @__PURE__ */ e(
|
|
1002
|
+
wi,
|
|
1003
|
+
{
|
|
1004
|
+
renderLabel: t.generateCriteriaTotalPointsLabel,
|
|
1005
|
+
isRequired: !0,
|
|
1006
|
+
value: r.totalPoints,
|
|
1007
|
+
onChange: (g, v) => {
|
|
1008
|
+
d("totalPoints", v), Ne(v) && h(!1);
|
|
1009
|
+
},
|
|
1010
|
+
messages: c && !u ? [{ text: t.generateCriteriaTotalPointsError, type: "error" }] : [],
|
|
1011
|
+
"data-testid": "rubric-builder-generator-total-points"
|
|
1012
|
+
}
|
|
1013
|
+
) })
|
|
1014
|
+
] }),
|
|
1015
|
+
i && /* @__PURE__ */ e(
|
|
1016
|
+
le,
|
|
1017
|
+
{
|
|
1018
|
+
variant: "toggle",
|
|
1019
|
+
label: t.rubricBuilderEnableRange,
|
|
1020
|
+
checked: r.useRange,
|
|
1021
|
+
onChange: (g) => d("useRange", g.target.checked),
|
|
1022
|
+
"data-testid": "rubric-builder-generator-use-range"
|
|
1023
|
+
}
|
|
1024
|
+
),
|
|
1025
|
+
/* @__PURE__ */ e(
|
|
1026
|
+
ce,
|
|
1027
|
+
{
|
|
1028
|
+
label: t.rubricBuilderGeneratorStandardLabel,
|
|
1029
|
+
placeholder: t.standardObjectivePlaceholder,
|
|
1030
|
+
value: r.standard,
|
|
1031
|
+
onChange: (g) => d("standard", g.target.value),
|
|
1032
|
+
messages: p ? [{ text: t.standardObjectiveTooLong, type: "error" }] : [],
|
|
1033
|
+
"data-testid": "rubric-builder-generator-standard"
|
|
1034
|
+
}
|
|
1035
|
+
),
|
|
1036
|
+
/* @__PURE__ */ e(
|
|
1037
|
+
ce,
|
|
1038
|
+
{
|
|
1039
|
+
label: t.rubricBuilderGeneratorAdditionalLabel,
|
|
1040
|
+
placeholder: t.generateCriteriaAdditionalPromptPlaceholder,
|
|
1041
|
+
value: r.additionalPromptInfo,
|
|
1042
|
+
onChange: (g) => d("additionalPromptInfo", g.target.value),
|
|
1043
|
+
messages: f ? [{ text: t.generateCriteriaAdditionalPromptTooLong, type: "error" }] : [],
|
|
1044
|
+
"data-testid": "rubric-builder-generator-additional"
|
|
1045
|
+
}
|
|
1046
|
+
),
|
|
1047
|
+
/* @__PURE__ */ b(T, { justifyItems: "end", gap: "small", children: [
|
|
1048
|
+
/* @__PURE__ */ e(
|
|
1049
|
+
A,
|
|
1050
|
+
{
|
|
1051
|
+
onClick: m,
|
|
1052
|
+
disabled: n,
|
|
1053
|
+
"data-testid": "rubric-builder-generator-cancel",
|
|
1054
|
+
children: t.cancel
|
|
1055
|
+
}
|
|
1056
|
+
),
|
|
1057
|
+
/* @__PURE__ */ e(
|
|
1058
|
+
A,
|
|
1059
|
+
{
|
|
1060
|
+
color: "ai-primary",
|
|
1061
|
+
renderIcon: /* @__PURE__ */ e(me, {}),
|
|
1062
|
+
onClick: C,
|
|
1063
|
+
disabled: n || p || f,
|
|
1064
|
+
"data-testid": "rubric-builder-generator-generate",
|
|
1065
|
+
children: t.rubricBuilderGeneratorGenerate
|
|
1066
|
+
}
|
|
1067
|
+
)
|
|
1068
|
+
] })
|
|
1069
|
+
] });
|
|
1070
|
+
}, zi = ({
|
|
1071
|
+
courseId: r,
|
|
1072
|
+
responseId: a,
|
|
1073
|
+
responseType: s
|
|
1074
|
+
}) => {
|
|
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]);
|
|
1079
|
+
const u = () => {
|
|
1080
|
+
d(""), c(null);
|
|
1081
|
+
}, { submitFeedback: p, isPending: f } = Xr({
|
|
1082
|
+
courseId: r,
|
|
1083
|
+
responseId: a,
|
|
1084
|
+
responseType: s,
|
|
1085
|
+
onSubmitted: () => {
|
|
1086
|
+
m(t), u();
|
|
1087
|
+
}
|
|
1088
|
+
}), C = t ?? o, g = h.length > He, v = t === "positive" ? i.positiveFeedbackLabel : i.negativeFeedbackLabel, E = (R) => {
|
|
1089
|
+
o !== R && c(R);
|
|
1090
|
+
};
|
|
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 }),
|
|
1094
|
+
/* @__PURE__ */ e(
|
|
1095
|
+
Ue,
|
|
1096
|
+
{
|
|
1097
|
+
withBackground: !1,
|
|
1098
|
+
withBorder: !1,
|
|
1099
|
+
size: "small",
|
|
1100
|
+
screenReaderLabel: i.positiveFeedbackLabel,
|
|
1101
|
+
"aria-pressed": C === "positive",
|
|
1102
|
+
onClick: () => E("positive"),
|
|
1103
|
+
"data-testid": "rubric-builder-generator-feedback-positive",
|
|
1104
|
+
children: C === "positive" ? /* @__PURE__ */ e(ze, {}) : /* @__PURE__ */ e($e, {})
|
|
1105
|
+
}
|
|
1106
|
+
),
|
|
1107
|
+
/* @__PURE__ */ e(
|
|
1108
|
+
Ue,
|
|
1109
|
+
{
|
|
1110
|
+
withBackground: !1,
|
|
1111
|
+
withBorder: !1,
|
|
1112
|
+
size: "small",
|
|
1113
|
+
screenReaderLabel: i.negativeFeedbackLabel,
|
|
1114
|
+
"aria-pressed": C === "negative",
|
|
1115
|
+
onClick: () => E("negative"),
|
|
1116
|
+
"data-testid": "rubric-builder-generator-feedback-negative",
|
|
1117
|
+
children: C === "negative" ? /* @__PURE__ */ e(ze, { rotate: "180" }) : /* @__PURE__ */ e($e, { rotate: "180" })
|
|
1118
|
+
}
|
|
1119
|
+
)
|
|
1120
|
+
] }),
|
|
1121
|
+
/* @__PURE__ */ b(
|
|
1122
|
+
M,
|
|
1123
|
+
{
|
|
1124
|
+
open: t != null,
|
|
1125
|
+
onDismiss: f ? void 0 : u,
|
|
1126
|
+
size: "medium",
|
|
1127
|
+
label: v,
|
|
1128
|
+
shouldCloseOnDocumentClick: !1,
|
|
1129
|
+
"data-testid": "rubric-builder-generator-feedback-modal",
|
|
1130
|
+
children: [
|
|
1131
|
+
/* @__PURE__ */ b(M.Header, { children: [
|
|
1132
|
+
/* @__PURE__ */ e(
|
|
1133
|
+
Be,
|
|
1134
|
+
{
|
|
1135
|
+
placement: "end",
|
|
1136
|
+
offset: "small",
|
|
1137
|
+
onClick: u,
|
|
1138
|
+
screenReaderLabel: i.feedbackModalCancelLabel
|
|
1139
|
+
}
|
|
1140
|
+
),
|
|
1141
|
+
/* @__PURE__ */ e(q, { level: "h2", children: v })
|
|
1142
|
+
] }),
|
|
1143
|
+
/* @__PURE__ */ b(M.Body, { children: [
|
|
1144
|
+
/* @__PURE__ */ e(Y, { as: "p", children: i.feedbackModalDescription }),
|
|
1145
|
+
/* @__PURE__ */ e(
|
|
1146
|
+
ce,
|
|
1147
|
+
{
|
|
1148
|
+
label: i.feedbackModalCommentLabel,
|
|
1149
|
+
placeholder: i.feedbackModalCommentPlaceholder,
|
|
1150
|
+
value: h,
|
|
1151
|
+
disabled: f,
|
|
1152
|
+
onChange: (R) => d(R.target.value),
|
|
1153
|
+
messages: g ? [
|
|
1154
|
+
{
|
|
1155
|
+
text: n("feedbackModalCommentTooLong", {
|
|
1156
|
+
limit: new Intl.NumberFormat(l).format(He)
|
|
1157
|
+
}),
|
|
1158
|
+
type: "error"
|
|
1159
|
+
}
|
|
1160
|
+
] : [],
|
|
1161
|
+
"data-testid": "rubric-builder-generator-feedback-comment"
|
|
1162
|
+
}
|
|
1163
|
+
)
|
|
1164
|
+
] }),
|
|
1165
|
+
/* @__PURE__ */ b(M.Footer, { children: [
|
|
1166
|
+
/* @__PURE__ */ e(A, { onClick: u, disabled: f, margin: "0 x-small 0 0", children: i.cancel }),
|
|
1167
|
+
/* @__PURE__ */ e(
|
|
1168
|
+
A,
|
|
1169
|
+
{
|
|
1170
|
+
color: "primary",
|
|
1171
|
+
disabled: g || f,
|
|
1172
|
+
onClick: () => t && p({ feedbackType: t, comment: h }),
|
|
1173
|
+
"data-testid": "rubric-builder-generator-feedback-submit",
|
|
1174
|
+
children: f ? i.feedbackModalSubmitting : i.feedbackModalSubmit
|
|
1175
|
+
}
|
|
1176
|
+
)
|
|
1177
|
+
] })
|
|
1178
|
+
]
|
|
1179
|
+
}
|
|
1180
|
+
)
|
|
1181
|
+
] });
|
|
1182
|
+
}, $i = ({
|
|
1183
|
+
isOpen: r,
|
|
1184
|
+
onRegenerate: a,
|
|
1185
|
+
onDismiss: s
|
|
1186
|
+
}) => {
|
|
1187
|
+
const { translations: i } = B(), n = F(null), [l, o] = y(""), m = l.length > ve, t = () => {
|
|
1188
|
+
o(""), s();
|
|
1189
|
+
};
|
|
1190
|
+
return /* @__PURE__ */ b(
|
|
1191
|
+
M,
|
|
1192
|
+
{
|
|
1193
|
+
open: r,
|
|
1194
|
+
onDismiss: t,
|
|
1195
|
+
size: "medium",
|
|
1196
|
+
label: i.regenerateModalCriteriaLabel,
|
|
1197
|
+
shouldCloseOnDocumentClick: !1,
|
|
1198
|
+
defaultFocusElement: () => n.current,
|
|
1199
|
+
"data-testid": "rubric-builder-regenerate-modal",
|
|
1200
|
+
children: [
|
|
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 })
|
|
1204
|
+
] }),
|
|
1205
|
+
/* @__PURE__ */ b(M.Body, { children: [
|
|
1206
|
+
/* @__PURE__ */ e(Y, { as: "p", children: i.regenerateModalDescriptionCriteria }),
|
|
1207
|
+
/* @__PURE__ */ e(
|
|
1208
|
+
ce,
|
|
1209
|
+
{
|
|
1210
|
+
label: i.regenerateModalPromptLabel,
|
|
1211
|
+
placeholder: i.regenerateModalPromptPlaceholder,
|
|
1212
|
+
value: l,
|
|
1213
|
+
textareaRef: (c) => {
|
|
1214
|
+
n.current = c;
|
|
1215
|
+
},
|
|
1216
|
+
onChange: (c) => o(c.target.value),
|
|
1217
|
+
messages: m ? [{ text: i.regenerateModalPromptTooLong, type: "error" }] : [],
|
|
1218
|
+
"data-testid": "rubric-builder-regenerate-prompt"
|
|
1219
|
+
}
|
|
1220
|
+
)
|
|
1221
|
+
] }),
|
|
1222
|
+
/* @__PURE__ */ b(M.Footer, { children: [
|
|
1223
|
+
/* @__PURE__ */ e(A, { onClick: t, margin: "0 x-small 0 0", children: i.cancel }),
|
|
1224
|
+
/* @__PURE__ */ e(
|
|
1225
|
+
A,
|
|
1226
|
+
{
|
|
1227
|
+
color: "ai-primary",
|
|
1228
|
+
renderIcon: /* @__PURE__ */ e(me, {}),
|
|
1229
|
+
disabled: m,
|
|
1230
|
+
onClick: () => {
|
|
1231
|
+
a(l), t();
|
|
1232
|
+
},
|
|
1233
|
+
"data-testid": "rubric-builder-regenerate-submit",
|
|
1234
|
+
children: i.regenerateButtonLabel
|
|
1235
|
+
}
|
|
1236
|
+
)
|
|
1237
|
+
] })
|
|
1238
|
+
]
|
|
1239
|
+
}
|
|
1240
|
+
);
|
|
1241
|
+
}, Ui = ({
|
|
1242
|
+
courseId: r,
|
|
1243
|
+
responseId: a,
|
|
1244
|
+
responseType: s,
|
|
1245
|
+
canRegenerate: i,
|
|
1246
|
+
isPending: n,
|
|
1247
|
+
onRegenerate: l
|
|
1248
|
+
}) => {
|
|
1249
|
+
const { translations: o } = B(), m = F(null), [t, c] = y(!1);
|
|
1250
|
+
N(() => {
|
|
1251
|
+
var d;
|
|
1252
|
+
(d = m.current) == null || d.focus();
|
|
1253
|
+
}, []);
|
|
1254
|
+
const h = /* @__PURE__ */ e(
|
|
1255
|
+
A,
|
|
1256
|
+
{
|
|
1257
|
+
color: "ai-secondary",
|
|
1258
|
+
renderIcon: /* @__PURE__ */ e(me, {}),
|
|
1259
|
+
disabled: n || !i,
|
|
1260
|
+
onClick: () => c(!0),
|
|
1261
|
+
"data-testid": "rubric-builder-generator-regenerate",
|
|
1262
|
+
children: o.regenerateButtonLabel
|
|
1263
|
+
}
|
|
1264
|
+
);
|
|
1265
|
+
return /* @__PURE__ */ b(T, { direction: "column", gap: "small", "data-testid": "rubric-builder-generator-summary", children: [
|
|
1266
|
+
/* @__PURE__ */ e(
|
|
1267
|
+
q,
|
|
1268
|
+
{
|
|
1269
|
+
level: "h4",
|
|
1270
|
+
elementRef: (d) => {
|
|
1271
|
+
m.current = d;
|
|
1272
|
+
},
|
|
1273
|
+
tabIndex: -1,
|
|
1274
|
+
children: o.rubricBuilderGeneratorDoneHeading
|
|
1275
|
+
}
|
|
1276
|
+
),
|
|
1277
|
+
/* @__PURE__ */ b(T, { justifyItems: "space-between", alignItems: "center", wrap: "wrap", gap: "small", children: [
|
|
1278
|
+
a ? /* @__PURE__ */ e(
|
|
1279
|
+
zi,
|
|
1280
|
+
{
|
|
1281
|
+
courseId: r,
|
|
1282
|
+
responseId: a,
|
|
1283
|
+
responseType: s
|
|
1284
|
+
}
|
|
1285
|
+
) : /* @__PURE__ */ e("span", {}),
|
|
1286
|
+
i ? h : /* @__PURE__ */ e(Si, { renderTip: o.noCriteriaForRegenerationTooltip, children: h })
|
|
1287
|
+
] }),
|
|
1288
|
+
/* @__PURE__ */ e(
|
|
1289
|
+
$i,
|
|
1290
|
+
{
|
|
1291
|
+
isOpen: t,
|
|
1292
|
+
onRegenerate: l,
|
|
1293
|
+
onDismiss: () => c(!1)
|
|
1294
|
+
}
|
|
1295
|
+
)
|
|
1296
|
+
] });
|
|
1297
|
+
}, br = "rubric-builder-generator", Vi = ({
|
|
1298
|
+
courseId: r,
|
|
1299
|
+
generator: a,
|
|
1300
|
+
onCancel: s
|
|
1301
|
+
}) => {
|
|
1302
|
+
const { translations: i } = B(), { aiRubricsMaxCriterionCount: n, aiRubricsMaxRatingCount: l, rubricCriterionRange: o } = ue(), { isPending: m, progress: t } = a, c = t == null ? void 0 : t.completion;
|
|
1303
|
+
return /* @__PURE__ */ e(
|
|
1304
|
+
Re,
|
|
1305
|
+
{
|
|
1306
|
+
as: "section",
|
|
1307
|
+
id: br,
|
|
1308
|
+
"aria-labelledby": "rubric-builder-generator-heading",
|
|
1309
|
+
borderWidth: "small",
|
|
1310
|
+
borderRadius: "medium",
|
|
1311
|
+
padding: "medium",
|
|
1312
|
+
margin: "small 0 0",
|
|
1313
|
+
background: "secondary",
|
|
1314
|
+
"data-testid": "rubric-builder-generator-panel",
|
|
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 })
|
|
1320
|
+
] }),
|
|
1321
|
+
m && (typeof c == "number" ? /* @__PURE__ */ e(
|
|
1322
|
+
vi,
|
|
1323
|
+
{
|
|
1324
|
+
screenReaderLabel: i.rubricBuilderGeneratorGenerating,
|
|
1325
|
+
valueNow: c,
|
|
1326
|
+
valueMax: 100,
|
|
1327
|
+
"data-testid": "rubric-builder-generator-progress"
|
|
1328
|
+
}
|
|
1329
|
+
) : /* @__PURE__ */ e(
|
|
1330
|
+
Ri,
|
|
1331
|
+
{
|
|
1332
|
+
size: "small",
|
|
1333
|
+
renderTitle: i.rubricBuilderGeneratorGenerating,
|
|
1334
|
+
"data-testid": "rubric-builder-generator-progress"
|
|
1335
|
+
}
|
|
1336
|
+
)),
|
|
1337
|
+
a.isGenerated ? /* @__PURE__ */ e(
|
|
1338
|
+
Ui,
|
|
1339
|
+
{
|
|
1340
|
+
courseId: r,
|
|
1341
|
+
responseId: a.feedbackResponseId,
|
|
1342
|
+
responseType: a.feedbackResponseType,
|
|
1343
|
+
canRegenerate: a.canRegenerate,
|
|
1344
|
+
isPending: m,
|
|
1345
|
+
onRegenerate: a.regenerateAll
|
|
1346
|
+
}
|
|
1347
|
+
) : /* @__PURE__ */ e(
|
|
1348
|
+
Hi,
|
|
1349
|
+
{
|
|
1350
|
+
options: a.options,
|
|
1351
|
+
maxCriterionCount: n,
|
|
1352
|
+
maxRatingCount: l,
|
|
1353
|
+
rangeEnabled: o,
|
|
1354
|
+
isPending: m,
|
|
1355
|
+
onChange: a.setOptions,
|
|
1356
|
+
onGenerate: a.generate,
|
|
1357
|
+
onCancel: s
|
|
1358
|
+
}
|
|
1359
|
+
)
|
|
1360
|
+
] })
|
|
1361
|
+
}
|
|
1362
|
+
);
|
|
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) => {
|
|
1367
|
+
try {
|
|
1368
|
+
return ri(r).criteria.length;
|
|
1369
|
+
} catch {
|
|
1370
|
+
return 0;
|
|
1371
|
+
}
|
|
1372
|
+
}, ji = ({
|
|
1373
|
+
courseId: r,
|
|
1374
|
+
assignmentId: a,
|
|
1375
|
+
assignmentPointsPossible: s,
|
|
1376
|
+
criteria: i,
|
|
1377
|
+
criteriaRef: n,
|
|
1378
|
+
setRubricFormField: l
|
|
1379
|
+
}) => {
|
|
1380
|
+
const { aiRubricsMaxCriterionCount: o, aiRubricsMaxRatingCount: m } = ue(), t = Ae(
|
|
1381
|
+
() => Qr({
|
|
1382
|
+
maxCriterionCount: o,
|
|
1383
|
+
maxRatingCount: m,
|
|
1384
|
+
assignmentPointsPossible: s
|
|
1385
|
+
}),
|
|
1386
|
+
[o, m, s]
|
|
1387
|
+
), [c, h] = y(t), d = Ke(() => h(t), [t]), {
|
|
1388
|
+
generateCriteriaProgress: u,
|
|
1389
|
+
generateCriteriaIsPending: p,
|
|
1390
|
+
generateCriteriaIsSuccess: f,
|
|
1391
|
+
generateCriteriaMutation: C,
|
|
1392
|
+
generateResponseId: g
|
|
1393
|
+
} = Jr({
|
|
1394
|
+
courseId: r,
|
|
1395
|
+
assignmentId: a,
|
|
1396
|
+
generateOptions: c,
|
|
1397
|
+
criteriaRef: n,
|
|
1398
|
+
setRubricFormField: l
|
|
1399
|
+
}), {
|
|
1400
|
+
regeneratedCriteriaProgress: v,
|
|
1401
|
+
regenerateCriteriaIsPending: E,
|
|
1402
|
+
regenerateCriteriaIsSuccess: R,
|
|
1403
|
+
regenerateAllCriteria: I,
|
|
1404
|
+
regenerateResponseId: L,
|
|
1405
|
+
regenerateResponseType: D
|
|
1406
|
+
} = Zr({
|
|
1407
|
+
courseId: r,
|
|
1408
|
+
assignmentId: a,
|
|
1409
|
+
criteriaRef: n,
|
|
1410
|
+
generateOptions: c,
|
|
1411
|
+
setRubricFormField: l
|
|
1412
|
+
}), x = Ae(
|
|
1413
|
+
() => f ? Wi(u == null ? void 0 : u.results) : 0,
|
|
1414
|
+
[f, u]
|
|
1415
|
+
);
|
|
1416
|
+
return {
|
|
1417
|
+
options: c,
|
|
1418
|
+
setOptions: h,
|
|
1419
|
+
resetOptions: d,
|
|
1420
|
+
generate: () => C(),
|
|
1421
|
+
regenerateAll: I,
|
|
1422
|
+
isPending: p || E,
|
|
1423
|
+
progress: E ? v : u,
|
|
1424
|
+
isGenerated: f,
|
|
1425
|
+
lastResult: R ? { kind: "regenerated" } : f ? { kind: "generated", count: x } : null,
|
|
1426
|
+
// Outcome-linked criteria can't be regenerated, so there must be another one.
|
|
1427
|
+
canRegenerate: i.some((O) => !O.learningOutcomeId),
|
|
1428
|
+
feedbackResponseId: L ?? g ?? "",
|
|
1429
|
+
feedbackResponseType: D ?? ei.GENERATE_CRITERIA
|
|
1430
|
+
};
|
|
1431
|
+
}, Ki = (r) => /* @__PURE__ */ e(we, { translations: r.translations, children: /* @__PURE__ */ e(
|
|
1432
|
+
je,
|
|
810
1433
|
{
|
|
811
1434
|
courseId: r.courseId,
|
|
812
1435
|
accountId: r.accountId,
|
|
813
1436
|
featureFlags: r.featureFlags,
|
|
814
1437
|
aiLimits: r.aiLimits,
|
|
815
|
-
children: /* @__PURE__ */ e(
|
|
1438
|
+
children: /* @__PURE__ */ e(Xi, { ...r })
|
|
816
1439
|
}
|
|
817
|
-
) }),
|
|
1440
|
+
) }), Xi = ({
|
|
818
1441
|
rubricId: r,
|
|
819
|
-
rubric:
|
|
1442
|
+
rubric: a,
|
|
820
1443
|
rubricAssociation: s,
|
|
821
1444
|
assignmentId: i,
|
|
822
|
-
assignmentPointsPossible:
|
|
823
|
-
canUseForGrading:
|
|
824
|
-
accountId:
|
|
825
|
-
courseId:
|
|
826
|
-
canManageRubrics:
|
|
827
|
-
onSaveRubric:
|
|
828
|
-
onDiscard:
|
|
1445
|
+
assignmentPointsPossible: n,
|
|
1446
|
+
canUseForGrading: l = !0,
|
|
1447
|
+
accountId: o,
|
|
1448
|
+
courseId: m,
|
|
1449
|
+
canManageRubrics: t,
|
|
1450
|
+
onSaveRubric: c,
|
|
1451
|
+
onDiscard: h
|
|
829
1452
|
}) => {
|
|
830
|
-
var
|
|
831
|
-
const { translations:
|
|
832
|
-
rubricForm:
|
|
1453
|
+
var Me;
|
|
1454
|
+
const { translations: d } = B(), { aiRubricsEnabled: u } = ue(), {
|
|
1455
|
+
rubricForm: p,
|
|
1456
|
+
criteriaRef: f,
|
|
833
1457
|
setRubricFormField: C,
|
|
834
|
-
validateField:
|
|
835
|
-
validationErrors:
|
|
836
|
-
isNewRubric:
|
|
837
|
-
load: { data:
|
|
838
|
-
savePending:
|
|
839
|
-
saveError:
|
|
1458
|
+
validateField: g,
|
|
1459
|
+
validationErrors: v,
|
|
1460
|
+
isNewRubric: E,
|
|
1461
|
+
load: { data: R, isLoading: I, isError: L, isSuccess: D },
|
|
1462
|
+
savePending: x,
|
|
1463
|
+
saveError: _,
|
|
840
1464
|
save: O,
|
|
841
|
-
saveAction:
|
|
842
|
-
isDirty:
|
|
843
|
-
criteriaValid:
|
|
844
|
-
criteriaValidationErrors:
|
|
845
|
-
saveCriterion:
|
|
846
|
-
deleteCriterion:
|
|
847
|
-
reorderCriteria:
|
|
848
|
-
} =
|
|
1465
|
+
saveAction: Q,
|
|
1466
|
+
isDirty: W,
|
|
1467
|
+
criteriaValid: J,
|
|
1468
|
+
criteriaValidationErrors: Z,
|
|
1469
|
+
saveCriterion: U,
|
|
1470
|
+
deleteCriterion: ee,
|
|
1471
|
+
reorderCriteria: j
|
|
1472
|
+
} = ii({
|
|
849
1473
|
rubricId: r,
|
|
850
|
-
rubric:
|
|
1474
|
+
rubric: a,
|
|
851
1475
|
rubricAssociation: s,
|
|
852
1476
|
assignmentId: i,
|
|
853
|
-
assignmentPointsPossible:
|
|
854
|
-
accountId:
|
|
855
|
-
courseId:
|
|
856
|
-
canManageRubrics:
|
|
857
|
-
onSaveRubric:
|
|
858
|
-
}),
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
1477
|
+
assignmentPointsPossible: n,
|
|
1478
|
+
accountId: o,
|
|
1479
|
+
courseId: m,
|
|
1480
|
+
canManageRubrics: t,
|
|
1481
|
+
onSaveRubric: c
|
|
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,
|
|
1484
|
+
assignmentId: i,
|
|
1485
|
+
assignmentPointsPossible: n,
|
|
1486
|
+
criteria: p.criteria,
|
|
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,
|
|
1495
|
+
errorCategory: d.rubricErrorPageCategory,
|
|
1496
|
+
translations: xe(d)
|
|
866
1497
|
});
|
|
867
|
-
if (r &&
|
|
868
|
-
return
|
|
869
|
-
const
|
|
870
|
-
var
|
|
871
|
-
if (
|
|
872
|
-
(
|
|
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();
|
|
873
1504
|
return;
|
|
874
1505
|
}
|
|
875
|
-
if (!(
|
|
876
|
-
switch (
|
|
1506
|
+
if (!(p.criteria.length === 0 || !J))
|
|
1507
|
+
switch (Q) {
|
|
877
1508
|
case "confirmPointsDifference":
|
|
878
|
-
|
|
1509
|
+
re(!0);
|
|
879
1510
|
break;
|
|
880
1511
|
case "confirmAssessedEdit":
|
|
881
|
-
|
|
1512
|
+
he(!0);
|
|
882
1513
|
break;
|
|
883
1514
|
case "confirmSave":
|
|
884
|
-
|
|
1515
|
+
ge(!0);
|
|
885
1516
|
break;
|
|
886
1517
|
case "save":
|
|
887
1518
|
O();
|
|
888
1519
|
break;
|
|
889
1520
|
default: {
|
|
890
|
-
const
|
|
891
|
-
throw new Error(`Unhandled save action: ${
|
|
1521
|
+
const Sr = Q;
|
|
1522
|
+
throw new Error(`Unhandled save action: ${Sr}`);
|
|
892
1523
|
}
|
|
893
1524
|
}
|
|
894
|
-
},
|
|
895
|
-
const
|
|
896
|
-
|
|
897
|
-
},
|
|
898
|
-
|
|
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();
|
|
899
1533
|
};
|
|
900
|
-
return /* @__PURE__ */
|
|
901
|
-
/* @__PURE__ */
|
|
902
|
-
/* @__PURE__ */ e(
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
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,
|
|
1558
|
+
{
|
|
1559
|
+
rubricForm: p,
|
|
1560
|
+
canUseForGrading: l,
|
|
1561
|
+
setRubricFormField: C
|
|
1562
|
+
}
|
|
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,
|
|
1601
|
+
{
|
|
1602
|
+
courseId: m,
|
|
1603
|
+
generator: ie,
|
|
1604
|
+
onCancel: () => {
|
|
1605
|
+
var w;
|
|
1606
|
+
ie.resetOptions(), ye(!1), (w = ke.current) == null || w.focus();
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
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
|
|
1625
|
+
}
|
|
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,
|
|
933
1633
|
{
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
{
|
|
939
|
-
renderIcon: /* @__PURE__ */ e(Le, {}),
|
|
940
|
-
onClick: Ae,
|
|
941
|
-
"data-testid": "rubric-builder-add-criterion",
|
|
942
|
-
children: c.rubricBuilderAddCriterion
|
|
943
|
-
}
|
|
944
|
-
),
|
|
945
|
-
children: /* @__PURE__ */ e(
|
|
946
|
-
Gr,
|
|
947
|
-
{
|
|
948
|
-
criteria: n.criteria,
|
|
949
|
-
hidePoints: n.hidePoints,
|
|
950
|
-
freeFormCriterionComments: n.freeFormCriterionComments,
|
|
951
|
-
ratingOrder: n.ratingOrder,
|
|
952
|
-
criteriaValidationErrors: _,
|
|
953
|
-
showErrors: H,
|
|
954
|
-
focusNameCriterionId: Pe,
|
|
955
|
-
onFocusedName: Oe,
|
|
956
|
-
onChangeCriterion: N,
|
|
957
|
-
onDuplicateCriterion: (L) => N(mr(L)),
|
|
958
|
-
onDeleteCriterion: z,
|
|
959
|
-
onReorderCriteria: W
|
|
960
|
-
}
|
|
961
|
-
)
|
|
1634
|
+
rubric: p,
|
|
1635
|
+
savePending: x,
|
|
1636
|
+
onClose: Ee,
|
|
1637
|
+
onSave: De
|
|
962
1638
|
}
|
|
963
|
-
)
|
|
1639
|
+
) })
|
|
964
1640
|
] }),
|
|
965
1641
|
/* @__PURE__ */ e(
|
|
966
|
-
|
|
1642
|
+
_i,
|
|
967
1643
|
{
|
|
968
|
-
savePending:
|
|
969
|
-
|
|
970
|
-
|
|
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
|
|
971
1652
|
}
|
|
972
1653
|
),
|
|
973
1654
|
/* @__PURE__ */ e(
|
|
974
|
-
|
|
1655
|
+
se,
|
|
975
1656
|
{
|
|
976
|
-
isOpen:
|
|
977
|
-
heading:
|
|
978
|
-
body:
|
|
979
|
-
confirmLabel:
|
|
980
|
-
cancelLabel:
|
|
981
|
-
onConfirm:
|
|
982
|
-
onDismiss: () =>
|
|
1657
|
+
isOpen: mr,
|
|
1658
|
+
heading: d.rubricBuilderDiscardHeading,
|
|
1659
|
+
body: d.rubricBuilderDiscardBody,
|
|
1660
|
+
confirmLabel: d.rubricBuilderDiscard,
|
|
1661
|
+
cancelLabel: d.rubricBuilderKeepEditing,
|
|
1662
|
+
onConfirm: h,
|
|
1663
|
+
onDismiss: () => Ie(!1),
|
|
983
1664
|
"data-testid": "rubric-builder-discard-modal"
|
|
984
1665
|
}
|
|
985
1666
|
),
|
|
986
1667
|
/* @__PURE__ */ e(
|
|
987
|
-
|
|
1668
|
+
se,
|
|
988
1669
|
{
|
|
989
|
-
isOpen:
|
|
990
|
-
heading:
|
|
991
|
-
body:
|
|
992
|
-
confirmLabel:
|
|
993
|
-
cancelLabel:
|
|
1670
|
+
isOpen: gr,
|
|
1671
|
+
heading: d.confirmToContinueHeader,
|
|
1672
|
+
body: d.gradingHistoryWarning,
|
|
1673
|
+
confirmLabel: d.saveConfirmModalSave,
|
|
1674
|
+
cancelLabel: d.cancel,
|
|
994
1675
|
onConfirm: () => {
|
|
995
|
-
|
|
1676
|
+
ge(!1), O();
|
|
996
1677
|
},
|
|
997
|
-
onDismiss: () =>
|
|
1678
|
+
onDismiss: () => ge(!1),
|
|
998
1679
|
"data-testid": "rubric-builder-save-confirm-modal"
|
|
999
1680
|
}
|
|
1000
1681
|
),
|
|
1001
1682
|
/* @__PURE__ */ e(
|
|
1002
|
-
|
|
1683
|
+
se,
|
|
1003
1684
|
{
|
|
1004
|
-
isOpen:
|
|
1005
|
-
heading:
|
|
1006
|
-
body:
|
|
1007
|
-
confirmLabel:
|
|
1008
|
-
cancelLabel:
|
|
1685
|
+
isOpen: hr,
|
|
1686
|
+
heading: d.confirmToContinueHeader,
|
|
1687
|
+
body: d.gradingHistoryWarning,
|
|
1688
|
+
confirmLabel: d.editConfirmModalConfirm,
|
|
1689
|
+
cancelLabel: d.cancel,
|
|
1009
1690
|
onConfirm: () => {
|
|
1010
|
-
|
|
1691
|
+
he(!1), O();
|
|
1011
1692
|
},
|
|
1012
|
-
onDismiss: () =>
|
|
1693
|
+
onDismiss: () => he(!1),
|
|
1013
1694
|
"data-testid": "rubric-builder-assessed-edit-modal"
|
|
1014
1695
|
}
|
|
1015
1696
|
),
|
|
1016
1697
|
/* @__PURE__ */ e(
|
|
1017
|
-
|
|
1698
|
+
Ai,
|
|
1018
1699
|
{
|
|
1019
|
-
isOpen:
|
|
1020
|
-
assignmentPoints:
|
|
1021
|
-
rubricPoints:
|
|
1700
|
+
isOpen: pr,
|
|
1701
|
+
assignmentPoints: n ?? 0,
|
|
1702
|
+
rubricPoints: p.pointsPossible,
|
|
1022
1703
|
onChange: () => {
|
|
1023
|
-
|
|
1704
|
+
re(!1), O(!1);
|
|
1024
1705
|
},
|
|
1025
1706
|
onLeaveDifferent: () => {
|
|
1026
|
-
|
|
1707
|
+
re(!1), O(!0);
|
|
1027
1708
|
},
|
|
1028
|
-
onDismiss: () =>
|
|
1709
|
+
onDismiss: () => re(!1)
|
|
1029
1710
|
}
|
|
1030
1711
|
)
|
|
1031
1712
|
] });
|
|
1713
|
+
}, Nt = (r) => /* @__PURE__ */ e(we, { translations: r.translations, children: /* @__PURE__ */ e(
|
|
1714
|
+
je,
|
|
1715
|
+
{
|
|
1716
|
+
courseId: r.courseId,
|
|
1717
|
+
featureFlags: r.featureFlags,
|
|
1718
|
+
aiLimits: r.aiLimits,
|
|
1719
|
+
children: /* @__PURE__ */ e(Yi, { ...r })
|
|
1720
|
+
}
|
|
1721
|
+
) }), Yi = ({
|
|
1722
|
+
courseId: r,
|
|
1723
|
+
assignmentId: a,
|
|
1724
|
+
assignmentPointsPossible: s,
|
|
1725
|
+
canManageRubrics: i,
|
|
1726
|
+
canUseForGrading: n = !0,
|
|
1727
|
+
featureFlags: l,
|
|
1728
|
+
aiLimits: o,
|
|
1729
|
+
onAssignmentPointsPossibleChange: m,
|
|
1730
|
+
onRubricChange: t
|
|
1731
|
+
}) => {
|
|
1732
|
+
const { translations: c } = B(), h = We(), { rubric: d, rubricAssociation: u, isLoading: p, error: f, applySavedRubric: C, reload: g } = li({
|
|
1733
|
+
courseId: r,
|
|
1734
|
+
assignmentId: a,
|
|
1735
|
+
canUseForGrading: n,
|
|
1736
|
+
onAssignmentPointsPossibleChange: m,
|
|
1737
|
+
onRubricChange: t
|
|
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);
|
|
1745
|
+
});
|
|
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,
|
|
1748
|
+
{
|
|
1749
|
+
translations: h,
|
|
1750
|
+
courseId: r,
|
|
1751
|
+
featureFlags: l,
|
|
1752
|
+
aiLimits: o,
|
|
1753
|
+
assignmentId: a,
|
|
1754
|
+
assignmentPointsPossible: s,
|
|
1755
|
+
rubric: d,
|
|
1756
|
+
rubricAssociation: u,
|
|
1757
|
+
canUseForGrading: n,
|
|
1758
|
+
canManageRubrics: i,
|
|
1759
|
+
onSaveRubric: L,
|
|
1760
|
+
onDiscard: I
|
|
1761
|
+
},
|
|
1762
|
+
v
|
|
1763
|
+
) });
|
|
1032
1764
|
};
|
|
1033
1765
|
export {
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
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
|
|
1040
1773
|
};
|