@pie-element/ebsr 10.3.4-next.0 → 10.3.4-next.3
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 +19 -14
- package/module/print.js +19 -14
- package/package.json +3 -3
package/module/element.js
CHANGED
|
@@ -12833,6 +12833,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12833
12833
|
gridTemplateColumns: `repeat(${gridColumns}, 1fr)`
|
|
12834
12834
|
} : undefined;
|
|
12835
12835
|
const selections = session.value && session.value.length || 0;
|
|
12836
|
+
const addAutoplayAudio = autoplayAudioEnabled && !((/Safari|Firefox|Edg/).test(navigator.userAgent) && !(/Chrome/).test(navigator.userAgent));
|
|
12836
12837
|
const teacherInstructionsDiv = React$2.createElement(PreviewPrompt, {
|
|
12837
12838
|
tagName: "div",
|
|
12838
12839
|
className: "prompt",
|
|
@@ -12841,7 +12842,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12841
12842
|
__self: this,
|
|
12842
12843
|
__source: {
|
|
12843
12844
|
fileName: _jsxFileName$1,
|
|
12844
|
-
lineNumber:
|
|
12845
|
+
lineNumber: 247
|
|
12845
12846
|
}
|
|
12846
12847
|
});
|
|
12847
12848
|
const getMultipleChoiceMinSelectionErrorMessage = () => {
|
|
@@ -12868,21 +12869,21 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12868
12869
|
__self: this,
|
|
12869
12870
|
__source: {
|
|
12870
12871
|
fileName: _jsxFileName$1,
|
|
12871
|
-
lineNumber:
|
|
12872
|
+
lineNumber: 270
|
|
12872
12873
|
}
|
|
12873
12874
|
}, partLabel && React$2.createElement('h3', {
|
|
12874
12875
|
className: classes.partLabel,
|
|
12875
12876
|
__self: this,
|
|
12876
12877
|
__source: {
|
|
12877
12878
|
fileName: _jsxFileName$1,
|
|
12878
|
-
lineNumber:
|
|
12879
|
+
lineNumber: 271
|
|
12879
12880
|
}
|
|
12880
12881
|
}, partLabel), this.renderHeading(), teacherInstructions && React$2.createElement('div', {
|
|
12881
12882
|
className: classes.teacherInstructions,
|
|
12882
12883
|
__self: this,
|
|
12883
12884
|
__source: {
|
|
12884
12885
|
fileName: _jsxFileName$1,
|
|
12885
|
-
lineNumber:
|
|
12886
|
+
lineNumber: 276
|
|
12886
12887
|
}
|
|
12887
12888
|
}, !animationsDisabled ? React$2.createElement(Collapsible, {
|
|
12888
12889
|
labels: {
|
|
@@ -12892,25 +12893,25 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12892
12893
|
__self: this,
|
|
12893
12894
|
__source: {
|
|
12894
12895
|
fileName: _jsxFileName$1,
|
|
12895
|
-
lineNumber:
|
|
12896
|
+
lineNumber: 278
|
|
12896
12897
|
}
|
|
12897
12898
|
}, teacherInstructionsDiv) : teacherInstructionsDiv), React$2.createElement('fieldset', {
|
|
12898
12899
|
className: classes.fieldset,
|
|
12899
12900
|
__self: this,
|
|
12900
12901
|
__source: {
|
|
12901
12902
|
fileName: _jsxFileName$1,
|
|
12902
|
-
lineNumber:
|
|
12903
|
+
lineNumber: 292
|
|
12903
12904
|
}
|
|
12904
12905
|
}, React$2.createElement(PreviewPrompt, {
|
|
12905
12906
|
className: "prompt",
|
|
12906
12907
|
defaultClassName: "prompt",
|
|
12907
12908
|
prompt: prompt,
|
|
12908
12909
|
tagName: 'legend',
|
|
12909
|
-
autoplayAudioEnabled:
|
|
12910
|
+
autoplayAudioEnabled: addAutoplayAudio,
|
|
12910
12911
|
__self: this,
|
|
12911
12912
|
__source: {
|
|
12912
12913
|
fileName: _jsxFileName$1,
|
|
12913
|
-
lineNumber:
|
|
12914
|
+
lineNumber: 293
|
|
12914
12915
|
}
|
|
12915
12916
|
}), !alwaysShowCorrect && React$2.createElement(CorrectAnswerToggle, {
|
|
12916
12917
|
show: showCorrectAnswerToggle,
|
|
@@ -12920,7 +12921,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12920
12921
|
__self: this,
|
|
12921
12922
|
__source: {
|
|
12922
12923
|
fileName: _jsxFileName$1,
|
|
12923
|
-
lineNumber:
|
|
12924
|
+
lineNumber: 302
|
|
12924
12925
|
}
|
|
12925
12926
|
}), React$2.createElement('div', {
|
|
12926
12927
|
className: classNames({
|
|
@@ -12931,7 +12932,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12931
12932
|
__self: this,
|
|
12932
12933
|
__source: {
|
|
12933
12934
|
fileName: _jsxFileName$1,
|
|
12934
|
-
lineNumber:
|
|
12935
|
+
lineNumber: 310
|
|
12935
12936
|
}
|
|
12936
12937
|
}, choices.map((choice, index) => React$2.createElement(StyledChoice, {
|
|
12937
12938
|
choicesLayout: this.props.choicesLayout,
|
|
@@ -12954,21 +12955,21 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12954
12955
|
__self: this,
|
|
12955
12956
|
__source: {
|
|
12956
12957
|
fileName: _jsxFileName$1,
|
|
12957
|
-
lineNumber:
|
|
12958
|
+
lineNumber: 318
|
|
12958
12959
|
}
|
|
12959
12960
|
})))), choiceMode === 'checkbox' && selections < minSelections && React$2.createElement('div', {
|
|
12960
12961
|
className: classes.errorText,
|
|
12961
12962
|
__self: this,
|
|
12962
12963
|
__source: {
|
|
12963
12964
|
fileName: _jsxFileName$1,
|
|
12964
|
-
lineNumber:
|
|
12965
|
+
lineNumber: 342
|
|
12965
12966
|
}
|
|
12966
12967
|
}, getMultipleChoiceMinSelectionErrorMessage()), choiceMode === 'checkbox' && maxSelectionsErrorState && React$2.createElement('div', {
|
|
12967
12968
|
className: classes.errorText,
|
|
12968
12969
|
__self: this,
|
|
12969
12970
|
__source: {
|
|
12970
12971
|
fileName: _jsxFileName$1,
|
|
12971
|
-
lineNumber:
|
|
12972
|
+
lineNumber: 347
|
|
12972
12973
|
}
|
|
12973
12974
|
}, translator.t(`translation:multipleChoice:maxSelections_${maxSelections === 1 ? 'one' : 'other'}`, {
|
|
12974
12975
|
lng: language,
|
|
@@ -13194,7 +13195,9 @@ class MultipleChoice extends HTMLElement {
|
|
|
13194
13195
|
const observer = new MutationObserver((mutationsList, observer) => {
|
|
13195
13196
|
mutationsList.forEach(mutation => {
|
|
13196
13197
|
if (mutation.type === 'childList') {
|
|
13197
|
-
const audio = this.querySelector('audio
|
|
13198
|
+
const audio = this.querySelector('audio');
|
|
13199
|
+
const isInsidePrompt = audio && audio.closest('#preview-prompt');
|
|
13200
|
+
if (audio && !isInsidePrompt) return;
|
|
13198
13201
|
if (!audio) return;
|
|
13199
13202
|
const info = this._createAudioInfoToast();
|
|
13200
13203
|
const enableAudio = () => {
|
|
@@ -13208,6 +13211,8 @@ class MultipleChoice extends HTMLElement {
|
|
|
13208
13211
|
if (audio.paused && !this.querySelector('#play-audio-info')) {
|
|
13209
13212
|
this.appendChild(info);
|
|
13210
13213
|
document.addEventListener('click', enableAudio);
|
|
13214
|
+
} else {
|
|
13215
|
+
document.removeEventListener('click', enableAudio);
|
|
13211
13216
|
}
|
|
13212
13217
|
}, 500);
|
|
13213
13218
|
const handlePlaying = () => {
|
package/module/print.js
CHANGED
|
@@ -12796,6 +12796,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12796
12796
|
gridTemplateColumns: `repeat(${gridColumns}, 1fr)`
|
|
12797
12797
|
} : undefined;
|
|
12798
12798
|
const selections = session.value && session.value.length || 0;
|
|
12799
|
+
const addAutoplayAudio = autoplayAudioEnabled && !((/Safari|Firefox|Edg/).test(navigator.userAgent) && !(/Chrome/).test(navigator.userAgent));
|
|
12799
12800
|
const teacherInstructionsDiv = React$2.createElement(PreviewPrompt, {
|
|
12800
12801
|
tagName: "div",
|
|
12801
12802
|
className: "prompt",
|
|
@@ -12804,7 +12805,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12804
12805
|
__self: this,
|
|
12805
12806
|
__source: {
|
|
12806
12807
|
fileName: _jsxFileName$1,
|
|
12807
|
-
lineNumber:
|
|
12808
|
+
lineNumber: 247
|
|
12808
12809
|
}
|
|
12809
12810
|
});
|
|
12810
12811
|
const getMultipleChoiceMinSelectionErrorMessage = () => {
|
|
@@ -12831,21 +12832,21 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12831
12832
|
__self: this,
|
|
12832
12833
|
__source: {
|
|
12833
12834
|
fileName: _jsxFileName$1,
|
|
12834
|
-
lineNumber:
|
|
12835
|
+
lineNumber: 270
|
|
12835
12836
|
}
|
|
12836
12837
|
}, partLabel && React$2.createElement('h3', {
|
|
12837
12838
|
className: classes.partLabel,
|
|
12838
12839
|
__self: this,
|
|
12839
12840
|
__source: {
|
|
12840
12841
|
fileName: _jsxFileName$1,
|
|
12841
|
-
lineNumber:
|
|
12842
|
+
lineNumber: 271
|
|
12842
12843
|
}
|
|
12843
12844
|
}, partLabel), this.renderHeading(), teacherInstructions && React$2.createElement('div', {
|
|
12844
12845
|
className: classes.teacherInstructions,
|
|
12845
12846
|
__self: this,
|
|
12846
12847
|
__source: {
|
|
12847
12848
|
fileName: _jsxFileName$1,
|
|
12848
|
-
lineNumber:
|
|
12849
|
+
lineNumber: 276
|
|
12849
12850
|
}
|
|
12850
12851
|
}, !animationsDisabled ? React$2.createElement(Collapsible, {
|
|
12851
12852
|
labels: {
|
|
@@ -12855,25 +12856,25 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12855
12856
|
__self: this,
|
|
12856
12857
|
__source: {
|
|
12857
12858
|
fileName: _jsxFileName$1,
|
|
12858
|
-
lineNumber:
|
|
12859
|
+
lineNumber: 278
|
|
12859
12860
|
}
|
|
12860
12861
|
}, teacherInstructionsDiv) : teacherInstructionsDiv), React$2.createElement('fieldset', {
|
|
12861
12862
|
className: classes.fieldset,
|
|
12862
12863
|
__self: this,
|
|
12863
12864
|
__source: {
|
|
12864
12865
|
fileName: _jsxFileName$1,
|
|
12865
|
-
lineNumber:
|
|
12866
|
+
lineNumber: 292
|
|
12866
12867
|
}
|
|
12867
12868
|
}, React$2.createElement(PreviewPrompt, {
|
|
12868
12869
|
className: "prompt",
|
|
12869
12870
|
defaultClassName: "prompt",
|
|
12870
12871
|
prompt: prompt,
|
|
12871
12872
|
tagName: 'legend',
|
|
12872
|
-
autoplayAudioEnabled:
|
|
12873
|
+
autoplayAudioEnabled: addAutoplayAudio,
|
|
12873
12874
|
__self: this,
|
|
12874
12875
|
__source: {
|
|
12875
12876
|
fileName: _jsxFileName$1,
|
|
12876
|
-
lineNumber:
|
|
12877
|
+
lineNumber: 293
|
|
12877
12878
|
}
|
|
12878
12879
|
}), !alwaysShowCorrect && React$2.createElement(CorrectAnswerToggle, {
|
|
12879
12880
|
show: showCorrectAnswerToggle,
|
|
@@ -12883,7 +12884,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12883
12884
|
__self: this,
|
|
12884
12885
|
__source: {
|
|
12885
12886
|
fileName: _jsxFileName$1,
|
|
12886
|
-
lineNumber:
|
|
12887
|
+
lineNumber: 302
|
|
12887
12888
|
}
|
|
12888
12889
|
}), React$2.createElement('div', {
|
|
12889
12890
|
className: classNames({
|
|
@@ -12894,7 +12895,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12894
12895
|
__self: this,
|
|
12895
12896
|
__source: {
|
|
12896
12897
|
fileName: _jsxFileName$1,
|
|
12897
|
-
lineNumber:
|
|
12898
|
+
lineNumber: 310
|
|
12898
12899
|
}
|
|
12899
12900
|
}, choices.map((choice, index) => React$2.createElement(StyledChoice, {
|
|
12900
12901
|
choicesLayout: this.props.choicesLayout,
|
|
@@ -12917,21 +12918,21 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
12917
12918
|
__self: this,
|
|
12918
12919
|
__source: {
|
|
12919
12920
|
fileName: _jsxFileName$1,
|
|
12920
|
-
lineNumber:
|
|
12921
|
+
lineNumber: 318
|
|
12921
12922
|
}
|
|
12922
12923
|
})))), choiceMode === 'checkbox' && selections < minSelections && React$2.createElement('div', {
|
|
12923
12924
|
className: classes.errorText,
|
|
12924
12925
|
__self: this,
|
|
12925
12926
|
__source: {
|
|
12926
12927
|
fileName: _jsxFileName$1,
|
|
12927
|
-
lineNumber:
|
|
12928
|
+
lineNumber: 342
|
|
12928
12929
|
}
|
|
12929
12930
|
}, getMultipleChoiceMinSelectionErrorMessage()), choiceMode === 'checkbox' && maxSelectionsErrorState && React$2.createElement('div', {
|
|
12930
12931
|
className: classes.errorText,
|
|
12931
12932
|
__self: this,
|
|
12932
12933
|
__source: {
|
|
12933
12934
|
fileName: _jsxFileName$1,
|
|
12934
|
-
lineNumber:
|
|
12935
|
+
lineNumber: 347
|
|
12935
12936
|
}
|
|
12936
12937
|
}, translator$1.t(`translation:multipleChoice:maxSelections_${maxSelections === 1 ? 'one' : 'other'}`, {
|
|
12937
12938
|
lng: language,
|
|
@@ -13194,7 +13195,9 @@ class MultipleChoice extends HTMLElement {
|
|
|
13194
13195
|
const observer = new MutationObserver((mutationsList, observer) => {
|
|
13195
13196
|
mutationsList.forEach(mutation => {
|
|
13196
13197
|
if (mutation.type === 'childList') {
|
|
13197
|
-
const audio = this.querySelector('audio
|
|
13198
|
+
const audio = this.querySelector('audio');
|
|
13199
|
+
const isInsidePrompt = audio && audio.closest('#preview-prompt');
|
|
13200
|
+
if (audio && !isInsidePrompt) return;
|
|
13198
13201
|
if (!audio) return;
|
|
13199
13202
|
const info = this._createAudioInfoToast();
|
|
13200
13203
|
const enableAudio = () => {
|
|
@@ -13208,6 +13211,8 @@ class MultipleChoice extends HTMLElement {
|
|
|
13208
13211
|
if (audio.paused && !this.querySelector('#play-audio-info')) {
|
|
13209
13212
|
this.appendChild(info);
|
|
13210
13213
|
document.addEventListener('click', enableAudio);
|
|
13214
|
+
} else {
|
|
13215
|
+
document.removeEventListener('click', enableAudio);
|
|
13211
13216
|
}
|
|
13212
13217
|
}, 500);
|
|
13213
13218
|
const handlePlaying = () => {
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/ebsr",
|
|
3
|
-
"version": "10.3.4-next.
|
|
3
|
+
"version": "10.3.4-next.3+ad7e530be",
|
|
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.10.1-next.
|
|
10
|
+
"@pie-element/multiple-choice": "^9.10.1-next.3+ad7e530be",
|
|
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": "ad7e530beaeba3fd71f3af1eca713ae156e4b2b2",
|
|
20
20
|
"scripts": {
|
|
21
21
|
"postpublish": "../../scripts/postpublish"
|
|
22
22
|
},
|