@instructure/quiz-core 17.66.2-rc.9 → 17.67.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,29 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [17.67.0](https://gerrit.instructure.com/quizzes-ui/compare/v17.66.1...v17.67.0) (2023-09-06)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **a11y:** Add correct answer information to Answer Frequency Summary table ([010f352](https://gerrit.instructure.com/quizzes-ui/commits/010f352ab09eb0e60ad8261f802bb69e4592d3a9))
12
+ * **a11y:** adjust the heading structure of item analysis ([a7d0e14](https://gerrit.instructure.com/quizzes-ui/commits/a7d0e14f3ffee5f0fc19771ed42fd1d4eeac2e53))
13
+ * **a11y:** exclude item stem expand button from screen readers ([3eb129f](https://gerrit.instructure.com/quizzes-ui/commits/3eb129fc6bb41bcfd86285b5f96b95c5bd5b2c6d))
14
+ * **a11y:** Hide expand button when the item analysis card rich content is not high enough ([58de8d5](https://gerrit.instructure.com/quizzes-ui/commits/58de8d55898e0f1899f16476e16ed50786f9cb8d))
15
+ * **a11y:** Item Analysis report cards are fully visible on 320px screen ([bc778cc](https://gerrit.instructure.com/quizzes-ui/commits/bc778cc52a3014879810e06942393d6772f0ccb7))
16
+ * **a11y:** make score distribution chart accessible ([28868d7](https://gerrit.instructure.com/quizzes-ui/commits/28868d7a4a3b2b06b94fbcdd5e535ffc79c3203a))
17
+ * **ItemAnalysis:** Make the new analysis report card have the same height as the others ([1f02d33](https://gerrit.instructure.com/quizzes-ui/commits/1f02d33c09a57ed2bbb1e7b76e5c6b1a4faa65bb))
18
+
19
+
20
+ ### Features
21
+
22
+ * **BOLA:** Adds bola position to setssion items ([d5fd33f](https://gerrit.instructure.com/quizzes-ui/commits/d5fd33f05363579b68e0acdd8a968889b4cb61e1))
23
+ * **BOLA:** REVERT Adds bola position to setssion items" ([4fb68a7](https://gerrit.instructure.com/quizzes-ui/commits/4fb68a7754f7630daddb3222a5bf75616f09abe2))
24
+
25
+
26
+
27
+
28
+
6
29
  ## [17.66.1](https://gerrit.instructure.com/quizzes-ui/compare/v17.66.0...v17.66.1) (2023-08-23)
7
30
 
8
31
 
@@ -192,9 +192,7 @@ export var QuizSession = /*#__PURE__*/function (_ReduxRecord) {
192
192
  status: '',
193
193
  takingData: Map(),
194
194
  timerMultiplier: null,
195
- user: Map(),
196
- // Good candidate for another Record - Still relevant?
197
- bolaSessionItemsCount: null,
198
- buildOnLastAttempt: null
195
+ user: Map() // Good candidate for another Record - Still relevant?
196
+
199
197
  }));
200
198
  export default QuizSession;
@@ -126,7 +126,6 @@ export var SessionItem = /*#__PURE__*/function (_ReduxRecord) {
126
126
  scoringData: {},
127
127
  calculatorType: 'none',
128
128
  stimulus: null,
129
- stimulusKey: null,
130
- bolaPosition: null
129
+ stimulusKey: null
131
130
  }));
132
131
  export default SessionItem;
@@ -38,8 +38,9 @@ import classnames from 'classnames';
38
38
  import { interactionTypesNameDictionary } from "../../../../../common/util/interactionTypeMetadata.js";
39
39
  import AnswerSummaryTable from "../AnswerSummaryTable/index.js";
40
40
  import { itemAnalysisPropType } from "../propTypes.js";
41
- import { RichContentRenderer } from '@instructure/quiz-rce';
42
41
  import { Flex } from '@instructure/ui-flex';
42
+ import { RichContentRenderer, ensureMathIsReady, ensureMathRendered } from '@instructure/quiz-rce';
43
+ import { ensureImagesLoaded } from "../../../../../common/util/printUtils.js";
43
44
  var supportedTables = ['choice', 'true-false', 'multi-answer'];
44
45
  export var NewItemAnalysis = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
45
46
  _inherits(NewItemAnalysis, _Component);
@@ -58,7 +59,8 @@ export var NewItemAnalysis = (_dec = themeable(theme, styles), _dec(_class = (_t
58
59
  _this = _super.call.apply(_super, [this].concat(args));
59
60
  _this.state = {
60
61
  bodyExpanded: false,
61
- metricsExpanded: false
62
+ metricsExpanded: false,
63
+ itemCardBodyHeight: 0
62
64
  };
63
65
 
64
66
  _this.mapInteractionTypeToTranslation = function (interactionType) {
@@ -112,7 +114,7 @@ export var NewItemAnalysis = (_dec = themeable(theme, styles), _dec(_class = (_t
112
114
  }, _this.mapInteractionTypeToTranslation(interactionType));
113
115
  };
114
116
 
115
- _this.renderRichContent = function (itemBody, itemBodyClass) {
117
+ _this.renderRichContent = function (itemBody, itemBodyClass, itemId) {
116
118
  return /*#__PURE__*/React.createElement(Flex, {
117
119
  direction: "row",
118
120
  alignItems: "start"
@@ -120,6 +122,7 @@ export var NewItemAnalysis = (_dec = themeable(theme, styles), _dec(_class = (_t
120
122
  shouldShrink: true,
121
123
  shouldGrow: true
122
124
  }, /*#__PURE__*/React.createElement("div", {
125
+ id: _this.itemCardBodyId(itemId),
123
126
  className: itemBodyClass
124
127
  }, /*#__PURE__*/React.createElement(RichContentRenderer, {
125
128
  content: itemBody
@@ -127,7 +130,7 @@ export var NewItemAnalysis = (_dec = themeable(theme, styles), _dec(_class = (_t
127
130
  margin: "none none none x-small"
128
131
  }, /*#__PURE__*/React.createElement("div", {
129
132
  className: styles.itemBodyToggleButtonWrapper
130
- }, /*#__PURE__*/React.createElement(PresentationContent, null, /*#__PURE__*/React.createElement(ExpandButton, {
133
+ }, _this.isBodyHigherThanContainer() && /*#__PURE__*/React.createElement(PresentationContent, null, /*#__PURE__*/React.createElement(ExpandButton, {
131
134
  onClick: _this.handleBodyToggle,
132
135
  title: _this.state.bodyExpanded ? t('collapse question stem') : t('expand question stem'),
133
136
  isExpanded: _this.state.bodyExpanded
@@ -209,6 +212,38 @@ export var NewItemAnalysis = (_dec = themeable(theme, styles), _dec(_class = (_t
209
212
  }
210
213
 
211
214
  _createClass(NewItemAnalysis, [{
215
+ key: "componentDidMount",
216
+ value: function componentDidMount() {
217
+ var _this2 = this;
218
+
219
+ ensureMathIsReady().then(ensureMathRendered).then(ensureImagesLoaded).then(function () {
220
+ return _this2.calculateItemCardBodyHeight(_this2.props.itemAnalysis.metadata.item_id);
221
+ });
222
+ }
223
+ }, {
224
+ key: "calculateItemCardBodyHeight",
225
+ value: function calculateItemCardBodyHeight(id) {
226
+ var element = document.getElementById(this.itemCardBodyId(id));
227
+
228
+ if (element) {
229
+ var height = element.clientHeight;
230
+ this.setState({
231
+ itemCardBodyHeight: height
232
+ });
233
+ }
234
+ }
235
+ }, {
236
+ key: "itemCardBodyId",
237
+ value: function itemCardBodyId(itemId) {
238
+ return "itemCardBody-".concat(itemId);
239
+ }
240
+ }, {
241
+ key: "isBodyHigherThanContainer",
242
+ value: function isBodyHigherThanContainer() {
243
+ var containerHeight = 48;
244
+ return this.state.itemCardBodyHeight > containerHeight;
245
+ }
246
+ }, {
212
247
  key: "render",
213
248
  value: function render() {
214
249
  var _metadata$item_title;
@@ -220,7 +255,7 @@ export var NewItemAnalysis = (_dec = themeable(theme, styles), _dec(_class = (_t
220
255
  var itemId = metadata.item_id;
221
256
  var isSupportedTable = supportedTables.includes(metadata.interaction_type);
222
257
  var metricsClass = classnames(_defineProperty({}, styles.hiddenMetrics, !this.state.metricsExpanded));
223
- var itemBodyClass = classnames(styles.itemBody, _defineProperty({}, styles.hiddenItemBody, !this.state.bodyExpanded));
258
+ var itemBodyClass = classnames(styles.itemBody, _defineProperty({}, styles.hiddenItemBody, this.isBodyHigherThanContainer() && !this.state.bodyExpanded));
224
259
  var title = (_metadata$item_title = metadata.item_title) !== null && _metadata$item_title !== void 0 ? _metadata$item_title : t('Untitled item');
225
260
  return /*#__PURE__*/React.createElement(Card, {
226
261
  className: styles.cardWrapper
@@ -242,7 +277,7 @@ export var NewItemAnalysis = (_dec = themeable(theme, styles), _dec(_class = (_t
242
277
  padding: "small xx-small none none",
243
278
  overflowY: "hidden",
244
279
  size: !this.state.bodyExpanded ? '60px' : void 0
245
- }, this.renderRichContent(metadata.item_body, itemBodyClass)))), /*#__PURE__*/React.createElement(Flex.Item, null, this.renderMetrics(scores, metricsClass)))), /*#__PURE__*/React.createElement(Flex.Item, null, this.renderAnswerSummaryTable(itemId, answer_summary, isSupportedTable, metricsClass))));
280
+ }, this.renderRichContent(metadata.item_body, itemBodyClass, itemId)))), /*#__PURE__*/React.createElement(Flex.Item, null, this.renderMetrics(scores, metricsClass)))), /*#__PURE__*/React.createElement(Flex.Item, null, this.renderAnswerSummaryTable(itemId, answer_summary, isSupportedTable, metricsClass))));
246
281
  }
247
282
  }]);
248
283
 
@@ -211,10 +211,8 @@ var QuizSession = /*#__PURE__*/function (_ReduxRecord) {
211
211
  status: '',
212
212
  takingData: (0, _immutable.Map)(),
213
213
  timerMultiplier: null,
214
- user: (0, _immutable.Map)(),
215
- // Good candidate for another Record - Still relevant?
216
- bolaSessionItemsCount: null,
217
- buildOnLastAttempt: null
214
+ user: (0, _immutable.Map)() // Good candidate for another Record - Still relevant?
215
+
218
216
  }));
219
217
 
220
218
  exports.QuizSession = QuizSession;
@@ -142,8 +142,7 @@ var SessionItem = /*#__PURE__*/function (_ReduxRecord) {
142
142
  scoringData: {},
143
143
  calculatorType: 'none',
144
144
  stimulus: null,
145
- stimulusKey: null,
146
- bolaPosition: null
145
+ stimulusKey: null
147
146
  }));
148
147
 
149
148
  exports.SessionItem = SessionItem;
@@ -51,9 +51,11 @@ var _index5 = _interopRequireDefault(require("../AnswerSummaryTable/index.js"));
51
51
 
52
52
  var _propTypes = require("../propTypes.js");
53
53
 
54
+ var _uiFlex = require("@instructure/ui-flex");
55
+
54
56
  var _quizRce = require("@instructure/quiz-rce");
55
57
 
56
- var _uiFlex = require("@instructure/ui-flex");
58
+ var _printUtils = require("../../../../../common/util/printUtils.js");
57
59
 
58
60
  var _dec, _class, _class2, _temp;
59
61
 
@@ -91,7 +93,8 @@ var NewItemAnalysis = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
91
93
  _this = _super.call.apply(_super, [this].concat(args));
92
94
  _this.state = {
93
95
  bodyExpanded: false,
94
- metricsExpanded: false
96
+ metricsExpanded: false,
97
+ itemCardBodyHeight: 0
95
98
  };
96
99
 
97
100
  _this.mapInteractionTypeToTranslation = function (interactionType) {
@@ -145,7 +148,7 @@ var NewItemAnalysis = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
145
148
  }, _this.mapInteractionTypeToTranslation(interactionType));
146
149
  };
147
150
 
148
- _this.renderRichContent = function (itemBody, itemBodyClass) {
151
+ _this.renderRichContent = function (itemBody, itemBodyClass, itemId) {
149
152
  return /*#__PURE__*/_react.default.createElement(_uiFlex.Flex, {
150
153
  direction: "row",
151
154
  alignItems: "start"
@@ -153,6 +156,7 @@ var NewItemAnalysis = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
153
156
  shouldShrink: true,
154
157
  shouldGrow: true
155
158
  }, /*#__PURE__*/_react.default.createElement("div", {
159
+ id: _this.itemCardBodyId(itemId),
156
160
  className: itemBodyClass
157
161
  }, /*#__PURE__*/_react.default.createElement(_quizRce.RichContentRenderer, {
158
162
  content: itemBody
@@ -160,7 +164,7 @@ var NewItemAnalysis = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
160
164
  margin: "none none none x-small"
161
165
  }, /*#__PURE__*/_react.default.createElement("div", {
162
166
  className: styles.itemBodyToggleButtonWrapper
163
- }, /*#__PURE__*/_react.default.createElement(_uiA11yContent.PresentationContent, null, /*#__PURE__*/_react.default.createElement(_index.default, {
167
+ }, _this.isBodyHigherThanContainer() && /*#__PURE__*/_react.default.createElement(_uiA11yContent.PresentationContent, null, /*#__PURE__*/_react.default.createElement(_index.default, {
164
168
  onClick: _this.handleBodyToggle,
165
169
  title: _this.state.bodyExpanded ? (0, _formatMessage.default)('collapse question stem') : (0, _formatMessage.default)('expand question stem'),
166
170
  isExpanded: _this.state.bodyExpanded
@@ -242,6 +246,38 @@ var NewItemAnalysis = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
242
246
  }
243
247
 
244
248
  (0, _createClass2.default)(NewItemAnalysis, [{
249
+ key: "componentDidMount",
250
+ value: function componentDidMount() {
251
+ var _this2 = this;
252
+
253
+ (0, _quizRce.ensureMathIsReady)().then(_quizRce.ensureMathRendered).then(_printUtils.ensureImagesLoaded).then(function () {
254
+ return _this2.calculateItemCardBodyHeight(_this2.props.itemAnalysis.metadata.item_id);
255
+ });
256
+ }
257
+ }, {
258
+ key: "calculateItemCardBodyHeight",
259
+ value: function calculateItemCardBodyHeight(id) {
260
+ var element = document.getElementById(this.itemCardBodyId(id));
261
+
262
+ if (element) {
263
+ var height = element.clientHeight;
264
+ this.setState({
265
+ itemCardBodyHeight: height
266
+ });
267
+ }
268
+ }
269
+ }, {
270
+ key: "itemCardBodyId",
271
+ value: function itemCardBodyId(itemId) {
272
+ return "itemCardBody-".concat(itemId);
273
+ }
274
+ }, {
275
+ key: "isBodyHigherThanContainer",
276
+ value: function isBodyHigherThanContainer() {
277
+ var containerHeight = 48;
278
+ return this.state.itemCardBodyHeight > containerHeight;
279
+ }
280
+ }, {
245
281
  key: "render",
246
282
  value: function render() {
247
283
  var _metadata$item_title;
@@ -253,7 +289,7 @@ var NewItemAnalysis = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
253
289
  var itemId = metadata.item_id;
254
290
  var isSupportedTable = supportedTables.includes(metadata.interaction_type);
255
291
  var metricsClass = (0, _classnames3.default)((0, _defineProperty2.default)({}, styles.hiddenMetrics, !this.state.metricsExpanded));
256
- var itemBodyClass = (0, _classnames3.default)(styles.itemBody, (0, _defineProperty2.default)({}, styles.hiddenItemBody, !this.state.bodyExpanded));
292
+ var itemBodyClass = (0, _classnames3.default)(styles.itemBody, (0, _defineProperty2.default)({}, styles.hiddenItemBody, this.isBodyHigherThanContainer() && !this.state.bodyExpanded));
257
293
  var title = (_metadata$item_title = metadata.item_title) !== null && _metadata$item_title !== void 0 ? _metadata$item_title : (0, _formatMessage.default)('Untitled item');
258
294
  return /*#__PURE__*/_react.default.createElement(_index2.default, {
259
295
  className: styles.cardWrapper
@@ -275,7 +311,7 @@ var NewItemAnalysis = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
275
311
  padding: "small xx-small none none",
276
312
  overflowY: "hidden",
277
313
  size: !this.state.bodyExpanded ? '60px' : void 0
278
- }, this.renderRichContent(metadata.item_body, itemBodyClass)))), /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, null, this.renderMetrics(scores, metricsClass)))), /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, null, this.renderAnswerSummaryTable(itemId, answer_summary, isSupportedTable, metricsClass))));
314
+ }, this.renderRichContent(metadata.item_body, itemBodyClass, itemId)))), /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, null, this.renderMetrics(scores, metricsClass)))), /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, null, this.renderAnswerSummaryTable(itemId, answer_summary, isSupportedTable, metricsClass))));
279
315
  }
280
316
  }]);
281
317
  NewItemAnalysis.displayName = "NewItemAnalysis";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/quiz-core",
3
- "version": "17.66.2-rc.9+bc778cc52",
3
+ "version": "17.67.0",
4
4
  "license": "MIT",
5
5
  "description": "The Quiz React SDK by Instructure Inc.",
6
6
  "author": "Instructure, Inc. Engineering and Product Design",
@@ -42,11 +42,11 @@
42
42
  "dependencies": {
43
43
  "@instructure/grading-utils": "^1.0.0",
44
44
  "@instructure/outcomes-ui": "^2.1.9",
45
- "@instructure/quiz-common": "17.66.2-rc.9+bc778cc52",
46
- "@instructure/quiz-i18n": "17.66.2-rc.9+bc778cc52",
47
- "@instructure/quiz-interactions": "17.66.2-rc.9+bc778cc52",
48
- "@instructure/quiz-number-input": "17.66.2-rc.9+bc778cc52",
49
- "@instructure/quiz-rce": "17.66.2-rc.9+bc778cc52",
45
+ "@instructure/quiz-common": "^17.67.0",
46
+ "@instructure/quiz-i18n": "^17.67.0",
47
+ "@instructure/quiz-interactions": "^17.67.0",
48
+ "@instructure/quiz-number-input": "^17.67.0",
49
+ "@instructure/quiz-rce": "^17.67.0",
50
50
  "@instructure/ui-a11y-content": "^7.20.0",
51
51
  "@instructure/ui-alerts": "^7.20.0",
52
52
  "@instructure/ui-avatar": "^7.20.0",
@@ -107,7 +107,7 @@
107
107
  "eventemitter3": "^3.1.0",
108
108
  "humps": "^2.0.0",
109
109
  "immutable": "^3.8.1",
110
- "instructure-validations": "17.66.2-rc.9+bc778cc52",
110
+ "instructure-validations": "^17.67.0",
111
111
  "ipaddr.js": "^1.5.4",
112
112
  "isomorphic-fetch": "^2.2.0",
113
113
  "isuuid": "^0.1.0",
@@ -139,7 +139,7 @@
139
139
  "uuid": "^3.2.1"
140
140
  },
141
141
  "devDependencies": {
142
- "@instructure/quiz-scripts": "17.66.1",
142
+ "@instructure/quiz-scripts": "^17.67.0",
143
143
  "@instructure/ui-axe-check": "^7.20.0",
144
144
  "@instructure/ui-babel-preset": "^7.20.0",
145
145
  "@instructure/ui-karma-config": "^7.20.0",
@@ -158,7 +158,7 @@
158
158
  "intl": "^1.2.4",
159
159
  "jquery": "^2.2.3",
160
160
  "most-subject": "^5.3.0",
161
- "quiz-presets": "17.66.2-rc.9+bc778cc52",
161
+ "quiz-presets": "^17.67.0",
162
162
  "react": "^16.8.6",
163
163
  "react-addons-test-utils": "^15.6.2",
164
164
  "react-dom": "^16.8.6",
@@ -174,5 +174,5 @@
174
174
  "publishConfig": {
175
175
  "access": "public"
176
176
  },
177
- "gitHead": "bc778cc52a3014879810e06942393d6772f0ccb7"
177
+ "gitHead": "b2b943153d890a1ba691ba3a346edfcb4d1d6be5"
178
178
  }