@instructure/quiz-core 20.4.2-rc.0 → 20.4.2-rc.2

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.
Files changed (55) hide show
  1. package/es/common/components/resources/quiz/instructions/Instructions.js +17 -18
  2. package/es/common/components/resources/quiz/instructions/styles.js +21 -0
  3. package/es/common/components/resources/quiz/instructions/theme.js +4 -2
  4. package/es/common/components/resources/quiz/title/Title.js +15 -18
  5. package/es/common/components/resources/quiz/title/styles.js +19 -0
  6. package/es/common/components/resources/quiz/title/theme.js +4 -2
  7. package/es/common/components/resources/quizSessionResult/Header/index.js +22 -29
  8. package/es/common/components/resources/quizSessionResult/Header/styles.js +29 -0
  9. package/es/common/components/resources/quizSessionResult/Header/theme.js +4 -2
  10. package/es/common/components/resources/quizSessionResult/Info/index.js +43 -53
  11. package/es/common/components/resources/quizSessionResult/Info/styles.js +61 -0
  12. package/es/common/components/resources/quizSessionResult/Info/theme.js +4 -2
  13. package/es/reporting/components/Caption/index.js +13 -18
  14. package/es/reporting/components/Caption/styles.js +12 -0
  15. package/es/reporting/components/Caption/theme.js +4 -2
  16. package/es/reporting/components/charts/Legend/index.js +45 -33
  17. package/es/reporting/components/charts/Legend/styles.js +44 -0
  18. package/es/reporting/components/charts/Legend/theme.js +4 -2
  19. package/es/reporting/components/itemAnalysis/ItemAnalysisRow/presenter.js +61 -79
  20. package/es/reporting/components/itemAnalysis/ItemAnalysisRow/styles.js +100 -0
  21. package/es/reporting/components/itemAnalysis/ItemAnalysisRow/theme.js +4 -2
  22. package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/presenter.js +34 -44
  23. package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/styles.js +40 -0
  24. package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/theme.js +4 -2
  25. package/es/reporting/components/resources/NewQuizAndItemAnalysis/charts/ScoreDistribution/presenter.js +27 -26
  26. package/es/reporting/components/resources/NewQuizAndItemAnalysis/charts/ScoreDistribution/styles.js +20 -0
  27. package/es/reporting/components/resources/NewQuizAndItemAnalysis/charts/ScoreDistribution/theme.js +4 -2
  28. package/lib/common/components/resources/quiz/instructions/Instructions.js +15 -22
  29. package/lib/common/components/resources/quiz/instructions/styles.js +29 -0
  30. package/lib/common/components/resources/quiz/instructions/theme.js +6 -3
  31. package/lib/common/components/resources/quiz/title/Title.js +15 -23
  32. package/lib/common/components/resources/quiz/title/styles.js +27 -0
  33. package/lib/common/components/resources/quiz/title/theme.js +6 -3
  34. package/lib/common/components/resources/quizSessionResult/Header/index.js +21 -31
  35. package/lib/common/components/resources/quizSessionResult/Header/styles.js +37 -0
  36. package/lib/common/components/resources/quizSessionResult/Header/theme.js +6 -3
  37. package/lib/common/components/resources/quizSessionResult/Info/index.js +42 -55
  38. package/lib/common/components/resources/quizSessionResult/Info/styles.js +69 -0
  39. package/lib/common/components/resources/quizSessionResult/Info/theme.js +6 -3
  40. package/lib/reporting/components/Caption/index.js +12 -19
  41. package/lib/reporting/components/Caption/styles.js +20 -0
  42. package/lib/reporting/components/Caption/theme.js +6 -3
  43. package/lib/reporting/components/charts/Legend/index.js +44 -34
  44. package/lib/reporting/components/charts/Legend/styles.js +54 -0
  45. package/lib/reporting/components/charts/Legend/theme.js +6 -3
  46. package/lib/reporting/components/itemAnalysis/ItemAnalysisRow/presenter.js +61 -80
  47. package/lib/reporting/components/itemAnalysis/ItemAnalysisRow/styles.js +110 -0
  48. package/lib/reporting/components/itemAnalysis/ItemAnalysisRow/theme.js +6 -3
  49. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/presenter.js +33 -45
  50. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/styles.js +48 -0
  51. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/theme.js +6 -3
  52. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/charts/ScoreDistribution/presenter.js +27 -26
  53. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/charts/ScoreDistribution/styles.js +28 -0
  54. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/charts/ScoreDistribution/theme.js +6 -3
  55. package/package.json +9 -9
