@pie-element/ebsr 9.19.0 → 9.19.1-next.13
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/lib/print.js +24 -1
- 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 +2 -2
- package/module/print.html +1 -1
- package/module/print.js +3453 -202
- package/package.json +4 -3
- package/src/print.js +24 -1
package/package.json
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/ebsr",
|
|
3
|
-
"version": "9.19.
|
|
3
|
+
"version": "9.19.1-next.13+e2f0ba2c8",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": "pie-framework/pie-elements",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@pie-element/multiple-choice": "^8.22.
|
|
10
|
+
"@pie-element/multiple-choice": "^8.22.1-next.13+e2f0ba2c8",
|
|
11
11
|
"@pie-framework/pie-player-events": "^0.1.0",
|
|
12
|
+
"@pie-lib/pie-toolbox": "1.27.0",
|
|
12
13
|
"classnames": "^2.2.5",
|
|
13
14
|
"debug": "^4.1.1",
|
|
14
15
|
"lodash": "^4.17.11"
|
|
15
16
|
},
|
|
16
17
|
"author": "pie framework developers",
|
|
17
18
|
"license": "ISC",
|
|
18
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "e2f0ba2c8d984648c56a1b9114b8875a8e0adc9f",
|
|
19
20
|
"scripts": {
|
|
20
21
|
"postpublish": "../../scripts/postpublish"
|
|
21
22
|
},
|
package/src/print.js
CHANGED
|
@@ -2,10 +2,12 @@ import cloneDeep from 'lodash/cloneDeep';
|
|
|
2
2
|
import MultipleChoice from '@pie-element/multiple-choice';
|
|
3
3
|
import debug from 'debug';
|
|
4
4
|
import get from 'lodash/get';
|
|
5
|
-
|
|
6
5
|
import { SessionChangedEvent } from '@pie-framework/pie-player-events';
|
|
7
6
|
const MC_TAG_NAME = 'ebsr-multiple-choice';
|
|
8
7
|
const SESSION_CHANGED = SessionChangedEvent.TYPE;
|
|
8
|
+
import Translator from '@pie-lib/pie-toolbox/translator';
|
|
9
|
+
|
|
10
|
+
const { translator } = Translator;
|
|
9
11
|
|
|
10
12
|
const log = debug('pie-element:ebsr:print');
|
|
11
13
|
|
|
@@ -114,9 +116,30 @@ export default class Ebsr extends HTMLElement {
|
|
|
114
116
|
|
|
115
117
|
setPartModel(part, key) {
|
|
116
118
|
if (this._model && this._model[key] && part) {
|
|
119
|
+
let labels = {
|
|
120
|
+
'partA': undefined,
|
|
121
|
+
'partB': undefined
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
if (this._model.partLabels) {
|
|
125
|
+
const language = this._model.language;
|
|
126
|
+
|
|
127
|
+
labels = {
|
|
128
|
+
'partA': translator.t('ebsr.part', {
|
|
129
|
+
lng: language,
|
|
130
|
+
index: this._model.partLabelType === 'Letters' ? 'A' : '1'
|
|
131
|
+
}),
|
|
132
|
+
'partB': translator.t('ebsr.part', {
|
|
133
|
+
lng: language,
|
|
134
|
+
index: this._model.partLabelType === 'Letters' ? 'B' : '2'
|
|
135
|
+
})
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
117
139
|
part.model = {
|
|
118
140
|
...preparePrintModel(this._model[key], this._options),
|
|
119
141
|
keyMode: this._model[key].choicePrefix,
|
|
142
|
+
partLabel: labels[key]
|
|
120
143
|
};
|
|
121
144
|
|
|
122
145
|
if (!part._session) {
|