@instructure/quiz-core 20.7.1-rc.7 → 20.8.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.
Files changed (50) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/index.js +1 -0
  3. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/presenter.js +90 -0
  4. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/index.js +1 -0
  5. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/presenter.js +255 -0
  6. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{shared/ChoiceGroupTypeTable → NumericType}/theme.js +1 -2
  7. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{shared → RichFillBlankType}/ChoiceGroupTypeTable/presenter.js +23 -59
  8. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/ChoiceGroupTypeTable/styles.js +10 -0
  9. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/presenter.js +11 -35
  10. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/Table/index.js +120 -0
  11. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/Table/styles.js +38 -0
  12. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/Table/theme.js +11 -0
  13. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/index.js +55 -0
  14. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/presenter.js +14 -0
  15. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsTableWrapper/presenter.js +8 -2
  16. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +34 -39
  17. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/index.js +1 -0
  18. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/presenter.js +104 -0
  19. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/{ChoiceGroupTypeTable → ExpandableCard}/styles.js +3 -2
  20. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/theme.js +7 -0
  21. package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/index.js +4 -1
  22. package/es/reporting/components/resources/NewQuizAndItemAnalysis/propTypes.js +54 -4
  23. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/index.js +13 -0
  24. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/presenter.js +113 -0
  25. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/index.js +13 -0
  26. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/presenter.js +281 -0
  27. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{shared/ChoiceGroupTypeTable → NumericType}/theme.js +1 -2
  28. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{shared → RichFillBlankType}/ChoiceGroupTypeTable/presenter.js +27 -64
  29. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/ChoiceGroupTypeTable/styles.js +18 -0
  30. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/presenter.js +15 -39
  31. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/Table/index.js +140 -0
  32. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/Table/styles.js +46 -0
  33. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/Table/theme.js +19 -0
  34. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/index.js +80 -0
  35. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/presenter.js +20 -4
  36. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsTableWrapper/presenter.js +8 -2
  37. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +33 -38
  38. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/index.js +13 -0
  39. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/presenter.js +124 -0
  40. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/{ChoiceGroupTypeTable → ExpandableCard}/styles.js +3 -2
  41. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/theme.js +15 -0
  42. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/index.js +4 -1
  43. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/propTypes.js +70 -5
  44. package/package.json +10 -10
  45. /package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{RichFillBlankType → NumericType}/styles.js +0 -0
  46. /package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{shared → RichFillBlankType}/ChoiceGroupTypeTable/index.js +0 -0
  47. /package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/{theme.js → ChoiceGroupTypeTable/theme.js} +0 -0
  48. /package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{RichFillBlankType → NumericType}/styles.js +0 -0
  49. /package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{shared → RichFillBlankType}/ChoiceGroupTypeTable/index.js +0 -0
  50. /package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/{theme.js → ChoiceGroupTypeTable/theme.js} +0 -0
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
4
+
3
5
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
6
 