@@ -5,26 +5,22 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
5
 
6
6
  var _dec, _class, _class2, _temp;
7
7
 
8
+ /** @jsx jsx */
9
+
8
10
  /* eslint "react/no-string-refs": "warn" */
9
- import React, { Component } from 'react';
11
+ import { Component } from 'react';
10
12
  import ImmutablePropTypes from 'react-immutable-proptypes';
11
- import { themeable } from '@instructure/ui-themeable';
12
- import { RichContentRenderer } from '@instructure/quiz-rce';
13
+ import PropTypes from 'prop-types';
14
+ import { withStyle, jsx } from '@instructure/emotion';
15
+ import { RichContentRendererEmotion } from '@instructure/quiz-rce';
13
16
  import makeScrollable from "../../../shared/functionality/makeScrollable.js"; // ================================
14
17
  // renders the quiz instructions on
15
18
  // the Preview and Take pages
16
19
  // ================================
17
20
 
18
- var styles = {
19
- componentId: 'eLFCb',
20
- template: function template(theme) {
21
- return "\n\n.eLFCb_gasz{box-sizing:border-box;padding-left:".concat(theme.wrapperPadding || 'inherit', ";padding-right:").concat(theme.wrapperPadding || 'inherit', ";position:relative;width:100%}\n\n.eLFCb_gasz:after{clear:both;content:\"\";display:table}\n\n[dir=ltr] .eLFCb_gasz:after,[dir=rtl] .eLFCb_gasz:after{clear:both}\n\n.eLFCb_eWKC{font-size:").concat(theme.textFontSize || 'inherit', "}");
22
- },
23
- 'wrapper': 'eLFCb_gasz',
24
- 'text': 'eLFCb_eWKC'
25
- };
26
- import theme from "./theme.js";
27
- export var QuizInstructions = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
21
+ import generateStyle from "./styles.js";
22
+ import generateComponentTheme from "./theme.js";
23
+ export var QuizInstructions = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
28
24
  _inherits(QuizInstructions, _Component);
29
25
 
30
26
  var _super = _createSuper(QuizInstructions);
