@instructure/quiz-core 18.6.1-rc.2 → 18.6.1-rc.4

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.
@@ -1,10 +1,10 @@
1
- import Fetcher from "../util/Fetcher.js";
1
+ import ExhaustivePaginatedFetcher from "../util/ExhaustivePaginatedFetcher.js";
2
2
  import { addFeatures } from "../actions/features.js";
3
3
  import { loadedApiFeatures } from "../actions/ui.js";
4
4
  export var getFeatures = function getFeatures() {
5
5
  var url = '/api/features';
6
6
  return function (dispatch, getState) {
7
- var fetcher = new Fetcher();
7
+ var fetcher = new ExhaustivePaginatedFetcher();
8
8
 
9
9
  var addFeaturesToStore = function addFeaturesToStore(featuresList) {
10
10
  dispatch(addFeatures(featuresList));
@@ -87,23 +87,19 @@ export var ChoiceTypeTableRow = (_dec = themeable(theme, styles), _dec(_class =
87
87
  key: _this.props.choiceIndex
88
88
  }, /*#__PURE__*/React.createElement(Table.Cell, {
89
89
  theme: {
90
- padding: '0px',
91
- fontWeight: 'bold'
90
+ padding: '0px'
92
91
  }
93
92
  }, /*#__PURE__*/React.createElement(ScreenReaderContent, null, _this.answerLabel(correct)), _this.renderIcon(correct)), /*#__PURE__*/React.createElement(Table.RowHeader, {
94
93
  theme: {
95
- padding: cellPadding,
96
- fontWeight: 'bold'
94
+ padding: cellPadding
97
95
  }
98
96
  }, _this.renderMiddleCell(correct, _this.extractChoiceText(choiceBody, correct))), /*#__PURE__*/React.createElement(Table.Cell, {
99
97
  theme: {
100
- padding: cellPadding,
101
- fontWeight: 'bold'
98
+ padding: cellPadding
102
99
  }
103
100
  }, _this.renderMiddleCell(correct, _this.props.choice.count)), /*#__PURE__*/React.createElement(Table.Cell, {
104
101
  theme: {
105
- padding: cellPadding,
106
- fontWeight: 'bold'
102
+ padding: cellPadding
107
103
  },
108
104
  textAlign: "center"
109
105
  }, _this.renderLastCell(correct, "".concat(_this.props.choice.percentage, "%"))));
@@ -14,12 +14,12 @@ import PropTypes from 'prop-types';
14
14
  import ChoiceTypeTableRow from "./ChoiceTypeTableRow/index.js";
15
15
  import { choiceTypeAnswerSummaryPropType } from "../../propTypes.js";
16
16
  var styles = {
17
- componentId: 'dCEWT',
17
+ componentId: 'fxQkB',
18
18
  template: function template(theme) {
19
- return "\n\n.dCEWT_rMrG{display:flex;flex-basis:100%;flex-direction:column;padding-bottom:".concat(theme.tableBottomPadding || 'inherit', "}\n\n.dCEWT_SVtU{max-width:100%;width:calc(25% + 350px)}");
19
+ return "\n\n.fxQkB_rMrG{display:flex;flex-basis:100%;flex-direction:column;padding-bottom:".concat(theme.tableBottomPadding || 'inherit', "}\n\n.fxQkB_SVtU{max-width:100%;width:calc(25% + 350px)}\n\n.fxQkB_SVtU table tbody tr th{font-weight:400}");
20
20
  },
21
- 'tableWrapper': 'dCEWT_rMrG',
22
- 'tableContainer': 'dCEWT_SVtU'
21
+ 'tableWrapper': 'fxQkB_rMrG',
22
+ 'tableContainer': 'fxQkB_SVtU'
23
23
  };
24
24
  import theme from "./theme.js";
25
25
  import AfsTableWrapper from "../shared/AfsTableWrapper/index.js";
@@ -8,16 +8,17 @@ var _dec, _class, _class2, _temp;
8
8
  import React, { Component } from 'react';
9
9
  import { Flex } from '@instructure/ui-flex';
10
10
  var styles = {
11
- componentId: 'bAOvu',
11
+ componentId: 'bdaoA',
12
12
  template: function template(theme) {
13
- return "\n\n.bAOvu_rMrG{display:flex;flex-basis:100%;flex-direction:column;padding-bottom:".concat(theme.tableBottomPadding || 'inherit', "}\n\n.bAOvu_cvRx{align-items:center;display:flex;height:48px;justify-content:center;width:46px}\n\n.bAOvu_EKAb{background-color:").concat(theme.colorGreen || 'inherit', "}\n\n.bAOvu_EKAb svg{fill:#fff}\n\n.bAOvu_tnta{border-color:").concat(theme.colorGreen || 'inherit', ";border-style:solid;border-width:2px 0}\n\n.bAOvu_fvqY{border-radius:4px 4px 4px 4px;border-width:2px 2px 2px 2px}\n\n.bAOvu_SVtU{max-width:100%;width:calc(25% + 350px)}");
13
+ return "\n\n.bdaoA_rMrG{display:flex;flex-basis:100%;flex-direction:column;padding-bottom:".concat(theme.tableBottomPadding || 'inherit', "}\n\n.bdaoA_cvRx{align-items:center;display:flex;height:48px;justify-content:center;width:46px}\n\n.bdaoA_EKAb{background-color:").concat(theme.colorGreen || 'inherit', "}\n\n.bdaoA_EKAb svg{fill:#fff}\n\n.bdaoA_tnta{border-color:").concat(theme.colorGreen || 'inherit', ";border-style:solid;border-width:2px 0}\n\n.bdaoA_fvqY{border-radius:4px 4px 4px 4px;border-width:2px 2px 2px 2px}\n\n.bdaoA_bwoZ{max-width:100%;width:calc(25% + 350px)}\n\n.bdaoA_SVtU table tbody tr th{font-weight:400}");
14
14
  },
15
- 'tableWrapper': 'bAOvu_rMrG',
16
- 'iconWrapper': 'bAOvu_cvRx',
17
- 'iconCorrect': 'bAOvu_EKAb',
18
- 'correctRowBorder': 'bAOvu_tnta',
19
- 'correctRowBorderRadius': 'bAOvu_fvqY',
20
- 'tableContainer': 'bAOvu_SVtU'
15
+ 'tableWrapper': 'bdaoA_rMrG',
16
+ 'iconWrapper': 'bdaoA_cvRx',
17
+ 'iconCorrect': 'bdaoA_EKAb',
18
+ 'correctRowBorder': 'bdaoA_tnta',
19
+ 'correctRowBorderRadius': 'bdaoA_fvqY',
20
+ 'tableHalfWidth': 'bdaoA_bwoZ',
21
+ 'tableContainer': 'bdaoA_SVtU'
21
22
  };
22
23
  import t from '@instructure/quiz-i18n/es/format-message';
23
24
  import { Table } from '@instructure/ui-table';
@@ -152,7 +153,7 @@ export var MatchingTypeTable = (_dec = themeable(theme, styles), _dec(_class = (
152
153
  var questionBody = extractedQuestionBody.trim().length > 0 ? extractedQuestionBody : question.body;
153
154
  return /*#__PURE__*/React.createElement(Table.Row, {
154
155
  key: rowKey
155
- }, /*#__PURE__*/React.createElement(Table.Cell, {
156
+ }, /*#__PURE__*/React.createElement(Table.RowHeader, {
156
157
  id: questionRowHeaderId,
157
158
  key: questionRowHeaderId,
158
159
  theme: {
@@ -171,7 +172,7 @@ export var MatchingTypeTable = (_dec = themeable(theme, styles), _dec(_class = (
171
172
  var orderedAnswerKeys = MatchingTypeOrderer.orderAnswerKeysForDiagonal(answerSummary, answerKeys);
172
173
  var orderedQuestionKeys = MatchingTypeOrderer.orderQuestionKeysForDiagonal(answerSummary, questionKeys, orderedAnswerKeys);
173
174
  return /*#__PURE__*/React.createElement("div", {
174
- className: classNames(_defineProperty({}, styles.tableContainer, tableHalfWidth))
175
+ className: classNames(styles.tableContainer, _defineProperty({}, styles.tableHalfWidth, tableHalfWidth))
175
176
  }, /*#__PURE__*/React.createElement(Table, {
176
177
  caption: t('Answer Frequency Summary')
177
178
  }, /*#__PURE__*/React.createElement(Table.Head, null, _this.renderHeaderRow(orderedAnswerKeys)), /*#__PURE__*/React.createElement(Table.Body, null, orderedQuestionKeys.map(function (orderedQuestionKey) {
@@ -14,27 +14,23 @@ import { IconCheckSolid, IconXSolid, IconNoSolid, IconOvalHalfSolid } from '@ins
14
14
  import { themeable } from '@instructure/ui-themeable';
15
15
  import theme from "./theme.js";
16
16
  var styles = {
17
- componentId: 'fuOpc',
17
+ componentId: 'fXtvV',
18
18
  template: function template(theme) {
19
- return "\n\n.fuOpc_cvRx{align-items:center;display:flex;height:48px;justify-content:center;width:46px}\n\n.fuOpc_fPIL table{border-collapse:separate;border-spacing:0 12px}\n\n.fuOpc_fPIL thead th{border-color:".concat(theme.colorHeaderBottomBorder || 'inherit', ";border-style:solid;border-width:0 0 1px 0}\n\n.fuOpc_euQM{padding-left:10px}\n\n.fuOpc_fuuc{padding-left:45px}\n\n.fuOpc_bTFA{border-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fuOpc_bvau{background-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fuOpc_dmcW{border-color:").concat(theme.colorRed || 'inherit', "}\n\n.fuOpc_cxOH{background-color:").concat(theme.colorRed || 'inherit', "}\n\n.fuOpc_xOeH{border-color:").concat(theme.colorBlue || 'inherit', "}\n\n.fuOpc_eRkO{background-color:").concat(theme.colorBlue || 'inherit', "}\n\n.fuOpc_dlLI{border-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fuOpc_eKcq{background-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fuOpc_vDgC svg{fill:#fff}\n\n.fuOpc_fHMm{border-color:").concat(theme.colorHeaderBottomBorder || 'inherit', ";border-style:solid;border-width:0 0 1px 0}\n\n.fuOpc_WspM{border-radius:4px 0 0 4px;border-style:solid;border-width:2px 0 2px 2px}\n\n.fuOpc_fAnT{border-width:2px 0 2px 0}\n\n.fuOpc_bMPk,.fuOpc_fAnT{border-style:solid;padding:").concat(theme.cellPadding || 'inherit', "}\n\n.fuOpc_bMPk{border-radius:0 4px 4px 0;border-width:2px 2px 2px 0}");
19
+ return "\n\n.fXtvV_cvRx{align-items:center;display:flex;height:100%;justify-content:center;min-height:47px;width:46px}\n\n.fXtvV_fPIL{min-width:500px}\n\n.fXtvV_fPIL table{border-collapse:separate;border-spacing:0 12px}\n\n.fXtvV_fPIL thead th{border-color:".concat(theme.colorHeaderBottomBorder || 'inherit', ";border-style:solid;border-width:0 0 1px 0}\n\n.fXtvV_fPIL table tbody tr td{border-style:solid;border-width:2px 0 2px 0;width:33.33%}\n\n.fXtvV_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.fXtvV_fPIL table tbody tr td:last-child{border-radius:0 4px 4px 0;border-style:solid;border-width:2px 2px 2px 0}\n\n.fXtvV_fZpZ table tbody tr:first-child td,.fXtvV_fZpZ table tbody tr:first-child th{border-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fXtvV_fZpZ table tbody tr:nth-child(2) td,.fXtvV_fZpZ table tbody tr:nth-child(2) th{border-color:").concat(theme.colorRed || 'inherit', "}\n\n.fXtvV_dgTJ table tbody tr:first-child td,.fXtvV_dgTJ table tbody tr:first-child th{border-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fXtvV_dgTJ table tbody tr:nth-child(2) td,.fXtvV_dgTJ table tbody tr:nth-child(2) th{border-color:").concat(theme.colorRed || 'inherit', "}\n\n.fXtvV_dgTJ table tbody tr:nth-child(3) td,.fXtvV_dgTJ table tbody tr:nth-child(3) th{border-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fXtvV_bUPM table tbody tr:first-child td,.fXtvV_bUPM table tbody tr:first-child th{border-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fXtvV_bUPM table tbody tr:nth-child(2) td,.fXtvV_bUPM table tbody tr:nth-child(2) th{border-color:").concat(theme.colorBlue || 'inherit', "}\n\n.fXtvV_bUPM table tbody tr:nth-child(3) td,.fXtvV_bUPM table tbody tr:nth-child(3) th{border-color:").concat(theme.colorRed || 'inherit', "}\n\n.fXtvV_bUPM table tbody tr:nth-child(4) td,.fXtvV_bUPM table tbody tr:nth-child(4) th{border-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fXtvV_bvau{background-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fXtvV_cxOH{background-color:").concat(theme.colorRed || 'inherit', "}\n\n.fXtvV_eRkO{background-color:").concat(theme.colorBlue || 'inherit', "}\n\n.fXtvV_eKcq{background-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fXtvV_euQM{padding-left:10px}\n\n.fXtvV_fuuc{padding-left:45px}\n\n.fXtvV_vDgC svg{fill:#fff}\n\n.fXtvV_fHMm{border-color:").concat(theme.colorHeaderBottomBorder || 'inherit', ";border-style:solid;border-width:0 0 1px 0}");
20
20
  },
21
- 'iconWrapper': 'fuOpc_cvRx',
22
- 'collapsingTable': 'fuOpc_fPIL',
23
- 'labelWrapper': 'fuOpc_euQM',
24
- 'firstHeaderCell': 'fuOpc_fuuc',
25
- 'correctBorder': 'fuOpc_bTFA',
26
- 'correctBackground': 'fuOpc_bvau',
27
- 'incorrectBorder': 'fuOpc_dmcW',
28
- 'incorrectBackground': 'fuOpc_cxOH',
29
- 'partialCorrectBorder': 'fuOpc_xOeH',
30
- 'partialCorrectBackground': 'fuOpc_eRkO',
31
- 'noAnswerBorder': 'fuOpc_dlLI',
32
- 'noAnswerBackground': 'fuOpc_eKcq',
33
- 'iconWhite': 'fuOpc_vDgC',
34
- 'headerCell': 'fuOpc_fHMm',
35
- 'firstCell': 'fuOpc_WspM',
36
- 'middleCell': 'fuOpc_fAnT',
37
- 'lastCell': 'fuOpc_bMPk'
21
+ 'iconWrapper': 'fXtvV_cvRx',
22
+ 'collapsingTable': 'fXtvV_fPIL',
23
+ 'correctIncorrect': 'fXtvV_fZpZ',
24
+ 'correctIncorrectNoanswer': 'fXtvV_dgTJ',
25
+ 'correctIncorrectNoanswerPartial': 'fXtvV_bUPM',
26
+ 'correctBackground': 'fXtvV_bvau',
27
+ 'incorrectBackground': 'fXtvV_cxOH',
28
+ 'partialCorrectBackground': 'fXtvV_eRkO',
29
+ 'noAnswerBackground': 'fXtvV_eKcq',
30
+ 'labelWrapper': 'fXtvV_euQM',
31
+ 'firstHeaderCell': 'fXtvV_fuuc',
32
+ 'iconWhite': 'fXtvV_vDgC',
33
+ 'headerCell': 'fXtvV_fHMm'
38
34
  };
39
35
  import { Flex } from '@instructure/ui-flex';
40
36
  import classNames from 'classnames';
@@ -43,7 +39,6 @@ var noAnswerKey = 'noAnswer';
43
39
  var incorrectKey = 'incorrect';
44
40
  var correctKey = 'correct';
45
41
  var partialCorrectKey = 'partialCorrect';
46
- var tableLayout = 'fixed';
47
42
 
48
43
  var _ref = /*#__PURE__*/React.createElement(IconCheckSolid, null);
49
44
 
@@ -88,45 +83,38 @@ export var AggregationTable = (_dec = themeable(theme, styles), _dec(_class = (_
88
83
  };
89
84
 
90
85
  _this.renderRow = function (key, icon, label, count, percentage) {
91
- var borderColor = styles["".concat(key, "Border")];
92
86
  var backgroundColor = styles["".concat(key, "Background")];
93
87
  var concatenatedPercentage = "".concat(percentage, "%");
94
88
  return /*#__PURE__*/React.createElement(Table.Row, {
95
89
  key: key
96
- }, /*#__PURE__*/React.createElement(Table.Cell, {
90
+ }, /*#__PURE__*/React.createElement(Table.RowHeader, {
97
91
  theme: {
98
92
  padding: '0px'
99
93
  }
100
- }, /*#__PURE__*/React.createElement("div", {
101
- className: classNames(styles.firstCell, borderColor)
102
94
  }, /*#__PURE__*/React.createElement(ScreenReaderContent, null, label), /*#__PURE__*/React.createElement(Flex, {
103
95
  direction: "row",
104
- alignItems: "center",
105
- height: "47px"
96
+ alignItems: "center"
106
97
  }, /*#__PURE__*/React.createElement(Flex.Item, {
107
98
  width: "46px",
108
- textAlign: "center"
99
+ textAlign: "center",
100
+ align: "stretch"
109
101
  }, /*#__PURE__*/React.createElement("div", {
110
102
  className: classNames(styles.iconWrapper, styles.iconWhite, backgroundColor)
111
103
  }, icon)), /*#__PURE__*/React.createElement(Flex.Item, {
112
- textAlign: "center"
104
+ shouldShrink: true
113
105
  }, /*#__PURE__*/React.createElement("div", {
114
106
  className: classNames(styles.labelWrapper)
115
- }, /*#__PURE__*/React.createElement(Text, null, label)))))), /*#__PURE__*/React.createElement(Table.Cell, {
107
+ }, /*#__PURE__*/React.createElement(Text, null, label))))), /*#__PURE__*/React.createElement(Table.Cell, {
116
108
  theme: {
117
109
  padding: '0px'
118
110
  },
119
111
  textAlign: "center"
120
- }, /*#__PURE__*/React.createElement("div", {
121
- className: classNames(styles.middleCell, borderColor)
122
- }, /*#__PURE__*/React.createElement(Text, null, count))), /*#__PURE__*/React.createElement(Table.Cell, {
112
+ }, /*#__PURE__*/React.createElement(Text, null, count)), /*#__PURE__*/React.createElement(Table.Cell, {
123
113
  theme: {
124
114
  padding: '0px'
125
115
  },
126
116
  textAlign: "center"
127
- }, /*#__PURE__*/React.createElement("div", {
128
- className: classNames(styles.lastCell, borderColor)
129
- }, /*#__PURE__*/React.createElement(Text, null, concatenatedPercentage))));
117
+ }, /*#__PURE__*/React.createElement(Text, null, concatenatedPercentage)));
130
118
  };
131
119
 
132
120
  _this.isPartialCorrectExist = function () {
@@ -174,12 +162,25 @@ export var AggregationTable = (_dec = themeable(theme, styles), _dec(_class = (_
174
162
  return _this.renderRow(noAnswerKey, _ref4, noAnswerLabel, noAnswerCount, noAnswerPercentage);
175
163
  };
176
164
 
165
+ _this.getColorProfile = function () {
166
+ var colorProfile;
167
+
168
+ if (!_this.isPartialCorrectExist() && _this.isNoAnswerExist()) {
169
+ colorProfile = 'correctIncorrectNoanswer';
170
+ } else if (_this.isPartialCorrectExist() && _this.isNoAnswerExist()) {
171
+ colorProfile = 'correctIncorrectNoanswerPartial';
172
+ } else {
173
+ colorProfile = 'correctIncorrect';
174
+ }
175
+
176
+ return colorProfile;
177
+ };
178
+
177
179
  _this.render = function () {
178
180
  return /*#__PURE__*/React.createElement("div", {
179
- className: classNames(styles.collapsingTable)
181
+ className: classNames(styles.collapsingTable, styles[_this.getColorProfile()])
180
182
  }, /*#__PURE__*/React.createElement(Table, {
181
- caption: t('Answer Frequency Summary Aggregates'),
182
- layout: tableLayout
183
+ caption: t('Answer Frequency Summary Aggregates')
183
184
  }, _this.renderHeaderRow(), /*#__PURE__*/React.createElement(Table.Body, null, _this.renderCorrect(), _this.isPartialCorrectExist() && _this.renderPartialCorrect(), _this.renderIncorrect(), _this.isNoAnswerExist() && _this.renderNoAnswer())));
184
185
  };
185
186
 
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.getFeatures = void 0;
9
9
 
10
- var _Fetcher = _interopRequireDefault(require("../util/Fetcher.js"));
10
+ var _ExhaustivePaginatedFetcher = _interopRequireDefault(require("../util/ExhaustivePaginatedFetcher.js"));
11
11
 
12
12
  var _features = require("../actions/features.js");
13
13
 
@@ -16,7 +16,7 @@ var _ui = require("../actions/ui.js");
16
16
  var getFeatures = function getFeatures() {
17
17
  var url = '/api/features';
18
18
  return function (dispatch, getState) {
19
- var fetcher = new _Fetcher.default();
19
+ var fetcher = new _ExhaustivePaginatedFetcher.default();
20
20
 
21
21
  var addFeaturesToStore = function addFeaturesToStore(featuresList) {
22
22
  dispatch((0, _features.addFeatures)(featuresList));
@@ -111,23 +111,19 @@ var ChoiceTypeTableRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, sty
111
111
  key: _this.props.choiceIndex
112
112
  }, /*#__PURE__*/_react.default.createElement(_uiTable.Table.Cell, {
113
113
  theme: {
114
- padding: '0px',
115
- fontWeight: 'bold'
114
+ padding: '0px'
116
115
  }
117
116
  }, /*#__PURE__*/_react.default.createElement(_uiA11yContent.ScreenReaderContent, null, _this.answerLabel(correct)), _this.renderIcon(correct)), /*#__PURE__*/_react.default.createElement(_uiTable.Table.RowHeader, {
118
117
  theme: {
119
- padding: cellPadding,
120
- fontWeight: 'bold'
118
+ padding: cellPadding
121
119
  }
122
120
  }, _this.renderMiddleCell(correct, _this.extractChoiceText(choiceBody, correct))), /*#__PURE__*/_react.default.createElement(_uiTable.Table.Cell, {
123
121
  theme: {
124
- padding: cellPadding,
125
- fontWeight: 'bold'
122
+ padding: cellPadding
126
123
  }
127
124
  }, _this.renderMiddleCell(correct, _this.props.choice.count)), /*#__PURE__*/_react.default.createElement(_uiTable.Table.Cell, {
128
125
  theme: {
129
- padding: cellPadding,
130
- fontWeight: 'bold'
126
+ padding: cellPadding
131
127
  },
132
128
  textAlign: "center"
133
129
  }, _this.renderLastCell(correct, "".concat(_this.props.choice.percentage, "%"))));
@@ -42,12 +42,12 @@ var _classnames = _interopRequireDefault(require("classnames"));
42
42
  var _dec, _class, _class2, _temp;
43
43
 
44
44
  var styles = {
45
- componentId: 'dCEWT',
45
+ componentId: 'fxQkB',
46
46
  template: function template(theme) {
47
- return "\n\n.dCEWT_rMrG{display:flex;flex-basis:100%;flex-direction:column;padding-bottom:".concat(theme.tableBottomPadding || 'inherit', "}\n\n.dCEWT_SVtU{max-width:100%;width:calc(25% + 350px)}");
47
+ return "\n\n.fxQkB_rMrG{display:flex;flex-basis:100%;flex-direction:column;padding-bottom:".concat(theme.tableBottomPadding || 'inherit', "}\n\n.fxQkB_SVtU{max-width:100%;width:calc(25% + 350px)}\n\n.fxQkB_SVtU table tbody tr th{font-weight:400}");
48
48
  },
49
- 'tableWrapper': 'dCEWT_rMrG',
50
- 'tableContainer': 'dCEWT_SVtU'
49
+ 'tableWrapper': 'fxQkB_rMrG',
50
+ 'tableContainer': 'fxQkB_SVtU'
51
51
  };
52
52
  var ChoiceType = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
53
53
  (0, _inherits2.default)(ChoiceType, _Component);
@@ -44,16 +44,17 @@ var _theme = _interopRequireDefault(require("./theme.js"));
44
44
  var _dec, _class, _class2, _temp;
45
45
 
46
46
  var styles = {
47
- componentId: 'bAOvu',
47
+ componentId: 'bdaoA',
48
48
  template: function template(theme) {
49
- return "\n\n.bAOvu_rMrG{display:flex;flex-basis:100%;flex-direction:column;padding-bottom:".concat(theme.tableBottomPadding || 'inherit', "}\n\n.bAOvu_cvRx{align-items:center;display:flex;height:48px;justify-content:center;width:46px}\n\n.bAOvu_EKAb{background-color:").concat(theme.colorGreen || 'inherit', "}\n\n.bAOvu_EKAb svg{fill:#fff}\n\n.bAOvu_tnta{border-color:").concat(theme.colorGreen || 'inherit', ";border-style:solid;border-width:2px 0}\n\n.bAOvu_fvqY{border-radius:4px 4px 4px 4px;border-width:2px 2px 2px 2px}\n\n.bAOvu_SVtU{max-width:100%;width:calc(25% + 350px)}");
49
+ return "\n\n.bdaoA_rMrG{display:flex;flex-basis:100%;flex-direction:column;padding-bottom:".concat(theme.tableBottomPadding || 'inherit', "}\n\n.bdaoA_cvRx{align-items:center;display:flex;height:48px;justify-content:center;width:46px}\n\n.bdaoA_EKAb{background-color:").concat(theme.colorGreen || 'inherit', "}\n\n.bdaoA_EKAb svg{fill:#fff}\n\n.bdaoA_tnta{border-color:").concat(theme.colorGreen || 'inherit', ";border-style:solid;border-width:2px 0}\n\n.bdaoA_fvqY{border-radius:4px 4px 4px 4px;border-width:2px 2px 2px 2px}\n\n.bdaoA_bwoZ{max-width:100%;width:calc(25% + 350px)}\n\n.bdaoA_SVtU table tbody tr th{font-weight:400}");
50
50
  },
51
- 'tableWrapper': 'bAOvu_rMrG',
52
- 'iconWrapper': 'bAOvu_cvRx',
53
- 'iconCorrect': 'bAOvu_EKAb',
54
- 'correctRowBorder': 'bAOvu_tnta',
55
- 'correctRowBorderRadius': 'bAOvu_fvqY',
56
- 'tableContainer': 'bAOvu_SVtU'
51
+ 'tableWrapper': 'bdaoA_rMrG',
52
+ 'iconWrapper': 'bdaoA_cvRx',
53
+ 'iconCorrect': 'bdaoA_EKAb',
54
+ 'correctRowBorder': 'bdaoA_tnta',
55
+ 'correctRowBorderRadius': 'bdaoA_fvqY',
56
+ 'tableHalfWidth': 'bdaoA_bwoZ',
57
+ 'tableContainer': 'bdaoA_SVtU'
57
58
  };
58
59
 
59
60
  var _ref = /*#__PURE__*/_react.default.createElement(_uiIcons.IconCheckSolid, null);
@@ -178,7 +179,7 @@ var MatchingTypeTable = (_dec = (0, _uiThemeable.themeable)(_theme.default, styl
178
179
  var questionBody = extractedQuestionBody.trim().length > 0 ? extractedQuestionBody : question.body;
179
180
  return /*#__PURE__*/_react.default.createElement(_uiTable.Table.Row, {
180
181
  key: rowKey
181
- }, /*#__PURE__*/_react.default.createElement(_uiTable.Table.Cell, {
182
+ }, /*#__PURE__*/_react.default.createElement(_uiTable.Table.RowHeader, {
182
183
  id: questionRowHeaderId,
183
184
  key: questionRowHeaderId,
184
185
  theme: {
@@ -200,7 +201,7 @@ var MatchingTypeTable = (_dec = (0, _uiThemeable.themeable)(_theme.default, styl
200
201
  var orderedQuestionKeys = _matchingTypeOrderer.default.orderQuestionKeysForDiagonal(answerSummary, questionKeys, orderedAnswerKeys);
201
202
 
202
203
  return /*#__PURE__*/_react.default.createElement("div", {
203
- className: (0, _classnames.default)((0, _defineProperty2.default)({}, styles.tableContainer, tableHalfWidth))
204
+ className: (0, _classnames.default)(styles.tableContainer, (0, _defineProperty2.default)({}, styles.tableHalfWidth, tableHalfWidth))
204
205
  }, /*#__PURE__*/_react.default.createElement(_uiTable.Table, {
205
206
  caption: (0, _formatMessage.default)('Answer Frequency Summary')
206
207
  }, /*#__PURE__*/_react.default.createElement(_uiTable.Table.Head, null, _this.renderHeaderRow(orderedAnswerKeys)), /*#__PURE__*/_react.default.createElement(_uiTable.Table.Body, null, orderedQuestionKeys.map(function (orderedQuestionKey) {
@@ -42,33 +42,28 @@ var _uiText = require("@instructure/ui-text");
42
42
  var _dec, _class, _class2, _temp;
43
43
 
44
44
  var styles = {
45
- componentId: 'fuOpc',
45
+ componentId: 'fXtvV',
46
46
  template: function template(theme) {
47
- return "\n\n.fuOpc_cvRx{align-items:center;display:flex;height:48px;justify-content:center;width:46px}\n\n.fuOpc_fPIL table{border-collapse:separate;border-spacing:0 12px}\n\n.fuOpc_fPIL thead th{border-color:".concat(theme.colorHeaderBottomBorder || 'inherit', ";border-style:solid;border-width:0 0 1px 0}\n\n.fuOpc_euQM{padding-left:10px}\n\n.fuOpc_fuuc{padding-left:45px}\n\n.fuOpc_bTFA{border-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fuOpc_bvau{background-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fuOpc_dmcW{border-color:").concat(theme.colorRed || 'inherit', "}\n\n.fuOpc_cxOH{background-color:").concat(theme.colorRed || 'inherit', "}\n\n.fuOpc_xOeH{border-color:").concat(theme.colorBlue || 'inherit', "}\n\n.fuOpc_eRkO{background-color:").concat(theme.colorBlue || 'inherit', "}\n\n.fuOpc_dlLI{border-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fuOpc_eKcq{background-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fuOpc_vDgC svg{fill:#fff}\n\n.fuOpc_fHMm{border-color:").concat(theme.colorHeaderBottomBorder || 'inherit', ";border-style:solid;border-width:0 0 1px 0}\n\n.fuOpc_WspM{border-radius:4px 0 0 4px;border-style:solid;border-width:2px 0 2px 2px}\n\n.fuOpc_fAnT{border-width:2px 0 2px 0}\n\n.fuOpc_bMPk,.fuOpc_fAnT{border-style:solid;padding:").concat(theme.cellPadding || 'inherit', "}\n\n.fuOpc_bMPk{border-radius:0 4px 4px 0;border-width:2px 2px 2px 0}");
47
+ return "\n\n.fXtvV_cvRx{align-items:center;display:flex;height:100%;justify-content:center;min-height:47px;width:46px}\n\n.fXtvV_fPIL{min-width:500px}\n\n.fXtvV_fPIL table{border-collapse:separate;border-spacing:0 12px}\n\n.fXtvV_fPIL thead th{border-color:".concat(theme.colorHeaderBottomBorder || 'inherit', ";border-style:solid;border-width:0 0 1px 0}\n\n.fXtvV_fPIL table tbody tr td{border-style:solid;border-width:2px 0 2px 0;width:33.33%}\n\n.fXtvV_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.fXtvV_fPIL table tbody tr td:last-child{border-radius:0 4px 4px 0;border-style:solid;border-width:2px 2px 2px 0}\n\n.fXtvV_fZpZ table tbody tr:first-child td,.fXtvV_fZpZ table tbody tr:first-child th{border-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fXtvV_fZpZ table tbody tr:nth-child(2) td,.fXtvV_fZpZ table tbody tr:nth-child(2) th{border-color:").concat(theme.colorRed || 'inherit', "}\n\n.fXtvV_dgTJ table tbody tr:first-child td,.fXtvV_dgTJ table tbody tr:first-child th{border-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fXtvV_dgTJ table tbody tr:nth-child(2) td,.fXtvV_dgTJ table tbody tr:nth-child(2) th{border-color:").concat(theme.colorRed || 'inherit', "}\n\n.fXtvV_dgTJ table tbody tr:nth-child(3) td,.fXtvV_dgTJ table tbody tr:nth-child(3) th{border-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fXtvV_bUPM table tbody tr:first-child td,.fXtvV_bUPM table tbody tr:first-child th{border-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fXtvV_bUPM table tbody tr:nth-child(2) td,.fXtvV_bUPM table tbody tr:nth-child(2) th{border-color:").concat(theme.colorBlue || 'inherit', "}\n\n.fXtvV_bUPM table tbody tr:nth-child(3) td,.fXtvV_bUPM table tbody tr:nth-child(3) th{border-color:").concat(theme.colorRed || 'inherit', "}\n\n.fXtvV_bUPM table tbody tr:nth-child(4) td,.fXtvV_bUPM table tbody tr:nth-child(4) th{border-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fXtvV_bvau{background-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fXtvV_cxOH{background-color:").concat(theme.colorRed || 'inherit', "}\n\n.fXtvV_eRkO{background-color:").concat(theme.colorBlue || 'inherit', "}\n\n.fXtvV_eKcq{background-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fXtvV_euQM{padding-left:10px}\n\n.fXtvV_fuuc{padding-left:45px}\n\n.fXtvV_vDgC svg{fill:#fff}\n\n.fXtvV_fHMm{border-color:").concat(theme.colorHeaderBottomBorder || 'inherit', ";border-style:solid;border-width:0 0 1px 0}");
48
48
  },
49
- 'iconWrapper': 'fuOpc_cvRx',
50
- 'collapsingTable': 'fuOpc_fPIL',
51
- 'labelWrapper': 'fuOpc_euQM',
52
- 'firstHeaderCell': 'fuOpc_fuuc',
53
- 'correctBorder': 'fuOpc_bTFA',
54
- 'correctBackground': 'fuOpc_bvau',
55
- 'incorrectBorder': 'fuOpc_dmcW',
56
- 'incorrectBackground': 'fuOpc_cxOH',
57
- 'partialCorrectBorder': 'fuOpc_xOeH',
58
- 'partialCorrectBackground': 'fuOpc_eRkO',
59
- 'noAnswerBorder': 'fuOpc_dlLI',
60
- 'noAnswerBackground': 'fuOpc_eKcq',
61
- 'iconWhite': 'fuOpc_vDgC',
62
- 'headerCell': 'fuOpc_fHMm',
63
- 'firstCell': 'fuOpc_WspM',
64
- 'middleCell': 'fuOpc_fAnT',
65
- 'lastCell': 'fuOpc_bMPk'
49
+ 'iconWrapper': 'fXtvV_cvRx',
50
+ 'collapsingTable': 'fXtvV_fPIL',
51
+ 'correctIncorrect': 'fXtvV_fZpZ',
52
+ 'correctIncorrectNoanswer': 'fXtvV_dgTJ',
53
+ 'correctIncorrectNoanswerPartial': 'fXtvV_bUPM',
54
+ 'correctBackground': 'fXtvV_bvau',
55
+ 'incorrectBackground': 'fXtvV_cxOH',
56
+ 'partialCorrectBackground': 'fXtvV_eRkO',
57
+ 'noAnswerBackground': 'fXtvV_eKcq',
58
+ 'labelWrapper': 'fXtvV_euQM',
59
+ 'firstHeaderCell': 'fXtvV_fuuc',
60
+ 'iconWhite': 'fXtvV_vDgC',
61
+ 'headerCell': 'fXtvV_fHMm'
66
62
  };
67
63
  var noAnswerKey = 'noAnswer';
68
64
  var incorrectKey = 'incorrect';
69
65
  var correctKey = 'correct';
70
66
  var partialCorrectKey = 'partialCorrect';
71
- var tableLayout = 'fixed';
72
67
 
73
68
  var _ref = /*#__PURE__*/_react.default.createElement(_uiIcons.IconCheckSolid, null);
74
69
 
@@ -113,45 +108,38 @@ var AggregationTable = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
113
108
  };
114
109
 
115
110
  _this.renderRow = function (key, icon, label, count, percentage) {
116
- var borderColor = styles["".concat(key, "Border")];
117
111
  var backgroundColor = styles["".concat(key, "Background")];
118
112
  var concatenatedPercentage = "".concat(percentage, "%");
119
113
  return /*#__PURE__*/_react.default.createElement(_uiTable.Table.Row, {
120
114
  key: key
121
- }, /*#__PURE__*/_react.default.createElement(_uiTable.Table.Cell, {
115
+ }, /*#__PURE__*/_react.default.createElement(_uiTable.Table.RowHeader, {
122
116
  theme: {
123
117
  padding: '0px'
124
118
  }
125
- }, /*#__PURE__*/_react.default.createElement("div", {
126
- className: (0, _classnames.default)(styles.firstCell, borderColor)
127
119
  }, /*#__PURE__*/_react.default.createElement(_uiA11yContent.ScreenReaderContent, null, label), /*#__PURE__*/_react.default.createElement(_uiFlex.Flex, {
128
120
  direction: "row",
129
- alignItems: "center",
130
- height: "47px"
121
+ alignItems: "center"
131
122
  }, /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, {
132
123
  width: "46px",
133
- textAlign: "center"
124
+ textAlign: "center",
125
+ align: "stretch"
134
126
  }, /*#__PURE__*/_react.default.createElement("div", {
135
127
  className: (0, _classnames.default)(styles.iconWrapper, styles.iconWhite, backgroundColor)
136
128
  }, icon)), /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, {
137
- textAlign: "center"
129
+ shouldShrink: true
138
130
  }, /*#__PURE__*/_react.default.createElement("div", {
139
131
  className: (0, _classnames.default)(styles.labelWrapper)
140
- }, /*#__PURE__*/_react.default.createElement(_uiText.Text, null, label)))))), /*#__PURE__*/_react.default.createElement(_uiTable.Table.Cell, {
132
+ }, /*#__PURE__*/_react.default.createElement(_uiText.Text, null, label))))), /*#__PURE__*/_react.default.createElement(_uiTable.Table.Cell, {
141
133
  theme: {
142
134
  padding: '0px'
143
135
  },
144
136
  textAlign: "center"
145
- }, /*#__PURE__*/_react.default.createElement("div", {
146
- className: (0, _classnames.default)(styles.middleCell, borderColor)
147
- }, /*#__PURE__*/_react.default.createElement(_uiText.Text, null, count))), /*#__PURE__*/_react.default.createElement(_uiTable.Table.Cell, {
137
+ }, /*#__PURE__*/_react.default.createElement(_uiText.Text, null, count)), /*#__PURE__*/_react.default.createElement(_uiTable.Table.Cell, {
148
138
  theme: {
149
139
  padding: '0px'
150
140
  },
151
141
  textAlign: "center"
152
- }, /*#__PURE__*/_react.default.createElement("div", {
153
- className: (0, _classnames.default)(styles.lastCell, borderColor)
154
- }, /*#__PURE__*/_react.default.createElement(_uiText.Text, null, concatenatedPercentage))));
142
+ }, /*#__PURE__*/_react.default.createElement(_uiText.Text, null, concatenatedPercentage)));
155
143
  };
156
144
 
157
145
  _this.isPartialCorrectExist = function () {
@@ -199,12 +187,25 @@ var AggregationTable = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
199
187
  return _this.renderRow(noAnswerKey, _ref4, noAnswerLabel, noAnswerCount, noAnswerPercentage);
200
188
  };
201
189
 
190
+ _this.getColorProfile = function () {
191
+ var colorProfile;
192
+
193
+ if (!_this.isPartialCorrectExist() && _this.isNoAnswerExist()) {
194
+ colorProfile = 'correctIncorrectNoanswer';
195
+ } else if (_this.isPartialCorrectExist() && _this.isNoAnswerExist()) {
196
+ colorProfile = 'correctIncorrectNoanswerPartial';
197
+ } else {
198
+ colorProfile = 'correctIncorrect';
199
+ }
200
+
201
+ return colorProfile;
202
+ };
203
+
202
204
  _this.render = function () {
203
205
  return /*#__PURE__*/_react.default.createElement("div", {
204
- className: (0, _classnames.default)(styles.collapsingTable)
206
+ className: (0, _classnames.default)(styles.collapsingTable, styles[_this.getColorProfile()])
205
207
  }, /*#__PURE__*/_react.default.createElement(_uiTable.Table, {
206
- caption: (0, _formatMessage.default)('Answer Frequency Summary Aggregates'),
207
- layout: tableLayout
208
+ caption: (0, _formatMessage.default)('Answer Frequency Summary Aggregates')
208
209
  }, _this.renderHeaderRow(), /*#__PURE__*/_react.default.createElement(_uiTable.Table.Body, null, _this.renderCorrect(), _this.isPartialCorrectExist() && _this.renderPartialCorrect(), _this.renderIncorrect(), _this.isNoAnswerExist() && _this.renderNoAnswer())));
209
210
  };
210
211
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/quiz-core",
3
- "version": "18.6.1-rc.2+ac66a4360",
3
+ "version": "18.6.1-rc.4+260b550de",
4
4
  "license": "MIT",
5
5
  "description": "The Quiz React SDK by Instructure Inc.",
6
6
  "author": "Instructure, Inc. Engineering and Product Design",
@@ -43,11 +43,11 @@
43
43
  "dependencies": {
44
44
  "@instructure/grading-utils": "^1.0.0",
45
45
  "@instructure/outcomes-ui": "^2.1.9",
46
- "@instructure/quiz-common": "18.6.1-rc.2+ac66a4360",
47
- "@instructure/quiz-i18n": "18.6.1-rc.2+ac66a4360",
48
- "@instructure/quiz-interactions": "18.6.1-rc.2+ac66a4360",
49
- "@instructure/quiz-number-input": "18.6.1-rc.2+ac66a4360",
50
- "@instructure/quiz-rce": "18.6.1-rc.2+ac66a4360",
46
+ "@instructure/quiz-common": "18.6.1-rc.4+260b550de",
47
+ "@instructure/quiz-i18n": "18.6.1-rc.4+260b550de",
48
+ "@instructure/quiz-interactions": "18.6.1-rc.4+260b550de",
49
+ "@instructure/quiz-number-input": "18.6.1-rc.4+260b550de",
50
+ "@instructure/quiz-rce": "18.6.1-rc.4+260b550de",
51
51
  "@instructure/ui-a11y-content": "^7.22.1",
52
52
  "@instructure/ui-alerts": "^7.22.1",
53
53
  "@instructure/ui-avatar": "^7.22.1",
@@ -109,7 +109,7 @@
109
109
  "file-saver": "~2.0.5",
110
110
  "humps": "^2.0.0",
111
111
  "immutable": "^3.8.1",
112
- "instructure-validations": "18.6.1-rc.2+ac66a4360",
112
+ "instructure-validations": "18.6.1-rc.4+260b550de",
113
113
  "ipaddr.js": "^1.5.4",
114
114
  "isomorphic-fetch": "^2.2.0",
115
115
  "isuuid": "^0.1.0",
@@ -160,7 +160,7 @@
160
160
  "intl": "^1.2.4",
161
161
  "jquery": "^2.2.3",
162
162
  "most-subject": "^5.3.0",
163
- "quiz-presets": "18.6.1-rc.2+ac66a4360",
163
+ "quiz-presets": "18.6.1-rc.4+260b550de",
164
164
  "react": "^16.8.6",
165
165
  "react-addons-test-utils": "^15.6.2",
166
166
  "react-dom": "^16.8.6",
@@ -176,5 +176,5 @@
176
176
  "publishConfig": {
177
177
  "access": "public"
178
178
  },
179
- "gitHead": "ac66a43604b7238d95451f873c5ed673e35e51f8"
179
+ "gitHead": "260b550de740114602860e4baad6725afbf21e88"
180
180
  }