@pie-element/complex-rubric 7.1.1 → 7.1.2-next.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/configure.js +2 -0
- package/controller.js +1 -0
- package/dist/author/defaults.d.ts +231 -0
- package/dist/author/defaults.js +177 -0
- package/dist/author/index.d.ts +34 -0
- package/dist/author/index.js +87 -0
- package/dist/author/main.d.ts +23 -0
- package/dist/author/main.js +106 -0
- package/dist/browser/author/index.js +7646 -0
- package/dist/browser/author/index.js.map +1 -0
- package/dist/browser/controller/index.js +145 -0
- package/dist/browser/controller/index.js.map +1 -0
- package/dist/browser/delivery/index.js +96 -0
- package/dist/browser/delivery/index.js.map +1 -0
- package/dist/browser/dist-DJUOd5EZ.js +19 -0
- package/dist/browser/dist-DJUOd5EZ.js.map +1 -0
- package/dist/browser/print/index.js +84 -0
- package/dist/browser/print/index.js.map +1 -0
- package/dist/controller/defaults.d.ts +39 -0
- package/dist/controller/defaults.js +42 -0
- package/dist/controller/index.d.ts +25 -0
- package/dist/controller/index.js +107 -0
- package/dist/controller/utils.d.ts +9 -0
- package/dist/controller/utils.js +4 -0
- package/dist/delivery/index.d.ts +23 -0
- package/dist/delivery/index.js +96 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.iife.d.ts +8 -0
- package/dist/index.iife.js +145 -0
- package/dist/index.js +2 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_apply.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +15 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseRest.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +4 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIterateeCall.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overRest.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToString.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +15 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/constant.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/defaults.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/identity.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +4 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +6 -0
- package/dist/print/index.d.ts +24 -0
- package/dist/print/index.js +84 -0
- package/package.json +85 -21
- package/CHANGELOG.md +0 -1443
- package/LICENSE.md +0 -5
- package/README.md +0 -3
- package/configure/CHANGELOG.md +0 -1097
- package/configure/lib/defaults.js +0 -271
- package/configure/lib/defaults.js.map +0 -1
- package/configure/lib/index.js +0 -150
- package/configure/lib/index.js.map +0 -1
- package/configure/lib/main.js +0 -172
- package/configure/lib/main.js.map +0 -1
- package/configure/package.json +0 -27
- package/configure/src/__tests__/index.test.js +0 -94
- package/configure/src/__tests__/main.test.jsx +0 -140
- package/configure/src/defaults.js +0 -213
- package/configure/src/index.js +0 -169
- package/configure/src/main.jsx +0 -162
- package/controller/CHANGELOG.md +0 -936
- package/controller/lib/defaults.js +0 -42
- package/controller/lib/defaults.js.map +0 -1
- package/controller/lib/index.js +0 -239
- package/controller/lib/index.js.map +0 -1
- package/controller/lib/utils.js +0 -11
- package/controller/lib/utils.js.map +0 -1
- package/controller/package.json +0 -16
- package/controller/src/__tests__/index.test.js +0 -55
- package/controller/src/defaults.js +0 -39
- package/controller/src/index.js +0 -220
- package/controller/src/utils.js +0 -3
- package/docs/config-schema.json +0 -4255
- package/docs/config-schema.json.md +0 -3162
- package/docs/demo/config.js +0 -8
- package/docs/demo/generate.js +0 -196
- package/docs/demo/index.html +0 -1
- package/docs/demo/session.js +0 -6
- package/docs/pie-schema.json +0 -3302
- package/docs/pie-schema.json.md +0 -2364
- package/lib/index.js +0 -141
- package/lib/index.js.map +0 -1
- package/lib/print.js +0 -129
- package/lib/print.js.map +0 -1
- package/module/configure.js +0 -1
- package/module/controller.js +0 -262
- package/module/demo.js +0 -221
- package/module/element.js +0 -1
- package/module/index.html +0 -21
- package/module/manifest.json +0 -22
- package/module/print-demo.js +0 -259
- package/module/print.html +0 -18
- package/module/print.js +0 -1
- package/src/__tests__/index.test.js +0 -256
- package/src/index.js +0 -152
- package/src/print.js +0 -140
package/configure/package.json
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@pie-element/complex-rubric-configure",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "5.1.1",
|
|
5
|
-
"description": "Complex Rubric authoring view",
|
|
6
|
-
"main": "lib/index.js",
|
|
7
|
-
"module": "src/index.js",
|
|
8
|
-
"author": "Pie Framework Authors",
|
|
9
|
-
"dependencies": {
|
|
10
|
-
"@emotion/react": "^11.14.0",
|
|
11
|
-
"@emotion/style": "^0.8.0",
|
|
12
|
-
"@mui/icons-material": "^7.3.4",
|
|
13
|
-
"@mui/material": "^7.3.4",
|
|
14
|
-
"@pie-element/multi-trait-rubric": "^8.1.1",
|
|
15
|
-
"@pie-element/rubric": "^8.1.1",
|
|
16
|
-
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
17
|
-
"@pie-lib/config-ui": "13.0.4",
|
|
18
|
-
"@pie-lib/render-ui": "6.1.0",
|
|
19
|
-
"@pie-lib/rubric": "2.0.4",
|
|
20
|
-
"debug": "^4.1.1",
|
|
21
|
-
"lodash-es": "^4.17.23",
|
|
22
|
-
"prop-types": "^15.6.2",
|
|
23
|
-
"react": "18.3.1",
|
|
24
|
-
"react-dom": "18.3.1"
|
|
25
|
-
},
|
|
26
|
-
"license": "ISC"
|
|
27
|
-
}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { createRoot } from 'react-dom/client';
|
|
3
|
-
|
|
4
|
-
import defaults from '../defaults';
|
|
5
|
-
|
|
6
|
-
jest.mock('@pie-lib/rubric', () => ({
|
|
7
|
-
RUBRIC_TYPES: {
|
|
8
|
-
SIMPLE_RUBRIC: 'simpleRubric',
|
|
9
|
-
MULTI_TRAIT_RUBRIC: 'multiTraitRubric',
|
|
10
|
-
RUBRICLESS: 'rubricless',
|
|
11
|
-
},
|
|
12
|
-
}));
|
|
13
|
-
|
|
14
|
-
jest.mock('@pie-lib/config-ui', () => ({
|
|
15
|
-
settings: {
|
|
16
|
-
Panel: (props) => <div {...props} />,
|
|
17
|
-
toggle: jest.fn(),
|
|
18
|
-
radio: jest.fn(),
|
|
19
|
-
},
|
|
20
|
-
}));
|
|
21
|
-
|
|
22
|
-
jest.mock('@pie-lib/render-ui', () => ({
|
|
23
|
-
color: {
|
|
24
|
-
text: jest.fn(() => '#000000'),
|
|
25
|
-
background: jest.fn(() => '#ffffff'),
|
|
26
|
-
primaryLight: jest.fn(() => '#e3f2fd'),
|
|
27
|
-
primary: jest.fn(() => '#1976d2'),
|
|
28
|
-
secondary: jest.fn(() => '#888'),
|
|
29
|
-
tertiary: jest.fn(() => '#146EB3'),
|
|
30
|
-
disabled: jest.fn(() => '#999999'),
|
|
31
|
-
correct: jest.fn(() => '#00c853'),
|
|
32
|
-
incorrect: jest.fn(() => '#d32f2f'),
|
|
33
|
-
},
|
|
34
|
-
Collapsible: (props) => <div data-testid="collapsible">{props.children}</div>,
|
|
35
|
-
Readable: (props) => <div data-testid="readable">{props.children}</div>,
|
|
36
|
-
Feedback: (props) => <div data-testid="feedback">{props.children}</div>,
|
|
37
|
-
PreviewPrompt: (props) => <div data-testid="preview-prompt">{props.children}</div>,
|
|
38
|
-
UiLayout: (props) => <div data-testid="ui-layout">{props.children}</div>,
|
|
39
|
-
hasText: jest.fn(),
|
|
40
|
-
hasMedia: jest.fn(),
|
|
41
|
-
}));
|
|
42
|
-
|
|
43
|
-
jest.mock('@pie-element/rubric/configure/lib', () => {
|
|
44
|
-
class MockRubricConfigure {
|
|
45
|
-
constructor() {}
|
|
46
|
-
}
|
|
47
|
-
return MockRubricConfigure;
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
jest.mock('@pie-element/multi-trait-rubric/configure/lib', () => {
|
|
51
|
-
class MockMultiTraitRubricConfigure {
|
|
52
|
-
constructor() {}
|
|
53
|
-
}
|
|
54
|
-
return MockMultiTraitRubricConfigure;
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
const model = () => ({ ...defaults.model });
|
|
58
|
-
|
|
59
|
-
const mockRender = jest.fn();
|
|
60
|
-
const mockUnmount = jest.fn();
|
|
61
|
-
jest.mock('react-dom/client', () => ({
|
|
62
|
-
createRoot: jest.fn(() => ({
|
|
63
|
-
render: mockRender,
|
|
64
|
-
unmount: mockUnmount,
|
|
65
|
-
})),
|
|
66
|
-
}));
|
|
67
|
-
|
|
68
|
-
describe('index', () => {
|
|
69
|
-
let Def;
|
|
70
|
-
let el;
|
|
71
|
-
let onModelChanged = jest.fn();
|
|
72
|
-
let initialModel = model();
|
|
73
|
-
|
|
74
|
-
beforeAll(() => {
|
|
75
|
-
Def = require('../index').default;
|
|
76
|
-
// Register the custom element for testing
|
|
77
|
-
if (!customElements.get('complex-rubric-configure-test')) {
|
|
78
|
-
customElements.define('complex-rubric-configure-test', Def);
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
beforeEach(() => {
|
|
83
|
-
el = document.createElement('complex-rubric-configure-test');
|
|
84
|
-
el.model = initialModel;
|
|
85
|
-
el.onModelChanged = onModelChanged;
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
describe('set model', () => {
|
|
89
|
-
it('calls ReactDOM.render', () => {
|
|
90
|
-
expect(createRoot).toHaveBeenCalled();
|
|
91
|
-
expect(mockRender).toHaveBeenCalled();
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
});
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
import { ThemeProvider, createTheme } from '@mui/material/styles';
|
|
4
|
-
import { Main } from '../main';
|
|
5
|
-
|
|
6
|
-
import defaults from '../defaults';
|
|
7
|
-
|
|
8
|
-
jest.mock('@pie-lib/config-ui', () => ({
|
|
9
|
-
layout: {
|
|
10
|
-
ConfigLayout: (props) => <div>{props.children}</div>,
|
|
11
|
-
},
|
|
12
|
-
}));
|
|
13
|
-
|
|
14
|
-
jest.mock('@pie-lib/render-ui', () => ({
|
|
15
|
-
color: {
|
|
16
|
-
tertiary: jest.fn(() => '#146EB3'),
|
|
17
|
-
text: jest.fn(() => '#000000'),
|
|
18
|
-
background: jest.fn(() => '#ffffff'),
|
|
19
|
-
primaryLight: jest.fn(() => '#e3f2fd'),
|
|
20
|
-
primary: jest.fn(() => '#1976d2'),
|
|
21
|
-
disabled: jest.fn(() => '#999999'),
|
|
22
|
-
correct: jest.fn(() => '#00c853'),
|
|
23
|
-
incorrect: jest.fn(() => '#d32f2f'),
|
|
24
|
-
},
|
|
25
|
-
}));
|
|
26
|
-
|
|
27
|
-
jest.mock('@pie-lib/rubric', () => ({
|
|
28
|
-
RUBRIC_TYPES: {
|
|
29
|
-
SIMPLE_RUBRIC: 'simpleRubric',
|
|
30
|
-
MULTI_TRAIT_RUBRIC: 'multiTraitRubric',
|
|
31
|
-
RUBRICLESS: 'rubricless',
|
|
32
|
-
},
|
|
33
|
-
}));
|
|
34
|
-
|
|
35
|
-
const theme = createTheme();
|
|
36
|
-
|
|
37
|
-
const model = (extras) => ({
|
|
38
|
-
id: '1',
|
|
39
|
-
element: 'complex-rubric',
|
|
40
|
-
...defaults.model,
|
|
41
|
-
...extras,
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
describe('Main', () => {
|
|
45
|
-
const onModelChanged = jest.fn();
|
|
46
|
-
const onConfigurationChanged = jest.fn();
|
|
47
|
-
|
|
48
|
-
const renderMain = (extras) => {
|
|
49
|
-
const defaultProps = {
|
|
50
|
-
onModelChanged,
|
|
51
|
-
onConfigurationChanged,
|
|
52
|
-
classes: {},
|
|
53
|
-
model: model(extras),
|
|
54
|
-
configuration: {
|
|
55
|
-
rubricOptions: ['simpleRubric', 'multiTraitRubric', 'rubricless'],
|
|
56
|
-
multiTraitRubric: {
|
|
57
|
-
width: 600,
|
|
58
|
-
showStandards: {
|
|
59
|
-
settings: false,
|
|
60
|
-
label: 'Show Standards',
|
|
61
|
-
enabled: false,
|
|
62
|
-
},
|
|
63
|
-
showExcludeZero: {
|
|
64
|
-
settings: true,
|
|
65
|
-
label: 'Exclude Zero',
|
|
66
|
-
enabled: false,
|
|
67
|
-
},
|
|
68
|
-
showScorePointLabels: {
|
|
69
|
-
settings: true,
|
|
70
|
-
label: 'Show Score Point Labels',
|
|
71
|
-
enabled: false,
|
|
72
|
-
},
|
|
73
|
-
showLevelTagInput: {
|
|
74
|
-
settings: true,
|
|
75
|
-
label: 'Show Level Tag Input',
|
|
76
|
-
enabled: false,
|
|
77
|
-
},
|
|
78
|
-
showDescription: {
|
|
79
|
-
settings: true,
|
|
80
|
-
label: 'Show Description',
|
|
81
|
-
enabled: false,
|
|
82
|
-
},
|
|
83
|
-
showVisibleToStudent: {
|
|
84
|
-
settings: true,
|
|
85
|
-
label: 'Visible to Student',
|
|
86
|
-
enabled: false,
|
|
87
|
-
},
|
|
88
|
-
showHalfScoring: {
|
|
89
|
-
settings: true,
|
|
90
|
-
label: 'Half Scoring',
|
|
91
|
-
enabled: false,
|
|
92
|
-
},
|
|
93
|
-
dragAndDrop: {
|
|
94
|
-
settings: false,
|
|
95
|
-
label: 'Enable Drag and Drop',
|
|
96
|
-
enabled: false,
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
canUpdateModel: true,
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
return render(
|
|
104
|
-
<ThemeProvider theme={theme}>
|
|
105
|
-
<Main {...defaultProps} />
|
|
106
|
-
</ThemeProvider>
|
|
107
|
-
);
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
beforeEach(() => {
|
|
111
|
-
onModelChanged.mockClear();
|
|
112
|
-
onConfigurationChanged.mockClear();
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
describe('render', () => {
|
|
116
|
-
it('renders without crashing', () => {
|
|
117
|
-
const { container } = renderMain();
|
|
118
|
-
expect(container.firstChild).toBeInTheDocument();
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
it('renders with simple rubric', () => {
|
|
122
|
-
const { container } = renderMain({ rubricType: 'simpleRubric' });
|
|
123
|
-
expect(container.firstChild).toBeInTheDocument();
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
it('renders with multi trait rubric', () => {
|
|
127
|
-
const { container } = renderMain({ rubricType: 'multiTraitRubric' });
|
|
128
|
-
expect(container.firstChild).toBeInTheDocument();
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
it('renders with rubricless', () => {
|
|
132
|
-
const { container } = renderMain({ rubricType: 'rubricless' });
|
|
133
|
-
expect(container.firstChild).toBeInTheDocument();
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
// Note: Tests for internal methods (onChangeRubricType) are implementation details
|
|
138
|
-
// and cannot be directly tested with RTL. These should be tested through
|
|
139
|
-
// user interactions with radio buttons in integration tests.
|
|
140
|
-
});
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
import { RUBRIC_TYPES } from '@pie-lib/rubric';
|
|
2
|
-
|
|
3
|
-
const multiTraitDefaultModel = {
|
|
4
|
-
description: false,
|
|
5
|
-
excludeZero: false,
|
|
6
|
-
halfScoring: false,
|
|
7
|
-
pointLabels: true,
|
|
8
|
-
scales: [],
|
|
9
|
-
standards: false,
|
|
10
|
-
visibleToStudent: true,
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const rubricDefaultModel = {
|
|
14
|
-
points: ['', '', '', ''],
|
|
15
|
-
sampleAnswers: [null, null, null, null],
|
|
16
|
-
maxPoints: 3,
|
|
17
|
-
excludeZero: false,
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const rubriclessDefaultModel = {
|
|
21
|
-
maxPoints: 100,
|
|
22
|
-
excludeZero: false,
|
|
23
|
-
rubriclessInstructionEnabled: true,
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const multiTraitDefaultConfiguration = {
|
|
27
|
-
baseInputConfiguration: {
|
|
28
|
-
h3: { disabled: true },
|
|
29
|
-
audio: { disabled: false },
|
|
30
|
-
video: { disabled: false },
|
|
31
|
-
image: { disabled: false },
|
|
32
|
-
textAlign: { disabled: true },
|
|
33
|
-
showParagraphs: { disabled: false },
|
|
34
|
-
},
|
|
35
|
-
expandedInput: {
|
|
36
|
-
inputConfiguration: {
|
|
37
|
-
math: { disabled: true },
|
|
38
|
-
audio: { disabled: false },
|
|
39
|
-
video: { disabled: false },
|
|
40
|
-
image: { disabled: false },
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
labelInput: {
|
|
44
|
-
inputConfiguration: {
|
|
45
|
-
math: { disabled: true },
|
|
46
|
-
audio: { disabled: true },
|
|
47
|
-
video: { disabled: true },
|
|
48
|
-
image: { disabled: true },
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
settingsPanelDisabled: false,
|
|
52
|
-
excludeZeroDialogBoxContent: {
|
|
53
|
-
title: 'Exclude 0 (Zero) from Score Point Values.',
|
|
54
|
-
text: `<div>
|
|
55
|
-
You are about to exclude 0 from score point values.
|
|
56
|
-
<br/>
|
|
57
|
-
Some of the existing data has to be changed.
|
|
58
|
-
<br/>
|
|
59
|
-
Please choose if you want to:
|
|
60
|
-
<ul>
|
|
61
|
-
<li>
|
|
62
|
-
shift Labels and Descriptions to the left
|
|
63
|
-
</li>
|
|
64
|
-
<li>
|
|
65
|
-
remove 0 column with its Label and Description
|
|
66
|
-
</li>
|
|
67
|
-
</ul>
|
|
68
|
-
</div>`,
|
|
69
|
-
},
|
|
70
|
-
includeZeroDialogBoxContent: {
|
|
71
|
-
title: 'Include 0 (Zero) in Score Point Values.',
|
|
72
|
-
text: `<div>
|
|
73
|
-
You are about to include 0 in score point values.
|
|
74
|
-
<br/>
|
|
75
|
-
Some of the existing data has to be changed.
|
|
76
|
-
<br/>
|
|
77
|
-
Please choose if you want to:
|
|
78
|
-
<ul>
|
|
79
|
-
<li>
|
|
80
|
-
shift Labels and Descriptions to the right
|
|
81
|
-
</li>
|
|
82
|
-
<li>
|
|
83
|
-
add 0 column with empty Label and Descriptions
|
|
84
|
-
</li>
|
|
85
|
-
</ul>
|
|
86
|
-
</div>`,
|
|
87
|
-
},
|
|
88
|
-
deleteScaleDialogBoxContent: {
|
|
89
|
-
title: 'Delete Scale',
|
|
90
|
-
text: 'Are you sure you want to delete this scale?',
|
|
91
|
-
},
|
|
92
|
-
maxPointsDialogBoxContent: {
|
|
93
|
-
title: 'Decreasing Max Points.',
|
|
94
|
-
text: ` You are about to decrease max score point value.
|
|
95
|
-
<br/>
|
|
96
|
-
All the Labels and Descriptions for scores above Max Point will be deleted.`,
|
|
97
|
-
},
|
|
98
|
-
spellCheck: {
|
|
99
|
-
label: 'Spellcheck',
|
|
100
|
-
settings: false,
|
|
101
|
-
enabled: true,
|
|
102
|
-
},
|
|
103
|
-
showExcludeZero: {
|
|
104
|
-
settings: true,
|
|
105
|
-
label: 'Exclude Zero',
|
|
106
|
-
},
|
|
107
|
-
showScorePointLabels: {
|
|
108
|
-
settings: true,
|
|
109
|
-
label: 'Show Score Point Labels',
|
|
110
|
-
},
|
|
111
|
-
showDescription: {
|
|
112
|
-
settings: true,
|
|
113
|
-
label: 'Show Description',
|
|
114
|
-
},
|
|
115
|
-
showVisibleToStudent: {
|
|
116
|
-
settings: true,
|
|
117
|
-
label: 'Visible to Student',
|
|
118
|
-
},
|
|
119
|
-
showHalfScoring: {
|
|
120
|
-
settings: true,
|
|
121
|
-
label: 'Half Scoring',
|
|
122
|
-
},
|
|
123
|
-
// commenting this in order to use the dynamic width if the width was not set by the client (PD-3203)
|
|
124
|
-
// width: '900px',
|
|
125
|
-
// these should not be set to true (should not be used) for now
|
|
126
|
-
showStandards: {
|
|
127
|
-
settings: false,
|
|
128
|
-
label: 'Show Standards',
|
|
129
|
-
},
|
|
130
|
-
showLevelTagInput: {
|
|
131
|
-
settings: false,
|
|
132
|
-
label: 'Show Level Tag Input',
|
|
133
|
-
enabled: false,
|
|
134
|
-
},
|
|
135
|
-
dragAndDrop: {
|
|
136
|
-
settings: true,
|
|
137
|
-
label: 'Enable Drag and Drop',
|
|
138
|
-
enabled: false,
|
|
139
|
-
},
|
|
140
|
-
maxMaxPoints: 9,
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
const rubricDefaultConfiguration = {
|
|
144
|
-
baseInputConfiguration: {
|
|
145
|
-
h3: { disabled: true },
|
|
146
|
-
audio: { disabled: false },
|
|
147
|
-
video: { disabled: false },
|
|
148
|
-
image: { disabled: false },
|
|
149
|
-
textAlign: { disabled: true },
|
|
150
|
-
showParagraphs: { disabled: false },
|
|
151
|
-
},
|
|
152
|
-
showExcludeZero: {
|
|
153
|
-
settings: true,
|
|
154
|
-
label: 'Ability to exclude zero',
|
|
155
|
-
},
|
|
156
|
-
showMaxPoint: {
|
|
157
|
-
settings: true,
|
|
158
|
-
label: 'Show max points dropdown',
|
|
159
|
-
},
|
|
160
|
-
settingsPanelDisabled: false,
|
|
161
|
-
maxMaxPoints: 9,
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
const rubriclessDefaultConfiguration = {
|
|
165
|
-
baseInputConfiguration: {
|
|
166
|
-
h3: { disabled: true },
|
|
167
|
-
audio: { disabled: false },
|
|
168
|
-
video: { disabled: false },
|
|
169
|
-
image: { disabled: false },
|
|
170
|
-
textAlign: { disabled: true },
|
|
171
|
-
showParagraphs: { disabled: false },
|
|
172
|
-
},
|
|
173
|
-
showExcludeZero: {
|
|
174
|
-
settings: true,
|
|
175
|
-
label: 'Ability to exclude zero',
|
|
176
|
-
},
|
|
177
|
-
showMaxPoint: {
|
|
178
|
-
settings: true,
|
|
179
|
-
label: 'Show max points dropdown',
|
|
180
|
-
},
|
|
181
|
-
settingsPanelDisabled: false,
|
|
182
|
-
// shows us if it simple rubric or rubricless(simple rubric with less structure)
|
|
183
|
-
rubricless: true,
|
|
184
|
-
// scoring instruction for rubricless
|
|
185
|
-
rubriclessInstruction: {
|
|
186
|
-
settings: true,
|
|
187
|
-
label: 'Instruction',
|
|
188
|
-
inputConfiguration: {
|
|
189
|
-
audio: { disabled: false },
|
|
190
|
-
video: { disabled: false },
|
|
191
|
-
image: { disabled: false },
|
|
192
|
-
},
|
|
193
|
-
},
|
|
194
|
-
maxMaxPoints: 100,
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
export default {
|
|
198
|
-
model: {
|
|
199
|
-
rubricType: 'simpleRubric',
|
|
200
|
-
rubrics: {
|
|
201
|
-
[RUBRIC_TYPES.SIMPLE_RUBRIC]: rubricDefaultModel,
|
|
202
|
-
[RUBRIC_TYPES.MULTI_TRAIT_RUBRIC]: multiTraitDefaultModel,
|
|
203
|
-
[RUBRIC_TYPES.RUBRICLESS]: rubriclessDefaultModel,
|
|
204
|
-
},
|
|
205
|
-
},
|
|
206
|
-
configuration: {
|
|
207
|
-
// width: '770px',
|
|
208
|
-
rubricOptions: ['simpleRubric', 'multiTraitRubric', 'rubricless'],
|
|
209
|
-
[RUBRIC_TYPES.MULTI_TRAIT_RUBRIC]: multiTraitDefaultConfiguration,
|
|
210
|
-
[RUBRIC_TYPES.SIMPLE_RUBRIC]: rubricDefaultConfiguration,
|
|
211
|
-
[RUBRIC_TYPES.RUBRICLESS]: rubriclessDefaultConfiguration,
|
|
212
|
-
},
|
|
213
|
-
};
|
package/configure/src/index.js
DELETED
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import { ModelUpdatedEvent } from '@pie-framework/pie-configure-events';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { createRoot } from 'react-dom/client';
|
|
4
|
-
import RubricConfigure from '@pie-element/rubric/configure/lib';
|
|
5
|
-
import MultiTraitRubricConfigure from '@pie-element/multi-trait-rubric/configure/lib';
|
|
6
|
-
import debug from 'debug';
|
|
7
|
-
import { defaults } from 'lodash-es';
|
|
8
|
-
import Main from './main';
|
|
9
|
-
import sensibleDefaults from './defaults';
|
|
10
|
-
|
|
11
|
-
const MODEL_UPDATED = ModelUpdatedEvent.TYPE;
|
|
12
|
-
const RUBRIC_TAG_NAME = 'rubric-configure';
|
|
13
|
-
const MULTI_TRAIT_RUBRIC_TAG_NAME = 'multi-trait-rubric-configure';
|
|
14
|
-
|
|
15
|
-
class ComplexSimpleRubricConfigure extends RubricConfigure {}
|
|
16
|
-
|
|
17
|
-
class ComplexMTRConfigure extends MultiTraitRubricConfigure {
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const defineComplexRubric = () => {
|
|
21
|
-
if (!customElements.get(RUBRIC_TAG_NAME)) {
|
|
22
|
-
customElements.define(RUBRIC_TAG_NAME, ComplexSimpleRubricConfigure);
|
|
23
|
-
}
|
|
24
|
-
if (!customElements.get(MULTI_TRAIT_RUBRIC_TAG_NAME)) {
|
|
25
|
-
customElements.define(MULTI_TRAIT_RUBRIC_TAG_NAME, ComplexMTRConfigure);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
defineComplexRubric();
|
|
30
|
-
|
|
31
|
-
const prepareCustomizationObject = (config, model) => {
|
|
32
|
-
const configuration = defaults(config, sensibleDefaults.configuration);
|
|
33
|
-
|
|
34
|
-
return {
|
|
35
|
-
configuration,
|
|
36
|
-
model,
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export default class ComplexRubricConfigureElement extends HTMLElement {
|
|
41
|
-
static createDefaultModel = (
|
|
42
|
-
{
|
|
43
|
-
rubrics: { simpleRubric = {}, rubricless = {}, multiTraitRubric = {} } = { simpleRubric: {}, rubricless: {}, multiTraitRubric: {} },
|
|
44
|
-
...model
|
|
45
|
-
} = {},
|
|
46
|
-
currentModel = {},
|
|
47
|
-
) =>
|
|
48
|
-
{
|
|
49
|
-
const pieDefaults = sensibleDefaults?.model || {}
|
|
50
|
-
return {
|
|
51
|
-
...pieDefaults,
|
|
52
|
-
...currentModel,
|
|
53
|
-
...model,
|
|
54
|
-
rubrics: {
|
|
55
|
-
simpleRubric: {
|
|
56
|
-
...(sensibleDefaults?.model?.rubrics || {}).simpleRubric,
|
|
57
|
-
...(currentModel.rubrics || {}).simpleRubric,
|
|
58
|
-
...simpleRubric,
|
|
59
|
-
},
|
|
60
|
-
multiTraitRubric: {
|
|
61
|
-
...(sensibleDefaults?.model?.rubrics || {}).multiTraitRubric,
|
|
62
|
-
...(currentModel.rubrics || {}).multiTraitRubric,
|
|
63
|
-
...multiTraitRubric,
|
|
64
|
-
},
|
|
65
|
-
rubricless: {
|
|
66
|
-
...(sensibleDefaults?.model?.rubrics || {}).rubricless,
|
|
67
|
-
...(currentModel.rubrics || {}).rubricless,
|
|
68
|
-
...rubricless,
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
}};
|
|
72
|
-
|
|
73
|
-
constructor() {
|
|
74
|
-
super();
|
|
75
|
-
this._root = null;
|
|
76
|
-
this.canUpdateModel = false;
|
|
77
|
-
|
|
78
|
-
debug.log('constructor called');
|
|
79
|
-
|
|
80
|
-
this._model = ComplexRubricConfigureElement.createDefaultModel();
|
|
81
|
-
this._configuration = sensibleDefaults.configuration;
|
|
82
|
-
|
|
83
|
-
this.onConfigurationChanged = this.onConfigurationChanged.bind(this);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
set model(m) {
|
|
87
|
-
this._model = ComplexRubricConfigureElement.createDefaultModel(m, this._model);
|
|
88
|
-
|
|
89
|
-
this.canUpdateModel = true;
|
|
90
|
-
this._render();
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
dispatchModelUpdated(reset) {
|
|
94
|
-
const resetValue = !!reset;
|
|
95
|
-
|
|
96
|
-
this.dispatchEvent(new ModelUpdatedEvent(this._model, resetValue));
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
onModelChanged = (m, reset) => {
|
|
100
|
-
this._model = ComplexRubricConfigureElement.createDefaultModel(m, this._model);
|
|
101
|
-
|
|
102
|
-
this.dispatchModelUpdated(reset);
|
|
103
|
-
|
|
104
|
-
this._render();
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
set configuration(c) {
|
|
108
|
-
const info = prepareCustomizationObject(c, this._model);
|
|
109
|
-
this._configuration = info.configuration;
|
|
110
|
-
|
|
111
|
-
this._render();
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
onConfigurationChanged(c) {
|
|
115
|
-
this._configuration = prepareCustomizationObject(c, this._model).configuration;
|
|
116
|
-
|
|
117
|
-
if (this._model) {
|
|
118
|
-
this.onModelChanged(this._model);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
this._render();
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
onModelUpdated = (e) => {
|
|
125
|
-
if (e.target === this) {
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
e.preventDefault();
|
|
130
|
-
e.stopImmediatePropagation();
|
|
131
|
-
|
|
132
|
-
const id = e.target && e.target.getAttribute('id');
|
|
133
|
-
|
|
134
|
-
if (id) {
|
|
135
|
-
if (e.update) {
|
|
136
|
-
this._model.rubrics[id] = e.update;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
this.dispatchEvent(new ModelUpdatedEvent(this._model));
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
connectedCallback() {
|
|
144
|
-
this.addEventListener(MODEL_UPDATED, this.onModelUpdated);
|
|
145
|
-
this._render();
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
_render() {
|
|
149
|
-
let element = React.createElement(Main, {
|
|
150
|
-
model: this._model,
|
|
151
|
-
configuration: this._configuration,
|
|
152
|
-
onModelChanged: this.onModelChanged,
|
|
153
|
-
onConfigurationChanged: this.onConfigurationChanged,
|
|
154
|
-
canUpdateModel: this.canUpdateModel
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
if (!this._root) {
|
|
158
|
-
this._root = createRoot(this);
|
|
159
|
-
}
|
|
160
|
-
this._root.render(element);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
disconnectedCallback() {
|
|
164
|
-
this.removeEventListener(MODEL_UPDATED, this.onModelUpdated);
|
|
165
|
-
if (this._root) {
|
|
166
|
-
this._root.unmount();
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|