@pie-element/rubric 1.5.16 → 1.5.17-beta.587
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/CHANGELOG.md +443 -0
- package/configure/CHANGELOG.md +389 -0
- package/configure/lib/defaults.js +29 -0
- package/configure/lib/defaults.js.map +1 -0
- package/configure/lib/index.js +46 -9
- package/configure/lib/index.js.map +1 -1
- package/configure/lib/main.js +100 -0
- package/configure/lib/main.js.map +1 -0
- package/configure/package.json +5 -3
- package/configure/src/defaults.js +21 -0
- package/configure/src/index.js +34 -8
- package/configure/src/main.jsx +48 -0
- package/controller/CHANGELOG.md +46 -0
- package/controller/lib/index.js.map +1 -1
- package/controller/package.json +1 -1
- package/controller/src/__tests__/index.test.js +2 -5
- package/controller/src/index.js +2 -2
- package/docs/config-schema.json +79 -0
- package/docs/config-schema.json.md +65 -0
- package/docs/demo/config.js +2 -2
- package/docs/demo/generate.js +2 -1
- package/docs/demo/index.html +1 -2
- package/docs/pie-schema.json +80 -0
- package/docs/pie-schema.json.md +53 -0
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/main.js +44 -19
- package/lib/main.js.map +1 -1
- package/lib/print.js +114 -0
- package/lib/print.js.map +1 -0
- package/package.json +6 -2
- package/src/__tests__/__snapshots__/rubric-view.test.jsx.snap +7271 -263
- package/src/__tests__/rubric-view.test.jsx +11 -12
- package/src/index.js +2 -5
- package/src/main.jsx +51 -23
- package/src/print.js +63 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
model: {
|
|
3
|
+
points: ['', '', '', ''],
|
|
4
|
+
sampleAnswers: [null, null, null, null],
|
|
5
|
+
maxPoints: 4,
|
|
6
|
+
excludeZero: false,
|
|
7
|
+
excludeZeroEnabled: true,
|
|
8
|
+
maxPointsEnabled: true,
|
|
9
|
+
},
|
|
10
|
+
configuration: {
|
|
11
|
+
showExcludeZero: {
|
|
12
|
+
settings: true,
|
|
13
|
+
label: 'Ability to exclude zero',
|
|
14
|
+
},
|
|
15
|
+
showMaxPoint: {
|
|
16
|
+
settings: true,
|
|
17
|
+
label: 'Show max points dropdown',
|
|
18
|
+
},
|
|
19
|
+
settingsPanelDisabled: false,
|
|
20
|
+
},
|
|
21
|
+
};
|
package/configure/src/index.js
CHANGED
|
@@ -1,19 +1,31 @@
|
|
|
1
1
|
import { ModelUpdatedEvent } from '@pie-framework/pie-configure-events';
|
|
2
|
-
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import ReactDOM from 'react-dom';
|
|
5
|
-
import { Authoring } from '@pie-lib/rubric';
|
|
6
4
|
import debug from 'debug';
|
|
7
5
|
|
|
6
|
+
import Main from './main';
|
|
7
|
+
import defaults from './defaults';
|
|
8
|
+
|
|
9
|
+
const modelWithDefaults = (m) => ({ ...defaults.model, ...m });
|
|
10
|
+
const configurationWithDefaults = (c) => ({ ...defaults.configuration, ...c });
|
|
11
|
+
|
|
8
12
|
export default class RubricElement extends HTMLElement {
|
|
9
13
|
constructor() {
|
|
10
14
|
super();
|
|
11
15
|
debug.log('constructor called');
|
|
16
|
+
this._model = modelWithDefaults();
|
|
17
|
+
this._configuration = configurationWithDefaults();
|
|
12
18
|
this.onModelChanged = this.onModelChanged.bind(this);
|
|
19
|
+
this.onConfigurationChanged = this.onConfigurationChanged.bind(this);
|
|
13
20
|
}
|
|
14
21
|
|
|
15
|
-
set model(
|
|
16
|
-
this._model =
|
|
22
|
+
set model(m) {
|
|
23
|
+
this._model = modelWithDefaults(m);
|
|
24
|
+
this._render();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
set configuration(c) {
|
|
28
|
+
this._configuration = configurationWithDefaults(c);
|
|
17
29
|
this._render();
|
|
18
30
|
}
|
|
19
31
|
|
|
@@ -23,16 +35,30 @@ export default class RubricElement extends HTMLElement {
|
|
|
23
35
|
this.dispatchEvent(new ModelUpdatedEvent(this._model, false));
|
|
24
36
|
}
|
|
25
37
|
|
|
38
|
+
onConfigurationChanged = (c) => {
|
|
39
|
+
this._configuration = configurationWithDefaults(c);
|
|
40
|
+
|
|
41
|
+
if (this._model) {
|
|
42
|
+
this.onModelChanged(this._model);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
this._render();
|
|
46
|
+
};
|
|
47
|
+
|
|
26
48
|
connectedCallback() {
|
|
27
49
|
this._render();
|
|
28
50
|
}
|
|
29
51
|
|
|
30
52
|
_render() {
|
|
31
53
|
if (this._model) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
54
|
+
let element = React.createElement(Main, {
|
|
55
|
+
model: this._model,
|
|
56
|
+
configuration: this._configuration,
|
|
57
|
+
onModelChanged: this.onModelChanged,
|
|
58
|
+
onConfigurationChanged: this.onConfigurationChanged,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
ReactDOM.render(element, this);
|
|
36
62
|
}
|
|
37
63
|
}
|
|
38
64
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Authoring } from '@pie-lib/rubric';
|
|
3
|
+
import { withStyles } from '@material-ui/core/styles';
|
|
4
|
+
import { layout, settings } from '@pie-lib/config-ui';
|
|
5
|
+
|
|
6
|
+
const { Panel, toggle } = settings;
|
|
7
|
+
|
|
8
|
+
const styles = (theme) => ({
|
|
9
|
+
design: {
|
|
10
|
+
fontFamily: 'Cerebri Sans',
|
|
11
|
+
fontSize: theme.typography.fontSize,
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
class Main extends React.Component {
|
|
16
|
+
render() {
|
|
17
|
+
const { model, classes, configuration, onConfigurationChanged, onModelChanged } = this.props || {};
|
|
18
|
+
const { settingsPanelDisabled, showExcludeZero = {}, showMaxPoint = {} } = configuration || {};
|
|
19
|
+
|
|
20
|
+
const panelProperties = {
|
|
21
|
+
excludeZeroEnabled: showExcludeZero.settings && toggle(showExcludeZero.label),
|
|
22
|
+
maxPointsEnabled: showMaxPoint.settings && toggle(showMaxPoint.label),
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<div className={classes.design}>
|
|
27
|
+
<layout.ConfigLayout
|
|
28
|
+
hideSettings={settingsPanelDisabled}
|
|
29
|
+
settings={
|
|
30
|
+
<Panel
|
|
31
|
+
model={model}
|
|
32
|
+
onChangeModel={onModelChanged}
|
|
33
|
+
configuration={configuration}
|
|
34
|
+
onChangeConfiguration={onConfigurationChanged}
|
|
35
|
+
groups={{
|
|
36
|
+
Properties: panelProperties,
|
|
37
|
+
}}
|
|
38
|
+
/>
|
|
39
|
+
}
|
|
40
|
+
>
|
|
41
|
+
<Authoring value={model} onChange={onModelChanged} />
|
|
42
|
+
</layout.ConfigLayout>
|
|
43
|
+
</div>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export default withStyles(styles)(Main);
|
package/controller/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,52 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.2.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.2.7...@pie-element/rubric-controller@1.2.8) (2022-12-07)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/rubric-controller
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [1.2.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.2.2...@pie-element/rubric-controller@1.2.4) (2021-11-11)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @pie-element/rubric-controller
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [1.2.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.2.2...@pie-element/rubric-controller@1.2.3) (2021-11-11)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @pie-element/rubric-controller
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [1.2.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.2.0...@pie-element/rubric-controller@1.2.2) (2021-08-05)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
|
|
35
|
+
* force bump ([5ea7295](https://github.com/pie-framework/pie-elements/commit/5ea7295e4755fbc492a76e7ec69e5fc35b196919))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
# [1.2.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.1.8...@pie-element/rubric-controller@1.2.0) (2021-06-29)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Features
|
|
45
|
+
|
|
46
|
+
* **rubric:** Added sample answers to the model - PD-621 ([#559](https://github.com/pie-framework/pie-elements/issues/559)) ([d436b47](https://github.com/pie-framework/pie-elements/commit/d436b47b1cb8dd7cfbd82dbd2de4dd5eab36905c))
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
6
52
|
## [1.1.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.1.6...@pie-element/rubric-controller@1.1.8) (2021-03-03)
|
|
7
53
|
|
|
8
54
|
**Note:** Version bump only for package @pie-element/rubric-controller
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["model","session","env","Promise","resolve","modelResult","role"],"mappings":";;;;;;;AAAO,SAASA,KAAT,CAAeA,KAAf,EAAsBC,OAAtB,EAA+BC,GAA/B,EAAoC;AACzC,SAAO,IAAIC,OAAJ,CAAY,
|
|
1
|
+
{"version":3,"sources":["../src/index.js"],"names":["model","session","env","Promise","resolve","modelResult","role"],"mappings":";;;;;;;AAAO,SAASA,KAAT,CAAeA,KAAf,EAAsBC,OAAtB,EAA+BC,GAA/B,EAAoC;AACzC,SAAO,IAAIC,OAAJ,CAAY,UAACC,OAAD,EAAa;AAC9B,QAAMC,WAAW,GAAG,CAACL,KAAD,GAAS,EAAT,GAAcA,KAAlC;AACAI,IAAAA,OAAO,CAACF,GAAG,IAAIA,GAAG,CAACI,IAAX,IAAmBJ,GAAG,CAACI,IAAJ,KAAa,YAAhC,GAA+CD,WAA/C,GAA6D,EAA9D,CAAP;AACD,GAHM,CAAP;AAID","sourcesContent":["export function model(model, session, env) {\n return new Promise((resolve) => {\n const modelResult = !model ? {} : model;\n resolve(env && env.role && env.role === 'instructor' ? modelResult : {});\n });\n}\n"],"file":"index.js"}
|
package/controller/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { model } from '../index';
|
|
2
2
|
|
|
3
3
|
describe('rubric model', () => {
|
|
4
|
-
|
|
5
4
|
let state = {
|
|
6
5
|
points: ['nothing right', 'a teeny bit right', 'mostly right', 'bingo'],
|
|
6
|
+
sampleAnswers: [null, 'just right', 'not left', null],
|
|
7
7
|
maxPoints: 4,
|
|
8
|
-
excludeZero: false
|
|
8
|
+
excludeZero: false,
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
let session = {};
|
|
@@ -28,7 +28,4 @@ describe('rubric model', () => {
|
|
|
28
28
|
result = await model(state, session, env);
|
|
29
29
|
expect(result).toEqual(state);
|
|
30
30
|
});
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
31
|
});
|
package/controller/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export function model(model, session, env) {
|
|
2
|
-
return new Promise(resolve => {
|
|
2
|
+
return new Promise((resolve) => {
|
|
3
3
|
const modelResult = !model ? {} : model;
|
|
4
|
-
resolve(
|
|
4
|
+
resolve(env && env.role && env.role === 'instructor' ? modelResult : {});
|
|
5
5
|
});
|
|
6
6
|
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "object",
|
|
3
|
+
"properties": {
|
|
4
|
+
"settingsPanelDisabled": {
|
|
5
|
+
"description": "Indicates if the settings panel is not available",
|
|
6
|
+
"type": "boolean",
|
|
7
|
+
"title": "settingsPanelDisabled"
|
|
8
|
+
},
|
|
9
|
+
"showExcludeZero": {
|
|
10
|
+
"title": "ConfigureProp",
|
|
11
|
+
"type": "object",
|
|
12
|
+
"properties": {
|
|
13
|
+
"settings": {
|
|
14
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel",
|
|
15
|
+
"type": "boolean",
|
|
16
|
+
"title": "settings"
|
|
17
|
+
},
|
|
18
|
+
"label": {
|
|
19
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel",
|
|
20
|
+
"type": "string",
|
|
21
|
+
"title": "label"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"showMaxPoint": {
|
|
26
|
+
"title": "ConfigureProp",
|
|
27
|
+
"type": "object",
|
|
28
|
+
"properties": {
|
|
29
|
+
"settings": {
|
|
30
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel",
|
|
31
|
+
"type": "boolean",
|
|
32
|
+
"title": "settings"
|
|
33
|
+
},
|
|
34
|
+
"label": {
|
|
35
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel",
|
|
36
|
+
"type": "string",
|
|
37
|
+
"title": "label"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"showPrompt": {
|
|
42
|
+
"description": "Determines whether prompt field will be displayed or not",
|
|
43
|
+
"default": true,
|
|
44
|
+
"type": "boolean",
|
|
45
|
+
"title": "showPrompt"
|
|
46
|
+
},
|
|
47
|
+
"promptLabel": {
|
|
48
|
+
"description": "The label for the item stem/prompt field",
|
|
49
|
+
"default": "Item Stemm",
|
|
50
|
+
"type": "string",
|
|
51
|
+
"title": "promptLabel"
|
|
52
|
+
},
|
|
53
|
+
"settingsPartialScoring": {
|
|
54
|
+
"description": "Indicates whether the settings panel wil allow the author to modify settings for partial scoring",
|
|
55
|
+
"default": true,
|
|
56
|
+
"type": "boolean",
|
|
57
|
+
"title": "settingsPartialScoring"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"definitions": {
|
|
61
|
+
"ConfigureProp": {
|
|
62
|
+
"title": "ConfigureProp",
|
|
63
|
+
"type": "object",
|
|
64
|
+
"properties": {
|
|
65
|
+
"settings": {
|
|
66
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel",
|
|
67
|
+
"type": "boolean",
|
|
68
|
+
"title": "settings"
|
|
69
|
+
},
|
|
70
|
+
"label": {
|
|
71
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel",
|
|
72
|
+
"type": "string",
|
|
73
|
+
"title": "label"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
79
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
The schema defines the following properties:
|
|
2
|
+
|
|
3
|
+
# `settingsPanelDisabled` (boolean)
|
|
4
|
+
|
|
5
|
+
Indicates if the settings panel is not available
|
|
6
|
+
|
|
7
|
+
# `showExcludeZero` (object)
|
|
8
|
+
|
|
9
|
+
Properties of the `showExcludeZero` object:
|
|
10
|
+
|
|
11
|
+
## `settings` (boolean)
|
|
12
|
+
|
|
13
|
+
Indicates if the item has to be displayed in the Settings Panel
|
|
14
|
+
|
|
15
|
+
## `label` (string)
|
|
16
|
+
|
|
17
|
+
Indicates the label for the item that has to be displayed in the Settings Panel
|
|
18
|
+
|
|
19
|
+
# `showMaxPoint` (object)
|
|
20
|
+
|
|
21
|
+
Properties of the `showMaxPoint` object:
|
|
22
|
+
|
|
23
|
+
## `settings` (boolean)
|
|
24
|
+
|
|
25
|
+
Indicates if the item has to be displayed in the Settings Panel
|
|
26
|
+
|
|
27
|
+
## `label` (string)
|
|
28
|
+
|
|
29
|
+
Indicates the label for the item that has to be displayed in the Settings Panel
|
|
30
|
+
|
|
31
|
+
# `showPrompt` (boolean)
|
|
32
|
+
|
|
33
|
+
Determines whether prompt field will be displayed or not
|
|
34
|
+
|
|
35
|
+
Default: `true`
|
|
36
|
+
|
|
37
|
+
# `promptLabel` (string)
|
|
38
|
+
|
|
39
|
+
The label for the item stem/prompt field
|
|
40
|
+
|
|
41
|
+
Default: `"Item Stemm"`
|
|
42
|
+
|
|
43
|
+
# `settingsPartialScoring` (boolean)
|
|
44
|
+
|
|
45
|
+
Indicates whether the settings panel wil allow the author to modify settings for partial scoring
|
|
46
|
+
|
|
47
|
+
Default: `true`
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
# Sub Schemas
|
|
52
|
+
|
|
53
|
+
The schema defines the following additional types:
|
|
54
|
+
|
|
55
|
+
## `ConfigureProp` (object)
|
|
56
|
+
|
|
57
|
+
Properties of the `ConfigureProp` object:
|
|
58
|
+
|
|
59
|
+
### `settings` (boolean)
|
|
60
|
+
|
|
61
|
+
Indicates if the item has to be displayed in the Settings Panel
|
|
62
|
+
|
|
63
|
+
### `label` (string)
|
|
64
|
+
|
|
65
|
+
Indicates the label for the item that has to be displayed in the Settings Panel
|
package/docs/demo/config.js
CHANGED
package/docs/demo/generate.js
CHANGED
package/docs/demo/index.html
CHANGED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Model for the RubricPie Interaction",
|
|
3
|
+
"additionalProperties": false,
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"points": {
|
|
7
|
+
"description": "Indicates the score points labels. Starting from 0 to max",
|
|
8
|
+
"type": "array",
|
|
9
|
+
"items": {
|
|
10
|
+
"description": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.",
|
|
11
|
+
"type": "object",
|
|
12
|
+
"additionalProperties": false,
|
|
13
|
+
"patternProperties": {
|
|
14
|
+
"^[0-9]+$": {
|
|
15
|
+
"type": "string"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"title": "points"
|
|
20
|
+
},
|
|
21
|
+
"sampleAnswers": {
|
|
22
|
+
"description": "Indicates the sample answers labels. Starting from 0 to max",
|
|
23
|
+
"type": "array",
|
|
24
|
+
"items": {
|
|
25
|
+
"description": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.",
|
|
26
|
+
"type": "object",
|
|
27
|
+
"additionalProperties": false,
|
|
28
|
+
"patternProperties": {
|
|
29
|
+
"^[0-9]+$": {
|
|
30
|
+
"type": "string"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"title": "sampleAnswers"
|
|
35
|
+
},
|
|
36
|
+
"maxPoints": {
|
|
37
|
+
"description": "Indicates the max limit for scoring points",
|
|
38
|
+
"type": "number",
|
|
39
|
+
"title": "maxPoints"
|
|
40
|
+
},
|
|
41
|
+
"excludeZeros": {
|
|
42
|
+
"description": "Indicates if point 0 should be shown",
|
|
43
|
+
"type": "boolean",
|
|
44
|
+
"title": "excludeZeros"
|
|
45
|
+
},
|
|
46
|
+
"id": {
|
|
47
|
+
"description": "Identifier to identify the Pie Element in html markup, Must be unique within a pie item config.",
|
|
48
|
+
"type": "string",
|
|
49
|
+
"title": "id"
|
|
50
|
+
},
|
|
51
|
+
"element": {
|
|
52
|
+
"description": "The html Element tag name",
|
|
53
|
+
"type": "string",
|
|
54
|
+
"title": "element"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"required": [
|
|
58
|
+
"element",
|
|
59
|
+
"id"
|
|
60
|
+
],
|
|
61
|
+
"definitions": {
|
|
62
|
+
"ConfigureProp": {
|
|
63
|
+
"title": "ConfigureProp",
|
|
64
|
+
"type": "object",
|
|
65
|
+
"properties": {
|
|
66
|
+
"settings": {
|
|
67
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel",
|
|
68
|
+
"type": "boolean",
|
|
69
|
+
"title": "settings"
|
|
70
|
+
},
|
|
71
|
+
"label": {
|
|
72
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel",
|
|
73
|
+
"type": "string",
|
|
74
|
+
"title": "label"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
80
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
Model for the RubricPie Interaction
|
|
2
|
+
|
|
3
|
+
The schema defines the following properties:
|
|
4
|
+
|
|
5
|
+
# `points` (array)
|
|
6
|
+
|
|
7
|
+
Indicates the score points labels. Starting from 0 to max
|
|
8
|
+
|
|
9
|
+
The object is an array with all elements of the type `object`.
|
|
10
|
+
|
|
11
|
+
The array object has the following properties:
|
|
12
|
+
|
|
13
|
+
# `sampleAnswers` (array)
|
|
14
|
+
|
|
15
|
+
Indicates the sample answers labels. Starting from 0 to max
|
|
16
|
+
|
|
17
|
+
The object is an array with all elements of the type `object`.
|
|
18
|
+
|
|
19
|
+
The array object has the following properties:
|
|
20
|
+
|
|
21
|
+
# `maxPoints` (number)
|
|
22
|
+
|
|
23
|
+
Indicates the max limit for scoring points
|
|
24
|
+
|
|
25
|
+
# `excludeZeros` (boolean)
|
|
26
|
+
|
|
27
|
+
Indicates if point 0 should be shown
|
|
28
|
+
|
|
29
|
+
# `id` (string, required)
|
|
30
|
+
|
|
31
|
+
Identifier to identify the Pie Element in html markup, Must be unique within a pie item config.
|
|
32
|
+
|
|
33
|
+
# `element` (string, required)
|
|
34
|
+
|
|
35
|
+
The html Element tag name
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
# Sub Schemas
|
|
40
|
+
|
|
41
|
+
The schema defines the following additional types:
|
|
42
|
+
|
|
43
|
+
## `ConfigureProp` (object)
|
|
44
|
+
|
|
45
|
+
Properties of the `ConfigureProp` object:
|
|
46
|
+
|
|
47
|
+
### `settings` (boolean)
|
|
48
|
+
|
|
49
|
+
Indicates if the item has to be displayed in the Settings Panel
|
|
50
|
+
|
|
51
|
+
### `label` (string)
|
|
52
|
+
|
|
53
|
+
Indicates the label for the item that has to be displayed in the Settings Panel
|
package/lib/index.js
CHANGED
|
@@ -31,7 +31,7 @@ var _debug = _interopRequireDefault(require("debug"));
|
|
|
31
31
|
|
|
32
32
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
33
33
|
|
|
34
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
34
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
35
35
|
|
|
36
36
|
var RubricRender = /*#__PURE__*/function (_HTMLElement) {
|
|
37
37
|
(0, _inherits2["default"])(RubricRender, _HTMLElement);
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["RubricRender","debug","log","onModelChanged","bind","s","_model","_render","m","el","ReactDOM","render","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;
|
|
1
|
+
{"version":3,"sources":["../src/index.js"],"names":["RubricRender","debug","log","onModelChanged","bind","s","_model","_render","m","el","ReactDOM","render","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;IAEqBA,Y;;;;;AACnB,0BAAc;AAAA;;AAAA;AACZ;;AACAC,sBAAMC,GAAN,CAAU,oBAAV;;AACA,UAAKC,cAAL,GAAsB,MAAKA,cAAL,CAAoBC,IAApB,gDAAtB;AAHY;AAIb;;;;SAED,aAAUC,CAAV,EAAa;AACX,WAAKC,MAAL,GAAcD,CAAd;;AACA,WAAKE,OAAL;AACD;;;WAED,wBAAeC,CAAf,EAAkB;AAChB,WAAKF,MAAL,GAAcE,CAAd;;AACA,WAAKD,OAAL;AACD;;;WAED,6BAAoB;AAClB,WAAKA,OAAL;AACD;;;WAED,mBAAU;AACR,UAAI,KAAKD,MAAT,EAAiB;AACf,YAAMG,EAAE,gBAAG,gCAAC,gBAAD;AAAQ,UAAA,KAAK,EAAE,KAAKH;AAApB,UAAX;;AAEAI,6BAASC,MAAT,CAAgBF,EAAhB,EAAoB,IAApB;AACD;AACF;;;kDA3BuCG,W","sourcesContent":["import Rubric from './main';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport debug from 'debug';\n\nexport default class RubricRender extends HTMLElement {\n constructor() {\n super();\n debug.log('constructor called');\n this.onModelChanged = this.onModelChanged.bind(this);\n }\n\n set model(s) {\n this._model = s;\n this._render();\n }\n\n onModelChanged(m) {\n this._model = m;\n this._render();\n }\n\n connectedCallback() {\n this._render();\n }\n\n _render() {\n if (this._model) {\n const el = <Rubric value={this._model} />;\n\n ReactDOM.render(el, this);\n }\n }\n}\n"],"file":"index.js"}
|