@pie-element/ebsr 10.3.5-next.6 → 10.3.6-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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
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
+ ## [10.3.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/ebsr@10.3.4...@pie-element/ebsr@10.3.5) (2025-02-12)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * update pie-lib/pie-toolbox PD-4717 ([4bc5bea](https://github.com/pie-framework/pie-elements/commit/4bc5beafe3c04efe64809ff95c5863a6142cbb02))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [10.3.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/ebsr@10.3.3...@pie-element/ebsr@10.3.4) (2025-02-07)
7
18
 
8
19
  **Note:** Version bump only for package @pie-element/ebsr
@@ -3,6 +3,17 @@
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
+ ## [10.2.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/ebsr-configure@10.2.4...@pie-element/ebsr-configure@10.2.5) (2025-02-12)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * update pie-lib/pie-toolbox PD-4717 ([4bc5bea](https://github.com/pie-framework/pie-elements/commit/4bc5beafe3c04efe64809ff95c5863a6142cbb02))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [10.2.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/ebsr-configure@10.2.3...@pie-element/ebsr-configure@10.2.4) (2025-02-07)
7
18
 
8
19
  **Note:** Version bump only for package @pie-element/ebsr-configure
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@pie-element/ebsr-configure",
3
3
  "private": true,
4
- "version": "10.2.4",
4
+ "version": "10.2.5",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
8
8
  "author": "",
9
9
  "dependencies": {
10
10
  "@material-ui/core": "^3.9.2",
11
- "@pie-element/multiple-choice": "^9.11.0",
11
+ "@pie-element/multiple-choice": "^9.12.0",
12
12
  "@pie-framework/pie-configure-events": "^1.2.0",
13
- "@pie-lib/pie-toolbox": "2.9.0",
13
+ "@pie-lib/pie-toolbox": "2.9.1",
14
14
  "lodash": "^4.17.15",
15
15
  "prop-types": "^15.6.2",
16
16
  "react": "^16.8.1",
@@ -3,6 +3,17 @@
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
+ ## [8.1.13](https://github.com/pie-framework/pie-elements/compare/@pie-element/ebsr-controller@8.1.12...@pie-element/ebsr-controller@8.1.13) (2025-02-12)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * update pie-lib/pie-toolbox PD-4717 ([4bc5bea](https://github.com/pie-framework/pie-elements/commit/4bc5beafe3c04efe64809ff95c5863a6142cbb02))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [8.1.12](https://github.com/pie-framework/pie-elements/compare/@pie-element/ebsr-controller@8.1.11...@pie-element/ebsr-controller@8.1.12) (2025-02-06)
7
18
 
8
19
 
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@pie-element/ebsr-controller",
3
3
  "private": true,
4
- "version": "8.1.12",
4
+ "version": "8.1.13",
5
5
  "description": "",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
8
8
  },
9
9
  "dependencies": {
10
- "@pie-lib/pie-toolbox": "2.9.0",
10
+ "@pie-lib/pie-toolbox": "2.9.1",
11
11
  "lodash": "^4.17.15"
12
12
  },
13
13
  "author": "",
@@ -1,6 +1,6 @@
1
1
  import {_dll_react, _dll_prop_types, _dll_lodash, _dll_react_dom} from "../../../@pie-lib/pie-toolbox-math-rendering-module@3.3.0/module/index.js";
2
2
  import MultipleChoiceConfigure from '@pie-element/multiple-choice/configure/lib';
