@pie-element/ebsr 10.3.5-next.38 → 10.3.5-next.6
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/module/element.js +21 -28
- package/module/print.js +21 -28
- package/package.json +3 -3
package/module/element.js
CHANGED
|
@@ -12719,6 +12719,8 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12719
12719
|
this.handleChange = event => {
|
|
12720
12720
|
const {value, checked} = event.target;
|
|
12721
12721
|
const {maxSelections, onChoiceChanged, session} = this.props;
|
|
12722
|
+
const {detail} = event.nativeEvent;
|
|
12723
|
+
let selector = detail ? 'Mouse' : 'Keyboard';
|
|
12722
12724
|
if (session.value && session.value.length >= maxSelections) {
|
|
12723
12725
|
this.setState({
|
|
12724
12726
|
maxSelectionsErrorState: checked
|
|
@@ -12730,7 +12732,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12730
12732
|
onChoiceChanged({
|
|
12731
12733
|
value,
|
|
12732
12734
|
selected: checked,
|
|
12733
|
-
selector
|
|
12735
|
+
selector
|
|
12734
12736
|
});
|
|
12735
12737
|
};
|
|
12736
12738
|
}
|
|
@@ -12814,14 +12816,14 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12814
12816
|
__self: this,
|
|
12815
12817
|
__source: {
|
|
12816
12818
|
fileName: _jsxFileName$1,
|
|
12817
|
-
lineNumber:
|
|
12819
|
+
lineNumber: 214
|
|
12818
12820
|
}
|
|
12819
12821
|
}, "Multiple Choice Question") : React$2.createElement('h2', {
|
|
12820
12822
|
className: classes.srOnly,
|
|
12821
12823
|
__self: this,
|
|
12822
12824
|
__source: {
|
|
12823
12825
|
fileName: _jsxFileName$1,
|
|
12824
|
-
lineNumber:
|
|
12826
|
+
lineNumber: 216
|
|
12825
12827
|
}
|
|
12826
12828
|
}, "Multiple Select Question");
|
|
12827
12829
|
}
|
|
@@ -12843,7 +12845,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12843
12845
|
__self: this,
|
|
12844
12846
|
__source: {
|
|
12845
12847
|
fileName: _jsxFileName$1,
|
|
12846
|
-
lineNumber:
|
|
12848
|
+
lineNumber: 251
|
|
12847
12849
|
}
|
|
12848
12850
|
});
|
|
12849
12851
|
const getMultipleChoiceMinSelectionErrorMessage = () => {
|
|
@@ -12870,21 +12872,21 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12870
12872
|
__self: this,
|
|
12871
12873
|
__source: {
|
|
12872
12874
|
fileName: _jsxFileName$1,
|
|
12873
|
-
lineNumber:
|
|
12875
|
+
lineNumber: 274
|
|
12874
12876
|
}
|
|
12875
12877
|
}, partLabel && React$2.createElement('h3', {
|
|
12876
12878
|
className: classes.partLabel,
|
|
12877
12879
|
__self: this,
|
|
12878
12880
|
__source: {
|
|
12879
12881
|
fileName: _jsxFileName$1,
|
|
12880
|
-
lineNumber:
|
|
12882
|
+
lineNumber: 275
|
|
12881
12883
|
}
|
|
12882
12884
|
}, partLabel), this.renderHeading(), teacherInstructions && React$2.createElement('div', {
|
|
12883
12885
|
className: classes.teacherInstructions,
|
|
12884
12886
|
__self: this,
|
|
12885
12887
|
__source: {
|
|
12886
12888
|
fileName: _jsxFileName$1,
|
|
12887
|
-
lineNumber:
|
|
12889
|
+
lineNumber: 280
|
|
12888
12890
|
}
|
|
12889
12891
|
}, !animationsDisabled ? React$2.createElement(Collapsible, {
|
|
12890
12892
|
labels: {
|
|
@@ -12894,14 +12896,14 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12894
12896
|
__self: this,
|
|
12895
12897
|
__source: {
|
|
12896
12898
|
fileName: _jsxFileName$1,
|
|
12897
|
-
lineNumber:
|
|
12899
|
+
lineNumber: 282
|
|
12898
12900
|
}
|
|
12899
12901
|
}, teacherInstructionsDiv) : teacherInstructionsDiv), React$2.createElement('fieldset', {
|
|
12900
12902
|
className: classes.fieldset,
|
|
12901
12903
|
__self: this,
|
|
12902
12904
|
__source: {
|
|
12903
12905
|
fileName: _jsxFileName$1,
|
|
12904
|
-
lineNumber:
|
|
12906
|
+
lineNumber: 296
|
|
12905
12907
|
}
|
|
12906
12908
|
}, React$2.createElement(PreviewPrompt, {
|
|
12907
12909
|
className: "prompt",
|
|
@@ -12912,7 +12914,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12912
12914
|
__self: this,
|
|
12913
12915
|
__source: {
|
|
12914
12916
|
fileName: _jsxFileName$1,
|
|
12915
|
-
lineNumber:
|
|
12917
|
+
lineNumber: 297
|
|
12916
12918
|
}
|
|
12917
12919
|
}), !alwaysShowCorrect && React$2.createElement(CorrectAnswerToggle, {
|
|
12918
12920
|
show: showCorrectAnswerToggle,
|
|
@@ -12922,7 +12924,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12922
12924
|
__self: this,
|
|
12923
12925
|
__source: {
|
|
12924
12926
|
fileName: _jsxFileName$1,
|
|
12925
|
-
lineNumber:
|
|
12927
|
+
lineNumber: 306
|
|
12926
12928
|
}
|
|
12927
12929
|
}), React$2.createElement('div', {
|
|
12928
12930
|
className: classNames({
|
|
@@ -12933,7 +12935,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12933
12935
|
__self: this,
|
|
12934
12936
|
__source: {
|
|
12935
12937
|
fileName: _jsxFileName$1,
|
|
12936
|
-
lineNumber:
|
|
12938
|
+
lineNumber: 314
|
|
12937
12939
|
}
|
|
12938
12940
|
}, choices.map((choice, index) => React$2.createElement(StyledChoice, {
|
|
12939
12941
|
choicesLayout: this.props.choicesLayout,
|
|
@@ -12956,21 +12958,21 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12956
12958
|
__self: this,
|
|
12957
12959
|
__source: {
|
|
12958
12960
|
fileName: _jsxFileName$1,
|
|
12959
|
-
lineNumber:
|
|
12961
|
+
lineNumber: 322
|
|
12960
12962
|
}
|
|
12961
12963
|
})))), choiceMode === 'checkbox' && selections < minSelections && React$2.createElement('div', {
|
|
12962
12964
|
className: classes.errorText,
|
|
12963
12965
|
__self: this,
|
|
12964
12966
|
__source: {
|
|
12965
12967
|
fileName: _jsxFileName$1,
|
|
12966
|
-
lineNumber:
|
|
12968
|
+
lineNumber: 346
|
|
12967
12969
|
}
|
|
12968
12970
|
}, getMultipleChoiceMinSelectionErrorMessage()), choiceMode === 'checkbox' && maxSelectionsErrorState && React$2.createElement('div', {
|
|
12969
12971
|
className: classes.errorText,
|
|
12970
12972
|
__self: this,
|
|
12971
12973
|
__source: {
|
|
12972
12974
|
fileName: _jsxFileName$1,
|
|
12973
|
-
lineNumber:
|
|
12975
|
+
lineNumber: 351
|
|
12974
12976
|
}
|
|
12975
12977
|
}, translator.t(`translation:multipleChoice:maxSelections_${maxSelections === 1 ? 'one' : 'other'}`, {
|
|
12976
12978
|
lng: language,
|
|
@@ -13120,8 +13122,6 @@ class MultipleChoice extends HTMLElement {
|
|
|
13120
13122
|
this._model = null;
|
|
13121
13123
|
this._session = null;
|
|
13122
13124
|
this.audioComplete = false;
|
|
13123
|
-
this._boundHandleKeyDown = this.handleKeyDown.bind(this);
|
|
13124
|
-
this._keyboardEventsEnabled = false;
|
|
13125
13125
|
this._rerender = debounce(() => {
|
|
13126
13126
|
if (this._model && this._session) {
|
|
13127
13127
|
var element = React.createElement(Root, {
|
|
@@ -13137,7 +13137,7 @@ class MultipleChoice extends HTMLElement {
|
|
|
13137
13137
|
log$1('render complete - render math');
|
|
13138
13138
|
renderMath(this);
|
|
13139
13139
|
});
|
|
13140
|
-
if (this._model.keyboardEventsEnabled === true
|
|
13140
|
+
if (this._model.keyboardEventsEnabled === true) {
|
|
13141
13141
|
this.enableKeyboardEvents();
|
|
13142
13142
|
}
|
|
13143
13143
|
} else {
|
|
@@ -13264,16 +13264,10 @@ class MultipleChoice extends HTMLElement {
|
|
|
13264
13264
|
});
|
|
13265
13265
|
}
|
|
13266
13266
|
enableKeyboardEvents() {
|
|
13267
|
-
|
|
13268
|
-
window.addEventListener('keydown', this._boundHandleKeyDown);
|
|
13269
|
-
this._keyboardEventsEnabled = true;
|
|
13270
|
-
}
|
|
13267
|
+
window.addEventListener('keydown', this.handleKeyDown.bind(this));
|
|
13271
13268
|
}
|
|
13272
13269
|
disconnectedCallback() {
|
|
13273
|
-
|
|
13274
|
-
window.removeEventListener('keydown', this._boundHandleKeyDown);
|
|
13275
|
-
this._keyboardEventsEnabled = false;
|
|
13276
|
-
}
|
|
13270
|
+
window.removeEventListener('keydown', this.handleKeyDown.bind(this));
|
|
13277
13271
|
}
|
|
13278
13272
|
handleKeyDown(event) {
|
|
13279
13273
|
if (!this._model || !this._session) {
|
|
@@ -13292,8 +13286,7 @@ class MultipleChoice extends HTMLElement {
|
|
|
13292
13286
|
const choiceId = this._model.choices[choiceIndex].value;
|
|
13293
13287
|
const newValue = {
|
|
13294
13288
|
value: choiceId,
|
|
13295
|
-
selected: !currentValue.includes(choiceId)
|
|
13296
|
-
selector: 'Keyboard'
|
|
13289
|
+
selected: !currentValue.includes(choiceId)
|
|
13297
13290
|
};
|
|
13298
13291
|
this._onChange(newValue);
|
|
13299
13292
|
}
|
package/module/print.js
CHANGED
|
@@ -12682,6 +12682,8 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12682
12682
|
this.handleChange = event => {
|
|
12683
12683
|
const {value, checked} = event.target;
|
|
12684
12684
|
const {maxSelections, onChoiceChanged, session} = this.props;
|
|
12685
|
+
const {detail} = event.nativeEvent;
|
|
12686
|
+
let selector = detail ? 'Mouse' : 'Keyboard';
|
|
12685
12687
|
if (session.value && session.value.length >= maxSelections) {
|
|
12686
12688
|
this.setState({
|
|
12687
12689
|
maxSelectionsErrorState: checked
|
|
@@ -12693,7 +12695,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12693
12695
|
onChoiceChanged({
|
|
12694
12696
|
value,
|
|
12695
12697
|
selected: checked,
|
|
12696
|
-
selector
|
|
12698
|
+
selector
|
|
12697
12699
|
});
|
|
12698
12700
|
};
|
|
12699
12701
|
}
|
|
@@ -12777,14 +12779,14 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12777
12779
|
__self: this,
|
|
12778
12780
|
__source: {
|
|
12779
12781
|
fileName: _jsxFileName$1,
|
|
12780
|
-
lineNumber:
|
|
12782
|
+
lineNumber: 214
|
|
12781
12783
|
}
|
|
12782
12784
|
}, "Multiple Choice Question") : React$2.createElement('h2', {
|
|
12783
12785
|
className: classes.srOnly,
|
|
12784
12786
|
__self: this,
|
|
12785
12787
|
__source: {
|
|
12786
12788
|
fileName: _jsxFileName$1,
|
|
12787
|
-
lineNumber:
|
|
12789
|
+
lineNumber: 216
|
|
12788
12790
|
}
|
|
12789
12791
|
}, "Multiple Select Question");
|
|
12790
12792
|
}
|
|
@@ -12806,7 +12808,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12806
12808
|
__self: this,
|
|
12807
12809
|
__source: {
|
|
12808
12810
|
fileName: _jsxFileName$1,
|
|
12809
|
-
lineNumber:
|
|
12811
|
+
lineNumber: 251
|
|
12810
12812
|
}
|
|
12811
12813
|
});
|
|
12812
12814
|
const getMultipleChoiceMinSelectionErrorMessage = () => {
|
|
@@ -12833,21 +12835,21 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12833
12835
|
__self: this,
|
|
12834
12836
|
__source: {
|
|
12835
12837
|
fileName: _jsxFileName$1,
|
|
12836
|
-
lineNumber:
|
|
12838
|
+
lineNumber: 274
|
|
12837
12839
|
}
|
|
12838
12840
|
}, partLabel && React$2.createElement('h3', {
|
|
12839
12841
|
className: classes.partLabel,
|
|
12840
12842
|
__self: this,
|
|
12841
12843
|
__source: {
|
|
12842
12844
|
fileName: _jsxFileName$1,
|
|
12843
|
-
lineNumber:
|
|
12845
|
+
lineNumber: 275
|
|
12844
12846
|
}
|
|
12845
12847
|
}, partLabel), this.renderHeading(), teacherInstructions && React$2.createElement('div', {
|
|
12846
12848
|
className: classes.teacherInstructions,
|
|
12847
12849
|
__self: this,
|
|
12848
12850
|
__source: {
|
|
12849
12851
|
fileName: _jsxFileName$1,
|
|
12850
|
-
lineNumber:
|
|
12852
|
+
lineNumber: 280
|
|
12851
12853
|
}
|
|
12852
12854
|
}, !animationsDisabled ? React$2.createElement(Collapsible, {
|
|
12853
12855
|
labels: {
|
|
@@ -12857,14 +12859,14 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12857
12859
|
__self: this,
|
|
12858
12860
|
__source: {
|
|
12859
12861
|
fileName: _jsxFileName$1,
|
|
12860
|
-
lineNumber:
|
|
12862
|
+
lineNumber: 282
|
|
12861
12863
|
}
|
|
12862
12864
|
}, teacherInstructionsDiv) : teacherInstructionsDiv), React$2.createElement('fieldset', {
|
|
12863
12865
|
className: classes.fieldset,
|
|
12864
12866
|
__self: this,
|
|
12865
12867
|
__source: {
|
|
12866
12868
|
fileName: _jsxFileName$1,
|
|
12867
|
-
lineNumber:
|
|
12869
|
+
lineNumber: 296
|
|
12868
12870
|
}
|
|
12869
12871
|
}, React$2.createElement(PreviewPrompt, {
|
|
12870
12872
|
className: "prompt",
|
|
@@ -12875,7 +12877,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12875
12877
|
__self: this,
|
|
12876
12878
|
__source: {
|
|
12877
12879
|
fileName: _jsxFileName$1,
|
|
12878
|
-
lineNumber:
|
|
12880
|
+
lineNumber: 297
|
|
12879
12881
|
}
|
|
12880
12882
|
}), !alwaysShowCorrect && React$2.createElement(CorrectAnswerToggle, {
|
|
12881
12883
|
show: showCorrectAnswerToggle,
|
|
@@ -12885,7 +12887,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12885
12887
|
__self: this,
|
|
12886
12888
|
__source: {
|
|
12887
12889
|
fileName: _jsxFileName$1,
|
|
12888
|
-
lineNumber:
|
|
12890
|
+
lineNumber: 306
|
|
12889
12891
|
}
|
|
12890
12892
|
}), React$2.createElement('div', {
|
|
12891
12893
|
className: classNames({
|
|
@@ -12896,7 +12898,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12896
12898
|
__self: this,
|
|
12897
12899
|
__source: {
|
|
12898
12900
|
fileName: _jsxFileName$1,
|
|
12899
|
-
lineNumber:
|
|
12901
|
+
lineNumber: 314
|
|
12900
12902
|
}
|
|
12901
12903
|
}, choices.map((choice, index) => React$2.createElement(StyledChoice, {
|
|
12902
12904
|
choicesLayout: this.props.choicesLayout,
|
|
@@ -12919,21 +12921,21 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12919
12921
|
__self: this,
|
|
12920
12922
|
__source: {
|
|
12921
12923
|
fileName: _jsxFileName$1,
|
|
12922
|
-
lineNumber:
|
|
12924
|
+
lineNumber: 322
|
|
12923
12925
|
}
|
|
12924
12926
|
})))), choiceMode === 'checkbox' && selections < minSelections && React$2.createElement('div', {
|
|
12925
12927
|
className: classes.errorText,
|
|
12926
12928
|
__self: this,
|
|
12927
12929
|
__source: {
|
|
12928
12930
|
fileName: _jsxFileName$1,
|
|
12929
|
-
lineNumber:
|
|
12931
|
+
lineNumber: 346
|
|
12930
12932
|
}
|
|
12931
12933
|
}, getMultipleChoiceMinSelectionErrorMessage()), choiceMode === 'checkbox' && maxSelectionsErrorState && React$2.createElement('div', {
|
|
12932
12934
|
className: classes.errorText,
|
|
12933
12935
|
__self: this,
|
|
12934
12936
|
__source: {
|
|
12935
12937
|
fileName: _jsxFileName$1,
|
|
12936
|
-
lineNumber:
|
|
12938
|
+
lineNumber: 351
|
|
12937
12939
|
}
|
|
12938
12940
|
}, translator$1.t(`translation:multipleChoice:maxSelections_${maxSelections === 1 ? 'one' : 'other'}`, {
|
|
12939
12941
|
lng: language,
|
|
@@ -13120,8 +13122,6 @@ class MultipleChoice extends HTMLElement {
|
|
|
13120
13122
|
this._model = null;
|
|
13121
13123
|
this._session = null;
|
|
13122
13124
|
this.audioComplete = false;
|
|
13123
|
-
this._boundHandleKeyDown = this.handleKeyDown.bind(this);
|
|
13124
|
-
this._keyboardEventsEnabled = false;
|
|
13125
13125
|
this._rerender = debounce(() => {
|
|
13126
13126
|
if (this._model && this._session) {
|
|
13127
13127
|
var element = React.createElement(Root, {
|
|
@@ -13137,7 +13137,7 @@ class MultipleChoice extends HTMLElement {
|
|
|
13137
13137
|
log$1('render complete - render math');
|
|
13138
13138
|
renderMath(this);
|
|
13139
13139
|
});
|
|
13140
|
-
if (this._model.keyboardEventsEnabled === true
|
|
13140
|
+
if (this._model.keyboardEventsEnabled === true) {
|
|
13141
13141
|
this.enableKeyboardEvents();
|
|
13142
13142
|
}
|
|
13143
13143
|
} else {
|
|
@@ -13264,16 +13264,10 @@ class MultipleChoice extends HTMLElement {
|
|
|
13264
13264
|
});
|
|
13265
13265
|
}
|
|
13266
13266
|
enableKeyboardEvents() {
|
|
13267
|
-
|
|
13268
|
-
window.addEventListener('keydown', this._boundHandleKeyDown);
|
|
13269
|
-
this._keyboardEventsEnabled = true;
|
|
13270
|
-
}
|
|
13267
|
+
window.addEventListener('keydown', this.handleKeyDown.bind(this));
|
|
13271
13268
|
}
|
|
13272
13269
|
disconnectedCallback() {
|
|
13273
|
-
|
|
13274
|
-
window.removeEventListener('keydown', this._boundHandleKeyDown);
|
|
13275
|
-
this._keyboardEventsEnabled = false;
|
|
13276
|
-
}
|
|
13270
|
+
window.removeEventListener('keydown', this.handleKeyDown.bind(this));
|
|
13277
13271
|
}
|
|
13278
13272
|
handleKeyDown(event) {
|
|
13279
13273
|
if (!this._model || !this._session) {
|
|
@@ -13292,8 +13286,7 @@ class MultipleChoice extends HTMLElement {
|
|
|
13292
13286
|
const choiceId = this._model.choices[choiceIndex].value;
|
|
13293
13287
|
const newValue = {
|
|
13294
13288
|
value: choiceId,
|
|
13295
|
-
selected: !currentValue.includes(choiceId)
|
|
13296
|
-
selector: 'Keyboard'
|
|
13289
|
+
selected: !currentValue.includes(choiceId)
|
|
13297
13290
|
};
|
|
13298
13291
|
this._onChange(newValue);
|
|
13299
13292
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/ebsr",
|
|
3
|
-
"version": "10.3.5-next.
|
|
3
|
+
"version": "10.3.5-next.6+5c374061c",
|
|
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": "^9.11.1-next.
|
|
10
|
+
"@pie-element/multiple-choice": "^9.11.1-next.6+5c374061c",
|
|
11
11
|
"@pie-framework/pie-player-events": "^0.1.0",
|
|
12
12
|
"@pie-lib/pie-toolbox": "2.9.0",
|
|
13
13
|
"classnames": "^2.2.5",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"author": "pie framework developers",
|
|
18
18
|
"license": "ISC",
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "5c374061c150a5937762cee20d5dd656778e8b2e",
|
|
20
20
|
"scripts": {
|
|
21
21
|
"postpublish": "../../scripts/postpublish"
|
|
22
22
|
},
|