@pie-element/ebsr 13.2.0-next.9 → 14.0.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/CHANGELOG.md +22 -0
- package/configure/CHANGELOG.md +16 -0
- package/configure/package.json +3 -3
- package/controller/CHANGELOG.md +6 -0
- package/controller/package.json +3 -3
- package/lib/print.js +24 -19
- package/lib/print.js.map +1 -1
- package/module/configure.js +1 -1
- package/module/element.js +1 -1
- package/module/index.html +1 -1
- package/module/manifest.json +3 -3
- package/module/print.html +1 -1
- package/module/print.js +1 -1
- package/package.json +4 -4
- package/src/print.js +29 -25
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/ebsr",
|
|
3
3
|
"repository": "pie-framework/pie-elements",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "14.0.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@pie-element/multiple-choice": "^
|
|
10
|
+
"@pie-element/multiple-choice": "^13.0.0",
|
|
11
11
|
"@pie-framework/pie-player-events": "^0.1.0",
|
|
12
|
-
"@pie-lib/translator": "
|
|
12
|
+
"@pie-lib/translator": "4.0.0",
|
|
13
13
|
"classnames": "^2.2.5",
|
|
14
14
|
"debug": "^4.1.1",
|
|
15
15
|
"lodash-es": "^4.17.23"
|
|
16
16
|
},
|
|
17
17
|
"author": "pie framework developers",
|
|
18
18
|
"license": "ISC",
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "ae83eee44da92ef9c135dbeeb94a889d0b14cdff",
|
|
20
20
|
"scripts": {
|
|
21
21
|
"postpublish": "../../scripts/postpublish"
|
|
22
22
|
},
|
package/src/print.js
CHANGED
|
@@ -20,31 +20,30 @@ const log = debug('pie-element:ebsr:print');
|
|
|
20
20
|
|
|
21
21
|
const preparePrintModel = (model, opts) => {
|
|
22
22
|
const instr = opts.role === 'instructor';
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
c.rationale = instr && model.rationaleEnabled !== false ? c.rationale : undefined;
|
|
23
|
+
const printModel = cloneDeep(model);
|
|
24
|
+
|
|
25
|
+
printModel.prompt = printModel.promptEnabled !== false ? printModel.prompt : undefined;
|
|
26
|
+
printModel.teacherInstructions =
|
|
27
|
+
instr && printModel.teacherInstructionsEnabled !== false ? printModel.teacherInstructions : undefined;
|
|
28
|
+
printModel.showTeacherInstructions = instr;
|
|
29
|
+
printModel.alwaysShowCorrect = instr;
|
|
30
|
+
printModel.mode = instr ? 'evaluate' : 'gather';
|
|
31
|
+
|
|
32
|
+
printModel.disabled = true;
|
|
33
|
+
printModel.animationsDisabled = true;
|
|
34
|
+
printModel.lockChoiceOrder = true;
|
|
35
|
+
printModel.choicesLayout = printModel.choicesLayout || 'vertical';
|
|
36
|
+
|
|
37
|
+
printModel.choices = (printModel.choices || []).map((c) => {
|
|
38
|
+
c.rationale = instr && printModel.rationaleEnabled !== false ? c.rationale : undefined;
|
|
40
39
|
c.hideTick = instr;
|
|
41
40
|
c.feedback = undefined;
|
|
42
41
|
return c;
|
|
43
42
|
});
|
|
44
43
|
|
|
45
|
-
|
|
44
|
+
printModel.keyMode = printModel.choicePrefix || 'letters';
|
|
46
45
|
|
|
47
|
-
return
|
|
46
|
+
return printModel;
|
|
48
47
|
};
|
|
49
48
|
|
|
50
49
|
class EbsrMC extends MultipleChoice {}
|
|
@@ -97,11 +96,7 @@ export default class Ebsr extends HTMLElement {
|
|
|
97
96
|
|
|
98
97
|
set model(m) {
|
|
99
98
|
this._model = m;
|
|
100
|
-
|
|
101
|
-
customElements.whenDefined(MC_TAG_NAME).then(() => {
|
|
102
|
-
this.setPartModel(this.partA, 'partA');
|
|
103
|
-
this.setPartModel(this.partB, 'partB');
|
|
104
|
-
});
|
|
99
|
+
this._updateParts();
|
|
105
100
|
}
|
|
106
101
|
|
|
107
102
|
set session(s) {
|
|
@@ -113,8 +108,15 @@ export default class Ebsr extends HTMLElement {
|
|
|
113
108
|
});
|
|
114
109
|
}
|
|
115
110
|
|
|
111
|
+
_updateParts() {
|
|
112
|
+
customElements.whenDefined(MC_TAG_NAME).then(() => {
|
|
113
|
+
this.setPartModel(this.partA, 'partA');
|
|
114
|
+
this.setPartModel(this.partB, 'partB');
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
116
118
|
setPartModel(part, key) {
|
|
117
|
-
if (this._model && this._model[key] && part) {
|
|
119
|
+
if (this._model && this._model[key] && part && this._options) {
|
|
118
120
|
let labels = {
|
|
119
121
|
partA: undefined,
|
|
120
122
|
partB: undefined,
|
|
@@ -155,6 +157,8 @@ export default class Ebsr extends HTMLElement {
|
|
|
155
157
|
|
|
156
158
|
set options(o) {
|
|
157
159
|
this._options = o;
|
|
160
|
+
// re-render parts so role changes (student/instructor) propagate to each part
|
|
161
|
+
this._updateParts();
|
|
158
162
|
}
|
|
159
163
|
|
|
160
164
|
setPartSession(part, key) {
|