3
- import {_dll_pie_lib__pie_toolbox_config_ui} from "../../../@pie-lib/pie-toolbox-module@5.9.0/module/index.js";
3
+ import {_dll_pie_lib__pie_toolbox_config_ui} from "../../../@pie-lib/pie-toolbox-module@5.10.0/module/index.js";
4
4
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
5
5
  function getDefaultExportFromCjs(x) {
6
6
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
package/module/element.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug, _dll_pie_lib__pie_toolbox_math_rendering} from "../../../@pie-lib/pie-toolbox-math-rendering-module@3.3.0/module/index.js";
2
- import {_dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@5.9.0/module/index.js";
2
+ import {_dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@5.10.0/module/index.js";
3
3
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
4
  function getDefaultExportFromCjs(x) {
5
5
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
@@ -12719,8 +12719,6 @@ 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';
12724
12722
  if (session.value && session.value.length >= maxSelections) {
12725
12723
  this.setState({
12726
12724
  maxSelectionsErrorState: checked
@@ -12732,7 +12730,7 @@ class MultipleChoice$1 extends React$2.Component {
12732
12730
  onChoiceChanged({
12733
12731
  value,
12734
12732
  selected: checked,
12735
- selector
12733
+ selector: 'Mouse'
12736
12734
  });
12737
12735
  };
12738
12736
  }
@@ -12816,14 +12814,14 @@ class MultipleChoice$1 extends React$2.Component {
12816
12814
  __self: this,
12817
12815
  __source: {
12818
12816
  fileName: _jsxFileName$1,
12819
- lineNumber: 214
12817
+ lineNumber: 210
12820
12818
  }
12821
12819
  }, "Multiple Choice Question") : React$2.createElement('h2', {
12822
12820
  className: classes.srOnly,
12823
12821
  __self: this,
12824
12822
  __source: {
12825
12823
  fileName: _jsxFileName$1,
12826
- lineNumber: 216
12824
+ lineNumber: 212
12827
12825
  }
12828
12826
  }, "Multiple Select Question");
12829
12827
  }
@@ -12845,7 +12843,7 @@ class MultipleChoice$1 extends React$2.Component {
12845
12843
  __self: this,
12846
12844
  __source: {
12847
12845
  fileName: _jsxFileName$1,
12848
- lineNumber: 251
12846
+ lineNumber: 247
12849
12847
  }
12850
12848
  });
12851
12849
  const getMultipleChoiceMinSelectionErrorMessage = () => {
@@ -12872,21 +12870,21 @@ class MultipleChoice$1 extends React$2.Component {
12872
12870
  __self: this,
12873
12871
  __source: {
12874
12872
  fileName: _jsxFileName$1,
12875
- lineNumber: 274
12873
+ lineNumber: 270
12876
12874
  }
12877
12875
  }, partLabel && React$2.createElement('h3', {
12878
12876
  className: classes.partLabel,
12879
12877
  __self: this,
12880
12878
  __source: {
12881
12879
  fileName: _jsxFileName$1,
12882
- lineNumber: 275
12880
+ lineNumber: 271
12883
12881
  }
12884
12882
  }, partLabel), this.renderHeading(), teacherInstructions && React$2.createElement('div', {
12885
12883
  className: classes.teacherInstructions,
12886
12884
  __self: this,
12887
12885
  __source: {
12888
12886
  fileName: _jsxFileName$1,
12889
- lineNumber: 280
12887
+ lineNumber: 276
12890
12888
  }
12891
12889
  }, !animationsDisabled ? React$2.createElement(Collapsible, {
12892
12890
  labels: {
@@ -12896,14 +12894,14 @@ class MultipleChoice$1 extends React$2.Component {
12896
12894
  __self: this,
12897
12895
  __source: {
12898
12896
  fileName: _jsxFileName$1,
12899
- lineNumber: 282
12897
+ lineNumber: 278
12900
12898
  }
12901
12899
  }, teacherInstructionsDiv) : teacherInstructionsDiv), React$2.createElement('fieldset', {
12902
12900
  className: classes.fieldset,
12903
12901
  __self: this,
12904
12902
  __source: {
12905
12903
  fileName: _jsxFileName$1,
12906
- lineNumber: 296
12904
+ lineNumber: 292
12907
12905
  }
12908
12906
  }, React$2.createElement(PreviewPrompt, {
12909
12907
  className: "prompt",
@@ -12914,7 +12912,7 @@ class MultipleChoice$1 extends React$2.Component {
12914
12912
  __self: this,
12915
12913
  __source: {
12916
12914
  fileName: _jsxFileName$1,
12917
- lineNumber: 297
12915
+ lineNumber: 293
12918
12916
  }
12919
12917
  }), !alwaysShowCorrect && React$2.createElement(CorrectAnswerToggle, {
12920
12918
  show: showCorrectAnswerToggle,
@@ -12924,7 +12922,7 @@ class MultipleChoice$1 extends React$2.Component {
12924
12922
  __self: this,
12925
12923
  __source: {
12926
12924
  fileName: _jsxFileName$1,
12927
- lineNumber: 306
12925
+ lineNumber: 302
12928
12926
  }
12929
12927
  }), React$2.createElement('div', {
12930
12928
  className: classNames({
@@ -12935,7 +12933,7 @@ class MultipleChoice$1 extends React$2.Component {
12935
12933
  __self: this,
12936
12934
  __source: {
12937
12935
  fileName: _jsxFileName$1,
12938
- lineNumber: 314
12936
+ lineNumber: 310
12939
12937
  }
12940
12938
  }, choices.map((choice, index) => React$2.createElement(StyledChoice, {
12941
12939
  choicesLayout: this.props.choicesLayout,
@@ -12958,21 +12956,21 @@ class MultipleChoice$1 extends React$2.Component {
12958
12956
  __self: this,
12959
12957
  __source: {
12960
12958
  fileName: _jsxFileName$1,
12961
- lineNumber: 322
12959
+ lineNumber: 318
12962
12960
  }
12963
12961
  })))), choiceMode === 'checkbox' && selections < minSelections && React$2.createElement('div', {
12964
12962
  className: classes.errorText,
12965
12963
  __self: this,
12966
12964
  __source: {
12967
12965
  fileName: _jsxFileName$1,
12968
- lineNumber: 346
12966
+ lineNumber: 342
12969
12967
  }
12970
12968
  }, getMultipleChoiceMinSelectionErrorMessage()), choiceMode === 'checkbox' && maxSelectionsErrorState && React$2.createElement('div', {
12971
12969
  className: classes.errorText,
12972
12970
  __self: this,
12973
12971
  __source: {
12974
12972
  fileName: _jsxFileName$1,
12975
- lineNumber: 351
12973
+ lineNumber: 347
12976
12974
  }
12977
12975
  }, translator.t(`translation:multipleChoice:maxSelections_${maxSelections === 1 ? 'one' : 'other'}`, {
12978
12976
  lng: language,
@@ -13122,6 +13120,8 @@ class MultipleChoice extends HTMLElement {
13122
13120
  this._model = null;
13123
13121
  this._session = null;
13124
13122
  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 && !this._keyboardEventsEnabled) {
13141
13141
  this.enableKeyboardEvents();
13142
13142
  }
13143
13143
  } else {
@@ -13264,10 +13264,16 @@ class MultipleChoice extends HTMLElement {
13264
13264
  });
13265
13265
  }
13266
13266
  enableKeyboardEvents() {
13267
- window.addEventListener('keydown', this.handleKeyDown.bind(this));
13267
+ if (!this._keyboardEventsEnabled) {
13268
+ window.addEventListener('keydown', this._boundHandleKeyDown);
13269
+ this._keyboardEventsEnabled = true;
13270
+ }
13268
13271
  }
13269
13272
  disconnectedCallback() {
13270
- window.removeEventListener('keydown', this.handleKeyDown.bind(this));
13273
+ if (this._keyboardEventsEnabled) {
13274
+ window.removeEventListener('keydown', this._boundHandleKeyDown);
13275
+ this._keyboardEventsEnabled = false;
13276
+ }
13271
13277
  }
13272
13278
  handleKeyDown(event) {
13273
13279
  if (!this._model || !this._session) {
@@ -13286,7 +13292,8 @@ class MultipleChoice extends HTMLElement {
13286
13292
  const choiceId = this._model.choices[choiceIndex].value;
13287
13293
  const newValue = {
13288
13294
  value: choiceId,
13289
- selected: !currentValue.includes(choiceId)
13295
+ selected: !currentValue.includes(choiceId),
13296
+ selector: 'Keyboard'
13290
13297
  };
13291
13298
  this._onChange(newValue);
13292
13299
  }
package/module/index.html CHANGED
@@ -2,7 +2,7 @@
2
2
  <!doctype html>
3
3
  <html>
4
4
  <head>
5
- <title>@pie-element/ebsr@10.3.4</title>
5
+ <title>@pie-element/ebsr@10.3.5</title>
6
6
  <script
7
7
  type="module"
8
8
  src="https://cdn.jsdelivr.net/npm/@pslb/demo-el@^1.0.0/dist/demo-el/demo-el.esm.js"></script>
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/ebsr",
3
- "version": "10.3.4",
3
+ "version": "10.3.5",
4
4
  "modules": [
5
5
  {
6
6
  "name": "@pie-lib/pie-toolbox-math-rendering-module",
@@ -8,7 +8,7 @@
8
8
  },
9
9
  {
10
10
  "name": "@pie-lib/pie-toolbox-module",
11
- "version": "5.9.0"
11
+ "version": "5.10.0"
12
12
  }
13
13
  ]
14
14
  }
package/module/print.html CHANGED
@@ -2,7 +2,7 @@
2
2
  <!doctype html>
3
3
  <html>
4
4
  <head>
5
- <title>@pie-element/ebsr@10.3.4</title>
5
+ <title>@pie-element/ebsr@10.3.5</title>
6
6
  <link
7
7
  href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
8
8
  rel="stylesheet"
package/module/print.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug, _dll_pie_lib__pie_toolbox_math_rendering} from "../../../@pie-lib/pie-toolbox-math-rendering-module@3.3.0/module/index.js";
2
- import {_dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@5.9.0/module/index.js";
2
+ import {_dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@5.10.0/module/index.js";
3
3
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
4
  function getDefaultExportFromCjs(x) {
5
5
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
@@ -12682,8 +12682,6 @@ 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';
12687
12685
  if (session.value && session.value.length >= maxSelections) {
12688
12686
  this.setState({
12689
12687
  maxSelectionsErrorState: checked
@@ -12695,7 +12693,7 @@ class MultipleChoice$1 extends React$2.Component {
12695
12693
  onChoiceChanged({
12696
12694
  value,
12697
12695
  selected: checked,
12698
- selector
12696
+ selector: 'Mouse'
12699
12697
  });
12700
12698
  };
12701
12699
  }
@@ -12779,14 +12777,14 @@ class MultipleChoice$1 extends React$2.Component {
12779
12777
  __self: this,
12780
12778
  __source: {
12781
12779
  fileName: _jsxFileName$1,
12782
- lineNumber: 214
12780
+ lineNumber: 210
12783
12781
  }
12784
12782
  }, "Multiple Choice Question") : React$2.createElement('h2', {
12785
12783
  className: classes.srOnly,
12786
12784
  __self: this,
12787
12785
  __source: {
12788
12786
  fileName: _jsxFileName$1,
12789
- lineNumber: 216
12787
+ lineNumber: 212
12790
12788
  }
12791
12789
  }, "Multiple Select Question");
12792
12790
  }
@@ -12808,7 +12806,7 @@ class MultipleChoice$1 extends React$2.Component {
12808
12806
  __self: this,
12809
12807
  __source: {
12810
12808
  fileName: _jsxFileName$1,
12811
- lineNumber: 251
12809
+ lineNumber: 247
12812
12810
  }
12813
12811
  });
12814
12812
  const getMultipleChoiceMinSelectionErrorMessage = () => {
@@ -12835,21 +12833,21 @@ class MultipleChoice$1 extends React$2.Component {
12835
12833
  __self: this,
12836
12834
  __source: {
12837
12835
  fileName: _jsxFileName$1,
12838
- lineNumber: 274
12836
+ lineNumber: 270
12839
12837
  }
12840
12838
  }, partLabel && React$2.createElement('h3', {
12841
12839
  className: classes.partLabel,
12842
12840
  __self: this,
12843
12841
  __source: {
12844
12842
  fileName: _jsxFileName$1,
12845
- lineNumber: 275
12843
+ lineNumber: 271
12846
12844
  }
12847
12845
  }, partLabel), this.renderHeading(), teacherInstructions && React$2.createElement('div', {
12848
12846
  className: classes.teacherInstructions,
12849
12847
  __self: this,
12850
12848
  __source: {
12851
12849
  fileName: _jsxFileName$1,
12852
- lineNumber: 280
12850
+ lineNumber: 276
12853
12851
  }
12854
12852
  }, !animationsDisabled ? React$2.createElement(Collapsible, {
12855
12853
  labels: {
@@ -12859,14 +12857,14 @@ class MultipleChoice$1 extends React$2.Component {
12859
12857
  __self: this,
12860
12858
  __source: {
12861
12859
  fileName: _jsxFileName$1,
12862
- lineNumber: 282
12860
+ lineNumber: 278
12863
12861
  }
12864
12862
  }, teacherInstructionsDiv) : teacherInstructionsDiv), React$2.createElement('fieldset', {
12865
12863
  className: classes.fieldset,
12866
12864
  __self: this,
12867
12865
  __source: {
12868
12866
  fileName: _jsxFileName$1,
12869
- lineNumber: 296
12867
+ lineNumber: 292
12870
12868
  }
12871
12869
  }, React$2.createElement(PreviewPrompt, {
12872
12870
  className: "prompt",
@@ -12877,7 +12875,7 @@ class MultipleChoice$1 extends React$2.Component {
12877
12875
  __self: this,
12878
12876
  __source: {
12879
12877
  fileName: _jsxFileName$1,
12880
- lineNumber: 297
12878
+ lineNumber: 293
12881
12879
  }
12882
12880
  }), !alwaysShowCorrect && React$2.createElement(CorrectAnswerToggle, {
12883
12881
  show: showCorrectAnswerToggle,
@@ -12887,7 +12885,7 @@ class MultipleChoice$1 extends React$2.Component {
12887
12885
  __self: this,
12888
12886
  __source: {
12889
12887
  fileName: _jsxFileName$1,
12890
- lineNumber: 306
12888
+ lineNumber: 302
12891
12889
  }
12892
12890
  }), React$2.createElement('div', {
12893
12891
  className: classNames({
@@ -12898,7 +12896,7 @@ class MultipleChoice$1 extends React$2.Component {
12898
12896
  __self: this,
12899
12897
  __source: {
12900
12898
  fileName: _jsxFileName$1,
12901
- lineNumber: 314
12899
+ lineNumber: 310
12902
12900
  }
12903
12901
  }, choices.map((choice, index) => React$2.createElement(StyledChoice, {
12904
12902
  choicesLayout: this.props.choicesLayout,
@@ -12921,21 +12919,21 @@ class MultipleChoice$1 extends React$2.Component {
12921
12919
  __self: this,
12922
12920
  __source: {
12923
12921
  fileName: _jsxFileName$1,
12924
- lineNumber: 322
12922
+ lineNumber: 318
12925
12923
  }
12926
12924
  })))), choiceMode === 'checkbox' && selections < minSelections && React$2.createElement('div', {
12927
12925
  className: classes.errorText,
12928
12926
  __self: this,
12929
12927
  __source: {
12930
12928
  fileName: _jsxFileName$1,
12931
- lineNumber: 346
12929
+ lineNumber: 342
12932
12930
  }
12933
12931
  }, getMultipleChoiceMinSelectionErrorMessage()), choiceMode === 'checkbox' && maxSelectionsErrorState && React$2.createElement('div', {
12934
12932
  className: classes.errorText,
12935
12933
  __self: this,
12936
12934
  __source: {
12937
12935
  fileName: _jsxFileName$1,
12938
- lineNumber: 351
12936
+ lineNumber: 347
12939
12937
  }
12940
12938
  }, translator$1.t(`translation:multipleChoice:maxSelections_${maxSelections === 1 ? 'one' : 'other'}`, {
12941
12939
  lng: language,
@@ -13122,6 +13120,8 @@ class MultipleChoice extends HTMLElement {
13122
13120
  this._model = null;
13123
13121
  this._session = null;
13124
13122
  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 && !this._keyboardEventsEnabled) {
13141
13141
  this.enableKeyboardEvents();
13142
13142
  }
13143
13143
  } else {
@@ -13264,10 +13264,16 @@ class MultipleChoice extends HTMLElement {
13264
13264
  });
13265
13265
  }
13266
13266
  enableKeyboardEvents() {
13267
- window.addEventListener('keydown', this.handleKeyDown.bind(this));
13267
+ if (!this._keyboardEventsEnabled) {
13268
+ window.addEventListener('keydown', this._boundHandleKeyDown);
13269
+ this._keyboardEventsEnabled = true;
13270
+ }
13268
13271
  }
13269
13272
  disconnectedCallback() {
13270
- window.removeEventListener('keydown', this.handleKeyDown.bind(this));
13273
+ if (this._keyboardEventsEnabled) {
13274
+ window.removeEventListener('keydown', this._boundHandleKeyDown);
13275
+ this._keyboardEventsEnabled = false;
13276
+ }
13271
13277
  }
13272
13278
  handleKeyDown(event) {
13273
13279
  if (!this._model || !this._session) {
@@ -13286,7 +13292,8 @@ class MultipleChoice extends HTMLElement {
13286
13292
  const choiceId = this._model.choices[choiceIndex].value;
13287
13293
  const newValue = {
13288
13294
  value: choiceId,
13289
- selected: !currentValue.includes(choiceId)
13295
+ selected: !currentValue.includes(choiceId),
13296
+ selector: 'Keyboard'
13290
13297
  };
13291
13298
  this._onChange(newValue);
13292
13299
  }
package/package.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "name": "@pie-element/ebsr",
3
- "version": "10.3.5-next.6+5c374061c",
3
+ "version": "10.3.6-next.0+c040d8d08",
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.6+5c374061c",
10
+ "@pie-element/multiple-choice": "^9.12.1-next.0+c040d8d08",
11
11
  "@pie-framework/pie-player-events": "^0.1.0",
12
- "@pie-lib/pie-toolbox": "2.9.0",
12
+ "@pie-lib/pie-toolbox": "2.9.1",
13
13
  "classnames": "^2.2.5",
14
14
  "debug": "^4.1.1",
15
15
  "lodash": "^4.17.11"
16
16
  },
17
17
  "author": "pie framework developers",
18
18
  "license": "ISC",
19
- "gitHead": "5c374061c150a5937762cee20d5dd656778e8b2e",
19
+ "gitHead": "c040d8d08c48faa9c552f129d1d369f0d6bf2590",
20
20
  "scripts": {
21
21
  "postpublish": "../../scripts/postpublish"
22
22
  },