@pie-element/complex-rubric 8.0.4-next.20261011174919 → 8.0.4
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/author/defaults.d.ts +10 -10
- package/dist/author/defaults.js +14 -14
- package/dist/author/index.d.ts +20 -20
- package/dist/author/index.js +4 -0
- package/dist/author/main.d.ts +26 -13
- package/dist/author/main.js +20 -30
- package/dist/browser/author/index.js +54 -76
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/delivery/index.js +2 -2
- package/dist/browser/{delivery-Z7dq393G.js → delivery-pWFw_9mm.js} +2 -2
- package/dist/browser/{delivery-Z7dq393G.js.map → delivery-pWFw_9mm.js.map} +1 -1
- package/dist/browser/editor-runtime/author/index.js +54 -76
- package/dist/browser/editor-runtime/author/index.js.map +1 -1
- package/dist/browser/editor-runtime/controller/index.js.map +1 -1
- package/dist/browser/editor-runtime/delivery/index.js +2 -2
- package/dist/browser/editor-runtime/{delivery-BD3aCYuV.js → delivery-DHFx9jYx.js} +2 -2
- package/dist/browser/editor-runtime/{delivery-BD3aCYuV.js.map → delivery-DHFx9jYx.js.map} +1 -1
- package/dist/browser/editor-runtime/print/index.js +2 -2
- package/dist/browser/editor-runtime/{private-tags-Dq8udgmI.js → private-tags-BRKFxLqP.js} +2 -2
- package/dist/browser/editor-runtime/{private-tags-Dq8udgmI.js.map → private-tags-BRKFxLqP.js.map} +1 -1
- package/dist/browser/print/index.js +2 -2
- package/dist/browser/{private-tags-C5WL6_In.js → private-tags-CMwniYBP.js} +2 -2
- package/dist/browser/{private-tags-C5WL6_In.js.map → private-tags-CMwniYBP.js.map} +1 -1
- package/dist/controller/defaults.d.ts +13 -12
- package/dist/controller/index.d.ts +88 -5
- package/dist/controller/utils.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.iife.js +1 -1
- package/dist/private-tags.js +1 -1
- package/dist/schemas/configuration.schema.json +469 -0
- package/dist/schemas/model.schema.json +553 -0
- package/dist/schemas/session.schema.json +17 -0
- package/dist/types.d.ts +60 -0
- package/module/print.js +1 -1
- package/module/print.js.map +1 -1
- package/package.json +16 -12
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Scale } from '@pie-element/multi-trait-rubric';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
model: {
|
|
4
|
-
rubricType:
|
|
4
|
+
rubricType: "simpleRubric";
|
|
5
5
|
rubrics: {
|
|
6
|
-
|
|
6
|
+
simpleRubric: {
|
|
7
7
|
points: string[];
|
|
8
8
|
sampleAnswers: null[];
|
|
9
9
|
maxPoints: number;
|
|
10
10
|
excludeZero: boolean;
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
multiTraitRubric: {
|
|
13
13
|
description: boolean;
|
|
14
14
|
excludeZero: boolean;
|
|
15
15
|
halfScoring: boolean;
|
|
16
16
|
pointLabels: boolean;
|
|
17
|
-
scales:
|
|
17
|
+
scales: Scale[];
|
|
18
18
|
standards: boolean;
|
|
19
19
|
visibleToStudent: boolean;
|
|
20
20
|
};
|
|
21
|
-
|
|
21
|
+
rubricless: {
|
|
22
22
|
maxPoints: number;
|
|
23
23
|
excludeZero: boolean;
|
|
24
24
|
rubriclessInstructionEnabled: boolean;
|
|
@@ -26,7 +26,8 @@ declare const _default: {
|
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
28
|
configuration: {
|
|
29
|
-
[
|
|
29
|
+
rubricOptions: ("simpleRubric" | "multiTraitRubric" | "rubricless")[];
|
|
30
|
+
multiTraitRubric: {
|
|
30
31
|
baseInputConfiguration: {
|
|
31
32
|
h3: {
|
|
32
33
|
disabled: boolean;
|
|
@@ -137,7 +138,7 @@ declare const _default: {
|
|
|
137
138
|
};
|
|
138
139
|
maxMaxPoints: number;
|
|
139
140
|
};
|
|
140
|
-
|
|
141
|
+
simpleRubric: {
|
|
141
142
|
baseInputConfiguration: {
|
|
142
143
|
h3: {
|
|
143
144
|
disabled: boolean;
|
|
@@ -169,7 +170,7 @@ declare const _default: {
|
|
|
169
170
|
settingsPanelDisabled: boolean;
|
|
170
171
|
maxMaxPoints: number;
|
|
171
172
|
};
|
|
172
|
-
|
|
173
|
+
rubricless: {
|
|
173
174
|
baseInputConfiguration: {
|
|
174
175
|
h3: {
|
|
175
176
|
disabled: boolean;
|
|
@@ -217,7 +218,6 @@ declare const _default: {
|
|
|
217
218
|
};
|
|
218
219
|
maxMaxPoints: number;
|
|
219
220
|
};
|
|
220
|
-
rubricOptions: string[];
|
|
221
221
|
};
|
|
222
222
|
};
|
|
223
223
|
export default _default;
|
package/dist/author/defaults.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RUBRIC_TYPES as e } from "@pie-lib/rubric";
|
|
2
2
|
//#region src/author/defaults.tsx
|
|
3
|
-
var t = {
|
|
3
|
+
var t = e, n = {
|
|
4
4
|
description: !1,
|
|
5
5
|
excludeZero: !1,
|
|
6
6
|
halfScoring: !1,
|
|
@@ -8,7 +8,7 @@ var t = {
|
|
|
8
8
|
scales: [],
|
|
9
9
|
standards: !1,
|
|
10
10
|
visibleToStudent: !0
|
|
11
|
-
},
|
|
11
|
+
}, r = {
|
|
12
12
|
points: [
|
|
13
13
|
"",
|
|
14
14
|
"",
|
|
@@ -23,11 +23,11 @@ var t = {
|
|
|
23
23
|
],
|
|
24
24
|
maxPoints: 3,
|
|
25
25
|
excludeZero: !1
|
|
26
|
-
},
|
|
26
|
+
}, i = {
|
|
27
27
|
maxPoints: 100,
|
|
28
28
|
excludeZero: !1,
|
|
29
29
|
rubriclessInstructionEnabled: !0
|
|
30
|
-
},
|
|
30
|
+
}, a = {
|
|
31
31
|
baseInputConfiguration: {
|
|
32
32
|
h3: { disabled: !0 },
|
|
33
33
|
audio: { disabled: !1 },
|
|
@@ -105,7 +105,7 @@ var t = {
|
|
|
105
105
|
enabled: !1
|
|
106
106
|
},
|
|
107
107
|
maxMaxPoints: 9
|
|
108
|
-
},
|
|
108
|
+
}, o = {
|
|
109
109
|
baseInputConfiguration: {
|
|
110
110
|
h3: { disabled: !0 },
|
|
111
111
|
audio: { disabled: !1 },
|
|
@@ -124,7 +124,7 @@ var t = {
|
|
|
124
124
|
},
|
|
125
125
|
settingsPanelDisabled: !1,
|
|
126
126
|
maxMaxPoints: 9
|
|
127
|
-
},
|
|
127
|
+
}, s = {
|
|
128
128
|
baseInputConfiguration: {
|
|
129
129
|
h3: { disabled: !0 },
|
|
130
130
|
audio: { disabled: !1 },
|
|
@@ -153,13 +153,13 @@ var t = {
|
|
|
153
153
|
}
|
|
154
154
|
},
|
|
155
155
|
maxMaxPoints: 100
|
|
156
|
-
},
|
|
156
|
+
}, c = {
|
|
157
157
|
model: {
|
|
158
158
|
rubricType: "simpleRubric",
|
|
159
159
|
rubrics: {
|
|
160
|
-
[
|
|
161
|
-
[
|
|
162
|
-
[
|
|
160
|
+
[t.SIMPLE_RUBRIC]: r,
|
|
161
|
+
[t.MULTI_TRAIT_RUBRIC]: n,
|
|
162
|
+
[t.RUBRICLESS]: i
|
|
163
163
|
}
|
|
164
164
|
},
|
|
165
165
|
configuration: {
|
|
@@ -168,10 +168,10 @@ var t = {
|
|
|
168
168
|
"multiTraitRubric",
|
|
169
169
|
"rubricless"
|
|
170
170
|
],
|
|
171
|
-
[
|
|
172
|
-
[
|
|
173
|
-
[
|
|
171
|
+
[t.MULTI_TRAIT_RUBRIC]: a,
|
|
172
|
+
[t.SIMPLE_RUBRIC]: o,
|
|
173
|
+
[t.RUBRICLESS]: s
|
|
174
174
|
}
|
|
175
175
|
};
|
|
176
176
|
//#endregion
|
|
177
|
-
export {
|
|
177
|
+
export { c as default };
|
package/dist/author/index.d.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} | undefined;
|
|
8
|
-
}, currentModel?: {}) => {
|
|
9
|
-
rubrics: {
|
|
10
|
-
simpleRubric: any;
|
|
11
|
-
multiTraitRubric: any;
|
|
12
|
-
rubricless: any;
|
|
13
|
-
};
|
|
14
|
-
rubricType: string;
|
|
1
|
+
import { type AuthorModel } from './main.js';
|
|
2
|
+
import type { ComplexRubricConfiguration, ComplexRubricModel, RubricModels } from '../types.js';
|
|
3
|
+
/** What the author accepts: it fills in the rest of the model, and of each rubric, from the defaults. */
|
|
4
|
+
type ModelInput = Omit<Partial<ComplexRubricModel>, 'rubrics'> & {
|
|
5
|
+
rubrics?: {
|
|
6
|
+
[K in keyof RubricModels]?: Partial<NonNullable<RubricModels[K]>>;
|
|
15
7
|
};
|
|
8
|
+
} & Pick<Partial<AuthorModel>, 'errors'>;
|
|
9
|
+
export default class ComplexRubricConfigureElement extends HTMLElement {
|
|
10
|
+
static createDefaultModel: ({ rubrics: { simpleRubric, rubricless, multiTraitRubric }, ...model }?: ModelInput, currentModel?: Partial<AuthorModel>) => AuthorModel;
|
|
11
|
+
private _root;
|
|
12
|
+
private _model;
|
|
13
|
+
private _configuration;
|
|
14
|
+
canUpdateModel: boolean;
|
|
16
15
|
constructor();
|
|
17
|
-
set model(m:
|
|
18
|
-
dispatchModelUpdated(reset
|
|
19
|
-
onModelChanged:
|
|
20
|
-
set configuration(c:
|
|
21
|
-
onConfigurationChanged(c:
|
|
22
|
-
onModelUpdated:
|
|
16
|
+
set model(m: ModelInput);
|
|
17
|
+
dispatchModelUpdated(reset?: boolean): void;
|
|
18
|
+
onModelChanged: (m: ModelInput, reset?: boolean) => void;
|
|
19
|
+
set configuration(c: ComplexRubricConfiguration);
|
|
20
|
+
onConfigurationChanged(c: ComplexRubricConfiguration): void;
|
|
21
|
+
onModelUpdated: (e: Event) => void;
|
|
23
22
|
connectedCallback(): void;
|
|
24
23
|
_render(): void;
|
|
25
24
|
disconnectedCallback(): void;
|
|
26
25
|
}
|
|
26
|
+
export {};
|
package/dist/author/index.js
CHANGED
|
@@ -41,6 +41,10 @@ var g = (e, t) => ({
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
|
+
_root;
|
|
45
|
+
_model;
|
|
46
|
+
_configuration;
|
|
47
|
+
canUpdateModel;
|
|
44
48
|
constructor() {
|
|
45
49
|
super(), this._root = null, this.canUpdateModel = !1, l.log("constructor called"), this._model = e.createDefaultModel(), this._configuration = r.configuration, this.onConfigurationChanged = this.onConfigurationChanged.bind(this);
|
|
46
50
|
}
|
package/dist/author/main.d.ts
CHANGED
|
@@ -1,17 +1,30 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
import type MultiTraitRubricAuthorElement from '@pie-element/multi-trait-rubric/author';
|
|
3
|
+
import type RubricAuthorElement from '@pie-element/rubric/author';
|
|
4
|
+
import type { ComplexRubricValidationErrors } from '../controller/index.js';
|
|
5
|
+
import type { ComplexRubricConfiguration, ComplexRubricModel, RubricModels } from '../types.js';
|
|
6
|
+
/** The model the author edits: the defaults supply every rubric; a host sets `errors` from the controller's `validate()`. */
|
|
7
|
+
export type AuthorModel = Partial<ComplexRubricModel> & {
|
|
8
|
+
rubrics: Required<RubricModels>;
|
|
9
|
+
errors?: ComplexRubricValidationErrors;
|
|
10
|
+
};
|
|
11
|
+
/** The configuration the author renders: the defaults supply the rubric options and each rubric's configuration. */
|
|
12
|
+
export type AuthorConfiguration = ComplexRubricConfiguration & Required<Pick<ComplexRubricConfiguration, 'rubricOptions' | 'simpleRubric' | 'multiTraitRubric' | 'rubricless'>>;
|
|
13
|
+
export type MainProps = {
|
|
14
|
+
canUpdateModel?: boolean;
|
|
15
|
+
configuration: AuthorConfiguration;
|
|
16
|
+
multiTraitRubricTagName?: string;
|
|
17
|
+
model: AuthorModel;
|
|
18
|
+
onModelChanged: (model: AuthorModel) => void;
|
|
19
|
+
onConfigurationChanged: (configuration: ComplexRubricConfiguration) => void;
|
|
20
|
+
simpleRubricTagName?: string;
|
|
21
|
+
};
|
|
22
|
+
export declare class Main extends React.Component<MainProps> {
|
|
23
|
+
simpleRubric: RubricAuthorElement | undefined;
|
|
24
|
+
multiTraitRubric: MultiTraitRubricAuthorElement | undefined;
|
|
25
|
+
rubricless: RubricAuthorElement | undefined;
|
|
26
|
+
onModelChanged: (model: AuthorModel) => void;
|
|
27
|
+
onChangeRubricType: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
15
28
|
render(): React.JSX.Element;
|
|
16
29
|
}
|
|
17
30
|
export default Main;
|
package/dist/author/main.js
CHANGED
|
@@ -2,33 +2,23 @@ import { COMPLEX_RUBRIC_MULTI_TRAIT_CONFIGURE_TAG as e, COMPLEX_RUBRIC_SIMPLE_CO
|
|
|
2
2
|
import { RUBRIC_TYPES as n } from "@pie-lib/rubric";
|
|
3
3
|
import { color as r } from "@pie-lib/render-ui";
|
|
4
4
|
import i from "react";
|
|
5
|
-
import a from "
|
|
6
|
-
import
|
|
7
|
-
import s from "@mui/material/
|
|
8
|
-
import c from "@mui/material/
|
|
9
|
-
import l from "@mui/material/
|
|
10
|
-
import {
|
|
11
|
-
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
5
|
+
import { layout as a } from "@pie-lib/config-ui";
|
|
6
|
+
import o from "@mui/material/Radio";
|
|
7
|
+
import s from "@mui/material/RadioGroup";
|
|
8
|
+
import c from "@mui/material/FormControlLabel";
|
|
9
|
+
import { styled as l } from "@mui/material/styles";
|
|
10
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
12
11
|
//#region src/author/main.tsx
|
|
13
|
-
var
|
|
12
|
+
var f = l(c)({ "&.MuiFormControlLabel-root": {
|
|
14
13
|
width: "fit-content",
|
|
15
14
|
paddingRight: "24px",
|
|
16
15
|
boxSizing: "border-box",
|
|
17
16
|
"&:hover": { background: "var(--pie-secondary-background, rgba(241,241,241,1))" }
|
|
18
|
-
} }),
|
|
17
|
+
} }), p = l(o)({ "&.MuiRadio-root": { color: `${r.tertiary()} !important` } }), m = {
|
|
19
18
|
[n.MULTI_TRAIT_RUBRIC]: "Multi Trait Rubric",
|
|
20
19
|
[n.SIMPLE_RUBRIC]: "Simple Rubric",
|
|
21
20
|
[n.RUBRICLESS]: "Rubricless"
|
|
22
|
-
},
|
|
23
|
-
static propTypes = {
|
|
24
|
-
canUpdateModel: a.bool,
|
|
25
|
-
configuration: a.object,
|
|
26
|
-
multiTraitRubricTagName: a.string,
|
|
27
|
-
model: a.object,
|
|
28
|
-
onModelChanged: a.func,
|
|
29
|
-
onConfigurationChanged: a.func,
|
|
30
|
-
simpleRubricTagName: a.string
|
|
31
|
-
};
|
|
21
|
+
}, h = class extends i.Component {
|
|
32
22
|
onModelChanged = (e) => {
|
|
33
23
|
let { onModelChanged: t } = this.props;
|
|
34
24
|
return t(e);
|
|
@@ -41,13 +31,13 @@ var p = u(l)({ "&.MuiFormControlLabel-root": {
|
|
|
41
31
|
});
|
|
42
32
|
};
|
|
43
33
|
render() {
|
|
44
|
-
let { model: r, configuration: i, canUpdateModel:
|
|
34
|
+
let { model: r, configuration: i, canUpdateModel: o, multiTraitRubricTagName: c = e, simpleRubricTagName: l = t } = this.props, h = c, g = l, { extraCSSRules: _, rubrics: v = {} } = r || {}, { rubricType: y } = r, { contentDimensions: b = {}, rubricOptions: x = [], multiTraitRubric: S, simpleRubric: C, rubricless: w, width: T } = i, E = "";
|
|
45
35
|
y ||= n.SIMPLE_RUBRIC;
|
|
46
36
|
let D = x.indexOf(y) > -1;
|
|
47
|
-
if (
|
|
37
|
+
if (o) switch (y) {
|
|
48
38
|
case n.SIMPLE_RUBRIC:
|
|
49
39
|
default:
|
|
50
|
-
E = /* @__PURE__ */
|
|
40
|
+
E = /* @__PURE__ */ u(g, {
|
|
51
41
|
"data-rubric-type": "simpleRubric",
|
|
52
42
|
ref: (e) => {
|
|
53
43
|
e && (this.simpleRubric = e, this.simpleRubric.model = {
|
|
@@ -61,7 +51,7 @@ var p = u(l)({ "&.MuiFormControlLabel-root": {
|
|
|
61
51
|
}, "simple-rubric");
|
|
62
52
|
break;
|
|
63
53
|
case n.MULTI_TRAIT_RUBRIC:
|
|
64
|
-
E = /* @__PURE__ */
|
|
54
|
+
E = /* @__PURE__ */ u(h, {
|
|
65
55
|
"data-rubric-type": "multiTraitRubric",
|
|
66
56
|
ref: (e) => {
|
|
67
57
|
e && (this.multiTraitRubric = e, this.multiTraitRubric.model = {
|
|
@@ -75,7 +65,7 @@ var p = u(l)({ "&.MuiFormControlLabel-root": {
|
|
|
75
65
|
}, "multi-trait-rubric");
|
|
76
66
|
break;
|
|
77
67
|
case n.RUBRICLESS:
|
|
78
|
-
E = /* @__PURE__ */
|
|
68
|
+
E = /* @__PURE__ */ u(g, {
|
|
79
69
|
"data-rubric-type": "rubricless",
|
|
80
70
|
ref: (e) => {
|
|
81
71
|
e && (this.rubricless = e, this.rubricless.model = v.rubricless, this.rubricless.configuration = {
|
|
@@ -86,24 +76,24 @@ var p = u(l)({ "&.MuiFormControlLabel-root": {
|
|
|
86
76
|
}, "rubricless");
|
|
87
77
|
break;
|
|
88
78
|
}
|
|
89
|
-
return /* @__PURE__ */
|
|
79
|
+
return /* @__PURE__ */ d(a.ConfigLayout, {
|
|
90
80
|
extraCSSRules: _,
|
|
91
81
|
dimensions: b,
|
|
92
82
|
hideSettings: !0,
|
|
93
83
|
settings: null,
|
|
94
|
-
children: [/* @__PURE__ */
|
|
84
|
+
children: [/* @__PURE__ */ u(s, {
|
|
95
85
|
"aria-label": "rubric-type",
|
|
96
86
|
name: "rubricType",
|
|
97
87
|
value: r.rubricType,
|
|
98
88
|
onChange: this.onChangeRubricType,
|
|
99
|
-
children: x.length > 1 && x.map((e, t) => /* @__PURE__ */
|
|
89
|
+
children: x.length > 1 && x.map((e, t) => /* @__PURE__ */ u(f, {
|
|
100
90
|
value: e,
|
|
101
|
-
control: /* @__PURE__ */
|
|
102
|
-
label:
|
|
91
|
+
control: /* @__PURE__ */ u(p, { checked: y === e }),
|
|
92
|
+
label: m[e]
|
|
103
93
|
}, t))
|
|
104
94
|
}), D && E]
|
|
105
95
|
});
|
|
106
96
|
}
|
|
107
97
|
};
|
|
108
98
|
//#endregion
|
|
109
|
-
export {
|
|
99
|
+
export { h as Main, h as default };
|