@instructure/quiz-core 17.66.2-rc.9 → 17.67.1-rc.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
 
@@ -23,22 +23,21 @@ export var fetchReportsStatus = /*#__PURE__*/function () {
23
23
  setGenerationInProgress(false);
24
24
  }
25
25
 
26
- _context.next = 14;
27
- break;
26
+ return _context.abrupt("return", isReportGenerationReady);
28
27
 
29
- case 9:
30
- _context.prev = 9;
28
+ case 10:
29
+ _context.prev = 10;
31
30
  _context.t0 = _context["catch"](1);
32
31
  addError(getFailedToFetchReports());
33
32
  setStatusPollingInProgress(false);
34
33
  setGenerationInProgress(false);
35
34
 
36
- case 14:
35
+ case 15:
37
36
  case "end":
38
37
  return _context.stop();
39
38
  }
40
39
  }
41
- }, _callee, null, [[1, 9]]);
40
+ }, _callee, null, [[1, 10]]);
42
41
  }));
43
42
 
44
43
  return function fetchReportsStatus(_x) {
@@ -1,7 +1,7 @@
1
1
  import _regeneratorRuntime from "@babel/runtime/regenerator";
2
2
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
- import React, { useEffect, useRef } from 'react';
4
+ import React, { useEffect } from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { itemAnalysisPropType, quizAnalysisPropType } from "./propTypes.js";
7
7
  import { fetchReports } from "./fetchReports.js";
@@ -31,7 +31,6 @@ export var withAnalysisStatePresenter = function withAnalysisStatePresenter(Orig
31
31
  passThroughProps = _objectWithoutProperties(_ref, ["quizAnalysis", "itemAnalyses", "fetchInProgress", "generationInProgress", "analysisError", "setQuizAnalysis", "addError", "setItemAnalyses", "setFetchInProgress", "setGenerationInProgress", "setAnalysisError", "activeQuizId", "generateAnalysis", "fetchQuizAnalysis", "fetchItemAnalyses", "fetchAnalysesStatus", "statusPollingInProgress", "setStatusPollingInProgress", "pollingInterval"]);
32
32
 
33
33
  WithAnalysisStatePresenter.displayName = "WithAnalysisStatePresenter(".concat(OriginalComponent.displayName || OriginalComponent.name, ")");
34
- var runningInterval = useRef(null);
35
34
 
36
35
  var instrumentedFetchReports = function instrumentedFetchReports() {
37
36
  return fetchReports({
@@ -64,15 +63,15 @@ export var withAnalysisStatePresenter = function withAnalysisStatePresenter(Orig
64
63
  }
65
64
 
66
65
  function _generateReports() {
67
- _generateReports = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
66
+ _generateReports = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
68
67
  var filter,
69
68
  generationConfig,
70
- _args2 = arguments;
71
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
69
+ _args3 = arguments;
70
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
72
71
  while (1) {
73
- switch (_context2.prev = _context2.next) {
72
+ switch (_context3.prev = _context3.next) {
74
73
  case 0:
75
- filter = _args2.length > 0 && _args2[0] !== void 0 ? _args2[0] : 'last_attempt';
74
+ filter = _args3.length > 0 && _args3[0] !== void 0 ? _args3[0] : 'last_attempt';
76
75
  generationConfig = {
77
76
  filter: filter,
78
77
  generateAnalysis: generateAnalysis,
@@ -80,15 +79,15 @@ export var withAnalysisStatePresenter = function withAnalysisStatePresenter(Orig
80
79
  setStatusPollingInProgress: setStatusPollingInProgress,
81
80
  addError: addError
82
81
  };
83
- _context2.next = 4;
82
+ _context3.next = 4;
84
83
  return triggerReportGeneration(generationConfig);
85
84
 
86
85
  case 4:
87
86
  case "end":
88
- return _context2.stop();
87
+ return _context3.stop();
89
88
  }
90
89
  }
91
- }, _callee2);
90
+ }, _callee3);
92
91
  }));
93
92
  return _generateReports.apply(this, arguments);
94
93
  }
@@ -126,20 +125,36 @@ export var withAnalysisStatePresenter = function withAnalysisStatePresenter(Orig
126
125
 
127
126
  fetchIfNeeded();
128
127
  }, []);