5
7
  Object.defineProperty(exports, "__esModule", {
@@ -13,7 +15,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
13
15
 
14
16
  var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
15
17
 
16
- var _react = require("react");
18
+ var _react = _interopRequireWildcard(require("react"));
17
19
 
18
20
  var _propTypes = _interopRequireDefault(require("prop-types"));
19
21
 
@@ -23,23 +25,11 @@ var _index = _interopRequireDefault(require("../shared/AfsTableWrapper/index.js"
23
25
 
24
26
  var _presenter = require("../shared/AfsPartsContainer/presenter.js");
25
27
 
26
- var _index2 = _interopRequireDefault(require("../shared/ChoiceGroupTypeTable/index.js"));
27
-
28
- var _uiText = require("@instructure/ui-text");
29
-
30
- var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
28
+ var _index2 = _interopRequireDefault(require("./ChoiceGroupTypeTable/index.js"));
31
29
 
32
30
  var _index3 = _interopRequireDefault(require("../shared/AggregationTable/index.js"));
33
31
 
34
- var _emotion = require("@instructure/emotion");
35
-
36
- var _styles = _interopRequireDefault(require("./styles.js"));
37
-
38
- var _theme = _interopRequireDefault(require("./theme.js"));
39
-
40
- var _dec, _class, _class2, _temp;
41
-
42
- var RichFillBlankType = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
32
+ var RichFillBlankType = /*#__PURE__*/function (_Component) {
43
33
  (0, _inherits2.default)(RichFillBlankType, _Component);
44
34
 
45
35
  var _super = (0, _createSuper2.default)(RichFillBlankType);
@@ -55,26 +45,11 @@ var RichFillBlankType = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.
55
45
 
56
46
  _this = _super.call.apply(_super, [this].concat(args));
57
47
 
58
- _this.renderBlankInfo = function (blank) {
59
- var _blank$aggregate, _blank$aggregate2;
60
-
61
- var correctCount = (blank === null || blank === void 0 ? void 0 : (_blank$aggregate = blank.aggregate) === null || _blank$aggregate === void 0 ? void 0 : _blank$aggregate.correct) || 0;
62
- var incorrectCount = (blank === null || blank === void 0 ? void 0 : (_blank$aggregate2 = blank.aggregate) === null || _blank$aggregate2 === void 0 ? void 0 : _blank$aggregate2.incorrect) || 0;
63
- var noAnswer = (blank === null || blank === void 0 ? void 0 : blank.no_answer) || 0;
64
- var correctString = "".concat((0, _formatMessage.default)('Correct'), ": ").concat(correctCount, " ");
65
- var incorrectString = "".concat((0, _formatMessage.default)('Incorrect'), ": ").concat(incorrectCount, " ");
66
- var noAnswerString = "".concat((0, _formatMessage.default)('No Answer'), ": ").concat(noAnswer, " ");
67
- return (0, _emotion.jsx)("div", {
68
- css: _this.props.styles.groupAggregationContainer
69
- }, (0, _emotion.jsx)(_uiText.Text, null, correctString), (0, _emotion.jsx)(_uiText.Text, null, incorrectString), (0, _emotion.jsx)(_uiText.Text, null, noAnswerString));
70
- };
71
-
72
48
  _this.renderGroup = function (key, itemId, blank, index) {
73
- return (0, _emotion.jsx)(_index2.default, {
49
+ return /*#__PURE__*/_react.default.createElement(_index2.default, {
74
50
  key: key,
75
51
  itemId: itemId,
76
52
  blank: blank,
77
- blankInfo: _this.renderBlankInfo(blank),
78
53
  index: index
79
54
  });
80
55
  };
@@ -85,7 +60,7 @@ var RichFillBlankType = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.
85
60
  itemId = _this$props.itemId;
86
61
  var blanks = answerSummary.blanks;
87
62
  return blanks.map(function (blank, index) {
88
- var key = "ChoiceGroupTypeTable_".concat(index);
63
+ var key = "ChoiceGroupTypeTable_".concat(itemId, "_").concat(index);
89
64
  return _this.renderGroup(key, itemId, blank, index);
90
65
  });
91
66
  };
@@ -94,9 +69,9 @@ var RichFillBlankType = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.
94
69
  var _this$props2 = _this.props,
95
70
  answerSummary = _this$props2.answerSummary,
96
71
  itemId = _this$props2.itemId;
97
- return (0, _emotion.jsx)(_index.default, null, (0, _emotion.jsx)(_presenter.AfsPartsContainer, {
72
+ return /*#__PURE__*/_react.default.createElement(_index.default, null, /*#__PURE__*/_react.default.createElement(_presenter.AfsPartsContainer, {
98
73
  afsTable: _this.renderGroups(),
99
- aggregationTable: (0, _emotion.jsx)(_index3.default, {
74
+ aggregationTable: /*#__PURE__*/_react.default.createElement(_index3.default, {
100
75
  itemId: itemId,
101
76
  answerSummary: answerSummary
102
77
  })
@@ -107,9 +82,10 @@ var RichFillBlankType = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.
107
82
  }
108
83
 
109
84
  return RichFillBlankType;
110
- }(_react.Component), _class2.propTypes = {
85
+ }(_react.Component);
86
+
87
+ exports.RichFillBlankType = RichFillBlankType;
88
+ RichFillBlankType.propTypes = {
111
89
  itemId: _propTypes.default.number.isRequired,
112
- answerSummary: _propTypes2.richFillBlankTypeAnswerSummaryPropType.isRequired,
113
- styles: _propTypes.default.object
114
- }.isRequired, _temp)) || _class);
115
- exports.RichFillBlankType = RichFillBlankType;
90
+ answerSummary: _propTypes2.richFillBlankTypeAnswerSummaryPropType.isRequired
91
+ }.isRequired;
@@ -0,0 +1,140 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = exports.ScoreDistributionTypeTable = void 0;
9
+
10
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
+
12
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
+
14
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
15
+
16
+ var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
17
+
18
+ var _propTypes = require("../../../propTypes.js");
19
+
20
+ var _react = require("react");
21
+
22
+ var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
23
+
24
+ var _uiTable = require("@instructure/ui-table");
25
+
26
+ var _propTypes2 = _interopRequireDefault(require("prop-types"));
27
+
28
+ var _emotion = require("@instructure/emotion");
29
+
30
+ var _styles = _interopRequireDefault(require("./styles.js"));
31
+
32
+ var _theme = _interopRequireDefault(require("./theme.js"));
33
+
34
+ var _dec, _class, _class2, _temp;
35
+
36
+ var ScoreDistributionTypeTable = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
37
+ (0, _inherits2.default)(ScoreDistributionTypeTable, _Component);
38
+
39
+ var _super = (0, _createSuper2.default)(ScoreDistributionTypeTable);
40
+
41
+ function ScoreDistributionTypeTable() {
42
+ var _this;
43
+
44
+ (0, _classCallCheck2.default)(this, ScoreDistributionTypeTable);
45
+
46
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
47
+ args[_key] = arguments[_key];
48
+ }
49
+
50
+ _this = _super.call.apply(_super, [this].concat(args));
51
+
52
+ _this.renderFirstCell = function (content) {
53
+ return (0, _emotion.jsx)("div", {
54
+ css: _this.props.styles.firstTextContainer
55
+ }, content);
56
+ };
57
+
58
+ _this.renderCell = function (content) {
59
+ return (0, _emotion.jsx)("div", {
60
+ css: _this.props.styles.textContainer
61
+ }, content);
62
+ };
63
+
64
+ _this.renderRow = function (choice, choiceIndex) {
65
+ var count = choice.count,
66
+ score = choice.score,
67
+ percentage = choice.percentage;
68
+ return (0, _emotion.jsx)(_uiTable.Table.Row, {
69
+ key: choiceIndex
70
+ }, (0, _emotion.jsx)(_uiTable.Table.Cell, {
71
+ themeOverride: {
72
+ padding: '0'
73
+ }
74
+ }, _this.renderFirstCell(score)), (0, _emotion.jsx)(_uiTable.Table.Cell, {
75
+ themeOverride: {
76
+ padding: '0'
77
+ }
78
+ }, _this.renderCell(count)), (0, _emotion.jsx)(_uiTable.Table.Cell, {
79
+ themeOverride: {
80
+ padding: '0'
81
+ },
82
+ textAlign: "center"
83
+ }, _this.renderCell("".concat(percentage, "%"))));
84
+ };
85
+
86
+ return _this;
87
+ }
88
+
89
+ (0, _createClass2.default)(ScoreDistributionTypeTable, [{
90
+ key: "componentDidMount",
91
+ value: function componentDidMount() {
92
+ this.props.makeStyles();
93
+ }
94
+ }, {
95
+ key: "componentDidUpdate",
96
+ value: function componentDidUpdate() {
97
+ this.props.makeStyles();
98
+ }
99
+ }, {
100
+ key: "render",
101
+ value: function render() {
102
+ var _this$props = this.props,
103
+ scores = _this$props.scores,
104
+ itemId = _this$props.itemId,
105
+ styles = _this$props.styles;
106
+ var pointsHeaderId = "answer-frequency-summary-points-".concat(itemId);
107
+ var respondentsHeaderId = "answer-frequency-summary-respondents-".concat(itemId);
108
+ var percentageHeaderId = "answer-frequency-summary-percentage-".concat(itemId);
109
+ return (0, _emotion.jsx)("div", {
110
+ css: styles.tableContainer
111
+ }, (0, _emotion.jsx)(_uiTable.Table, {
112
+ caption: (0, _formatMessage.default)('Score Frequency Summary'),
113
+ elementRef: this.setTableRef
114
+ }, (0, _emotion.jsx)(_uiTable.Table.Head, null, (0, _emotion.jsx)(_uiTable.Table.Row, null, (0, _emotion.jsx)(_uiTable.Table.ColHeader, {
115
+ id: pointsHeaderId,
116
+ height: "47px"
117
+ }, (0, _formatMessage.default)('Points')), (0, _emotion.jsx)(_uiTable.Table.ColHeader, {
118
+ id: respondentsHeaderId,
119
+ height: "47px",
120
+ textAlign: "center"
121
+ }, (0, _formatMessage.default)('Respondents')), (0, _emotion.jsx)(_uiTable.Table.ColHeader, {
122
+ id: percentageHeaderId,
123
+ height: "47px",
124
+ textAlign: "center"
125
+ }, (0, _formatMessage.default)('%')))), (0, _emotion.jsx)(_uiTable.Table.Body, null, scores.map(this.renderRow))));
126
+ }
127
+ }]);
128
+ ScoreDistributionTypeTable.displayName = "ScoreDistributionTypeTable";
129
+ return ScoreDistributionTypeTable;
130
+ }(_react.Component), _class2.propTypes = {
131
+ itemId: _propTypes2.default.number.isRequired,
132
+ scores: _propTypes2.default.arrayOf(_propTypes.scoreDistributionType).isRequired,
133
+ // eslint-disable-next-line react/require-default-props
134
+ makeStyles: _propTypes2.default.func,
135
+ // eslint-disable-next-line react/require-default-props,react/forbid-prop-types
136
+ styles: _propTypes2.default.object
137
+ }, _temp)) || _class);
138
+ exports.ScoreDistributionTypeTable = ScoreDistributionTypeTable;
139
+ var _default = ScoreDistributionTypeTable;
140
+ exports.default = _default;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var generateStyle = function generateStyle(componentTheme) {
9
+ var borderBottom = "solid 0.0625rem ".concat(componentTheme.colorGray);
10
+ return {
11
+ tableContainer: {
12
+ width: 'calc(25% + 350px)',
13
+ maxWidth: '100%',
14
+ '& table': {
15
+ borderCollapse: 'separate',
16
+ borderSpacing: '0 1px',
17
+ '& thead tr': {
18
+ '& th, & td': {
19
+ borderBottom: borderBottom
20
+ }
21
+ },
22
+ '& tbody tr': {
23
+ '& th, & td': {
24
+ width: '33.33%',
25
+ borderBottom: borderBottom
26
+ },
27
+ '& th': {
28
+ fontWeight: 400
29
+ }
30
+ }
31
+ }
32
+ },
33
+ textContainer: {
34
+ height: 'calc(100% - 4px)',
35
+ display: 'flex',
36
+ alignItems: 'center',
37
+ justifyContent: 'center'
38
+ },
39
+ firstTextContainer: {
40
+ padding: componentTheme.cellPadding
41
+ }
42
+ };
43
+ };
44
+
45
+ var _default = generateStyle;
46
+ exports.default = _default;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var generateComponentTheme = function generateComponentTheme(_ref) {
9
+ var spacing = _ref.spacing,
10
+ colors = _ref.colors;
11
+ return {
12
+ tableBottomPadding: spacing === null || spacing === void 0 ? void 0 : spacing.medium,
13
+ colorGray: colors === null || colors === void 0 ? void 0 : colors.tiara,
14
+ cellPadding: "".concat(spacing === null || spacing === void 0 ? void 0 : spacing.small, " ").concat(spacing === null || spacing === void 0 ? void 0 : spacing.small)
15
+ };
16
+ };
17
+
18
+ var _default = generateComponentTheme;
19
+ exports.default = _default;
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
4
+
5
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports.default = exports.ScoreDistributionType = void 0;
11
+
12
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
+
14
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
15
+
16
+ var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
17
+
18
+ var _react = _interopRequireWildcard(require("react"));
19
+
20
+ var _propTypes = _interopRequireDefault(require("prop-types"));
21
+
22
+ var _index = _interopRequireDefault(require("./Table/index.js"));
23
+
24
+ var _propTypes2 = require("../../propTypes.js");
25
+
26
+ var _index2 = _interopRequireDefault(require("../shared/AggregationTable/index.js"));
27
+
28
+ var _presenter = require("../shared/AfsPartsContainer/presenter.js");
29
+
30
+ var _index3 = _interopRequireDefault(require("../shared/AfsTableWrapper/index.js"));
31
+
32
+ var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
33
+
34
+ var ScoreDistributionType = /*#__PURE__*/function (_Component) {
35
+ (0, _inherits2.default)(ScoreDistributionType, _Component);
36
+
37
+ var _super = (0, _createSuper2.default)(ScoreDistributionType);
38
+
39
+ function ScoreDistributionType() {
40
+ var _this;
41
+
42
+ (0, _classCallCheck2.default)(this, ScoreDistributionType);
43
+
44
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
45
+ args[_key] = arguments[_key];
46
+ }
47
+
48
+ _this = _super.call.apply(_super, [this].concat(args));
49
+
50
+ _this.render = function () {
51
+ var _this$props = _this.props,
52
+ answerSummary = _this$props.answerSummary,
53
+ itemId = _this$props.itemId;
54
+ return /*#__PURE__*/_react.default.createElement(_index3.default, {
55
+ tableHeader: (0, _formatMessage.default)('Score Frequency Summary')
56
+ }, /*#__PURE__*/_react.default.createElement(_presenter.AfsPartsContainer, {
57
+ afsTable: /*#__PURE__*/_react.default.createElement(_index.default, {
58
+ itemId: itemId,
59
+ scores: answerSummary.score_distribution
60
+ }),
61
+ aggregationTable: /*#__PURE__*/_react.default.createElement(_index2.default, {
62
+ itemId: itemId,
63
+ answerSummary: answerSummary
64
+ })
65
+ }));
66
+ };
67
+
68
+ return _this;
69
+ }
70
+
71
+ return ScoreDistributionType;
72
+ }(_react.Component);
73
+
74
+ exports.ScoreDistributionType = ScoreDistributionType;
75
+ ScoreDistributionType.propTypes = {
76
+ itemId: _propTypes.default.number,
77
+ answerSummary: _propTypes2.scoreDistributionTypeAnswerSummaryPropType
78
+ }.isRequired;
79
+ var _default = ScoreDistributionType;
80
+ exports.default = _default;
@@ -27,7 +27,11 @@ var _index3 = _interopRequireDefault(require("./RichFillBlankType/index.js"));
27
27
 
28
28
  var _index4 = _interopRequireDefault(require("./AggregationType/index.js"));
29
29
 
30
- var _index5 = require("./MatchingType/index.js");
30
+ var _index5 = _interopRequireDefault(require("./NumericType/index.js"));
31
+
32
+ var _index6 = require("./MatchingType/index.js");
33
+
34
+ var _index7 = require("./ScoreDistributionType/index.js");
31
35
 
32
36
  var _propTypes = require("../propTypes.js");
33
37
 
@@ -58,15 +62,15 @@ var AnswerFrequencySummary = /*#__PURE__*/function (_Component) {
58
62
  }
59
63
 
60
64
  if (afsFlags.matchingEnabled) {
61
- _this.afsTableComponentMap.set('matching', _index5.MatchingType);
65
+ _this.afsTableComponentMap.set('matching', _index6.MatchingType);
62
66
  }
63
67
 
64
68
  if (afsFlags.orderingEnabled) {
65
- _this.afsTableComponentMap.set('ordering', _index5.OrderingType);
69
+ _this.afsTableComponentMap.set('ordering', _index6.OrderingType);
66
70
  }
67
71
 
68
72
  if (afsFlags.categorizationEnabled) {
69
- _this.afsTableComponentMap.set('categorization', _index5.CategorizationType);
73
+ _this.afsTableComponentMap.set('categorization', _index6.CategorizationType);
70
74
  }
71
75
 
72
76
  if (afsFlags.trueFalseEnabled) {
@@ -84,6 +88,18 @@ var AnswerFrequencySummary = /*#__PURE__*/function (_Component) {
84
88
  if (afsFlags.fillInTheBlankEnabled) {
85
89
  _this.afsTableComponentMap.set('rich-fill-blank', _index3.default);
86
90
  }
91
+
92
+ if (afsFlags.numericEnabled) {
93
+ _this.afsTableComponentMap.set('numeric', _index5.default);
94
+ }
95
+
96
+ if (afsFlags.essayEnabled) {
97
+ _this.afsTableComponentMap.set('essay', _index7.ScoreDistributionType);
98
+ }
99
+
100
+ if (afsFlags.fileUploadEnabled) {
101
+ _this.afsTableComponentMap.set('file-upload', _index7.ScoreDistributionType);
102
+ }
87
103
  };
88
104
 
89
105
  _this.render = function () {
@@ -45,6 +45,11 @@ var AfsTableWrapper = (_dec = (0, _emotion.withStyle)(_styles.default, null), _d
45
45
 
46
46
  _this = _super.call.apply(_super, [this].concat(args));
47
47
 
48
+ _this.getHeader = function () {
49
+ var tableHeader = _this.props.tableHeader;
50
+ return tableHeader || (0, _formatMessage.default)('Answer Frequency Summary');
51
+ };
52
+
48
53
  _this.render = function () {
49
54
  return (0, _emotion.jsx)(_uiFlex.Flex, {
50
55
  direction: "row",
@@ -58,7 +63,7 @@ var AfsTableWrapper = (_dec = (0, _emotion.withStyle)(_styles.default, null), _d
58
63
  level: "h3",
59
64
  weight: "bold",
60
65
  color: "primary"
61
- }, (0, _formatMessage.default)('Answer Frequency Summary')), _this.props.children)));
66
+ }, _this.getHeader()), _this.props.children)));
62
67
  };
