@instructure/quiz-core 17.63.1-rc.8 → 17.64.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 (20) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/es/building/api/qtiImports.js +16 -10
  3. package/es/building/components/QTIImportModal/index.js +1 -1
  4. package/es/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/presenter.js +3 -2
  5. package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/popoverContent.js +10 -12
  6. package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js +1 -1
  7. package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/popoverContent.js +11 -0
  8. package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/presenter.js +3 -14
  9. package/es/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/presenter.js +7 -2
  10. package/es/reporting/components/resources/NewQuizAndItemAnalysis/generateReports.js +18 -6
  11. package/lib/building/api/qtiImports.js +16 -10
  12. package/lib/building/components/QTIImportModal/index.js +1 -1
  13. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/presenter.js +3 -2
  14. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/popoverContent.js +14 -12
  15. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js +1 -1
  16. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/popoverContent.js +23 -0
  17. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/presenter.js +4 -14
  18. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/presenter.js +7 -2
  19. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/generateReports.js +18 -6
  20. package/package.json +10 -10
package/CHANGELOG.md CHANGED
@@ -3,6 +3,31 @@
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.64.0](https://gerrit.instructure.com/quizzes-ui/compare/v17.63.0...v17.64.0) (2023-08-14)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **itemanalysis:** fix bad alignment of metrics and remove average attempts metric ([70beebd](https://gerrit.instructure.com/quizzes-ui/commits/70beebd5f9c207e03df9942938452b5389ef3881))
12
+ * **Reports:** Change report generation invocation ([2a57eb8](https://gerrit.instructure.com/quizzes-ui/commits/2a57eb86c403aefbc7255ea95aecb8b7df4e9a8e))
13
+ * **Reports:** Handle rejected generation properly ([627d26f](https://gerrit.instructure.com/quizzes-ui/commits/627d26f3fa7e7bcbb616169a35306c73d82adcb7))
14
+
15
+
16
+ ### Features
17
+
18
+ * **import:** wait for lti assignment settings on import ([35b51ed](https://gerrit.instructure.com/quizzes-ui/commits/35b51ed8f5fba0d63337bafc790b1f1cbc48e6e4))
19
+ * **itemanalysis:** report card update with new props and spinners ([d5b17d3](https://gerrit.instructure.com/quizzes-ui/commits/d5b17d3d081eaf1eedc84b1bf597eb972ecccb20))
20
+ * **NewItemAnalysis:** Handle rich content in Item Cards ([3b1ed68](https://gerrit.instructure.com/quizzes-ui/commits/3b1ed689cbb9d38d69287f541dfa2396cc315f28))
21
+ * **quizAndItemAnalysis:** Item analysis popover content ([843f5c0](https://gerrit.instructure.com/quizzes-ui/commits/843f5c04700dc96877b1e936110a17fe421abd4d))
22
+ * **reporting:** Add polling logic for report generation ([4bcb564](https://gerrit.instructure.com/quizzes-ui/commits/4bcb5647493df6773dbeee4579c0a89ded6b1532))
23
+ * **reporting:** Add report fetching logic ([50aaf1e](https://gerrit.instructure.com/quizzes-ui/commits/50aaf1e20d82c1b56354aa7744a0a99634f9b385))
24
+ * **Reports:** Change Pearson to Corrected item total ([04b8256](https://gerrit.instructure.com/quizzes-ui/commits/04b8256df99a5b90afd76c80237f2fc91dfb6953))
25
+ * **Reports:** Implement report generation capability ([658933d](https://gerrit.instructure.com/quizzes-ui/commits/658933df6dc2a88f7f7aed3173a41409c7190686))
26
+
27
+
28
+
29
+
30
+
6
31
  # [17.63.0](https://gerrit.instructure.com/quizzes-ui/compare/v17.62.0...v17.63.0) (2023-08-08)
7
32
 
8
33
 
@@ -17,8 +17,8 @@ export var getQTIInfo = function getQTIInfo(quizId) {
17
17
  return fetcher.get(url).then(addImportsToStore);
18
18
  };
19
19
  };
20
- export var pollForQtiInfo = function pollForQtiInfo(parentId, parentType) {
21
- var opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
20
+ export var pollForQtiInfo = function pollForQtiInfo(parentId, parentType, waitForAssignmentSettingsImported) {
21
+ var opts = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {
22
22
  getExistingBankAndEntries: getExistingBankAndEntries,
23
23
  getExistingQuizAndItems: getExistingQuizAndItems,
24
24
  pollForQtiInfo: pollForQtiInfo
@@ -47,11 +47,17 @@ export var pollForQtiInfo = function pollForQtiInfo(parentId, parentType) {
47
47
  dispatch(opts.getExistingBankAndEntries(parentId));
48
48
  }
49
49
 
50
- dispatch(setUploadStatus(FILE_UPLOAD_SUCCESS));
50
+ if (waitForAssignmentSettingsImported) {
51
+ waitForAssignmentSettingsImported().then(function () {
52
+ dispatch(setUploadStatus(FILE_UPLOAD_SUCCESS));
53
+ });
54
+ } else {
55
+ dispatch(setUploadStatus(FILE_UPLOAD_SUCCESS));
56
+ }
51
57
  } else if (importsList.find(function (qtiImport) {
52
58
  return qtiImport.status !== 'failed';
53
59
  })) {
54
- dispatch(opts.pollForQtiInfo(parentId, parentType, opts));
60
+ dispatch(opts.pollForQtiInfo(parentId, parentType, waitForAssignmentSettingsImported, opts));
55
61
  } else {
56
62
  dispatch(setUploadStatus(FILE_UPLOAD_FAILURE));
57
63
  }
@@ -68,7 +74,7 @@ export var pollForQtiInfo = function pollForQtiInfo(parentId, parentType) {
68
74
  // the url from the first response, and finally receives the promise.
69
75
  // Exported for testing purposes
70
76
 
71
- export var postQtiCreate = function postQtiCreate(qtiImportUrl, dispatch, onError) {
77
+ export var postQtiCreate = function postQtiCreate(qtiImportUrl, dispatch, onError, waitForAssignmentSettingsImported) {
72
78
  return function (url) {
73
79
  var qtiCreateFetcher = new Fetcher({
74
80
  callType: CREATE_QTI_IMPORT,
@@ -81,7 +87,7 @@ export var postQtiCreate = function postQtiCreate(qtiImportUrl, dispatch, onErro
81
87
  var addImportToStore = function addImportToStore(importData) {
82
88
  dispatch(handleQtiImportsResponse([importData]));
83
89
  var parentType = importData.parent_type === 'Quiz' ? PARENT_TYPE_QUIZ : PARENT_TYPE_BANK;
84
- dispatch(pollForQtiInfo(importData.parent_id, parentType));
90
+ dispatch(pollForQtiInfo(importData.parent_id, parentType, waitForAssignmentSettingsImported));
85
91
  };
86
92
 
87
93
  return qtiCreateFetcher.post(qtiImportUrl, {
@@ -89,9 +95,9 @@ export var postQtiCreate = function postQtiCreate(qtiImportUrl, dispatch, onErro
89
95
  }).then(addImportToStore);
90
96
  };
91
97
  };
92
- export var qtiFileUpload = function qtiFileUpload(file, parentId, parentType, onError) {
93
- var withUrlCallback = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : sendFileToS3;
94
- var qtiCreateFxn = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : postQtiCreate;
98
+ export var qtiFileUpload = function qtiFileUpload(file, parentId, parentType, onError, waitForAssignmentSettingsImported) {
99
+ var withUrlCallback = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : sendFileToS3;
100
+ var qtiCreateFxn = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : postQtiCreate;
95
101
  return function (dispatch, getState) {
96
102
  var qtiImportUrl;
97
103
 
@@ -102,7 +108,7 @@ export var qtiFileUpload = function qtiFileUpload(file, parentId, parentType, on
102
108
  }
103
109
 
104
110
  var pathToGetUrl = "".concat(qtiImportUrl, "/upload_url");
105
- var onSuccess = qtiCreateFxn(qtiImportUrl, dispatch, onError);
111
+ var onSuccess = qtiCreateFxn(qtiImportUrl, dispatch, onError, waitForAssignmentSettingsImported);
106
112
  return getUploadUrl(pathToGetUrl).then(withUrlCallback(file, onSuccess, onError));
107
113
  };
108
114
  };
@@ -23,7 +23,7 @@ export var mapDispatchToProps = function mapDispatchToProps(dispatch, props) {
23
23
  return {
24
24
  onContinue: bindActionCreators(clearQtiImports, dispatch),
25
25
  fileUpload: function fileUpload(file, cancelAction) {
26
- boundQtiFileUpload(file, props.parentId, props.parentType, cancelAction);
26
+ boundQtiFileUpload(file, props.parentId, props.parentType, cancelAction, props.waitForAssignmentSettingsImported);
27
27
  }
28
28
  };
29
29
  };
@@ -83,8 +83,9 @@ export var MetricPopover = (_dec = themeable(theme, styles), _dec(_class = (_tem
83
83
  })), /*#__PURE__*/React.createElement("div", {
84
84
  className: styles.headerContainer
85
85
  }, /*#__PURE__*/React.createElement(Heading, {
86
+ className: styles.popoverTitle,
86
87
  level: "h3"
87
- }, _this.props.title)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Heading, {
88
+ }, _this.props.title)), /*#__PURE__*/React.createElement("div", null, _this.props.subtitle && /*#__PURE__*/React.createElement(Heading, {
88
89
  theme: {
89
90
  h5FontWeight: 700
90
91
  },
@@ -108,7 +109,7 @@ export var MetricPopover = (_dec = themeable(theme, styles), _dec(_class = (_tem
108
109
  },
109
110
  withBackground: false,
110
111
  withBorder: false,
111
- screenReaderLabel: t('Metric tooltip'),
112
+ screenReaderLabel: this.props.screenReaderLabel,
112
113
  renderIcon: _ref
113
114
  });
114
115
  }
@@ -1,18 +1,16 @@
1
+ import t from '@instructure/quiz-i18n/es/format-message';
1
2
  export var difficultyIndex = {
2
- title: 'Difficulty title',
3
- subtitle: 'difficulty subtitle',
4
- body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi elementum interdum risus sed condimentum. Duis vel nisi at quam luctus dictum id eu risus. Donec eget tristique justo',
5
- screenReaderLabel: 'Lorem one'
3
+ title: t('Item Difficulty (p value)'),
4
+ body: t('Item difficulty is the proportion of individuals who answered an item correctly. Multiplying this value by 100 equals the percentage of individuals who answered an item correctly. Values range from 0 to 1.'),
5
+ screenReaderLabel: t('Item difficulty (p value) tooltip')
6
6
  };
7
7
  export var discriminationIndex = {
8
- title: 'Discrimination title',
9
- subtitle: 'discrimination subtitle',
10
- body: 'Lorem ipsum dolor sit amet',
11
- screenReaderLabel: 'Lorem two'
8
+ title: t('Discrimination Index'),
9
+ body: t('Discrimination index assesses the ability of an item to differentiate between the highest scoring and lowest scoring individuals. It ranges from -1 to +1. A higher value suggests good discrimination while a lower index indicates poor discrimination.'),
10
+ screenReaderLabel: t('Discrimination index tooltip')
12
11
  };
13
12
  export var pearsonCorrelation = {
14
- title: 'Pearson correlation title',
15
- subtitle: 'pearson correlation subtitle',
16
- body: 'Lorem ipsum dolor sit amet',
17
- screenReaderLabel: 'Lorem three'
13
+ title: t('Corrected Item-Total Correlation Coefficient'),
14
+ body: t('Corrected item-total correlation coefficient is a widely used discrimination index used to assess the overall relationship between individual item scores and the total score of the quiz. Values range from -1 to +1. Values greater than +.20 are considered acceptable; low and negative values indicate unexpected scoring patterns or potential miskeys. Higher value indicates that higher scores on the item are associated with higher total scores.'),
15
+ screenReaderLabel: t('Corrected item-total correlation coefficient tooltip')
18
16
  };
@@ -174,7 +174,7 @@ export var NewItemAnalysis = (_dec = themeable(theme, styles), _dec(_class = (_t
174
174
  margin: "none medium none none"
175
175
  }, /*#__PURE__*/React.createElement(AnalysisPopoverMetric, {
176
176
  metricKey: "pearson_correlation",
177
- label: t('Pearson Correlation Coefficient'),
177
+ label: t('Corrected Item-Total Correlation Coefficient'),
178
178
  value: t.number(scores.pearson_correlation),
179
179
  popoverDescription: pearsonCorrelation
180
180
  }))))));
@@ -0,0 +1,11 @@
1
+ import t from '@instructure/quiz-i18n/es/format-message';
2
+ export var standardDeviation = {
3
+ title: t('Standard Deviation'),
4
+ body: t('Standard deviation is a measure of the average absolute deviation of scores around the mean. A low standard deviation indicates, on average, the scores tend to be close to the mean of the set. A high value indicates, on average, scores vary widely from the mean of the data set.'),
5
+ screenReaderLabel: t('Standard deviation tooltip')
6
+ };
7
+ export var cronbachsAlpha = {
8
+ title: t('Cronbach\'s Alpha'),
9
+ body: t('Cronbach\'s alpha is an internal consistency measure that estimates the reliability of a quiz. Values range from 0 to 1, with higher values indicating greater reliability.'),
10
+ screenReaderLabel: t('Cronbach\'s alpha tooltip')
11
+ };
@@ -29,18 +29,7 @@ import AnalysisPopoverMetric from "../AnalysisPopoverMetric/index.js";
29
29
  import AnalysisMetric from "../AnalysisMetric/index.js";
30
30
  import { ScoreDistribution } from "../charts/ScoreDistribution/presenter.js";
31
31
  import { quizAnalysisPropType } from "../propTypes.js";
32
- var stdDevPopoverTexts = {
33
- title: 'Lorem ipsum ',
34
- subtitle: 'subtitle',
35
- body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor',
36
- screenReaderLabel: 'standard deviation tooltip'
37
- };
38
- var cronbachsAlphaPopoverTexts = {
39
- title: 'Lorem ipsum ',
40
- subtitle: 'subtitle',
41
- body: 'cronbach\'s alpha description',
42
- screenReaderLabel: 'cronbach\'s alpha tooltip'
43
- };
32
+ import { cronbachsAlpha, standardDeviation } from "./popoverContent.js";
44
33
  export var NewQuizAnalysis = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
45
34
  _inherits(NewQuizAnalysis, _Component);
46
35
 
@@ -76,12 +65,12 @@ export var NewQuizAnalysis = (_dec = themeable(theme, styles), _dec(_class = (_t
76
65
  metricKey: "stddev",
77
66
  value: t.number(scores === null || scores === void 0 ? void 0 : scores.stddev),
78
67
  label: t('Standard Deviation'),
79
- popoverDescription: stdDevPopoverTexts
68
+ popoverDescription: standardDeviation
80
69
  }), /*#__PURE__*/React.createElement(AnalysisPopoverMetric, {
81
70
  metricKey: "cronbachs_alpha",
82
71
  value: t.number(scores === null || scores === void 0 ? void 0 : scores.cronbachs_alpha),
83
72
  label: t('Cronbach\'s Alpha'),
84
- popoverDescription: cronbachsAlphaPopoverTexts
73
+ popoverDescription: cronbachsAlpha
85
74
  })));
86
75
  };
87
76
 
@@ -46,6 +46,12 @@ export var NewQuizAndItemAnalysisReportCardPresenter = (_dec = themeable(theme,
46
46
 
47
47
  _this = _super.call.apply(_super, [this].concat(args));
48
48
 
49
+ _this.handleGeneration = function (_event) {
50
+ var filter = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'last_attempt';
51
+
52
+ _this.props.generateReports(filter);
53
+ };
54
+
49
55
  _this.renderMetrics = function () {
50
56
  var _quizAnalysis$scores, _quizAnalysis$scores2, _quizAnalysis$scores3;
51
57
 
@@ -105,7 +111,6 @@ export var NewQuizAndItemAnalysisReportCardPresenter = (_dec = themeable(theme,
105
111
  _this.renderReportCardFooter = function () {
106
112
  var _this$props2 = _this.props,
107
113
  generationInProgress = _this$props2.generationInProgress,
108
- generateReports = _this$props2.generateReports,
109
114
  analysisError = _this$props2.analysisError;
110
115
  return /*#__PURE__*/React.createElement(Flex, {
111
116
  direction: "row",
@@ -118,7 +123,7 @@ export var NewQuizAndItemAnalysisReportCardPresenter = (_dec = themeable(theme,
118
123
  weight: "bold",
119
124
  color: "danger"
120
125
  }, analysisError)), /*#__PURE__*/React.createElement(Flex.Item, null, generationInProgress ? _this.renderSpinner(t('Generation In Progress')) : /*#__PURE__*/React.createElement(Link, {
121
- onClick: generateReports,
126
+ onClick: _this.handleGeneration,
122
127
  role: "button"
123
128
  }, /*#__PURE__*/React.createElement(Text, {
124
129
  size: "small"
@@ -3,7 +3,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
3
  import { getReportGenerationFailure } from "./errorMessages.js";
4
4
  export var generateReports = /*#__PURE__*/function () {
5
5
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
6
- var setGenerationInProgress, setStatusPollingInProgress, generateAnalysis, filter, addError;
6
+ var setGenerationInProgress, setStatusPollingInProgress, generateAnalysis, filter, addError, response;
7
7
  return _regeneratorRuntime.wrap(function _callee$(_context) {
8
8
  while (1) {
9
9
  switch (_context.prev = _context.next) {
@@ -15,22 +15,34 @@ export var generateReports = /*#__PURE__*/function () {
15
15
  return generateAnalysis(filter);
16
16
 
17
17
  case 5:
18
+ response = _context.sent;
19
+
20
+ if (response) {
21
+ _context.next = 10;
22
+ break;
23
+ }
24
+
25
+ addError(getReportGenerationFailure());
26
+ setGenerationInProgress(false);
27
+ return _context.abrupt("return");
28
+
29
+ case 10:
18
30
  setStatusPollingInProgress(true);
19
- _context.next = 12;
31
+ _context.next = 17;
20
32
  break;
21
33
 
22
- case 8:
23
- _context.prev = 8;
34
+ case 13:
35
+ _context.prev = 13;
24
36
  _context.t0 = _context["catch"](1);
25
37
  addError(getReportGenerationFailure());
26
38
  setGenerationInProgress(false);
27
39
 
28
- case 12:
40
+ case 17:
29
41
  case "end":
30
42
  return _context.stop();
31
43
  }
32
44
  }
33
- }, _callee, null, [[1, 8]]);
45
+ }, _callee, null, [[1, 13]]);
34
46
  }));
35
47
 
36
48
  return function generateReports(_x) {
@@ -36,8 +36,8 @@ var getQTIInfo = function getQTIInfo(quizId) {
36
36
 
37
37
  exports.getQTIInfo = getQTIInfo;
38
38
 
39
- var pollForQtiInfo = function pollForQtiInfo(parentId, parentType) {
40
- var opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
39
+ var pollForQtiInfo = function pollForQtiInfo(parentId, parentType, waitForAssignmentSettingsImported) {
40
+ var opts = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {
41
41
  getExistingBankAndEntries: _banks.getExistingBankAndEntries,
42
42
  getExistingQuizAndItems: _quizzes.getExistingQuizAndItems,
43
43
  pollForQtiInfo: pollForQtiInfo
@@ -66,11 +66,17 @@ var pollForQtiInfo = function pollForQtiInfo(parentId, parentType) {
66
66
  dispatch(opts.getExistingBankAndEntries(parentId));
67
67
  }
68
68
 
69
- dispatch((0, _upload.uploadStatus)(_quizCommon.FILE_UPLOAD_SUCCESS));
69
+ if (waitForAssignmentSettingsImported) {
70
+ waitForAssignmentSettingsImported().then(function () {
71
+ dispatch((0, _upload.uploadStatus)(_quizCommon.FILE_UPLOAD_SUCCESS));
72
+ });
73
+ } else {
74
+ dispatch((0, _upload.uploadStatus)(_quizCommon.FILE_UPLOAD_SUCCESS));
75
+ }
70
76
  } else if (importsList.find(function (qtiImport) {
71
77
  return qtiImport.status !== 'failed';
72
78
  })) {
73
- dispatch(opts.pollForQtiInfo(parentId, parentType, opts));
79
+ dispatch(opts.pollForQtiInfo(parentId, parentType, waitForAssignmentSettingsImported, opts));
74
80
  } else {
75
81
  dispatch((0, _upload.uploadStatus)(_quizCommon.FILE_UPLOAD_FAILURE));
76
82
  }
@@ -90,7 +96,7 @@ var pollForQtiInfo = function pollForQtiInfo(parentId, parentType) {
90
96
 
91
97
  exports.pollForQtiInfo = pollForQtiInfo;
92
98
 
93
- var postQtiCreate = function postQtiCreate(qtiImportUrl, dispatch, onError) {
99
+ var postQtiCreate = function postQtiCreate(qtiImportUrl, dispatch, onError, waitForAssignmentSettingsImported) {
94
100
  return function (url) {
95
101
  var qtiCreateFetcher = new _Fetcher.default({
96
102
  callType: _quizCommon.CREATE_QTI_IMPORT,
@@ -103,7 +109,7 @@ var postQtiCreate = function postQtiCreate(qtiImportUrl, dispatch, onError) {
103
109
  var addImportToStore = function addImportToStore(importData) {
104
110
  dispatch((0, _callHandlers.handleQtiImportsResponse)([importData]));
105
111
  var parentType = importData.parent_type === 'Quiz' ? _quizCommon.PARENT_TYPE_QUIZ : _quizCommon.PARENT_TYPE_BANK;
106
- dispatch(pollForQtiInfo(importData.parent_id, parentType));
112
+ dispatch(pollForQtiInfo(importData.parent_id, parentType, waitForAssignmentSettingsImported));
107
113
  };
108
114
 
109
115
  return qtiCreateFetcher.post(qtiImportUrl, {
@@ -114,9 +120,9 @@ var postQtiCreate = function postQtiCreate(qtiImportUrl, dispatch, onError) {
114
120
 
115
121
  exports.postQtiCreate = postQtiCreate;
116
122
 
117
- var qtiFileUpload = function qtiFileUpload(file, parentId, parentType, onError) {
118
- var withUrlCallback = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : _fileUpload.sendFileToS3;
119
- var qtiCreateFxn = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : postQtiCreate;
123
+ var qtiFileUpload = function qtiFileUpload(file, parentId, parentType, onError, waitForAssignmentSettingsImported) {
124
+ var withUrlCallback = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : _fileUpload.sendFileToS3;
125
+ var qtiCreateFxn = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : postQtiCreate;
120
126
  return function (dispatch, getState) {
121
127
  var qtiImportUrl;
122
128
 
@@ -127,7 +133,7 @@ var qtiFileUpload = function qtiFileUpload(file, parentId, parentType, onError)
127
133
  }
128
134
 
129
135
  var pathToGetUrl = "".concat(qtiImportUrl, "/upload_url");
130
- var onSuccess = qtiCreateFxn(qtiImportUrl, dispatch, onError);
136
+ var onSuccess = qtiCreateFxn(qtiImportUrl, dispatch, onError, waitForAssignmentSettingsImported);
131
137
  return (0, _fileUpload.getUploadUrl)(pathToGetUrl).then(withUrlCallback(file, onSuccess, onError));
132
138
  };
133
139
  };
@@ -42,7 +42,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch, props) {
42
42
  return {
43
43
  onContinue: (0, _redux.bindActionCreators)(_qtiImports.clearQtiImports, dispatch),
44
44
  fileUpload: function fileUpload(file, cancelAction) {
45
- boundQtiFileUpload(file, props.parentId, props.parentType, cancelAction);
45
+ boundQtiFileUpload(file, props.parentId, props.parentType, cancelAction, props.waitForAssignmentSettingsImported);
46
46
  }
47
47
  };
48
48
  };
@@ -108,8 +108,9 @@ var MetricPopover = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
108
108
  })), /*#__PURE__*/_react.default.createElement("div", {
109
109
  className: styles.headerContainer
110
110
  }, /*#__PURE__*/_react.default.createElement(_uiHeading.Heading, {
111
+ className: styles.popoverTitle,
111
112
  level: "h3"
112
- }, _this.props.title)), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_uiHeading.Heading, {
113
+ }, _this.props.title)), /*#__PURE__*/_react.default.createElement("div", null, _this.props.subtitle && /*#__PURE__*/_react.default.createElement(_uiHeading.Heading, {
113
114
  theme: {
114
115
  h5FontWeight: 700
115
116
  },
@@ -133,7 +134,7 @@ var MetricPopover = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
133
134
  },
134
135
  withBackground: false,
135
136
  withBorder: false,
136
- screenReaderLabel: (0, _formatMessage.default)('Metric tooltip'),
137
+ screenReaderLabel: this.props.screenReaderLabel,
137
138
  renderIcon: _ref
138
139
  });
139
140
  }
@@ -1,27 +1,29 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
8
  exports.pearsonCorrelation = exports.discriminationIndex = exports.difficultyIndex = void 0;
9
+
10
+ var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
11
+
7
12
  var difficultyIndex = {
8
- title: 'Difficulty title',
9
- subtitle: 'difficulty subtitle',
10
- body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi elementum interdum risus sed condimentum. Duis vel nisi at quam luctus dictum id eu risus. Donec eget tristique justo',
11
- screenReaderLabel: 'Lorem one'
13
+ title: (0, _formatMessage.default)('Item Difficulty (p value)'),
14
+ body: (0, _formatMessage.default)('Item difficulty is the proportion of individuals who answered an item correctly. Multiplying this value by 100 equals the percentage of individuals who answered an item correctly. Values range from 0 to 1.'),
15
+ screenReaderLabel: (0, _formatMessage.default)('Item difficulty (p value) tooltip')
12
16
  };
13
17
  exports.difficultyIndex = difficultyIndex;
14
18
  var discriminationIndex = {
15
- title: 'Discrimination title',
16
- subtitle: 'discrimination subtitle',
17
- body: 'Lorem ipsum dolor sit amet',
18
- screenReaderLabel: 'Lorem two'
19
+ title: (0, _formatMessage.default)('Discrimination Index'),
20
+ body: (0, _formatMessage.default)('Discrimination index assesses the ability of an item to differentiate between the highest scoring and lowest scoring individuals. It ranges from -1 to +1. A higher value suggests good discrimination while a lower index indicates poor discrimination.'),
21
+ screenReaderLabel: (0, _formatMessage.default)('Discrimination index tooltip')
19
22
  };
20
23
  exports.discriminationIndex = discriminationIndex;
21
24
  var pearsonCorrelation = {
22
- title: 'Pearson correlation title',
23
- subtitle: 'pearson correlation subtitle',
24
- body: 'Lorem ipsum dolor sit amet',
25
- screenReaderLabel: 'Lorem three'
25
+ title: (0, _formatMessage.default)('Corrected Item-Total Correlation Coefficient'),
26
+ body: (0, _formatMessage.default)('Corrected item-total correlation coefficient is a widely used discrimination index used to assess the overall relationship between individual item scores and the total score of the quiz. Values range from -1 to +1. Values greater than +.20 are considered acceptable; low and negative values indicate unexpected scoring patterns or potential miskeys. Higher value indicates that higher scores on the item are associated with higher total scores.'),
27
+ screenReaderLabel: (0, _formatMessage.default)('Corrected item-total correlation coefficient tooltip')
26
28
  };
27
29
  exports.pearsonCorrelation = pearsonCorrelation;
@@ -206,7 +206,7 @@ var NewItemAnalysis = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
206
206
  margin: "none medium none none"
207
207
  }, /*#__PURE__*/_react.default.createElement(_index4.default, {
208
208
  metricKey: "pearson_correlation",
209
- label: (0, _formatMessage.default)('Pearson Correlation Coefficient'),
209
+ label: (0, _formatMessage.default)('Corrected Item-Total Correlation Coefficient'),
210
210
  value: _formatMessage.default.number(scores.pearson_correlation),
211
211
  popoverDescription: _popoverContent.pearsonCorrelation
212
212
  }))))));
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.cronbachsAlpha = exports.standardDeviation = void 0;
9
+
10
+ var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
11
+
12
+ var standardDeviation = {
13
+ title: (0, _formatMessage.default)('Standard Deviation'),
14
+ body: (0, _formatMessage.default)('Standard deviation is a measure of the average absolute deviation of scores around the mean. A low standard deviation indicates, on average, the scores tend to be close to the mean of the set. A high value indicates, on average, scores vary widely from the mean of the data set.'),
15
+ screenReaderLabel: (0, _formatMessage.default)('Standard deviation tooltip')
16
+ };
17
+ exports.standardDeviation = standardDeviation;
18
+ var cronbachsAlpha = {
19
+ title: (0, _formatMessage.default)('Cronbach\'s Alpha'),
20
+ body: (0, _formatMessage.default)('Cronbach\'s alpha is an internal consistency measure that estimates the reliability of a quiz. Values range from 0 to 1, with higher values indicating greater reliability.'),
21
+ screenReaderLabel: (0, _formatMessage.default)('Cronbach\'s alpha tooltip')
22
+ };
23
+ exports.cronbachsAlpha = cronbachsAlpha;
@@ -41,6 +41,8 @@ var _presenter = require("../charts/ScoreDistribution/presenter.js");
41
41
 
42
42
  var _propTypes = require("../propTypes.js");
43
43
 
44
+ var _popoverContent = require("./popoverContent.js");
45
+
44
46
  var _dec, _class, _class2, _temp;
45
47
 
46
48
  var styles = {
@@ -55,18 +57,6 @@ var styles = {
55
57
  'metricGroup': 'fQZVs_dPzc',
56
58
  'metricsWrapper': 'fQZVs_cpZE'
57
59
  };
58
- var stdDevPopoverTexts = {
59
- title: 'Lorem ipsum ',
60
- subtitle: 'subtitle',
61
- body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor',
62
- screenReaderLabel: 'standard deviation tooltip'
63
- };
64
- var cronbachsAlphaPopoverTexts = {
65
- title: 'Lorem ipsum ',
66
- subtitle: 'subtitle',
67
- body: 'cronbach\'s alpha description',
68
- screenReaderLabel: 'cronbach\'s alpha tooltip'
69
- };
70
60
  var NewQuizAnalysis = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
71
61
  (0, _inherits2.default)(NewQuizAnalysis, _Component);
72
62
 
@@ -102,12 +92,12 @@ var NewQuizAnalysis = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
102
92
  metricKey: "stddev",
103
93
  value: _formatMessage.default.number(scores === null || scores === void 0 ? void 0 : scores.stddev),
104
94
  label: (0, _formatMessage.default)('Standard Deviation'),
105
- popoverDescription: stdDevPopoverTexts
95
+ popoverDescription: _popoverContent.standardDeviation
106
96
  }), /*#__PURE__*/_react.default.createElement(_index3.default, {
107
97
  metricKey: "cronbachs_alpha",
108
98
  value: _formatMessage.default.number(scores === null || scores === void 0 ? void 0 : scores.cronbachs_alpha),
109
99
  label: (0, _formatMessage.default)('Cronbach\'s Alpha'),
110
- popoverDescription: cronbachsAlphaPopoverTexts
100
+ popoverDescription: _popoverContent.cronbachsAlpha
111
101
  })));
112
102
  };
113
103
 
@@ -73,6 +73,12 @@ var NewQuizAndItemAnalysisReportCardPresenter = (_dec = (0, _uiThemeable.themeab
73
73
 
74
74
  _this = _super.call.apply(_super, [this].concat(args));
75
75
 
76
+ _this.handleGeneration = function (_event) {
77
+ var filter = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'last_attempt';
78
+
79
+ _this.props.generateReports(filter);
80
+ };
81
+
76
82
  _this.renderMetrics = function () {
77
83
  var _quizAnalysis$scores, _quizAnalysis$scores2, _quizAnalysis$scores3;
78
84
 
@@ -132,7 +138,6 @@ var NewQuizAndItemAnalysisReportCardPresenter = (_dec = (0, _uiThemeable.themeab
132
138
  _this.renderReportCardFooter = function () {
133
139
  var _this$props2 = _this.props,
134
140
  generationInProgress = _this$props2.generationInProgress,
135
- generateReports = _this$props2.generateReports,
136
141
  analysisError = _this$props2.analysisError;
137
142
  return /*#__PURE__*/_react.default.createElement(_uiFlex.Flex, {
138
143
  direction: "row",
@@ -145,7 +150,7 @@ var NewQuizAndItemAnalysisReportCardPresenter = (_dec = (0, _uiThemeable.themeab
145
150
  weight: "bold",
146
151
  color: "danger"
147
152
  }, analysisError)), /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, null, generationInProgress ? _this.renderSpinner((0, _formatMessage.default)('Generation In Progress')) : /*#__PURE__*/_react.default.createElement(_uiLink.Link, {
148
- onClick: generateReports,
153
+ onClick: _this.handleGeneration,
149
154
  role: "button"
150
155
  }, /*#__PURE__*/_react.default.createElement(_uiText.Text, {
151
156
  size: "small"
@@ -15,7 +15,7 @@ var _errorMessages = require("./errorMessages.js");
15
15
 
16
16
  var generateReports = /*#__PURE__*/function () {
17
17
  var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
18
- var setGenerationInProgress, setStatusPollingInProgress, generateAnalysis, filter, addError;
18
+ var setGenerationInProgress, setStatusPollingInProgress, generateAnalysis, filter, addError, response;
19
19
  return _regenerator.default.wrap(function _callee$(_context) {
20
20
  while (1) {
21
21
  switch (_context.prev = _context.next) {
@@ -27,22 +27,34 @@ var generateReports = /*#__PURE__*/function () {
27
27
  return generateAnalysis(filter);
28
28
 
29
29
  case 5:
30
+ response = _context.sent;
31
+
32
+ if (response) {
33
+ _context.next = 10;
34
+ break;
35
+ }
36
+
37
+ addError((0, _errorMessages.getReportGenerationFailure)());
38
+ setGenerationInProgress(false);
39
+ return _context.abrupt("return");
40
+
41
+ case 10:
30
42
  setStatusPollingInProgress(true);
31
- _context.next = 12;
43
+ _context.next = 17;
32
44
  break;
33
45
 
34
- case 8:
35
- _context.prev = 8;
46
+ case 13:
47
+ _context.prev = 13;
36
48
  _context.t0 = _context["catch"](1);
37
49
  addError((0, _errorMessages.getReportGenerationFailure)());
38
50
  setGenerationInProgress(false);
39
51
 
40
- case 12:
52
+ case 17:
41
53
  case "end":
42
54
  return _context.stop();
43
55
  }
44
56
  }
45
- }, _callee, null, [[1, 8]]);
57
+ }, _callee, null, [[1, 13]]);
46
58
  }));
47
59
 
48
60
  return function generateReports(_x) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/quiz-core",
3
- "version": "17.63.1-rc.8+2e8d0f7f4",
3
+ "version": "17.64.0",
4
4
  "license": "MIT",
5
5
  "description": "The Quiz React SDK by Instructure Inc.",
6
6
  "author": "Instructure, Inc. Engineering and Product Design",
@@ -41,11 +41,11 @@
41
41
  ],
42
42
  "dependencies": {
43
43
  "@instructure/outcomes-ui": "^2.1.9",
44
- "@instructure/quiz-common": "17.63.1-rc.8+2e8d0f7f4",
45
- "@instructure/quiz-i18n": "17.63.1-rc.8+2e8d0f7f4",
46
- "@instructure/quiz-interactions": "17.63.1-rc.8+2e8d0f7f4",
47
- "@instructure/quiz-number-input": "17.63.1-rc.8+2e8d0f7f4",
48
- "@instructure/quiz-rce": "17.63.1-rc.8+2e8d0f7f4",
44
+ "@instructure/quiz-common": "^17.64.0",
45
+ "@instructure/quiz-i18n": "^17.64.0",
46
+ "@instructure/quiz-interactions": "^17.64.0",
47
+ "@instructure/quiz-number-input": "^17.64.0",
48
+ "@instructure/quiz-rce": "^17.64.0",
49
49
  "@instructure/ui-a11y-content": "^7.20.0",
50
50
  "@instructure/ui-alerts": "^7.20.0",
51
51
  "@instructure/ui-avatar": "^7.20.0",
@@ -106,7 +106,7 @@
106
106
  "eventemitter3": "^3.1.0",
107
107
  "humps": "^2.0.0",
108
108
  "immutable": "^3.8.1",
109
- "instructure-validations": "17.63.1-rc.8+2e8d0f7f4",
109
+ "instructure-validations": "^17.64.0",
110
110
  "ipaddr.js": "^1.5.4",
111
111
  "isomorphic-fetch": "^2.2.0",
112
112
  "isuuid": "^0.1.0",
@@ -138,7 +138,7 @@
138
138
  "uuid": "^3.2.1"
139
139
  },
140
140
  "devDependencies": {
141
- "@instructure/quiz-scripts": "17.63.0",
141
+ "@instructure/quiz-scripts": "^17.64.0",
142
142
  "@instructure/ui-axe-check": "^7.20.0",
143
143
  "@instructure/ui-babel-preset": "^7.20.0",
144
144
  "@instructure/ui-karma-config": "^7.20.0",
@@ -157,7 +157,7 @@
157
157
  "intl": "^1.2.4",
158
158
  "jquery": "^2.2.3",
159
159
  "most-subject": "^5.3.0",
160
- "quiz-presets": "17.63.1-rc.8+2e8d0f7f4",
160
+ "quiz-presets": "^17.64.0",
161
161
  "react": "^16.8.6",
162
162
  "react-addons-test-utils": "^15.6.2",
163
163
  "react-dom": "^16.8.6",
@@ -173,5 +173,5 @@
173
173
  "publishConfig": {
174
174
  "access": "public"
175
175
  },
176
- "gitHead": "2e8d0f7f41b9295b04f19cc7317efb74fff965ab"
176
+ "gitHead": "ec1c160f09f4689642c51740ca977756bb0dba45"
177
177
  }