129
- useEffect(function () {
130
- if (statusPollingInProgress && !runningInterval.current) {
131
- runningInterval.current = setInterval(instrumentedStatusFetching, pollingInterval);
132
- }
133
128
 
134
- if (!statusPollingInProgress && runningInterval.current) {
135
- clearInterval(runningInterval.current);
136
- runningInterval.current = null;
137
- } // unmount cleanup
129
+ var recursiveInstrumentedStatusFetching = /*#__PURE__*/function () {
130
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
131
+ var isReportGenerationReady;
132
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
133
+ while (1) {
134
+ switch (_context2.prev = _context2.next) {
135
+ case 0:
136
+ _context2.next = 2;
137
+ return instrumentedStatusFetching();
138
138
 
139
+ case 2:
140
+ isReportGenerationReady = _context2.sent;
141
+ !isReportGenerationReady && setTimeout(recursiveInstrumentedStatusFetching, pollingInterval);
139
142
 
140
- return function () {
141
- return clearInterval(runningInterval.current);
143
+ case 4:
144
+ case "end":
145
+ return _context2.stop();
146
+ }
147
+ }
148
+ }, _callee2);
149
+ }));
150
+
151
+ return function recursiveInstrumentedStatusFetching() {
152
+ return _ref3.apply(this, arguments);
142
153
  };
154
+ }();
155
+
156
+ useEffect(function () {
157
+ statusPollingInProgress && recursiveInstrumentedStatusFetching();
143
158
  }, [statusPollingInProgress]);
144
159
  return /*#__PURE__*/React.createElement(OriginalComponent, Object.assign({
145
160
  quizAnalysis: quizAnalysis,
@@ -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";
@@ -35,22 +35,21 @@ var fetchReportsStatus = /*#__PURE__*/function () {
35
35
  setGenerationInProgress(false);
36
36
  }
37
37
 
38
- _context.next = 14;
39
- break;
38
+ return _context.abrupt("return", isReportGenerationReady);
40
39
 
41
- case 9:
42
- _context.prev = 9;
40
+ case 10:
41
+ _context.prev = 10;
43
42
  _context.t0 = _context["catch"](1);
44
43
  addError((0, _errorMessages.getFailedToFetchReports)());
45
44
  setStatusPollingInProgress(false);
46
45
  setGenerationInProgress(false);
47
46
 
48
- case 14:
47
+ case 15:
49
48
  case "end":
50
49
  return _context.stop();
51
50
  }
52
51
  }
53
- }, _callee, null, [[1, 9]]);
52
+ }, _callee, null, [[1, 10]]);
54
53
  }));
55
54
 