63
68
 
64
69
  return _this;
@@ -67,6 +72,7 @@ var AfsTableWrapper = (_dec = (0, _emotion.withStyle)(_styles.default, null), _d
67
72
  return AfsTableWrapper;
68
73
  }(_react.Component), _class2.propTypes = {
69
74
  children: _propTypes.default.node.isRequired,
70
- styles: _propTypes.default.object
75
+ styles: _propTypes.default.object,
76
+ tableHeader: _propTypes.default.string
71
77
  }, _temp)) || _class);
72
78
  exports.AfsTableWrapper = AfsTableWrapper;
@@ -44,33 +44,33 @@ var _popoverContent = require("./popoverContent.js");
44
44
  var _dec, _class, _class2, _temp;
45
45
 
46
46
  var styles = {
47
- componentId: 'fSsSV',
47
+ componentId: 'fMmrG',
48
48
  template: function template(theme) {
49
- return "\n\n.fSsSV_cvRx{align-items:center;display:flex;height:100%;justify-content:center;min-height:47px;width:46px}\n\n.fSsSV_fPIL{min-width:500px}\n\n.fSsSV_fPIL table{border-collapse:separate;border-spacing:0 12px}\n\n.fSsSV_fPIL thead th{border-color:".concat(theme.colorHeaderBottomBorder || 'inherit', ";border-style:solid;border-width:0 0 1px 0}\n\n.fSsSV_fPIL table tbody tr td{border-style:solid;border-width:2px 0 2px 0;width:33.33%}\n\n.fSsSV_fPIL table tbody tr th:first-child{border-radius:4px 0 0 4px;border-style:solid;border-width:2px 0 2px 2px;font-weight:400}\n\n.fSsSV_fPIL table tbody tr td:last-child{border-radius:0 4px 4px 0;border-style:solid;border-width:2px 2px 2px 0}\n\n.fSsSV_dzqP table tbody tr:first-child td,.fSsSV_dzqP table tbody tr:first-child th{border-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fSsSV_fZpZ table tbody tr:first-child td,.fSsSV_fZpZ table tbody tr:first-child th{border-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fSsSV_fZpZ table tbody tr:nth-child(2) td,.fSsSV_fZpZ table tbody tr:nth-child(2) th{border-color:").concat(theme.colorRed || 'inherit', "}\n\n.fSsSV_dgTJ table tbody tr:first-child td,.fSsSV_dgTJ table tbody tr:first-child th{border-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fSsSV_dgTJ table tbody tr:nth-child(2) td,.fSsSV_dgTJ table tbody tr:nth-child(2) th{border-color:").concat(theme.colorRed || 'inherit', "}\n\n.fSsSV_dgTJ table tbody tr:nth-child(3) td,.fSsSV_dgTJ table tbody tr:nth-child(3) th{border-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fSsSV_bUPM table tbody tr:first-child td,.fSsSV_bUPM table tbody tr:first-child th{border-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fSsSV_bUPM table tbody tr:nth-child(2) td,.fSsSV_bUPM table tbody tr:nth-child(2) th{border-color:").concat(theme.colorBlue || 'inherit', "}\n\n.fSsSV_bUPM table tbody tr:nth-child(3) td,.fSsSV_bUPM table tbody tr:nth-child(3) th{border-color:").concat(theme.colorRed || 'inherit', "}\n\n.fSsSV_bUPM table tbody tr:nth-child(4) td,.fSsSV_bUPM table tbody tr:nth-child(4) th{border-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fSsSV_bvau{background-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fSsSV_cxOH{background-color:").concat(theme.colorRed || 'inherit', "}\n\n.fSsSV_eRkO{background-color:").concat(theme.colorBlue || 'inherit', "}\n\n.fSsSV_eKcq{background-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fSsSV_euQM{padding:12px 0 12px 10px}\n\n.fSsSV_fuuc{padding-left:45px}\n\n.fSsSV_vDgC svg{fill:#fff}\n\n.fSsSV_fHMm{border-color:").concat(theme.colorHeaderBottomBorder || 'inherit', ";border-style:solid;border-width:0 0 1px 0}");
49
+ return "\n\n.fMmrG_cvRx{align-items:center;display:flex;height:100%;justify-content:center;min-height:47px;width:46px}\n\n.fMmrG_fPIL{min-width:500px}\n\n.fMmrG_fPIL table{border-collapse:separate;border-spacing:0 12px}\n\n.fMmrG_fPIL thead th{border-color:".concat(theme.colorHeaderBottomBorder || 'inherit', ";border-style:solid;border-width:0 0 1px 0}\n\n.fMmrG_fPIL table tbody tr td{border-style:solid;border-width:2px 0 2px 0;width:33.33%}\n\n.fMmrG_fPIL table tbody tr th:first-child{border-radius:4px 0 0 4px;border-style:solid;border-width:2px 0 2px 2px;font-weight:400}\n\n.fMmrG_fPIL table tbody tr td:last-child{border-radius:0 4px 4px 0;border-style:solid;border-width:2px 2px 2px 0}\n\n.fMmrG_dzqP table tbody tr:first-child td,.fMmrG_dzqP table tbody tr:first-child th{border-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fMmrG_fZpZ table tbody tr:first-child td,.fMmrG_fZpZ table tbody tr:first-child th{border-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fMmrG_fZpZ table tbody tr:nth-child(2) td,.fMmrG_fZpZ table tbody tr:nth-child(2) th{border-color:").concat(theme.colorRed || 'inherit', "}\n\n.fMmrG_dgTJ table tbody tr:first-child td,.fMmrG_dgTJ table tbody tr:first-child th{border-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fMmrG_dgTJ table tbody tr:nth-child(2) td,.fMmrG_dgTJ table tbody tr:nth-child(2) th{border-color:").concat(theme.colorRed || 'inherit', "}\n\n.fMmrG_dgTJ table tbody tr:nth-child(3) td,.fMmrG_dgTJ table tbody tr:nth-child(3) th{border-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fMmrG_bYLj table tbody tr:first-child td,.fMmrG_bYLj table tbody tr:first-child th{border-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fMmrG_bYLj table tbody tr:nth-child(2) td,.fMmrG_bYLj table tbody tr:nth-child(2) th{border-color:").concat(theme.colorBlue || 'inherit', "}\n\n.fMmrG_bYLj table tbody tr:nth-child(3) td,.fMmrG_bYLj table tbody tr:nth-child(3) th{border-color:").concat(theme.colorRed || 'inherit', "}\n\n.fMmrG_bYLj table tbody tr:nth-child(4) td,.fMmrG_bYLj table tbody tr:nth-child(4) th{border-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fMmrG_bvau{background-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fMmrG_cxOH{background-color:").concat(theme.colorRed || 'inherit', "}\n\n.fMmrG_dsqS{background-color:").concat(theme.colorBlue || 'inherit', "}\n\n.fMmrG_eKcq{background-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fMmrG_euQM{padding:12px 0 12px 10px}\n\n.fMmrG_fuuc{padding-left:45px}\n\n.fMmrG_vDgC svg{fill:#fff}\n\n.fMmrG_fHMm{border-color:").concat(theme.colorHeaderBottomBorder || 'inherit', ";border-style:solid;border-width:0 0 1px 0}");
50
50
  },
51
- 'iconWrapper': 'fSsSV_cvRx',
52
- 'collapsingTable': 'fSsSV_fPIL',
53
- 'onlyNoanswer': 'fSsSV_dzqP',
54
- 'correctIncorrect': 'fSsSV_fZpZ',
55
- 'correctIncorrectNoanswer': 'fSsSV_dgTJ',
56
- 'correctIncorrectNoanswerPartial': 'fSsSV_bUPM',
57
- 'correctBackground': 'fSsSV_bvau',
58
- 'incorrectBackground': 'fSsSV_cxOH',
59
- 'partialCorrectBackground': 'fSsSV_eRkO',
60
- 'noAnswerBackground': 'fSsSV_eKcq',
61
- 'labelWrapper': 'fSsSV_euQM',
62
- 'firstHeaderCell': 'fSsSV_fuuc',
63
- 'iconWhite': 'fSsSV_vDgC',
64
- 'headerCell': 'fSsSV_fHMm'
51
+ 'iconWrapper': 'fMmrG_cvRx',
52
+ 'collapsingTable': 'fMmrG_fPIL',
53
+ 'onlyNoanswer': 'fMmrG_dzqP',
54
+ 'correctIncorrect': 'fMmrG_fZpZ',
55
+ 'correctIncorrectNoanswer': 'fMmrG_dgTJ',
56
+ 'correctIncorrectNoanswerGraded': 'fMmrG_bYLj',
57
+ 'correctBackground': 'fMmrG_bvau',
58
+ 'incorrectBackground': 'fMmrG_cxOH',
59
+ 'gradedBackground': 'fMmrG_dsqS',
60
+ 'noAnswerBackground': 'fMmrG_eKcq',
61
+ 'labelWrapper': 'fMmrG_euQM',
62
+ 'firstHeaderCell': 'fMmrG_fuuc',
63
+ 'iconWhite': 'fMmrG_vDgC',
64
+ 'headerCell': 'fMmrG_fHMm'
65
65
  };