@@ -38,11 +34,12 @@ export var QuizInstructions = (_dec = themeable(theme, styles), _dec(_class = (_
38
34
  _createClass(QuizInstructions, [{
39
35
  key: "render",
40
36
  value: function render() {
41
- return /*#__PURE__*/React.createElement("div", {
42
- className: styles.wrapper,
37
+ return jsx("div", {
38
+ "data-testid": "instructionsWrapper",
39
+ css: this.props.styles.wrapper,
43
40
  tabIndex: "-1"
44
- }, /*#__PURE__*/React.createElement(RichContentRenderer, {
45
- customStyles: styles.text,
41
+ }, jsx(RichContentRendererEmotion, {
42
+ customStyles: this.props.styles.text,
46
43
  content: this.props.quiz.instructions
47
44
  }));
48
45
  }
@@ -51,6 +48,8 @@ export var QuizInstructions = (_dec = themeable(theme, styles), _dec(_class = (_
51
48
  QuizInstructions.displayName = "QuizInstructions";
52
49
  return QuizInstructions;
53
50
  }(Component), _class2.propTypes = {
54
- quiz: ImmutablePropTypes.record.isRequired
51
+ quiz: ImmutablePropTypes.record.isRequired,
52
+ // eslint-disable-next-line react/require-default-props,react/forbid-prop-types
53
+ styles: PropTypes.object
55
54
  }, _temp)) || _class);
56
55
  export default makeScrollable(QuizInstructions);
@@ -0,0 +1,21 @@
1
+ var generateStyle = function generateStyle(componentTheme) {
2
+ return {
3
+ wrapper: {
4
+ position: 'relative',
5
+ width: '100%',
6
+ boxSizing: 'border-box',
7
+ paddingLeft: componentTheme.wrapperPadding,
8
+ paddingRight: componentTheme.wrapperPadding,
9
+ '&::after': {
10
+ clear: 'both',
11
+ content: '""',
12
+ display: 'table'
13
+ }
14
+ },
15
+ text: {
16
+ fontSize: componentTheme.textFontSize
17
+ }
18
+ };
19
+ };
20
+
21
+ export default generateStyle;
@@ -1,8 +1,10 @@
1
- export default function generator(_ref) {
1
+ var generateComponentTheme = function generateComponentTheme(_ref) {
2
2
  var spacing = _ref.spacing,
3
3
  typography = _ref.typography;
4
4
  return {
5
5
  wrapperPadding: spacing.large,
6
6
  textFontSize: typography.fontSizeMedium
7
7
  };
8
- }
8
+ };
9
+
10
+ export default generateComponentTheme;
@@ -5,25 +5,20 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
5
 
6
6
  var _dec, _class, _class2, _temp;
7
7
 
8
- import React, { Component } from 'react';
8
+ /** @jsx jsx */
9
+ import { Component } from 'react';
10
+ import PropTypes from 'prop-types';
9
11
  import ImmutablePropTypes from 'react-immutable-proptypes';
10
12
  import { Heading } from '@instructure/ui-heading';
11
- import { themeable } from '@instructure/ui-themeable';
13
+ import { withStyle, jsx } from '@instructure/emotion';
12
14
  import makeScrollable from "../../../shared/functionality/makeScrollable.js"; // ==========================
13
15
  // renders the quiz title on
14
16
  // the Preview and Take pages
15
17
  // ==========================
16
18
 
17
- var styles = {
18
- componentId: 'cBDEG',
19
- template: function template(theme) {
20
- return "\n\n.cBDEG_gasz{align-items:center;box-sizing:border-box;display:flex;margin-bottom:".concat(theme.wrapperMargin || 'inherit', ";padding-left:").concat(theme.wrapperPadding || 'inherit', ";padding-top:").concat(theme.wrapperPadding || 'inherit', ";position:relative;width:100%}\n\n.cBDEG_eWKC{font-size:").concat(theme.textFontSize || 'inherit', "}");
21
- },
22
- 'wrapper': 'cBDEG_gasz',
23
- 'text': 'cBDEG_eWKC'
24
- };
25
- import theme from "./theme.js";
26
- export var QuizTitle = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
19
+ import generateStyle from "./styles.js";
20
+ import generateComponentTheme from "./theme.js";
21
+ export var QuizTitle = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
27
22
  _inherits(QuizTitle, _Component);
28
23
 
29
24
  var _super = _createSuper(QuizTitle);
@@ -37,13 +32,13 @@ export var QuizTitle = (_dec = themeable(theme, styles), _dec(_class = (_temp =
37
32
  _createClass(QuizTitle, [{
38
33
  key: "render",
39
34
  value: function render() {
40
- return /*#__PURE__*/React.createElement("div", {
41
- className: styles.wrapper,
35
+ return jsx("div", {
36
+ css: this.props.styles.wrapper,
42
37
  tabIndex: "-1"
43
- }, /*#__PURE__*/React.createElement(Heading, {
38
+ }, jsx(Heading, {
44
39
  level: "h1"
45
- }, /*#__PURE__*/React.createElement("span", {
46
- className: styles.text,
40
+ }, jsx("span", {
41
+ css: this.props.styles.text,
47
42
  "data-automation": "sdk-quiz-title-text"
48
43
  }, this.props.quiz.title)));
49
44
  }
@@ -52,6 +47,8 @@ export var QuizTitle = (_dec = themeable(theme, styles), _dec(_class = (_temp =
52
47
  QuizTitle.displayName = "QuizTitle";
53
48
  return QuizTitle;
54
49
  }(Component), _class2.propTypes = {
55
- quiz: ImmutablePropTypes.record.isRequired
50
+ quiz: ImmutablePropTypes.record.isRequired,
51
+ // eslint-disable-next-line react/require-default-props,react/forbid-prop-types
52
+ styles: PropTypes.object
56
53
  }, _temp)) || _class);
57
54
  export default makeScrollable(QuizTitle);
@@ -0,0 +1,19 @@
1
+ var generateStyle = function generateStyle(componentTheme) {
2
+ return {
3
+ wrapper: {
4
+ position: 'relative',
5
+ width: '100%',
6
+ boxSizing: 'border-box',
7
+ marginBottom: componentTheme.wrapperMargin,
8
+ display: 'flex',
9
+ alignItems: 'center',
10
+ paddingTop: componentTheme.wrapperPadding,
11
+ paddingLeft: componentTheme.wrapperPadding
12
+ },
13
+ text: {
14
+ fontSize: componentTheme.textFontSize
15
+ }
16
+ };
17
+ };
18
+
19
+ export default generateStyle;
@@ -1,4 +1,4 @@
1
- export default function generator(_ref) {
1
+ var generateComponentTheme = function generateComponentTheme(_ref) {
2
2
  var spacing = _ref.spacing,
3
3
  typography = _ref.typography;
4
4
  return {
@@ -6,4 +6,6 @@ export default function generator(_ref) {
6
6
  wrapperMargin: spacing.medium,
7
7
  textFontSize: typography.fontSizeXLarge
8
8
  };
9
- }
9
+ };
10
+
11
+ export default generateComponentTheme;
@@ -5,27 +5,17 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
5
 
6
6
  var _dec, _class, _class2, _temp;
7
7
 
8
- import React, { Component } from 'react';
8
+ /** @jsx jsx */
9
+ import { Component } from 'react';
9
10
  import PropTypes from 'prop-types';
10
11
  import ImmutablePropTypes from 'react-immutable-proptypes';
11
- import classNames from 'classnames';
12
12
  import { Heading } from '@instructure/ui-heading';
13
13
  import { Alert } from '@instructure/ui-alerts';
14
- import { themeable } from '@instructure/ui-themeable';
14
+ import { withStyle, jsx } from '@instructure/emotion';
15
15
  import t from '@instructure/quiz-i18n/es/format-message';
16
- var styles = {
17
- componentId: 'eSNUQ',
18
- template: function template(theme) {
19
- return "\n\n.eSNUQ_cgjN,.eSNUQ_dmuJ{display:flex;justify-content:flex-start}\n\n.eSNUQ_dmuJ{align-items:center;flex-wrap:wrap;margin:".concat(theme.resultListInfoMargin || 'inherit', "}\n\n.eSNUQ_dHwi{font-size:").concat(theme.resultListTitleFontSize || 'inherit', ";margin:").concat(theme.resultListTitleMargin || 'inherit', " 0;width:100%}\n\n.eSNUQ_dTyP{width:100%}\n\n.eSNUQ_dkVT{padding-left:").concat(theme.regradeAlertPadding || 'inherit', ";padding-right:").concat(theme.regradeAlertPadding || 'inherit', "}");
20
- },
21
- 'resultListHeading': 'eSNUQ_cgjN',
22
- 'resultListInfo': 'eSNUQ_dmuJ',
23
- 'resultListTitle': 'eSNUQ_dHwi',
24
- 'resultListDescription': 'eSNUQ_dTyP',
25
- 'regradeAlert': 'eSNUQ_dkVT'
26
- };
27
- import theme from "./theme.js";
28
- export var QuizSessionResultHeader = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
16
+ import generateStyle from "./styles.js";
17
+ import generateComponentTheme from "./theme.js";
18
+ export var QuizSessionResultHeader = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
29
19
  _inherits(QuizSessionResultHeader, _Component);
30
20
 
31
21
  var _super = _createSuper(QuizSessionResultHeader);
@@ -47,7 +37,7 @@ export var QuizSessionResultHeader = (_dec = themeable(theme, styles), _dec(_cla
47
37
  return rsi.position;
48
38
  }).toJS().join(', ');
49
39
 
50
- return /*#__PURE__*/React.createElement(Alert, {
40
+ return jsx(Alert, {
51
41
  variant: "warning"
52
42
  }, t("This assessment has been regraded. {\n numRegradedSI, plural,\n =1 {Question {questions} has been affected.}\n other {Questions {questions} have been affected.}\n }", {
53
43
  questions: questions,
@@ -67,19 +57,20 @@ export var QuizSessionResultHeader = (_dec = themeable(theme, styles), _dec(_cla
67
57
  }, {
68
58
  key: "render",
69
59
  value: function render() {
70
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
71
- className: styles.resultListHeading
72
- }, /*#__PURE__*/React.createElement("div", {
73
- className: styles.resultListInfo
74
- }, /*#__PURE__*/React.createElement("div", {
75
- className: styles.resultListTitle,
60
+ return jsx("div", null, jsx("div", {
61
+ css: this.props.styles.resultListHeading
62
+ }, jsx("div", {
63
+ css: this.props.styles.resultListInfo
64
+ }, jsx("div", {
65
+ css: this.props.styles.resultListTitle,
76
66
  "data-automation": "sdk-result-list-title"
77
- }, /*#__PURE__*/React.createElement(Heading, {
67
+ }, jsx(Heading, {
78
68
  level: "h1"
79
- }, t('Results'))), /*#__PURE__*/React.createElement("div", {
80
- className: classNames('fs-mask', styles.resultListDescription)
81
- }, this.props.studentDescription || this.studentName()))), /*#__PURE__*/React.createElement("div", {
82
- className: styles.regradeAlert
69
+ }, t('Results'))), jsx("div", {
70
+ css: this.props.styles.resultListDescription,
71
+ className: "fs-mask"
72
+ }, this.props.studentDescription || this.studentName()))), jsx("div", {
73
+ css: this.props.styles.regradeAlert
83
74
  }, this.renderRegradeAlert()));
84
75
  }
85
76
  }]);
@@ -89,7 +80,9 @@ export var QuizSessionResultHeader = (_dec = themeable(theme, styles), _dec(_cla
89
80
  }(Component), _class2.propTypes = {
90
81
  quizSession: ImmutablePropTypes.record.isRequired,
91
82
  regradedSessionItemResults: ImmutablePropTypes.list,
92
- studentDescription: PropTypes.node
83
+ studentDescription: PropTypes.node,
84
+ // eslint-disable-next-line react/require-default-props,react/forbid-prop-types
85
+ styles: PropTypes.object
93
86
  }, _class2.defaultProps = {
94
87
  regradedSessionItemResults: null,
95
88
  studentDescription: null
@@ -0,0 +1,29 @@
1
+ var generateStyle = function generateStyle(componentTheme) {
2
+ return {
3
+ resultListHeading: {
4
+ display: 'flex',
5
+ justifyContent: 'flex-start'
6
+ },
7
+ resultListInfo: {
8
+ margin: componentTheme.resultListInfoMargin,
9
+ display: 'flex',
10
+ flexWrap: 'wrap',
11
+ justifyContent: 'flex-start',
12
+ alignItems: 'center'
13
+ },
14
+ resultListTitle: {
15
+ width: '100%',
16
+ fontSize: componentTheme.resultListTitleFontSize,
17
+ margin: "".concat(componentTheme.resultListTitleMargin, " 0")
18
+ },
19
+ resultListDescription: {
20
+ width: '100%'
21
+ },
22
+ regradeAlert: {
23
+ paddingLeft: componentTheme.regradeAlertPadding,
24
+ paddingRight: componentTheme.regradeAlertPadding
25
+ }
26
+ };
27
+ };
28
+
29
+ export default generateStyle;
@@ -1,4 +1,4 @@
1
- export default function generator(_ref) {
1
+ var generateComponentTheme = function generateComponentTheme(_ref) {
2
2
  var spacing = _ref.spacing,
3
3
  typography = _ref.typography;
4
4
  return {
@@ -7,4 +7,6 @@ export default function generator(_ref) {
7
7
  resultListTitleMargin: spacing.xSmall,
8
8
  regradeAlertPadding: spacing.xLarge
9
9
  };
10
- }
10
+ };
11
+
12
+ export default generateComponentTheme;
@@ -6,39 +6,26 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
6
6
 
7
7
  var _dec, _class, _class2, _temp;
8
8
 
9
- import React, { Component } from 'react';
9
+ /** @jsx jsx */
10
+ import { Component } from 'react';
10
11
  import PropTypes from 'prop-types';
11
12
  import ImmutablePropTypes from 'react-immutable-proptypes';
12
- import classNames from 'classnames';
13
13
  import { AccessibleContent, ScreenReaderContent } from '@instructure/ui-a11y-content';
14
14
  import { Alert } from '@instructure/ui-alerts';
15
15
  import { Text } from '@instructure/ui-text';
16
16
  import { ProgressCircle } from '@instructure/ui-progress';
17
17
  import { Heading } from '@instructure/ui-heading';
18
18
  import { View } from '@instructure/ui-view';
19
- import { themeable } from '@instructure/ui-themeable';
19
+ import { withStyle, jsx } from '@instructure/emotion';
20
20
  import t from '@instructure/quiz-i18n/es/format-message';
21
21
  import { scoreToLetterGrade } from '@instructure/grading-utils';
22
22
  import { withI18nSupport } from '@instructure/quiz-common';
23
23
  import FormattedDuration from "../../../shared/FormattedDuration/index.js";
24
24
  import { formatTime } from "../../../../util/formatTimespan.js";
25
- var styles = {
26
- componentId: 'fhrSa',
27
- template: function template(theme) {
28
- return "\n\n.fhrSa_ekHz{align-items:center;display:flex;flex-direction:row;justify-content:center;margin-top:".concat(theme.alertWrapperMargin || 'inherit', "}\n\n.fhrSa_bANW{flex-grow:1;max-width:33rem}\n\n.fhrSa_gasz{margin:none;padding:none}\n\n.fhrSa_pypk,.fhrSa_gasz{align-items:center;display:flex;justify-content:center}\n\n.fhrSa_pypk{align-self:center;flex-wrap:wrap}\n\n.fhrSa_bCqi{flex-wrap:wrap;justify-content:flex-start}\n\n.fhrSa_frHB,.fhrSa_bCqi{align-items:center;display:flex;flex:1 1 auto}\n\n.fhrSa_frHB{height:150px;margin:").concat(theme.scoreMargin || 'inherit', ";width:150px;z-index:").concat(theme.scoreZIndex || 'inherit', "}\n\n.fhrSa_fkZg{font-size:").concat(theme.scorePercentageFontSize || 'inherit', ";font-weight:").concat(theme.scorePercentageFontWeight || 'inherit', "}\n\n.fhrSa_vsBM{flex:1 1 auto;margin:").concat(theme.infoWrapperMargin || 'inherit', ";padding-left:").concat(theme.inforWrapperPadding || 'inherit', "}");
29
- },
30
- 'alertWrapper': 'fhrSa_ekHz',
31
- 'alertWidth': 'fhrSa_bANW',
32
- 'wrapper': 'fhrSa_gasz',
33
- 'info': 'fhrSa_pypk',
34
- 'scoreStats': 'fhrSa_bCqi',
35
- 'score': 'fhrSa_frHB',
36
- 'scorePercentage': 'fhrSa_fkZg',
37
- 'infoWrapper': 'fhrSa_vsBM'
38
- };
39
- import theme from "./theme.js";
25
+ import generateStyle from "./styles.js";
26
+ import generateComponentTheme from "./theme.js";
40
27
  var unknownPercentageValue = 'UNKNOWN_PERCENTAGE';
41
- export var Info = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_withI18nSupport) {
28
+ export var Info = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_withI18nSupport) {
42
29
  _inherits(Info, _withI18nSupport);
43
30
 
44
31
  var _super = _createSuper(Info);
@@ -74,8 +61,8 @@ export var Info = (_dec = themeable(theme, styles), _dec(_class = (_temp = _clas
74
61
  default: '?',
75
62
  description: 'placeholder for an unknown percentage value'
76
63
  }) : this.formatPercentMax2FractionDigits(valueNow);
77
- return /*#__PURE__*/React.createElement("div", {
78
- className: styles.scorePercentage,
64
+ return jsx("div", {
65
+ css: this.props.styles.scorePercentage,
79
66
  "data-automation": "sdk-quiz-score-percentage"
80
67
  }, valueToShow);
81
68
  }
@@ -93,7 +80,7 @@ export var Info = (_dec = themeable(theme, styles), _dec(_class = (_temp = _clas
93
80
 
94
81
  if (quizSessionResult.isLoaded() && quizSessionResult.autogradingFailed()) {
95
82
  var msg = t('There was a grading problem. Please inform your instructor.');
96
- alerts.push( /*#__PURE__*/React.createElement(Alert, {
83
+ alerts.push(jsx(Alert, {
97
84
  key: "autograding_failed",
98
85
  variant: "warning"
99
86
  }, msg));
@@ -103,17 +90,17 @@ export var Info = (_dec = themeable(theme, styles), _dec(_class = (_temp = _clas
103
90
  var ungradedText = t("{\n count, plural,\n one {# question requires grading}\n other {# questions require grading}\n }", {
104
91
  count: ungradedCount
105
92
  });
106
- alerts.push( /*#__PURE__*/React.createElement(Alert, {
93
+ alerts.push(jsx(Alert, {
107
94
  key: "manual_grading",
108
95
  variant: "info"
109
96
  }, ungradedText));
110
97
  }
111
98
 
112
99
  if (alerts.length) {
113
- return /*#__PURE__*/React.createElement("div", {
114
- className: styles.alertWrapper
115
- }, /*#__PURE__*/React.createElement("div", {
116
- className: styles.alertWidth,
100
+ return jsx("div", {
101
+ css: this.props.styles.alertWrapper
102
+ }, jsx("div", {
103
+ css: this.props.styles.alertWidth,
117
104
  "data-automation": "sdk-results-requires-grading"
118
105
  }, alerts));
119
106
  }
@@ -126,23 +113,23 @@ export var Info = (_dec = themeable(theme, styles), _dec(_class = (_temp = _clas
126
113
  var alt = t('Grade for this attempt: { grade }', {
127
114
  grade: letterGrade
128
115
  });
129
- return /*#__PURE__*/React.createElement(AccessibleContent, {
116
+ return jsx(AccessibleContent, {
130
117
  alt: alt
131
- }, /*#__PURE__*/React.createElement(View, {
118
+ }, jsx(View, {
132
119
  as: "div"
133
- }, /*#__PURE__*/React.createElement(Text, {
120
+ }, jsx(Text, {
134
121
  size: "xx-large",
135
122
  weight: "bold",
136
123
  color: "primary"
137
- }, letterGrade)), /*#__PURE__*/React.createElement(Text, {
124
+ }, letterGrade)), jsx(Text, {
138
125
  color: "secondary"
139
126
  }, gradeText));
140
127
  }
141
128
  }, {
142
129
  key: "renderScoreStats",
143
130
  value: function renderScoreStats() {
144
- return /*#__PURE__*/React.createElement("div", {
145
- className: styles.scoreStats
131
+ return jsx("div", {
132
+ css: this.props.styles.scoreStats
146
133
  }, this.renderProgress(), this.renderPointsDisplay());
147
134
  }
148
135
  }, {
@@ -152,10 +139,10 @@ export var Info = (_dec = themeable(theme, styles), _dec(_class = (_temp = _clas
152
139
  return null;
153
140
  }
154
141
 
155
- return /*#__PURE__*/React.createElement("div", {
156
- className: styles.score,
142
+ return jsx("div", {
143
+ css: this.props.styles.score,
157
144
  "data-automation": "sdk-info-score"
158
- }, /*#__PURE__*/React.createElement(ProgressCircle, {
145
+ }, jsx(ProgressCircle, {
159
146
  shouldAnimateOnMount: true,
160
147
  size: "large",
161
148
  screenReaderLabel: t('Your Score'),
@@ -168,16 +155,16 @@ export var Info = (_dec = themeable(theme, styles), _dec(_class = (_temp = _clas
168
155
  }, {
169
156
  key: "renderPointsDisplay",
170
157
  value: function renderPointsDisplay() {
171
- return /*#__PURE__*/React.createElement("div", {
172
- className: styles.infoWrapper
173
- }, /*#__PURE__*/React.createElement(AccessibleContent, {
158
+ return jsx("div", {
159
+ css: this.props.styles.infoWrapper
160
+ }, jsx(AccessibleContent, {
174
161
  alt: this.pointsText
175
- }, /*#__PURE__*/React.createElement(Text, {
162
+ }, jsx(Text, {
176
163
  as: "div",
177
164
  color: "primary",
178
165
  size: "xx-large",
179
166
  weight: "bold"
180
- }, this.mainPointsText), /*#__PURE__*/React.createElement(Text, {
167
+ }, this.mainPointsText), jsx(Text, {
181
168
  color: "secondary"
182
169
  }, this.subPointsText)));
183
170
  }
@@ -188,29 +175,30 @@ export var Info = (_dec = themeable(theme, styles), _dec(_class = (_temp = _clas
188
175
  var alt = t('Time for this attempt: { time }', {
189
176
  time: formatTime(this.props.quizSession.elapsedTime)
190
177
  });
191
- return /*#__PURE__*/React.createElement(AccessibleContent, {
178
+ return jsx(AccessibleContent, {
192
179
  alt: alt
193
- }, /*#__PURE__*/React.createElement(View, {
180
+ }, jsx(View, {
194
181
  as: "div"
195
- }, /*#__PURE__*/React.createElement(FormattedDuration, {
182
+ }, jsx(FormattedDuration, {
196
183
  fontSize: "xx-large",
197
184
  fontWeight: "bold",
198
185
  seconds: this.props.quizSession.elapsedTime
199
- })), /*#__PURE__*/React.createElement(Text, {
186
+ })), jsx(Text, {
200
187
  color: "secondary"
201
188
  }, attemptText));
202
189
  }
203
190
  }, {
204
191
  key: "render",
205
192
  value: function render() {
206
- return /*#__PURE__*/React.createElement("div", null, this.renderAlert(), /*#__PURE__*/React.createElement("div", {
207
- className: styles.wrapper
208
- }, /*#__PURE__*/React.createElement("div", {
209
- className: classNames('fs-mask', styles.info)
210
- }, /*#__PURE__*/React.createElement(ScreenReaderContent, null, /*#__PURE__*/React.createElement(Heading, {
193
+ return jsx("div", null, this.renderAlert(), jsx("div", {
194
+ css: this.props.styles.wrapper
195
+ }, jsx("div", {
196
+ css: this.props.styles.info,
197
+ className: "fs-mask"
198
+ }, jsx(ScreenReaderContent, null, jsx(Heading, {
211
199
  level: "h2"
212
- }, t('Assessment Statistics'))), this.props.restrictQuantitativeData ? this.renderLetterGrade() : this.renderScoreStats(), /*#__PURE__*/React.createElement("div", {
213
- className: styles.infoWrapper
200
+ }, t('Assessment Statistics'))), this.props.restrictQuantitativeData ? this.renderLetterGrade() : this.renderScoreStats(), jsx("div", {
201
+ css: this.props.styles.infoWrapper
214
202
  }, this.renderTime()))));
215
203
  }
216
204
  }, {
@@ -316,7 +304,9 @@ export var Info = (_dec = themeable(theme, styles), _dec(_class = (_temp = _clas
316
304
  quizSession: ImmutablePropTypes.record.isRequired,
317
305
  quizSessionResult: ImmutablePropTypes.record.isRequired,
318
306
  restrictQuantitativeData: PropTypes.bool,
319
- sessionItemResults: ImmutablePropTypes.list.isRequired
307
+ sessionItemResults: ImmutablePropTypes.list.isRequired,
308
+ // eslint-disable-next-line react/require-default-props,react/forbid-prop-types
309
+ styles: PropTypes.object
320
310
  }, _class2.defaultProps = {
321
311
  gradingScheme: [],
322
312
  restrictQuantitativeData: false
@@ -0,0 +1,61 @@
1
+ var generateStyle = function generateStyle(componentTheme) {
2
+ return {
3
+ alertWrapper: {
4
+ display: 'flex',
5
+ flexDirection: 'row',
6
+ alignItems: 'center',
7
+ justifyContent: 'center',
8
+ marginTop: componentTheme.alertWrapperMargin
9
+ },
10
+ alertWidth: {
11
+ flexGrow: 1,
12
+ maxWidth: '33rem,'
13
+ },
14
+ wrapper: {
15
+ padding: 'none',
16
+ margin: 'none',
17
+ display: 'flex',
18
+ alignItems: 'center',
19
+ justifyContent: 'center'
20
+ },
21
+ info: {
22
+ alignSelf: 'center',
23
+ display: 'flex',
24
+ flexWrap: 'wrap',
25
+ alignItems: 'center',
26
+ justifyContent: 'center'
27
+ },
28
+ scoreStats: {
29
+ display: 'flex',
30
+ flexWrap: 'wrap',
31
+ alignItems: 'center',
32
+ justifyContent: 'flex-start',
33
+ flex: '1 1 auto'
34
+ },
35
+ score: {
36
+ display: 'flex',
37
+ alignItems: 'center',
38
+ flex: '1 1 auto',
39
+ margin: componentTheme.scoreMargin,
40
+ height: '150px',
41
+ width: '150px',
42
+
43
+ /*
44
+ progress modal sets a -1 z-index on its content
45
+ and this raises it above the app background
46
+ */
47
+ zIndex: componentTheme.scoreZIndex
48
+ },
49
+ scorePercentage: {
50
+ fontSize: componentTheme.scorePercentageFontSize,
51
+ fontWeight: componentTheme.scorePercentageFontWeight
52
+ },
53
+ infoWrapper: {
54
+ flex: '1 1 auto',
55
+ margin: componentTheme.infoWrapperMargin,
56
+ paddingLeft: componentTheme.inforWrapperPadding
57
+ }
58
+ };
59
+ };
60
+
61
+ export default generateStyle;
@@ -1,4 +1,4 @@
1
- export default function generator(_ref) {
1
+ var generateComponentTheme = function generateComponentTheme(_ref) {
2
2
  var spacing = _ref.spacing,
3
3
  typography = _ref.typography;
4
4
  return {
@@ -10,4 +10,6 @@ export default function generator(_ref) {
10
10
  infoWrapperMargin: spacing.small,
11
11
  inforWrapperPadding: spacing.small
12
12
  };
13
- }
13
+ };
14
+
15
+ export default generateComponentTheme;