56
55
  return function fetchReportsStatus(_x) {
@@ -50,7 +50,6 @@ var withAnalysisStatePresenter = function withAnalysisStatePresenter(OriginalCom
50
50
  pollingInterval = _ref.pollingInterval,
51
51
  passThroughProps = (0, _objectWithoutProperties2.default)(_ref, ["quizAnalysis", "itemAnalyses", "fetchInProgress", "generationInProgress", "analysisError", "setQuizAnalysis", "addError", "setItemAnalyses", "setFetchInProgress", "setGenerationInProgress", "setAnalysisError", "activeQuizId", "generateAnalysis", "fetchQuizAnalysis", "fetchItemAnalyses", "fetchAnalysesStatus", "statusPollingInProgress", "setStatusPollingInProgress", "pollingInterval"]);
52
52
  WithAnalysisStatePresenter.displayName = "WithAnalysisStatePresenter(".concat(OriginalComponent.displayName || OriginalComponent.name, ")");
53
- var runningInterval = (0, _react.useRef)(null);
54
53
 
55
54
  var instrumentedFetchReports = function instrumentedFetchReports() {
56
55
  return (0, _fetchReports.fetchReports)({
@@ -83,15 +82,15 @@ var withAnalysisStatePresenter = function withAnalysisStatePresenter(OriginalCom
83
82
  }
84
83
 
85
84
  function _generateReports() {
86
- _generateReports = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
85
+ _generateReports = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
87
86
  var filter,
88
87
  generationConfig,
89
- _args2 = arguments;
90
- return _regenerator.default.wrap(function _callee2$(_context2) {
88
+ _args3 = arguments;
89
+ return _regenerator.default.wrap(function _callee3$(_context3) {
91
90
  while (1) {
92
- switch (_context2.prev = _context2.next) {
91
+ switch (_context3.prev = _context3.next) {
93
92
  case 0:
94
- filter = _args2.length > 0 && _args2[0] !== void 0 ? _args2[0] : 'last_attempt';
93
+ filter = _args3.length > 0 && _args3[0] !== void 0 ? _args3[0] : 'last_attempt';
95
94
  generationConfig = {
96
95
  filter: filter,
97
96
  generateAnalysis: generateAnalysis,
@@ -99,15 +98,15 @@ var withAnalysisStatePresenter = function withAnalysisStatePresenter(OriginalCom
99
98
  setStatusPollingInProgress: setStatusPollingInProgress,
100
99
  addError: addError
101
100
  };
102
- _context2.next = 4;
101
+ _context3.next = 4;
103
102
  return (0, _generateReports2.generateReports)(generationConfig);
104
103
 
105
104
  case 4:
106
105
  case "end":
107
- return _context2.stop();
106
+ return _context3.stop();
108
107
  }
109
108
  }
110
- }, _callee2);
109
+ }, _callee3);
111
110
  }));
112
111
  return _generateReports.apply(this, arguments);
113
112
  }
@@ -145,20 +144,36 @@ var withAnalysisStatePresenter = function withAnalysisStatePresenter(OriginalCom
145
144
 
146
145
  fetchIfNeeded();
147
146
  }, []);
148
- (0, _react.useEffect)(function () {
149
- if (statusPollingInProgress && !runningInterval.current) {
150
- runningInterval.current = setInterval(instrumentedStatusFetching, pollingInterval);
151
- }
152
147
 
153
- if (!statusPollingInProgress && runningInterval.current) {
154
- clearInterval(runningInterval.current);
155
- runningInterval.current = null;
156
- } // unmount cleanup
148
+ var recursiveInstrumentedStatusFetching = /*#__PURE__*/function () {
149
+ var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
150
+ var isReportGenerationReady;
151
+ return _regenerator.default.wrap(function _callee2$(_context2) {
152
+ while (1) {
153
+ switch (_context2.prev = _context2.next) {
154
+ case 0:
155
+ _context2.next = 2;
156
+ return instrumentedStatusFetching();
157
157
 
158
+ case 2:
159
+ isReportGenerationReady = _context2.sent;
160
+ !isReportGenerationReady && setTimeout(recursiveInstrumentedStatusFetching, pollingInterval);
158
161
 
159
- return function () {
160
- return clearInterval(runningInterval.current);
162
+ case 4:
163
+ case "end":
164
+ return _context2.stop();
165
+ }
166
+ }
167
+ }, _callee2);
168
+ }));
169
+
170
+ return function recursiveInstrumentedStatusFetching() {
171
+ return _ref3.apply(this, arguments);
161
172
  };
173
+ }();
174
+
175
+ (0, _react.useEffect)(function () {
176
+ statusPollingInProgress && recursiveInstrumentedStatusFetching();
162
177
  }, [statusPollingInProgress]);
163
178
  return /*#__PURE__*/_react.default.createElement(OriginalComponent, Object.assign({
164
179
  quizAnalysis: quizAnalysis,
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.1-rc.0+7afeb9ec9",
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.1-rc.0+7afeb9ec9",
46
+ "@instructure/quiz-i18n": "17.67.1-rc.0+7afeb9ec9",
47
+ "@instructure/quiz-interactions": "17.67.1-rc.0+7afeb9ec9",
48
+ "@instructure/quiz-number-input": "17.67.1-rc.0+7afeb9ec9",
49
+ "@instructure/quiz-rce": "17.67.1-rc.0+7afeb9ec9",
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.1-rc.0+7afeb9ec9",
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.1-rc.0+7afeb9ec9",
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": "7afeb9ec94ab66b70ef4c1cf9dbd19b8eb9f8acd"
178
178
  }