@instructure/platform-rubrics 0.7.1 → 0.8.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/RubricAssessment/components/TraditionalViewCriterionPoints.d.ts.map +1 -1
- package/dist/_internal/RubricAssignment/hooks/useAssignmentRubricState.d.ts +27 -0
- package/dist/_internal/RubricAssignment/hooks/useAssignmentRubricState.d.ts.map +1 -0
- package/dist/_internal/RubricAssignment/hooks/useGradingRubricContexts.d.ts +3 -0
- package/dist/_internal/RubricAssignment/hooks/useGradingRubricContexts.d.ts.map +1 -0
- package/dist/_internal/RubricAssignment/hooks/useGradingRubricsForContext.d.ts +19 -0
- package/dist/_internal/RubricAssignment/hooks/useGradingRubricsForContext.d.ts.map +1 -0
- package/dist/_internal/RubricAssignment/hooks/useRubricSearch.d.ts +22 -0
- package/dist/_internal/RubricAssignment/hooks/useRubricSearch.d.ts.map +1 -0
- package/dist/_internal/RubricAssignment/hooks/useRubricSelfAssessmentSettings.d.ts +10 -0
- package/dist/_internal/RubricAssignment/hooks/useRubricSelfAssessmentSettings.d.ts.map +1 -0
- package/dist/_internal/RubricAssignment/rubricSearch.d.ts +6 -0
- package/dist/_internal/RubricAssignment/rubricSearch.d.ts.map +1 -0
- package/dist/_internal/RubricForm/generateCriteriaForm.d.ts +18 -0
- package/dist/_internal/RubricForm/generateCriteriaForm.d.ts.map +1 -0
- package/dist/_internal/RubricForm/useCriterionForm.d.ts.map +1 -1
- package/dist/_internal/RubricForm/useRubricForm.d.ts +3 -0
- package/dist/_internal/RubricForm/useRubricForm.d.ts.map +1 -1
- package/dist/_internal/RubricForm/useSubmitRubricFeedback.d.ts +23 -0
- package/dist/_internal/RubricForm/useSubmitRubricFeedback.d.ts.map +1 -0
- package/dist/_internal/RubricForm/utils.d.ts +12 -0
- package/dist/_internal/RubricForm/utils.d.ts.map +1 -1
- package/dist/_internal/ViewRubrics/types.d.ts +5 -0
- package/dist/_internal/ViewRubrics/types.d.ts.map +1 -1
- package/dist/_internal/ViewRubrics/useRubricImport.d.ts +22 -0
- package/dist/_internal/ViewRubrics/useRubricImport.d.ts.map +1 -0
- package/dist/_internal/ViewRubrics/useRubricMutations.d.ts +27 -0
- package/dist/_internal/ViewRubrics/useRubricMutations.d.ts.map +1 -0
- package/dist/_internal/ViewRubrics/useRubricsQuery.d.ts.map +1 -1
- package/dist/_internal/ViewRubrics/useViewRubrics.d.ts +77 -0
- package/dist/_internal/ViewRubrics/useViewRubrics.d.ts.map +1 -0
- package/dist/_internal/ViewRubrics/usedLocations.d.ts +4 -0
- package/dist/_internal/ViewRubrics/usedLocations.d.ts.map +1 -0
- package/dist/_internal/constants/i18n.d.ts +47 -0
- package/dist/_internal/constants/i18n.d.ts.map +1 -1
- package/dist/canvas/RubricAssessment/RubricAssessmentTray.d.ts +6 -1
- package/dist/canvas/RubricAssessment/RubricAssessmentTray.d.ts.map +1 -1
- package/dist/canvas/RubricAssignment/components/RubricAssignmentContainer.d.ts.map +1 -1
- package/dist/canvas/RubricAssignment/components/RubricSearchTray/RubricContextSelect.d.ts.map +1 -1
- package/dist/canvas/RubricAssignment/components/RubricSearchTray/RubricSearchTray.d.ts.map +1 -1
- package/dist/canvas/RubricAssignment/components/RubricSearchTray/RubricsForContext.d.ts.map +1 -1
- package/dist/canvas/RubricAssignment/components/RubricSelfAssessmentSettings.d.ts.map +1 -1
- package/dist/canvas/RubricForm/components/AIGeneratedCriteria/Feedback/GeneratedCriteriaFeedbackModal.d.ts.map +1 -1
- package/dist/canvas/RubricForm/components/AIGeneratedCriteria/GeneratedCriteriaForm.d.ts +0 -1
- package/dist/canvas/RubricForm/components/AIGeneratedCriteria/GeneratedCriteriaForm.d.ts.map +1 -1
- package/dist/canvas/RubricForm/components/AIGeneratedCriteria/RegenerateCriteriaModal.d.ts.map +1 -1
- package/dist/canvas/RubricForm/index.d.ts.map +1 -1
- package/dist/canvas/ViewRubrics/DeleteRubricModal.d.ts.map +1 -1
- package/dist/canvas/ViewRubrics/DuplicateRubricModal.d.ts.map +1 -1
- package/dist/canvas/ViewRubrics/ImportRubric/index.d.ts.map +1 -1
- package/dist/canvas/ViewRubrics/RubricTable.d.ts +2 -1
- package/dist/canvas/ViewRubrics/RubricTable.d.ts.map +1 -1
- package/dist/canvas/ViewRubrics/UsedLocationsModal.d.ts.map +1 -1
- package/dist/canvas/ViewRubrics/ViewRubricsPaginated.d.ts.map +1 -1
- package/dist/canvas/ViewRubrics/shared.d.ts +1 -4
- package/dist/canvas/ViewRubrics/shared.d.ts.map +1 -1
- package/dist/canvas.js +6323 -10721
- package/dist/chunks/ErrorShip-Dzd13wSZ.js +5338 -0
- package/dist/chunks/{errorPage-CMPx9rIp.js → errorPage-Jon3K-u6.js} +65 -55
- package/dist/chunks/useLocalStorage-BoUaI48x.js +41 -0
- package/dist/foundation/RubricBuilder/RubricBuilder.d.ts +11 -0
- package/dist/foundation/RubricBuilder/RubricBuilder.d.ts.map +1 -0
- package/dist/foundation/RubricBuilder/components/ConfirmModal.d.ts +12 -0
- package/dist/foundation/RubricBuilder/components/ConfirmModal.d.ts.map +1 -0
- package/dist/foundation/RubricBuilder/components/CriteriaSection.d.ts +9 -0
- package/dist/foundation/RubricBuilder/components/CriteriaSection.d.ts.map +1 -0
- package/dist/foundation/RubricBuilder/components/RubricBuilderFooter.d.ts +7 -0
- package/dist/foundation/RubricBuilder/components/RubricBuilderFooter.d.ts.map +1 -0
- package/dist/foundation/RubricBuilder/components/RubricBuilderHeader.d.ts +6 -0
- package/dist/foundation/RubricBuilder/components/RubricBuilderHeader.d.ts.map +1 -0
- package/dist/foundation/RubricBuilder/components/RubricDetailsCard.d.ts +10 -0
- package/dist/foundation/RubricBuilder/components/RubricDetailsCard.d.ts.map +1 -0
- package/dist/foundation/RubricBuilder/components/criteria/CriteriaList.d.ts +15 -0
- package/dist/foundation/RubricBuilder/components/criteria/CriteriaList.d.ts.map +1 -0
- package/dist/foundation/RubricBuilder/components/criteria/CriterionCard.d.ts +18 -0
- package/dist/foundation/RubricBuilder/components/criteria/CriterionCard.d.ts.map +1 -0
- package/dist/foundation/RubricBuilder/components/criteria/RatingList.d.ts +9 -0
- package/dist/foundation/RubricBuilder/components/criteria/RatingList.d.ts.map +1 -0
- package/dist/foundation/RubricBuilder/components/criteria/RatingRow.d.ts +15 -0
- package/dist/foundation/RubricBuilder/components/criteria/RatingRow.d.ts.map +1 -0
- package/dist/foundation/index.d.ts +3 -0
- package/dist/foundation/index.d.ts.map +1 -1
- package/dist/foundation.js +756 -59
- package/dist/index.js +8 -8
- package/locales/en.json +47 -0
- package/package.json +5 -5
- package/dist/chunks/helloWorld-DAP1kQju.js +0 -53
- package/dist/chunks/useRubricsPlatformUiContext-BNQd8FbG.js +0 -585
package/dist/foundation.js
CHANGED
|
@@ -1,19 +1,30 @@
|
|
|
1
|
-
import { g as
|
|
2
|
-
import { D as
|
|
1
|
+
import { g as De, u as we, R as Le, r as Te, e as ee, b as Ee } from "./chunks/errorPage-Jon3K-u6.js";
|
|
2
|
+
import { D as Zr, a as ei } from "./chunks/errorPage-Jon3K-u6.js";
|
|
3
3
|
import "@instructure/platform-provider";
|
|
4
|
-
import "react";
|
|
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
|
-
|
|
4
|
+
import { useState as k, useEffect as $, useRef as X, useCallback as ke } from "react";
|
|
5
|
+
import { jsx as e, jsxs as c, Fragment as xe } from "react/jsx-runtime";
|
|
6
|
+
import { Heading as A } from "@instructure/ui-heading";
|
|
7
|
+
import { View as h } from "@instructure/ui-view";
|
|
8
|
+
import { Button as x, CloseButton as Pe, IconButton as j } from "@instructure/ui-buttons";
|
|
9
|
+
import { Flex as p } from "@instructure/ui-flex";
|
|
10
|
+
import { SimpleSelect as V } from "@instructure/ui-simple-select";
|
|
11
|
+
import { Spinner as Ae } from "@instructure/ui-spinner";
|
|
12
|
+
import { Text as I } from "@instructure/ui-text";
|
|
13
|
+
import { useQuery as Oe } from "@tanstack/react-query";
|
|
14
|
+
import { u as Ne, T as te, t as ae, i as ne, a as D, b as le, p as re, C as oe, c as ie, d as Me, e as se, f as K, s as de, K as ce, P as ue, r as He, D as me, S as be, v as ge, g as Ue, h as _e, j as qe, k as ze, l as Fe, m as Ge, n as We, w as $e, o as je, q as Ke, x as Qe, y as Ve, z as Xe, A as Ye, B as Je } from "./chunks/ErrorShip-Dzd13wSZ.js";
|
|
15
|
+
import Ze from "graphql-tag";
|
|
16
|
+
import { LoadingIndicator as er } from "@instructure/platform-loading-indicator";
|
|
17
|
+
import { Alert as rr } from "@instructure/ui-alerts";
|
|
18
|
+
import { IconDragHandleLine as he, IconTrashLine as pe, IconAddLine as fe, IconArrowOpenDownLine as ir, IconArrowOpenEndLine as tr, IconDuplicateLine as ar } from "@instructure/ui-icons";
|
|
19
|
+
import { Modal as G } from "@instructure/ui-modal";
|
|
20
|
+
import { ScreenReaderContent as nr } from "@instructure/ui-a11y-content";
|
|
21
|
+
import { Checkbox as lr } from "@instructure/ui-checkbox";
|
|
22
|
+
import { Pill as Ce } from "@instructure/ui-pill";
|
|
23
|
+
import { TextArea as or } from "@instructure/ui-text-area";
|
|
24
|
+
import { TextInput as Q } from "@instructure/ui-text-input";
|
|
25
|
+
import { NumberInput as sr } from "@instructure/ui-number-input";
|
|
26
|
+
import { RadioInputGroup as dr, RadioInput as cr } from "@instructure/ui-radio-input";
|
|
27
|
+
const Qr = () => /* @__PURE__ */ e(h, { as: "div", padding: "small", children: /* @__PURE__ */ e(A, { level: "h2", children: De("foundation") }) }), ur = Ze`
|
|
17
28
|
query CourseRubricsList($courseId: ID!, $first: Int) {
|
|
18
29
|
course(id: $courseId) {
|
|
19
30
|
rubricsConnection(first: $first) {
|
|
@@ -31,74 +42,760 @@ const K = () => /* @__PURE__ */ e(o, { as: "div", padding: "small", children: /*
|
|
|
31
42
|
}
|
|
32
43
|
}
|
|
33
44
|
`;
|
|
34
|
-
function
|
|
35
|
-
const { executeQuery:
|
|
36
|
-
return
|
|
37
|
-
queryKey: ["courseRubrics",
|
|
45
|
+
function mr(r) {
|
|
46
|
+
const { executeQuery: n } = Ne();
|
|
47
|
+
return Oe({
|
|
48
|
+
queryKey: ["courseRubrics", r],
|
|
38
49
|
queryFn: async () => {
|
|
39
|
-
var
|
|
40
|
-
const { course:
|
|
41
|
-
courseId:
|
|
50
|
+
var o;
|
|
51
|
+
const { course: d } = await n(ur, {
|
|
52
|
+
courseId: r,
|
|
42
53
|
first: 50
|
|
43
|
-
}),
|
|
54
|
+
}), i = d == null ? void 0 : d.rubricsConnection;
|
|
44
55
|
return {
|
|
45
|
-
rubrics: ((
|
|
46
|
-
(
|
|
56
|
+
rubrics: ((i == null ? void 0 : i.nodes) ?? []).filter(
|
|
57
|
+
(t) => t != null
|
|
47
58
|
),
|
|
48
|
-
hasMore: ((
|
|
59
|
+
hasMore: ((o = i == null ? void 0 : i.pageInfo) == null ? void 0 : o.hasNextPage) ?? !1
|
|
49
60
|
};
|
|
50
61
|
},
|
|
51
|
-
enabled: !!
|
|
62
|
+
enabled: !!r
|
|
52
63
|
});
|
|
53
64
|
}
|
|
54
|
-
const
|
|
55
|
-
courseId:
|
|
56
|
-
value:
|
|
57
|
-
onChange:
|
|
65
|
+
const Vr = (r) => /* @__PURE__ */ e(te, { translations: ne, translate: ae, children: /* @__PURE__ */ e(br, { ...r }) }), br = ({
|
|
66
|
+
courseId: r,
|
|
67
|
+
value: n,
|
|
68
|
+
onChange: d
|
|
58
69
|
}) => {
|
|
59
|
-
const { translations:
|
|
60
|
-
return
|
|
61
|
-
/* @__PURE__ */ e(
|
|
62
|
-
/* @__PURE__ */ e(
|
|
63
|
-
] }) :
|
|
64
|
-
/* @__PURE__ */ e(
|
|
65
|
-
|
|
70
|
+
const { translations: i } = D(), { data: o, isLoading: t, isError: a, refetch: s } = mr(r), m = o == null ? void 0 : o.rubrics;
|
|
71
|
+
return t ? /* @__PURE__ */ c(h, { as: "div", role: "status", "aria-live": "polite", margin: "0 0 medium", children: [
|
|
72
|
+
/* @__PURE__ */ e(Ae, { renderTitle: i.rubricSelectorLoading, size: "x-small" }),
|
|
73
|
+
/* @__PURE__ */ e(h, { as: "span", padding: "0 0 0 x-small", children: /* @__PURE__ */ e(I, { size: "small", children: i.rubricSelectorLoading }) })
|
|
74
|
+
] }) : a ? /* @__PURE__ */ e(h, { as: "div", margin: "0 0 medium", children: /* @__PURE__ */ c(p, { gap: "small", alignItems: "center", wrap: "wrap", children: [
|
|
75
|
+
/* @__PURE__ */ e(p.Item, { children: /* @__PURE__ */ c(I, { size: "small", color: "danger", children: [
|
|
76
|
+
i.rubricSelectorErrorTitle,
|
|
66
77
|
". ",
|
|
67
|
-
|
|
78
|
+
i.rubricSelectorErrorBody
|
|
68
79
|
] }) }),
|
|
69
|
-
/* @__PURE__ */ e(
|
|
70
|
-
] }) }) : !
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
|
|
80
|
+
/* @__PURE__ */ e(p.Item, { children: /* @__PURE__ */ e(x, { size: "small", onClick: () => s(), children: i.rubricSelectorRetry }) })
|
|
81
|
+
] }) }) : !m || m.length === 0 ? /* @__PURE__ */ e(h, { as: "div", margin: "0 0 medium", children: /* @__PURE__ */ e(I, { size: "small", children: i.rubricSelectorEmpty }) }) : /* @__PURE__ */ c(h, { as: "div", margin: "0 0 medium", maxWidth: "360px", children: [
|
|
82
|
+
/* @__PURE__ */ c(
|
|
83
|
+
V,
|
|
73
84
|
{
|
|
74
|
-
renderLabel:
|
|
75
|
-
assistiveText:
|
|
76
|
-
value:
|
|
77
|
-
onChange: (l, { value:
|
|
78
|
-
if (typeof
|
|
79
|
-
const
|
|
80
|
-
|
|
85
|
+
renderLabel: i.rubricSelectorLabel,
|
|
86
|
+
assistiveText: i.rubricSelectorAssistiveText,
|
|
87
|
+
value: n ?? "",
|
|
88
|
+
onChange: (l, { value: u }) => {
|
|
89
|
+
if (typeof u != "string" || !u) return;
|
|
90
|
+
const g = m.find((f) => f.id === u);
|
|
91
|
+
d(u, (g == null ? void 0 : g.title) ?? "");
|
|
81
92
|
},
|
|
82
93
|
children: [
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
94
|
+
n === void 0 && /* @__PURE__ */ e(V.Option, { id: "rubrics-rubric-selector-placeholder", value: "", children: i.rubricSelectorPlaceholder }),
|
|
95
|
+
m.map((l) => /* @__PURE__ */ e(
|
|
96
|
+
V.Option,
|
|
86
97
|
{
|
|
87
98
|
id: `rubrics-rubric-selector-option-${l.id}`,
|
|
88
99
|
value: l.id,
|
|
89
|
-
children: l.title ||
|
|
100
|
+
children: l.title || i.rubricSelectorUntitled
|
|
90
101
|
},
|
|
91
102
|
l.id
|
|
92
103
|
))
|
|
93
104
|
]
|
|
94
105
|
}
|
|
95
106
|
),
|
|
96
|
-
(
|
|
107
|
+
(o == null ? void 0 : o.hasMore) && /* @__PURE__ */ e(h, { as: "div", padding: "xx-small 0 0", children: /* @__PURE__ */ e(I, { size: "x-small", color: "secondary", children: i.rubricSelectorTruncated }) })
|
|
108
|
+
] });
|
|
109
|
+
}, Y = ({
|
|
110
|
+
isOpen: r,
|
|
111
|
+
heading: n,
|
|
112
|
+
body: d,
|
|
113
|
+
confirmLabel: i,
|
|
114
|
+
cancelLabel: o,
|
|
115
|
+
onConfirm: t,
|
|
116
|
+
onDismiss: a,
|
|
117
|
+
"data-testid": s
|
|
118
|
+
}) => {
|
|
119
|
+
const { translations: m } = D();
|
|
120
|
+
return /* @__PURE__ */ c(G, { open: r, onDismiss: a, size: "small", label: n, "data-testid": s, children: [
|
|
121
|
+
/* @__PURE__ */ c(G.Header, { children: [
|
|
122
|
+
/* @__PURE__ */ e(
|
|
123
|
+
Pe,
|
|
124
|
+
{
|
|
125
|
+
placement: "end",
|
|
126
|
+
offset: "small",
|
|
127
|
+
onClick: a,
|
|
128
|
+
screenReaderLabel: m.close
|
|
129
|
+
}
|
|
130
|
+
),
|
|
131
|
+
/* @__PURE__ */ e(A, { level: "h2", children: n })
|
|
132
|
+
] }),
|
|
133
|
+
/* @__PURE__ */ e(G.Body, { children: /* @__PURE__ */ e(I, { children: d }) }),
|
|
134
|
+
/* @__PURE__ */ c(G.Footer, { children: [
|
|
135
|
+
/* @__PURE__ */ e(x, { onClick: a, margin: "0 x-small 0 0", children: o }),
|
|
136
|
+
/* @__PURE__ */ e(x, { color: "primary", onClick: t, "data-testid": "confirm-modal-confirm", children: i })
|
|
137
|
+
] })
|
|
138
|
+
] });
|
|
139
|
+
}, gr = ({
|
|
140
|
+
criteriaCount: r,
|
|
141
|
+
showMissingCriteriaError: n,
|
|
142
|
+
actions: d,
|
|
143
|
+
children: i
|
|
144
|
+
}) => {
|
|
145
|
+
const { translations: o } = D();
|
|
146
|
+
return /* @__PURE__ */ c(h, { as: "section", "aria-labelledby": "rubric-builder-criteria-heading", children: [
|
|
147
|
+
/* @__PURE__ */ c(p, { justifyItems: "space-between", alignItems: "center", wrap: "wrap", gap: "small", children: [
|
|
148
|
+
/* @__PURE__ */ e(A, { level: "h3", id: "rubric-builder-criteria-heading", children: o.rubricBuilderCriteriaHeading }),
|
|
149
|
+
d && /* @__PURE__ */ e(p, { gap: "small", wrap: "wrap", children: d })
|
|
150
|
+
] }),
|
|
151
|
+
/* @__PURE__ */ e(h, { as: "div", margin: "small 0 0", children: r === 0 ? /* @__PURE__ */ e(I, { color: "secondary", children: o.rubricBuilderCriteriaEmpty }) : i }),
|
|
152
|
+
/* @__PURE__ */ e("div", { "aria-live": "polite", children: n && r === 0 && /* @__PURE__ */ e(I, { color: "danger", "data-testid": "rubric-builder-criteria-error", children: o.rubricBuilderAddCriterionError }) })
|
|
153
|
+
] });
|
|
154
|
+
}, hr = ({
|
|
155
|
+
rating: r,
|
|
156
|
+
sortableId: n,
|
|
157
|
+
position: d,
|
|
158
|
+
rangeStart: i,
|
|
159
|
+
useRange: o,
|
|
160
|
+
showNameError: t,
|
|
161
|
+
canRemove: a,
|
|
162
|
+
onChange: s,
|
|
163
|
+
onPointsBlur: m,
|
|
164
|
+
onRemove: l
|
|
165
|
+
}) => {
|
|
166
|
+
const { translations: u, translate: g } = D(), { attributes: f, listeners: S, setNodeRef: L, transform: P, transition: B } = le({
|
|
167
|
+
id: n
|
|
168
|
+
}), [v, T] = k(String(r.points));
|
|
169
|
+
$(() => {
|
|
170
|
+
re(v) !== r.points && T(String(r.points));
|
|
171
|
+
}, [r.points]);
|
|
172
|
+
const E = (C, R) => {
|
|
173
|
+
T(R), s({ ...r, points: C });
|
|
174
|
+
};
|
|
175
|
+
return /* @__PURE__ */ e(
|
|
176
|
+
"div",
|
|
177
|
+
{
|
|
178
|
+
ref: L,
|
|
179
|
+
style: { transform: oe.Transform.toString(P), transition: B },
|
|
180
|
+
"data-testid": "rubric-builder-rating-row",
|
|
181
|
+
children: /* @__PURE__ */ c(p, { gap: "small", alignItems: "start", wrap: "wrap", margin: "0 0 small", children: [
|
|
182
|
+
/* @__PURE__ */ e(
|
|
183
|
+
h,
|
|
184
|
+
{
|
|
185
|
+
as: "div",
|
|
186
|
+
cursor: "grab",
|
|
187
|
+
margin: "medium 0 0",
|
|
188
|
+
"aria-label": g("rubricBuilderReorderRating", { position: d }),
|
|
189
|
+
...f,
|
|
190
|
+
...S,
|
|
191
|
+
children: /* @__PURE__ */ e(he, { "aria-hidden": "true" })
|
|
192
|
+
}
|
|
193
|
+
),
|
|
194
|
+
/* @__PURE__ */ e(h, { as: "div", minWidth: "1.5rem", margin: "medium 0 0", children: /* @__PURE__ */ e(I, { weight: "bold", "aria-hidden": "true", children: d }) }),
|
|
195
|
+
/* @__PURE__ */ c(p, { gap: "x-small", alignItems: "end", children: [
|
|
196
|
+
o && i !== void 0 && /* @__PURE__ */ e(h, { as: "div", margin: "0 0 x-small", children: /* @__PURE__ */ e(I, { children: g("rangeStartPrefix", { rangeStart: i }) }) }),
|
|
197
|
+
/* @__PURE__ */ e(
|
|
198
|
+
sr,
|
|
199
|
+
{
|
|
200
|
+
renderLabel: o ? u.rubricBuilderPointRangeLabel : u.rubricBuilderPointsLabel,
|
|
201
|
+
allowStringValue: !0,
|
|
202
|
+
showArrows: !1,
|
|
203
|
+
width: "6rem",
|
|
204
|
+
value: v,
|
|
205
|
+
onChange: (C, R) => {
|
|
206
|
+
Me(R) && E(re(R), R);
|
|
207
|
+
},
|
|
208
|
+
onIncrement: () => {
|
|
209
|
+
const C = ie(Math.floor(r.points) + 1);
|
|
210
|
+
E(C, String(C));
|
|
211
|
+
},
|
|
212
|
+
onDecrement: () => {
|
|
213
|
+
const C = ie(Math.floor(r.points) - 1);
|
|
214
|
+
E(C, String(C));
|
|
215
|
+
},
|
|
216
|
+
onBlur: m,
|
|
217
|
+
"data-testid": "rubric-builder-rating-points"
|
|
218
|
+
}
|
|
219
|
+
)
|
|
220
|
+
] }),
|
|
221
|
+
/* @__PURE__ */ e(p.Item, { shouldGrow: !0, shouldShrink: !0, size: "10rem", children: /* @__PURE__ */ e(
|
|
222
|
+
Q,
|
|
223
|
+
{
|
|
224
|
+
renderLabel: u.rubricBuilderRatingNameLabel,
|
|
225
|
+
isRequired: !0,
|
|
226
|
+
value: r.description,
|
|
227
|
+
onChange: (C) => s({ ...r, description: C.target.value }),
|
|
228
|
+
messages: t ? [{ text: u.rubricBuilderRatingNameRequired, type: "error" }] : [],
|
|
229
|
+
"data-testid": "rubric-builder-rating-name"
|
|
230
|
+
}
|
|
231
|
+
) }),
|
|
232
|
+
/* @__PURE__ */ e(p.Item, { shouldGrow: !0, shouldShrink: !0, size: "14rem", children: /* @__PURE__ */ e(
|
|
233
|
+
Q,
|
|
234
|
+
{
|
|
235
|
+
renderLabel: u.rubricBuilderRatingDescriptionLabel,
|
|
236
|
+
value: r.longDescription,
|
|
237
|
+
onChange: (C) => s({ ...r, longDescription: C.target.value }),
|
|
238
|
+
"data-testid": "rubric-builder-rating-description"
|
|
239
|
+
}
|
|
240
|
+
) }),
|
|
241
|
+
a && /* @__PURE__ */ e(h, { as: "div", margin: "medium 0 0", children: /* @__PURE__ */ e(
|
|
242
|
+
j,
|
|
243
|
+
{
|
|
244
|
+
screenReaderLabel: g("rubricBuilderRemoveRating", { position: d }),
|
|
245
|
+
withBackground: !1,
|
|
246
|
+
withBorder: !1,
|
|
247
|
+
onClick: l,
|
|
248
|
+
"data-testid": "rubric-builder-remove-rating",
|
|
249
|
+
children: /* @__PURE__ */ e(pe, {})
|
|
250
|
+
}
|
|
251
|
+
) })
|
|
252
|
+
] })
|
|
253
|
+
}
|
|
254
|
+
);
|
|
255
|
+
}, pr = ({
|
|
256
|
+
ratings: r,
|
|
257
|
+
useRange: n,
|
|
258
|
+
ratingNamesRequired: d,
|
|
259
|
+
onChange: i
|
|
260
|
+
}) => {
|
|
261
|
+
const { translations: o } = D(), t = se(
|
|
262
|
+
K(ue, { activationConstraint: { distance: 8 } }),
|
|
263
|
+
K(ce, { coordinateGetter: de })
|
|
264
|
+
), a = r.map(He);
|
|
265
|
+
return /* @__PURE__ */ c(h, { as: "div", children: [
|
|
266
|
+
/* @__PURE__ */ e(me, { sensors: t, onDragEnd: ({ active: m, over: l }) => {
|
|
267
|
+
if (!l || m.id === l.id) return;
|
|
268
|
+
const u = a.indexOf(String(m.id)), g = a.indexOf(String(l.id));
|
|
269
|
+
u === -1 || g === -1 || i(Ge({ list: r, startIndex: u, endIndex: g }));
|
|
270
|
+
}, children: /* @__PURE__ */ e(be, { items: a, strategy: ge, children: r.map((m, l) => /* @__PURE__ */ e(
|
|
271
|
+
hr,
|
|
272
|
+
{
|
|
273
|
+
rating: m,
|
|
274
|
+
sortableId: a[l],
|
|
275
|
+
position: l + 1,
|
|
276
|
+
rangeStart: Ue(r, l),
|
|
277
|
+
useRange: n,
|
|
278
|
+
showNameError: d.includes(l),
|
|
279
|
+
canRemove: r.length > 1,
|
|
280
|
+
onChange: (u) => i(ze(r, l, u)),
|
|
281
|
+
onPointsBlur: () => i(qe(r)),
|
|
282
|
+
onRemove: () => i(_e(r, l))
|
|
283
|
+
},
|
|
284
|
+
a[l]
|
|
285
|
+
)) }) }),
|
|
286
|
+
/* @__PURE__ */ e(
|
|
287
|
+
x,
|
|
288
|
+
{
|
|
289
|
+
renderIcon: /* @__PURE__ */ e(fe, {}),
|
|
290
|
+
withBackground: !1,
|
|
291
|
+
onClick: () => i(Fe(r, r.length)),
|
|
292
|
+
"data-testid": "rubric-builder-add-rating",
|
|
293
|
+
children: o.rubricBuilderAddRatingLevel
|
|
294
|
+
}
|
|
295
|
+
)
|
|
296
|
+
] });
|
|
297
|
+
}, fr = ({
|
|
298
|
+
criterion: r,
|
|
299
|
+
sortableId: n,
|
|
300
|
+
position: d,
|
|
301
|
+
errors: i,
|
|
302
|
+
showErrors: o,
|
|
303
|
+
shouldFocusName: t,
|
|
304
|
+
shouldFocusHandle: a,
|
|
305
|
+
onNameFocused: s,
|
|
306
|
+
onHandleFocused: m,
|
|
307
|
+
onChange: l,
|
|
308
|
+
onDuplicate: u,
|
|
309
|
+
onDelete: g
|
|
310
|
+
}) => {
|
|
311
|
+
const { translations: f, translate: S } = D(), { rubricCriterionRange: L } = we(), { attributes: P, listeners: B, setNodeRef: v, transform: T, transition: E, isDragging: C } = le({
|
|
312
|
+
id: n
|
|
313
|
+
}), [R, _] = k(!r.description.trim()), [O, N] = k(!1), q = X(null), M = X(null), H = o && We(i), z = S("rubricBuilderCriterionHeading", { position: d }), U = r.description.trim(), w = U || z, F = `rubric-builder-criterion-body-${n}`;
|
|
314
|
+
return $(() => {
|
|
315
|
+
H && _(!0);
|
|
316
|
+
}, [H]), $(() => {
|
|
317
|
+
var b;
|
|
318
|
+
t && R && ((b = q.current) == null || b.focus(), s());
|
|
319
|
+
}, [t, R, s]), $(() => {
|
|
320
|
+
var b;
|
|
321
|
+
a && ((b = M.current) == null || b.focus(), m());
|
|
322
|
+
}, [a, m]), /* @__PURE__ */ c(
|
|
323
|
+
"div",
|
|
324
|
+
{
|
|
325
|
+
ref: v,
|
|
326
|
+
style: { transform: oe.Transform.toString(T), transition: E },
|
|
327
|
+
"data-testid": "rubric-builder-criterion-card",
|
|
328
|
+
children: [
|
|
329
|
+
/* @__PURE__ */ c(
|
|
330
|
+
h,
|
|
331
|
+
{
|
|
332
|
+
as: "section",
|
|
333
|
+
"aria-label": w,
|
|
334
|
+
borderWidth: "small",
|
|
335
|
+
borderRadius: "medium",
|
|
336
|
+
padding: "small medium",
|
|
337
|
+
margin: "0 0 small",
|
|
338
|
+
background: "primary",
|
|
339
|
+
shadow: C ? "above" : "none",
|
|
340
|
+
children: [
|
|
341
|
+
/* @__PURE__ */ c(p, { gap: "small", alignItems: "center", wrap: "wrap", children: [
|
|
342
|
+
/* @__PURE__ */ e(
|
|
343
|
+
"div",
|
|
344
|
+
{
|
|
345
|
+
ref: M,
|
|
346
|
+
"aria-label": S("rubricBuilderReorderCriterion", { name: w }),
|
|
347
|
+
"data-testid": "rubric-builder-criterion-drag-handle",
|
|
348
|
+
...P,
|
|
349
|
+
...B,
|
|
350
|
+
children: /* @__PURE__ */ e(he, { "aria-hidden": "true" })
|
|
351
|
+
}
|
|
352
|
+
),
|
|
353
|
+
/* @__PURE__ */ e(
|
|
354
|
+
j,
|
|
355
|
+
{
|
|
356
|
+
screenReaderLabel: S(
|
|
357
|
+
R ? "rubricBuilderCollapseCriterion" : "rubricBuilderExpandCriterion",
|
|
358
|
+
{ name: w }
|
|
359
|
+
),
|
|
360
|
+
"aria-expanded": R,
|
|
361
|
+
"aria-controls": F,
|
|
362
|
+
withBackground: !1,
|
|
363
|
+
withBorder: !1,
|
|
364
|
+
size: "small",
|
|
365
|
+
onClick: () => _((b) => !b),
|
|
366
|
+
"data-testid": "rubric-builder-criterion-toggle",
|
|
367
|
+
children: R ? /* @__PURE__ */ e(ir, {}) : /* @__PURE__ */ e(tr, {})
|
|
368
|
+
}
|
|
369
|
+
),
|
|
370
|
+
/* @__PURE__ */ e(p.Item, { shouldGrow: !0, shouldShrink: !0, children: /* @__PURE__ */ c(A, { level: "h4", children: [
|
|
371
|
+
z,
|
|
372
|
+
U && /* @__PURE__ */ e(I, { weight: "normal", "data-testid": "rubric-builder-criterion-name", children: `: ${U}` })
|
|
373
|
+
] }) }),
|
|
374
|
+
/* @__PURE__ */ e(Ce, { "data-testid": "rubric-builder-criterion-max", children: S("rubricBuilderCriterionMaxPoints", { count: r.points }) }),
|
|
375
|
+
/* @__PURE__ */ e(
|
|
376
|
+
j,
|
|
377
|
+
{
|
|
378
|
+
screenReaderLabel: S("rubricBuilderDuplicateCriterion", { name: w }),
|
|
379
|
+
withBackground: !1,
|
|
380
|
+
withBorder: !1,
|
|
381
|
+
onClick: u,
|
|
382
|
+
"data-testid": "rubric-builder-duplicate-criterion",
|
|
383
|
+
children: /* @__PURE__ */ e(ar, {})
|
|
384
|
+
}
|
|
385
|
+
),
|
|
386
|
+
/* @__PURE__ */ e(
|
|
387
|
+
j,
|
|
388
|
+
{
|
|
389
|
+
screenReaderLabel: S("rubricBuilderDeleteCriterion", { name: w }),
|
|
390
|
+
withBackground: !1,
|
|
391
|
+
withBorder: !1,
|
|
392
|
+
onClick: () => N(!0),
|
|
393
|
+
"data-testid": "rubric-builder-delete-criterion",
|
|
394
|
+
children: /* @__PURE__ */ e(pe, {})
|
|
395
|
+
}
|
|
396
|
+
)
|
|
397
|
+
] }),
|
|
398
|
+
R && /* @__PURE__ */ e(h, { as: "div", id: F, margin: "medium 0 0", children: /* @__PURE__ */ c(p, { direction: "column", gap: "medium", children: [
|
|
399
|
+
/* @__PURE__ */ e(
|
|
400
|
+
Q,
|
|
401
|
+
{
|
|
402
|
+
renderLabel: f.rubricBuilderCriterionNameLabel,
|
|
403
|
+
isRequired: !0,
|
|
404
|
+
value: r.description,
|
|
405
|
+
inputRef: (b) => {
|
|
406
|
+
q.current = b;
|
|
407
|
+
},
|
|
408
|
+
onChange: (b) => l({ ...r, description: b.target.value }),
|
|
409
|
+
messages: o && i.nameRequired ? [{ text: f.rubricBuilderCriterionNameRequired, type: "error" }] : [],
|
|
410
|
+
"data-testid": "rubric-builder-criterion-name-input"
|
|
411
|
+
}
|
|
412
|
+
),
|
|
413
|
+
/* @__PURE__ */ e(
|
|
414
|
+
or,
|
|
415
|
+
{
|
|
416
|
+
label: f.rubricBuilderCriterionDescriptionLabel,
|
|
417
|
+
value: r.longDescription ?? "",
|
|
418
|
+
onChange: (b) => l({ ...r, longDescription: b.target.value }),
|
|
419
|
+
"data-testid": "rubric-builder-criterion-description"
|
|
420
|
+
}
|
|
421
|
+
),
|
|
422
|
+
L && /* @__PURE__ */ e(
|
|
423
|
+
lr,
|
|
424
|
+
{
|
|
425
|
+
variant: "toggle",
|
|
426
|
+
label: f.rubricBuilderEnableRange,
|
|
427
|
+
checked: r.criterionUseRange,
|
|
428
|
+
onChange: (b) => l({ ...r, criterionUseRange: b.target.checked }),
|
|
429
|
+
"data-testid": "rubric-builder-enable-range"
|
|
430
|
+
}
|
|
431
|
+
),
|
|
432
|
+
/* @__PURE__ */ e(
|
|
433
|
+
pr,
|
|
434
|
+
{
|
|
435
|
+
ratings: r.ratings,
|
|
436
|
+
useRange: r.criterionUseRange,
|
|
437
|
+
ratingNamesRequired: o ? i.ratingNamesRequired : [],
|
|
438
|
+
onChange: (b) => l($e(r, b))
|
|
439
|
+
}
|
|
440
|
+
)
|
|
441
|
+
] }) })
|
|
442
|
+
]
|
|
443
|
+
}
|
|
444
|
+
),
|
|
445
|
+
/* @__PURE__ */ e(
|
|
446
|
+
Y,
|
|
447
|
+
{
|
|
448
|
+
isOpen: O,
|
|
449
|
+
heading: f.rubricBuilderCriterionDeleteHeading,
|
|
450
|
+
body: f.rubricBuilderCriterionDeleteBody,
|
|
451
|
+
confirmLabel: f.delete,
|
|
452
|
+
cancelLabel: f.cancel,
|
|
453
|
+
onConfirm: () => {
|
|
454
|
+
N(!1), g();
|
|
455
|
+
},
|
|
456
|
+
onDismiss: () => N(!1),
|
|
457
|
+
"data-testid": "rubric-builder-delete-criterion-modal"
|
|
458
|
+
}
|
|
459
|
+
)
|
|
460
|
+
]
|
|
461
|
+
}
|
|
462
|
+
);
|
|
463
|
+
}, Cr = ({
|
|
464
|
+
criteria: r,
|
|
465
|
+
criteriaValidationErrors: n,
|
|
466
|
+
showErrors: d,
|
|
467
|
+
focusNameCriterionId: i,
|
|
468
|
+
onFocusedName: o,
|
|
469
|
+
onChangeCriterion: t,
|
|
470
|
+
onDuplicateCriterion: a,
|
|
471
|
+
onDeleteCriterion: s,
|
|
472
|
+
onReorderCriteria: m
|
|
473
|
+
}) => {
|
|
474
|
+
const {
|
|
475
|
+
sortableIds: l,
|
|
476
|
+
movedCriterionId: u,
|
|
477
|
+
clearMovedCriterion: g,
|
|
478
|
+
srAnnouncement: f,
|
|
479
|
+
moveCriterionBySortableId: S
|
|
480
|
+
} = je({ criteria: r, onReorderCriteria: m }), L = se(
|
|
481
|
+
K(ue, { activationConstraint: { distance: 8 } }),
|
|
482
|
+
K(ce, { coordinateGetter: de })
|
|
483
|
+
);
|
|
484
|
+
return /* @__PURE__ */ c(xe, { children: [
|
|
485
|
+
/* @__PURE__ */ e(nr, { children: /* @__PURE__ */ e("div", { "aria-live": "polite", "aria-atomic": "true", children: f }) }),
|
|
486
|
+
/* @__PURE__ */ e(me, { sensors: L, onDragEnd: ({ active: B, over: v }) => {
|
|
487
|
+
v && S(B.id, v.id);
|
|
488
|
+
}, children: /* @__PURE__ */ e(be, { items: l, strategy: ge, children: r.map((B, v) => /* @__PURE__ */ e(
|
|
489
|
+
fr,
|
|
490
|
+
{
|
|
491
|
+
criterion: B,
|
|
492
|
+
sortableId: l[v],
|
|
493
|
+
position: v + 1,
|
|
494
|
+
errors: n[v],
|
|
495
|
+
showErrors: d,
|
|
496
|
+
shouldFocusName: B.id === i,
|
|
497
|
+
shouldFocusHandle: B.id === u,
|
|
498
|
+
onNameFocused: o,
|
|
499
|
+
onHandleFocused: g,
|
|
500
|
+
onChange: t,
|
|
501
|
+
onDuplicate: () => a(B),
|
|
502
|
+
onDelete: () => s(B)
|
|
503
|
+
},
|
|
504
|
+
l[v]
|
|
505
|
+
)) }) })
|
|
506
|
+
] });
|
|
507
|
+
}, vr = ({
|
|
508
|
+
savePending: r,
|
|
509
|
+
onDiscard: n,
|
|
510
|
+
onSave: d
|
|
511
|
+
}) => {
|
|
512
|
+
const { translations: i } = D();
|
|
513
|
+
return /* @__PURE__ */ e(
|
|
514
|
+
h,
|
|
515
|
+
{
|
|
516
|
+
as: "footer",
|
|
517
|
+
position: "sticky",
|
|
518
|
+
insetBlockEnd: "0",
|
|
519
|
+
background: "primary",
|
|
520
|
+
borderWidth: "small none none none",
|
|
521
|
+
padding: "small 0",
|
|
522
|
+
stacking: "above",
|
|
523
|
+
children: /* @__PURE__ */ c(p, { justifyItems: "end", gap: "small", wrap: "wrap", children: [
|
|
524
|
+
/* @__PURE__ */ e(x, { onClick: n, "data-testid": "rubric-builder-discard", children: i.rubricBuilderDiscard }),
|
|
525
|
+
/* @__PURE__ */ e(
|
|
526
|
+
x,
|
|
527
|
+
{
|
|
528
|
+
color: "primary",
|
|
529
|
+
onClick: d,
|
|
530
|
+
interaction: r ? "disabled" : "enabled",
|
|
531
|
+
"data-testid": "rubric-builder-save",
|
|
532
|
+
children: i.rubricBuilderSave
|
|
533
|
+
}
|
|
534
|
+
)
|
|
535
|
+
] })
|
|
536
|
+
}
|
|
537
|
+
);
|
|
538
|
+
}, Rr = ({ isNewRubric: r, pointsPossible: n }) => {
|
|
539
|
+
const { translations: d, translate: i } = D();
|
|
540
|
+
return /* @__PURE__ */ c(p, { as: "header", justifyItems: "space-between", alignItems: "center", wrap: "wrap", gap: "small", children: [
|
|
541
|
+
/* @__PURE__ */ e(A, { level: "h2", children: r ? d.rubricBuilderCreateTitle : d.rubricBuilderEditTitle }),
|
|
542
|
+
/* @__PURE__ */ e(Ce, { "data-testid": "rubric-builder-current-total", children: i("rubricBuilderCurrentTotal", { count: n }) })
|
|
543
|
+
] });
|
|
544
|
+
}, W = ({ name: r, label: n, value: d, options: i, onChange: o }) => /* @__PURE__ */ e(
|
|
545
|
+
dr,
|
|
546
|
+
{
|
|
547
|
+
name: r,
|
|
548
|
+
description: n,
|
|
549
|
+
variant: "toggle",
|
|
550
|
+
layout: "columns",
|
|
551
|
+
value: d,
|
|
552
|
+
onChange: (t, a) => o(a),
|
|
553
|
+
children: i.map((t) => /* @__PURE__ */ e(cr, { value: t.value, label: t.label }, t.value))
|
|
554
|
+
}
|
|
555
|
+
), Br = ({
|
|
556
|
+
rubricForm: r,
|
|
557
|
+
setRubricFormField: n,
|
|
558
|
+
validateTitle: d,
|
|
559
|
+
titleError: i,
|
|
560
|
+
titleInputRef: o
|
|
561
|
+
}) => {
|
|
562
|
+
const { translations: t } = D(), a = (s) => {
|
|
563
|
+
if (s === "unscored" === r.hidePoints) return;
|
|
564
|
+
const { hidePoints: m, hideScoreTotal: l, useForGrading: u, buttonDisplay: g } = Ke(
|
|
565
|
+
r.hidePoints
|
|
566
|
+
);
|
|
567
|
+
n("hidePoints", m), n("hideScoreTotal", l), n("useForGrading", u), g && n("buttonDisplay", g);
|
|
568
|
+
};
|
|
569
|
+
return /* @__PURE__ */ c(
|
|
570
|
+
h,
|
|
571
|
+
{
|
|
572
|
+
as: "section",
|
|
573
|
+
"aria-labelledby": "rubric-builder-details-heading",
|
|
574
|
+
borderWidth: "small",
|
|
575
|
+
borderRadius: "medium",
|
|
576
|
+
padding: "medium",
|
|
577
|
+
children: [
|
|
578
|
+
/* @__PURE__ */ e(A, { level: "h3", id: "rubric-builder-details-heading", margin: "0 0 medium", children: t.rubricBuilderDetailsHeading }),
|
|
579
|
+
/* @__PURE__ */ c(p, { direction: "column", gap: "medium", children: [
|
|
580
|
+
/* @__PURE__ */ e(
|
|
581
|
+
Q,
|
|
582
|
+
{
|
|
583
|
+
"data-testid": "rubric-builder-name",
|
|
584
|
+
renderLabel: t.rubricBuilderNameLabel,
|
|
585
|
+
isRequired: !0,
|
|
586
|
+
value: r.title,
|
|
587
|
+
inputRef: o,
|
|
588
|
+
onChange: (s) => n("title", s.target.value),
|
|
589
|
+
onBlur: (s) => d(s.target.value),
|
|
590
|
+
messages: i ? [{ text: i, type: "error" }] : []
|
|
591
|
+
}
|
|
592
|
+
),
|
|
593
|
+
/* @__PURE__ */ c(p, { gap: "medium", wrap: "wrap", children: [
|
|
594
|
+
/* @__PURE__ */ e(
|
|
595
|
+
W,
|
|
596
|
+
{
|
|
597
|
+
name: "rubric-builder-scoring",
|
|
598
|
+
label: t.scoringTypeSelectLabel,
|
|
599
|
+
value: r.hidePoints ? "unscored" : "scored",
|
|
600
|
+
options: [
|
|
601
|
+
{ value: "scored", label: t.scoringTypeScored },
|
|
602
|
+
{ value: "unscored", label: t.scoringTypeUnscored }
|
|
603
|
+
],
|
|
604
|
+
onChange: a
|
|
605
|
+
}
|
|
606
|
+
),
|
|
607
|
+
/* @__PURE__ */ e(
|
|
608
|
+
W,
|
|
609
|
+
{
|
|
610
|
+
name: "rubric-builder-display",
|
|
611
|
+
label: t.rubricBuilderDisplayLabel,
|
|
612
|
+
value: r.buttonDisplay,
|
|
613
|
+
options: [
|
|
614
|
+
{ value: "points", label: t.ratingDisplayPoints },
|
|
615
|
+
{ value: "numeric", label: t.ratingDisplayLevel }
|
|
616
|
+
],
|
|
617
|
+
onChange: (s) => n("buttonDisplay", s)
|
|
618
|
+
}
|
|
619
|
+
),
|
|
620
|
+
/* @__PURE__ */ e(
|
|
621
|
+
W,
|
|
622
|
+
{
|
|
623
|
+
name: "rubric-builder-feedback",
|
|
624
|
+
label: t.rubricBuilderFeedbackLabel,
|
|
625
|
+
value: r.freeFormCriterionComments ? "freeForm" : "scale",
|
|
626
|
+
options: [
|
|
627
|
+
{ value: "scale", label: t.gradingTypeScale },
|
|
628
|
+
{ value: "freeForm", label: t.rubricBuilderFeedbackWrittenOnly }
|
|
629
|
+
],
|
|
630
|
+
onChange: (s) => n("freeFormCriterionComments", s === "freeForm")
|
|
631
|
+
}
|
|
632
|
+
),
|
|
633
|
+
/* @__PURE__ */ e(
|
|
634
|
+
W,
|
|
635
|
+
{
|
|
636
|
+
name: "rubric-builder-rating-order",
|
|
637
|
+
label: t.rubricBuilderRatingOrderLabel,
|
|
638
|
+
value: r.ratingOrder,
|
|
639
|
+
options: [
|
|
640
|
+
{ value: "ascending", label: t.rubricBuilderRatingOrderLowToHigh },
|
|
641
|
+
{ value: "descending", label: t.rubricBuilderRatingOrderHighToLow }
|
|
642
|
+
],
|
|
643
|
+
onChange: (s) => n("ratingOrder", s)
|
|
644
|
+
}
|
|
645
|
+
)
|
|
646
|
+
] })
|
|
647
|
+
] })
|
|
648
|
+
]
|
|
649
|
+
}
|
|
650
|
+
);
|
|
651
|
+
}, Xr = (r) => /* @__PURE__ */ e(te, { translations: ne, translate: ae, children: /* @__PURE__ */ e(
|
|
652
|
+
Le,
|
|
653
|
+
{
|
|
654
|
+
courseId: r.courseId,
|
|
655
|
+
accountId: r.accountId,
|
|
656
|
+
featureFlags: r.featureFlags,
|
|
657
|
+
aiLimits: r.aiLimits,
|
|
658
|
+
children: /* @__PURE__ */ e(Sr, { ...r })
|
|
659
|
+
}
|
|
660
|
+
) }), Sr = ({
|
|
661
|
+
rubricId: r,
|
|
662
|
+
accountId: n,
|
|
663
|
+
courseId: d,
|
|
664
|
+
canManageRubrics: i,
|
|
665
|
+
onSaveRubric: o,
|
|
666
|
+
onDiscard: t
|
|
667
|
+
}) => {
|
|
668
|
+
var Z;
|
|
669
|
+
const { translations: a } = D(), {
|
|
670
|
+
rubricForm: s,
|
|
671
|
+
setRubricFormField: m,
|
|
672
|
+
validateField: l,
|
|
673
|
+
validationErrors: u,
|
|
674
|
+
isNewRubric: g,
|
|
675
|
+
load: { data: f, isLoading: S, isError: L, isSuccess: P },
|
|
676
|
+
savePending: B,
|
|
677
|
+
saveError: v,
|
|
678
|
+
save: T,
|
|
679
|
+
saveAction: E,
|
|
680
|
+
isDirty: C,
|
|
681
|
+
criteriaValid: R,
|
|
682
|
+
criteriaValidationErrors: _,
|
|
683
|
+
saveCriterion: O,
|
|
684
|
+
deleteCriterion: N,
|
|
685
|
+
reorderCriteria: q
|
|
686
|
+
} = Qe({ rubricId: r, accountId: n, courseId: d, canManageRubrics: i, onSaveRubric: o }), M = X(null), [H, z] = k(!1), [U, w] = k(!1), [F, b] = k(!1), [ve, J] = k(), Re = Ve(), Be = ke(() => J(void 0), []);
|
|
687
|
+
if (r && S)
|
|
688
|
+
return /* @__PURE__ */ e(er, {});
|
|
689
|
+
if (r && L)
|
|
690
|
+
return Te({
|
|
691
|
+
errorImageUrl: Xe,
|
|
692
|
+
errorCategory: a.rubricErrorPageCategory,
|
|
693
|
+
translations: ee(a)
|
|
694
|
+
});
|
|
695
|
+
if (r && P && !f)
|
|
696
|
+
return Ee({ translations: ee(a) });
|
|
697
|
+
const Se = () => {
|
|
698
|
+
var y;
|
|
699
|
+
if (z(!0), !l("title", s.title)) {
|
|
700
|
+
(y = M.current) == null || y.focus();
|
|
701
|
+
return;
|
|
702
|
+
}
|
|
703
|
+
s.criteria.length === 0 || !R || (E === "confirmSave" ? b(!0) : T());
|
|
704
|
+
}, ye = () => {
|
|
705
|
+
const y = Je(Re());
|
|
706
|
+
O(y), J(y.id);
|
|
707
|
+
}, Ie = () => {
|
|
708
|
+
C ? w(!0) : t();
|
|
709
|
+
};
|
|
710
|
+
return /* @__PURE__ */ c(h, { as: "div", "data-testid": "rubric-builder", children: [
|
|
711
|
+
/* @__PURE__ */ c(p, { direction: "column", gap: "medium", padding: "medium 0", children: [
|
|
712
|
+
/* @__PURE__ */ e(Rr, { isNewRubric: g, pointsPossible: s.pointsPossible }),
|
|
713
|
+
v && /* @__PURE__ */ e(rr, { variant: "error", margin: "0", children: a.rubricFormSaveError }),
|
|
714
|
+
/* @__PURE__ */ e(
|
|
715
|
+
Br,
|
|
716
|
+
{
|
|
717
|
+
rubricForm: s,
|
|
718
|
+
setRubricFormField: m,
|
|
719
|
+
validateTitle: (y) => l("title", y),
|
|
720
|
+
titleError: (Z = u.title) == null ? void 0 : Z.message,
|
|
721
|
+
titleInputRef: (y) => {
|
|
722
|
+
M.current = y;
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
),
|
|
726
|
+
/* @__PURE__ */ e(
|
|
727
|
+
gr,
|
|
728
|
+
{
|
|
729
|
+
criteriaCount: s.criteria.length,
|
|
730
|
+
showMissingCriteriaError: H,
|
|
731
|
+
actions: /* @__PURE__ */ e(
|
|
732
|
+
x,
|
|
733
|
+
{
|
|
734
|
+
renderIcon: /* @__PURE__ */ e(fe, {}),
|
|
735
|
+
onClick: ye,
|
|
736
|
+
"data-testid": "rubric-builder-add-criterion",
|
|
737
|
+
children: a.rubricBuilderAddCriterion
|
|
738
|
+
}
|
|
739
|
+
),
|
|
740
|
+
children: /* @__PURE__ */ e(
|
|
741
|
+
Cr,
|
|
742
|
+
{
|
|
743
|
+
criteria: s.criteria,
|
|
744
|
+
criteriaValidationErrors: _,
|
|
745
|
+
showErrors: H,
|
|
746
|
+
focusNameCriterionId: ve,
|
|
747
|
+
onFocusedName: Be,
|
|
748
|
+
onChangeCriterion: O,
|
|
749
|
+
onDuplicateCriterion: (y) => O(Ye(y)),
|
|
750
|
+
onDeleteCriterion: N,
|
|
751
|
+
onReorderCriteria: q
|
|
752
|
+
}
|
|
753
|
+
)
|
|
754
|
+
}
|
|
755
|
+
)
|
|
756
|
+
] }),
|
|
757
|
+
/* @__PURE__ */ e(
|
|
758
|
+
vr,
|
|
759
|
+
{
|
|
760
|
+
savePending: B,
|
|
761
|
+
onDiscard: Ie,
|
|
762
|
+
onSave: Se
|
|
763
|
+
}
|
|
764
|
+
),
|
|
765
|
+
/* @__PURE__ */ e(
|
|
766
|
+
Y,
|
|
767
|
+
{
|
|
768
|
+
isOpen: U,
|
|
769
|
+
heading: a.rubricBuilderDiscardHeading,
|
|
770
|
+
body: a.rubricBuilderDiscardBody,
|
|
771
|
+
confirmLabel: a.rubricBuilderDiscard,
|
|
772
|
+
cancelLabel: a.rubricBuilderKeepEditing,
|
|
773
|
+
onConfirm: t,
|
|
774
|
+
onDismiss: () => w(!1),
|
|
775
|
+
"data-testid": "rubric-builder-discard-modal"
|
|
776
|
+
}
|
|
777
|
+
),
|
|
778
|
+
/* @__PURE__ */ e(
|
|
779
|
+
Y,
|
|
780
|
+
{
|
|
781
|
+
isOpen: F,
|
|
782
|
+
heading: a.confirmToContinueHeader,
|
|
783
|
+
body: a.gradingHistoryWarning,
|
|
784
|
+
confirmLabel: a.saveConfirmModalSave,
|
|
785
|
+
cancelLabel: a.cancel,
|
|
786
|
+
onConfirm: () => {
|
|
787
|
+
b(!1), T();
|
|
788
|
+
},
|
|
789
|
+
onDismiss: () => b(!1),
|
|
790
|
+
"data-testid": "rubric-builder-save-confirm-modal"
|
|
791
|
+
}
|
|
792
|
+
)
|
|
97
793
|
] });
|
|
98
794
|
};
|
|
99
795
|
export {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
796
|
+
Zr as DEFAULT_AI_MAX_CRITERION_COUNT,
|
|
797
|
+
ei as DEFAULT_AI_MAX_RATING_COUNT,
|
|
798
|
+
Qr as HelloWorld,
|
|
799
|
+
Xr as RubricBuilder,
|
|
800
|
+
Vr as RubricSelector
|
|
104
801
|
};
|