66
66
  var noAnswerKey = 'noAnswer';
67
67
  var incorrectKey = 'incorrect';
68
68
  var correctKey = 'correct';
69
- var partialCorrectKey = 'partialCorrect';
69
+ var gradedKey = 'graded';
70
70
 
71
71
  var _ref = /*#__PURE__*/_react.default.createElement(_uiIcons.IconCheckSolid, null);
72
72
 
73
- var _ref2 = /*#__PURE__*/_react.default.createElement(_uiIcons.IconOvalHalfSolid, null);
73
+ var _ref2 = /*#__PURE__*/_react.default.createElement(_uiIcons.IconGradebookSolid, null);
74
74
 
75
75
  var _ref3 = /*#__PURE__*/_react.default.createElement(_uiIcons.IconXSolid, null);
76
76
 
@@ -148,9 +148,9 @@ var AggregationTable = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
148
148
  }, /*#__PURE__*/_react.default.createElement(_uiText.Text, null, concatenatedPercentage)));
149
149
  };
150
150
 
151
- _this.partialCorrectExist = function () {
152
- var aggregate = _this.props.answerSummary.aggregate;
153
- return !!(aggregate === null || aggregate === void 0 ? void 0 : aggregate.partial_correct);
151
+ _this.gradedExist = function () {
152
+ var graded = _this.props.answerSummary.graded;
153
+ return !!graded;
154
154
  };
155
155
 
156
156
  _this.correctExist = function () {
@@ -168,24 +168,19 @@ var AggregationTable = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
168
168
  return !!no_answer;
169
169
  };
170
170
 
171
- _this.getCorrectLabel = function () {
172
- return _this.partialCorrectExist() ? (0, _formatMessage.default)('Fully correct') : (0, _formatMessage.default)('Correct');
173
- };
174
-
175
171
  _this.renderCorrect = function () {
176
172
  var aggregate = _this.props.answerSummary.aggregate;
177
173
  var correct = aggregate.correct;
178
174
  var correctCount = correct.count || 0;
179
175
  var correctPercentage = correct.percentage || 0;
180
- return _this.renderRow(correctKey, _ref, _this.getCorrectLabel(), correctCount, correctPercentage);
176
+ return _this.renderRow(correctKey, _ref, (0, _formatMessage.default)('Correct'), correctCount, correctPercentage);
181
177
  };
182
178
 
183
- _this.renderPartialCorrect = function () {
184
- var aggregate = _this.props.answerSummary.aggregate;
185
- var partial_correct = aggregate.partial_correct;
186
- var partialCorrectCount = partial_correct.count || 0;
187
- var partialCorrectPercentage = partial_correct.percentage || 0;
188
- return _this.renderRow(partialCorrectKey, _ref2, (0, _formatMessage.default)('Partially correct'), partialCorrectCount, partialCorrectPercentage);
179
+ _this.renderGraded = function () {
180
+ var graded = _this.props.answerSummary.graded;
181
+ var gradedCount = graded.count || 0;
182
+ var gradedPercentage = graded.percentage || 0;
183
+ return _this.renderRow(gradedKey, _ref2, (0, _formatMessage.default)('Graded'), gradedCount, gradedPercentage);
189
184
  };
190
185
 
191
186
  _this.renderIncorrect = function () {
@@ -206,16 +201,16 @@ var AggregationTable = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
206
201
  _this.getColorProfile = function () {
207
202
  var colorProfile;
208
203
 
209
- var correctIncorrectNoAnswerPartial = _this.partialCorrectExist() && _this.noAnswerExist() && _this.correctExist() && _this.incorrectExist();
204
+ var correctIncorrectNoAnswerGraded = _this.gradedExist() && _this.noAnswerExist() && _this.correctExist() && _this.incorrectExist();
210
205
 
211
- var correctIncorrectNoAnswer = !_this.partialCorrectExist() && _this.noAnswerExist() && _this.correctExist() && _this.incorrectExist();
206
+ var correctIncorrectNoAnswer = !_this.gradedExist() && _this.noAnswerExist() && _this.correctExist() && _this.incorrectExist();
212
207
 
213
- var onlyNoAnswer = _this.noAnswerExist() && !_this.partialCorrectExist() && !_this.correctExist() && !_this.incorrectExist();
208
+ var onlyNoAnswer = _this.noAnswerExist() && !_this.gradedExist() && !_this.correctExist() && !_this.incorrectExist();
214
209
 
215
210
  if (correctIncorrectNoAnswer) {
216
211
  colorProfile = 'correctIncorrectNoanswer';
217
- } else if (correctIncorrectNoAnswerPartial) {
218
- colorProfile = 'correctIncorrectNoanswerPartial';
212
+ } else if (correctIncorrectNoAnswerGraded) {
213
+ colorProfile = 'correctIncorrectNoanswerGraded';
219
214
  } else if (onlyNoAnswer) {
220
215
  colorProfile = 'onlyNoanswer';
221
216
  } else {
@@ -231,7 +226,7 @@ var AggregationTable = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
231
226
  className: (0, _classnames.default)(styles.collapsingTable, styles[_this.getColorProfile()])
232
227
  }, /*#__PURE__*/_react.default.createElement(_uiTable.Table, {
233
228
  caption: (0, _formatMessage.default)('Answer Frequency Summary Aggregates')
234
- }, _this.renderHeaderRow(popover), /*#__PURE__*/_react.default.createElement(_uiTable.Table.Body, null, _this.correctExist() && _this.renderCorrect(), _this.partialCorrectExist() && _this.renderPartialCorrect(), _this.incorrectExist() && _this.renderIncorrect(), _this.noAnswerExist() && _this.renderNoAnswer())));
229
+ }, _this.renderHeaderRow(popover), /*#__PURE__*/_react.default.createElement(_uiTable.Table.Body, null, _this.correctExist() && _this.renderCorrect(), _this.gradedExist() && _this.renderGraded(), _this.incorrectExist() && _this.renderIncorrect(), _this.noAnswerExist() && _this.renderNoAnswer())));
235
230
  };
236
231
 
237
232
  return _this;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "default", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _presenter.ExpandableCard;
10
+ }
11
+ });
12
+
13
+ var _presenter = require("./presenter.js");