@pie-element/ebsr 10.2.6-next.34 → 10.2.6-next.39

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 CHANGED
@@ -12513,7 +12513,7 @@ class Choice extends React$3.Component {
12513
12513
  };
12514
12514
  }
12515
12515
  render() {
12516
- const {choice, index, choicesLength, showCorrect, isEvaluateMode, choiceMode, disabled, checked, correctness, displayKey, classes, choicesLayout, gridColumns, isSelectionButtonBelow} = this.props;
12516
+ const {choice, index, choicesLength, showCorrect, isEvaluateMode, choiceMode, disabled, checked, correctness, displayKey, classes, choicesLayout, gridColumns, isSelectionButtonBelow, selectedAnswerBackgroundColor} = this.props;
12517
12517
  const choiceClass = 'choice' + (index === choicesLength - 1 ? ' last' : '');
12518
12518
  const feedback = !isEvaluateMode || showCorrect ? '' : choice.feedback;
12519
12519
  const choiceProps = {
@@ -12535,13 +12535,17 @@ class Choice extends React$3.Component {
12535
12535
  [classes.noBorder]: index === choicesLength - 1 || choicesLayout !== 'vertical',
12536
12536
  [classes.horizontalLayout]: choicesLayout === 'horizontal'
12537
12537
  });
12538
+ const choiceBackground = selectedAnswerBackgroundColor && checked ? selectedAnswerBackgroundColor : 'initial';
12538
12539
  return React$3.createElement('div', {
12539
12540
  className: choiceClass,
12540
12541
  key: index,
12542
+ style: {
12543
+ backgroundColor: choiceBackground
12544
+ },
12541
12545
  __self: this,
12542
12546
  __source: {
12543
12547
  fileName: _jsxFileName$2,
12544
- lineNumber: 62
12548
+ lineNumber: 65
12545
12549
  }
12546
12550
  }, React$3.createElement(ChoiceInput$1, {
12547
12551
  ...choiceProps,
@@ -12549,7 +12553,7 @@ class Choice extends React$3.Component {
12549
12553
  __self: this,
12550
12554
  __source: {
12551
12555
  fileName: _jsxFileName$2,
12552
- lineNumber: 63
12556
+ lineNumber: 66
12553
12557
  }
12554
12558
  }));
12555
12559
  }
@@ -12570,12 +12574,15 @@ Choice.propTypes = {
12570
12574
  displayKey: PropTypes$2.string,
12571
12575
  choicesLayout: PropTypes$2.oneOf(['vertical', 'grid', 'horizontal']),
12572
12576
  gridColumns: PropTypes$2.string,
12577
+ selectedAnswerBackgroundColor: PropTypes$2.string,
12573
12578
  isSelectionButtonBelow: PropTypes$2.bool
12574
12579
  };
12575
12580
  var StyledChoice = styles$b.withStyles(theme => ({
12576
12581
  choice: {
12577
12582
  paddingTop: theme.spacing.unit * 2.5,
12578
12583
  paddingBottom: theme.spacing.unit + 2,
12584
+ paddingLeft: theme.spacing.unit + 2,
12585
+ paddingRight: theme.spacing.unit + 2,
12579
12586
  borderBottom: `1px solid ${theme.palette.grey[300]}`
12580
12587
  },
12581
12588
  noBorder: {
@@ -12665,6 +12672,7 @@ class MultipleChoice$1 extends React$2.Component {
12665
12672
  alwaysShowCorrect: PropTypes$1.bool,
12666
12673
  animationsDisabled: PropTypes$1.bool,
12667
12674
  language: PropTypes$1.string,
12675
+ selectedAnswerBackgroundColor: PropTypes$1.string,
12668
12676
  onShowCorrectToggle: PropTypes$1.func,
12669
12677
  isSelectionButtonBelow: PropTypes$1.bool,
12670
12678
  minSelections: PropTypes$1.number,
@@ -12796,14 +12804,14 @@ class MultipleChoice$1 extends React$2.Component {
12796
12804
  __self: this,
12797
12805
  __source: {
12798
12806
  fileName: _jsxFileName$1,
12799
- lineNumber: 224
12807
+ lineNumber: 225
12800
12808
  }
12801
12809
  }, "Multiple Choice Question") : React$2.createElement('h2', {
12802
12810
  className: classes.srOnly,
12803
12811
  __self: this,
12804
12812
  __source: {
12805
12813
  fileName: _jsxFileName$1,
12806
- lineNumber: 226
12814
+ lineNumber: 227
12807
12815
  }
12808
12816
  }, "Multiple Select Question");
12809
12817
  }
@@ -12824,7 +12832,7 @@ class MultipleChoice$1 extends React$2.Component {
12824
12832
  __self: this,
12825
12833
  __source: {
12826
12834
  fileName: _jsxFileName$1,
12827
- lineNumber: 258
12835
+ lineNumber: 259
12828
12836
  }
12829
12837
  });
12830
12838
  return React$2.createElement('div', {
@@ -12832,21 +12840,21 @@ class MultipleChoice$1 extends React$2.Component {
12832
12840
  __self: this,
12833
12841
  __source: {
12834
12842
  fileName: _jsxFileName$1,
12835
- lineNumber: 267
12843
+ lineNumber: 268
12836
12844
  }
12837
12845
  }, partLabel && React$2.createElement('h3', {
12838
12846
  className: classes.partLabel,
12839
12847
  __self: this,
12840
12848
  __source: {
12841
12849
  fileName: _jsxFileName$1,
12842
- lineNumber: 268
12850
+ lineNumber: 269
12843
12851
  }
12844
12852
  }, partLabel), this.renderHeading(), teacherInstructions && React$2.createElement('div', {
12845
12853
  className: classes.teacherInstructions,
12846
12854
  __self: this,
12847
12855
  __source: {
12848
12856
  fileName: _jsxFileName$1,
12849
- lineNumber: 273
12857
+ lineNumber: 274
12850
12858
  }
12851
12859
  }, !animationsDisabled ? React$2.createElement(Collapsible, {
12852
12860
  labels: {
@@ -12856,14 +12864,14 @@ class MultipleChoice$1 extends React$2.Component {
12856
12864
  __self: this,
12857
12865
  __source: {
12858
12866
  fileName: _jsxFileName$1,
12859
- lineNumber: 275
12867
+ lineNumber: 276
12860
12868
  }
12861
12869
  }, teacherInstructionsDiv) : teacherInstructionsDiv), React$2.createElement('fieldset', {
12862
12870
  className: classes.fieldset,
12863
12871
  __self: this,
12864
12872
  __source: {
12865
12873
  fileName: _jsxFileName$1,
12866
- lineNumber: 289
12874
+ lineNumber: 290
12867
12875
  }
12868
12876
  }, React$2.createElement(PreviewPrompt, {
12869
12877
  className: "prompt",
@@ -12873,7 +12881,7 @@ class MultipleChoice$1 extends React$2.Component {
12873
12881
  __self: this,
12874
12882
  __source: {
12875
12883
  fileName: _jsxFileName$1,
12876
- lineNumber: 290
12884
+ lineNumber: 291
12877
12885
  }
12878
12886
  }), !alwaysShowCorrect && React$2.createElement(CorrectAnswerToggle, {
12879
12887
  show: showCorrectAnswerToggle,
@@ -12883,7 +12891,7 @@ class MultipleChoice$1 extends React$2.Component {
12883
12891
  __self: this,
12884
12892
  __source: {
12885
12893
  fileName: _jsxFileName$1,
12886
- lineNumber: 293
12894
+ lineNumber: 294
12887
12895
  }
12888
12896
  }), React$2.createElement('div', {
12889
12897
  className: classNames({
@@ -12894,10 +12902,11 @@ class MultipleChoice$1 extends React$2.Component {
12894
12902
  __self: this,
12895
12903
  __source: {
12896
12904
  fileName: _jsxFileName$1,
12897
- lineNumber: 301
12905
+ lineNumber: 302
12898
12906
  }
12899
12907
  }, choices.map((choice, index) => React$2.createElement(StyledChoice, {
12900
12908
  choicesLayout: this.props.choicesLayout,
12909
+ selectedAnswerBackgroundColor: this.props.selectedAnswerBackgroundColor,
12901
12910
  gridColumns: gridColumns,
12902
12911
  key: `choice-${index}`,
12903
12912
  choice: choice,
@@ -12916,14 +12925,14 @@ class MultipleChoice$1 extends React$2.Component {
12916
12925
  __self: this,
12917
12926
  __source: {
12918
12927
  fileName: _jsxFileName$1,
12919
- lineNumber: 309
12928
+ lineNumber: 310
12920
12929
  }
12921
12930
  })))), choiceMode === 'checkbox' && selections < minSelections && React$2.createElement('div', {
12922
12931
  className: classes.errorText,
12923
12932
  __self: this,
12924
12933
  __source: {
12925
12934
  fileName: _jsxFileName$1,
12926
- lineNumber: 332
12935
+ lineNumber: 334
12927
12936
  }
12928
12937
  }, translator.t(`translation:multipleChoice:minSelections_${minSelections === 1 ? 'one' : 'other'}`, {
12929
12938
  lng: language,
@@ -12933,7 +12942,7 @@ class MultipleChoice$1 extends React$2.Component {
12933
12942
  __self: this,
12934
12943
  __source: {
12935
12944
  fileName: _jsxFileName$1,
12936
- lineNumber: 340
12945
+ lineNumber: 342
12937
12946
  }
12938
12947
  }, translator.t(`translation:multipleChoice:maxSelections_${maxSelections === 1 ? 'one' : 'other'}`, {
12939
12948
  lng: language,
package/module/print.js CHANGED
@@ -12476,7 +12476,7 @@ class Choice extends React$3.Component {
12476
12476
  };
12477
12477
  }
12478
12478
  render() {
12479
- const {choice, index, choicesLength, showCorrect, isEvaluateMode, choiceMode, disabled, checked, correctness, displayKey, classes, choicesLayout, gridColumns, isSelectionButtonBelow} = this.props;
12479
+ const {choice, index, choicesLength, showCorrect, isEvaluateMode, choiceMode, disabled, checked, correctness, displayKey, classes, choicesLayout, gridColumns, isSelectionButtonBelow, selectedAnswerBackgroundColor} = this.props;
12480
12480
  const choiceClass = 'choice' + (index === choicesLength - 1 ? ' last' : '');
12481
12481
  const feedback = !isEvaluateMode || showCorrect ? '' : choice.feedback;
12482
12482
  const choiceProps = {
@@ -12498,13 +12498,17 @@ class Choice extends React$3.Component {
12498
12498
  [classes.noBorder]: index === choicesLength - 1 || choicesLayout !== 'vertical',
12499
12499
  [classes.horizontalLayout]: choicesLayout === 'horizontal'
12500
12500
  });
12501
+ const choiceBackground = selectedAnswerBackgroundColor && checked ? selectedAnswerBackgroundColor : 'initial';
12501
12502
  return React$3.createElement('div', {
12502
12503
  className: choiceClass,
12503
12504
  key: index,
12505
+ style: {
12506
+ backgroundColor: choiceBackground
12507
+ },
12504
12508
  __self: this,
12505
12509
  __source: {
12506
12510
  fileName: _jsxFileName$2,
12507
- lineNumber: 62
12511
+ lineNumber: 65
12508
12512
  }
12509
12513
  }, React$3.createElement(ChoiceInput$1, {
12510
12514
  ...choiceProps,
@@ -12512,7 +12516,7 @@ class Choice extends React$3.Component {
12512
12516
  __self: this,
12513
12517
  __source: {
12514
12518
  fileName: _jsxFileName$2,
12515
- lineNumber: 63
12519
+ lineNumber: 66
12516
12520
  }
12517
12521
  }));
12518
12522
  }
@@ -12533,12 +12537,15 @@ Choice.propTypes = {
12533
12537
  displayKey: PropTypes$2.string,
12534
12538
  choicesLayout: PropTypes$2.oneOf(['vertical', 'grid', 'horizontal']),
12535
12539
  gridColumns: PropTypes$2.string,
12540
+ selectedAnswerBackgroundColor: PropTypes$2.string,
12536
12541
  isSelectionButtonBelow: PropTypes$2.bool
12537
12542
  };
12538
12543
  var StyledChoice = styles$b.withStyles(theme => ({
12539
12544
  choice: {
12540
12545
  paddingTop: theme.spacing.unit * 2.5,
12541
12546
  paddingBottom: theme.spacing.unit + 2,
12547
+ paddingLeft: theme.spacing.unit + 2,
12548
+ paddingRight: theme.spacing.unit + 2,
12542
12549
  borderBottom: `1px solid ${theme.palette.grey[300]}`
12543
12550
  },
12544
12551
  noBorder: {
@@ -12628,6 +12635,7 @@ class MultipleChoice$1 extends React$2.Component {
12628
12635
  alwaysShowCorrect: PropTypes$1.bool,
12629
12636
  animationsDisabled: PropTypes$1.bool,
12630
12637
  language: PropTypes$1.string,
12638
+ selectedAnswerBackgroundColor: PropTypes$1.string,
12631
12639
  onShowCorrectToggle: PropTypes$1.func,
12632
12640
  isSelectionButtonBelow: PropTypes$1.bool,
12633
12641
  minSelections: PropTypes$1.number,
@@ -12759,14 +12767,14 @@ class MultipleChoice$1 extends React$2.Component {
12759
12767
  __self: this,
12760
12768
  __source: {
12761
12769
  fileName: _jsxFileName$1,
12762
- lineNumber: 224
12770
+ lineNumber: 225
12763
12771
  }
12764
12772
  }, "Multiple Choice Question") : React$2.createElement('h2', {
12765
12773
  className: classes.srOnly,
12766
12774
  __self: this,
12767
12775
  __source: {
12768
12776
  fileName: _jsxFileName$1,
12769
- lineNumber: 226
12777
+ lineNumber: 227
12770
12778
  }
12771
12779
  }, "Multiple Select Question");
12772
12780
  }
@@ -12787,7 +12795,7 @@ class MultipleChoice$1 extends React$2.Component {
12787
12795
  __self: this,
12788
12796
  __source: {
12789
12797
  fileName: _jsxFileName$1,
12790
- lineNumber: 258
12798
+ lineNumber: 259
12791
12799
  }
12792
12800
  });
12793
12801
  return React$2.createElement('div', {
@@ -12795,21 +12803,21 @@ class MultipleChoice$1 extends React$2.Component {
12795
12803
  __self: this,
12796
12804
  __source: {
12797
12805
  fileName: _jsxFileName$1,
12798
- lineNumber: 267
12806
+ lineNumber: 268
12799
12807
  }
12800
12808
  }, partLabel && React$2.createElement('h3', {
12801
12809
  className: classes.partLabel,
12802
12810
  __self: this,
12803
12811
  __source: {
12804
12812
  fileName: _jsxFileName$1,
12805
- lineNumber: 268
12813
+ lineNumber: 269
12806
12814
  }
12807
12815
  }, partLabel), this.renderHeading(), teacherInstructions && React$2.createElement('div', {
12808
12816
  className: classes.teacherInstructions,
12809
12817
  __self: this,
12810
12818
  __source: {
12811
12819
  fileName: _jsxFileName$1,
12812
- lineNumber: 273
12820
+ lineNumber: 274
12813
12821
  }
12814
12822
  }, !animationsDisabled ? React$2.createElement(Collapsible, {
12815
12823
  labels: {
@@ -12819,14 +12827,14 @@ class MultipleChoice$1 extends React$2.Component {
12819
12827
  __self: this,
12820
12828
  __source: {
12821
12829
  fileName: _jsxFileName$1,
12822
- lineNumber: 275
12830
+ lineNumber: 276
12823
12831
  }
12824
12832
  }, teacherInstructionsDiv) : teacherInstructionsDiv), React$2.createElement('fieldset', {
12825
12833
  className: classes.fieldset,
12826
12834
  __self: this,
12827
12835
  __source: {
12828
12836
  fileName: _jsxFileName$1,
12829
- lineNumber: 289
12837
+ lineNumber: 290
12830
12838
  }
12831
12839
  }, React$2.createElement(PreviewPrompt, {
12832
12840
  className: "prompt",
@@ -12836,7 +12844,7 @@ class MultipleChoice$1 extends React$2.Component {
12836
12844
  __self: this,
12837
12845
  __source: {
12838
12846
  fileName: _jsxFileName$1,
12839
- lineNumber: 290
12847
+ lineNumber: 291
12840
12848
  }
12841
12849
  }), !alwaysShowCorrect && React$2.createElement(CorrectAnswerToggle, {
12842
12850
  show: showCorrectAnswerToggle,
@@ -12846,7 +12854,7 @@ class MultipleChoice$1 extends React$2.Component {
12846
12854
  __self: this,
12847
12855
  __source: {
12848
12856
  fileName: _jsxFileName$1,
12849
- lineNumber: 293
12857
+ lineNumber: 294
12850
12858
  }
12851
12859
  }), React$2.createElement('div', {
12852
12860
  className: classNames({
@@ -12857,10 +12865,11 @@ class MultipleChoice$1 extends React$2.Component {
12857
12865
  __self: this,
12858
12866
  __source: {
12859
12867
  fileName: _jsxFileName$1,
12860
- lineNumber: 301
12868
+ lineNumber: 302
12861
12869
  }
12862
12870
  }, choices.map((choice, index) => React$2.createElement(StyledChoice, {
12863
12871
  choicesLayout: this.props.choicesLayout,
12872
+ selectedAnswerBackgroundColor: this.props.selectedAnswerBackgroundColor,
12864
12873
  gridColumns: gridColumns,
12865
12874
  key: `choice-${index}`,
12866
12875
  choice: choice,
@@ -12879,14 +12888,14 @@ class MultipleChoice$1 extends React$2.Component {
12879
12888
  __self: this,
12880
12889
  __source: {
12881
12890
  fileName: _jsxFileName$1,
12882
- lineNumber: 309
12891
+ lineNumber: 310
12883
12892
  }
12884
12893
  })))), choiceMode === 'checkbox' && selections < minSelections && React$2.createElement('div', {
12885
12894
  className: classes.errorText,
12886
12895
  __self: this,
12887
12896
  __source: {
12888
12897
  fileName: _jsxFileName$1,
12889
- lineNumber: 332
12898
+ lineNumber: 334
12890
12899
  }
12891
12900
  }, translator$1.t(`translation:multipleChoice:minSelections_${minSelections === 1 ? 'one' : 'other'}`, {
12892
12901
  lng: language,
@@ -12896,7 +12905,7 @@ class MultipleChoice$1 extends React$2.Component {
12896
12905
  __self: this,
12897
12906
  __source: {
12898
12907
  fileName: _jsxFileName$1,
12899
- lineNumber: 340
12908
+ lineNumber: 342
12900
12909
  }
12901
12910
  }, translator$1.t(`translation:multipleChoice:maxSelections_${maxSelections === 1 ? 'one' : 'other'}`, {
12902
12911
  lng: language,
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@pie-element/ebsr",
3
- "version": "10.2.6-next.34+1bf85f10a",
3
+ "version": "10.2.6-next.39+bf2631ffc",
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.5.2-next.34+1bf85f10a",
10
+ "@pie-element/multiple-choice": "^9.5.2-next.39+bf2631ffc",
11
11
  "@pie-framework/pie-player-events": "^0.1.0",
12
12
  "@pie-lib/pie-toolbox": "2.4.1",
13
13
  "classnames": "^2.2.5",
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "author": "pie framework developers",
18
18
  "license": "ISC",
19
- "gitHead": "1bf85f10abdec54911ebbade6b8a54c17d00870a",
19
+ "gitHead": "bf2631ffc30c390f37db654a3a79098c76ad8748",
20
20
  "scripts": {
21
21
  "postpublish": "../../scripts/postpublish"
22
22
  },