@instructure/quiz-core 18.5.1-rc.8 → 18.6.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 +23 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnalysisMetric/presenter.js +8 -5
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/AggregationType/presenter.js +11 -21
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ChoiceType/presenter.js +5 -5
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingType.js +15 -25
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +4 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/OrderingType.js +87 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/index.js +2 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/presenter.js +8 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/index.js +1 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/presenter.js +73 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/index.js +1 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/presenter.js +9 -9
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/theme.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/errorMessages.js +3 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/exportReports.js +65 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/utils.js +4 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/withAnalysisState.js +2 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/withAnalysisStatePresenter.js +41 -1
- package/es/reporting/components/resources/ReportCard/theme.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnalysisMetric/presenter.js +8 -5
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/AggregationType/presenter.js +15 -24
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ChoiceType/presenter.js +5 -5
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingType.js +19 -29
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +5 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/OrderingType.js +115 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/index.js +9 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/presenter.js +7 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/index.js +13 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/presenter.js +92 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/index.js +1 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/presenter.js +9 -9
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/theme.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/errorMessages.js +7 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/exportReports.js +80 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/utils.js +10 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/withAnalysisState.js +3 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/withAnalysisStatePresenter.js +43 -1
- package/lib/reporting/components/resources/ReportCard/theme.js +1 -1
- package/package.json +11 -10
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/AggregationType/theme.js +0 -5
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/AggregationType/theme.js +0 -12
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
|
+
# [18.6.0](https://gerrit.instructure.com/quizzes-ui/compare/v18.5.0...v18.6.0) (2023-11-14)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **reports:** fixes for generate report button positioning after audit ([9f64fe1](https://gerrit.instructure.com/quizzes-ui/commits/9f64fe1029e0029cb999b0d8255369562691241f))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **afs-formula:** Add formula aggregation ui component ([7e05172](https://gerrit.instructure.com/quizzes-ui/commits/7e05172cfb3460af3f9231c0e072898116415f40))
|
|
17
|
+
* **afs-hot-spot:** Add hot-spot afs ([b23d37c](https://gerrit.instructure.com/quizzes-ui/commits/b23d37cd626992f7db90c3453d1556df7b2b4cfb))
|
|
18
|
+
* **AfsOrderingType:** create frontend for ordering afs and summary part ([d1e9066](https://gerrit.instructure.com/quizzes-ui/commits/d1e9066d016e3503fecd812c533c388e68e49136))
|
|
19
|
+
* **Fetcher:** support auth header injection for requests with custom headers ([1553b56](https://gerrit.instructure.com/quizzes-ui/commits/1553b56ba37bfd69bb798c66ec34b3cd601ad8a3))
|
|
20
|
+
* **MatchingType:** create frontend for the afs table for matching question type ([c654589](https://gerrit.instructure.com/quizzes-ui/commits/c6545899277fee2f0cb7a574740c0b89e13c3ad3))
|
|
21
|
+
* **quizanalysis:** extend quiz analysis chart by extreme low and high value ([846b42d](https://gerrit.instructure.com/quizzes-ui/commits/846b42d6fbb1d77bb36641c1fa31725bb5b42b47))
|
|
22
|
+
* **Reports:** increase report card sizes, adapt metric rendering ([06ef7c9](https://gerrit.instructure.com/quizzes-ui/commits/06ef7c93969d591a3403d13a9365183179c855b1))
|
|
23
|
+
* **Reports:** pass down export download functionality to analysis components ([7684e86](https://gerrit.instructure.com/quizzes-ui/commits/7684e8663eece2857d4f080e80563f2a6f31de33))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
6
29
|
# [18.5.0](https://gerrit.instructure.com/quizzes-ui/compare/v18.4.0...v18.5.0) (2023-11-01)
|
|
7
30
|
|
|
8
31
|
|
package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnalysisMetric/presenter.js
CHANGED
|
@@ -8,11 +8,12 @@ var _dec, _class, _class2, _temp;
|
|
|
8
8
|
import { themeable } from '@instructure/ui-themeable';
|
|
9
9
|
import theme from "./theme.js";
|
|
10
10
|
var styles = {
|
|
11
|
-
componentId: '
|
|
11
|
+
componentId: 'fKESK',
|
|
12
12
|
template: function template(theme) {
|
|
13
|
-
return "\n\n.
|
|
13
|
+
return "\n\n.fKESK_eckF{margin:0;max-width:159px;text-transform:capitalize}\n\n.fKESK_CIyo{width:90px}";
|
|
14
14
|
},
|
|
15
|
-
'metricLabel': '
|
|
15
|
+
'metricLabel': 'fKESK_eckF',
|
|
16
|
+
'metricWrapper': 'fKESK_CIyo'
|
|
16
17
|
};
|
|
17
18
|
import React, { Component } from 'react';
|
|
18
19
|
import { getSanitizedMetricValue } from "../utils.js";
|
|
@@ -37,7 +38,9 @@ export var AnalysisMetric = (_dec = themeable(theme, styles), _dec(_class = (_te
|
|
|
37
38
|
label = _this$props.label,
|
|
38
39
|
value = _this$props.value,
|
|
39
40
|
suffix = _this$props.suffix;
|
|
40
|
-
return /*#__PURE__*/React.createElement(
|
|
41
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
className: styles.metricWrapper
|
|
43
|
+
}, /*#__PURE__*/React.createElement(Metric, {
|
|
41
44
|
theme: {
|
|
42
45
|
valueFontWeight: 500,
|
|
43
46
|
padding: '0'
|
|
@@ -48,7 +51,7 @@ export var AnalysisMetric = (_dec = themeable(theme, styles), _dec(_class = (_te
|
|
|
48
51
|
className: styles.metricLabel
|
|
49
52
|
}, label),
|
|
50
53
|
renderValue: getSanitizedMetricValue(value, suffix)
|
|
51
|
-
});
|
|
54
|
+
}));
|
|
52
55
|
}
|
|
53
56
|
}]);
|
|
54
57
|
|
|
@@ -1,24 +1,13 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
2
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
3
3
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
4
|
-
|
|
5
|
-
var _dec, _class, _class2, _temp;
|
|
6
|
-
|
|
7
4
|
import React, { Component } from 'react';
|
|
8
5
|
import PropTypes from 'prop-types';
|
|
9
6
|
import AggregationTable from "../shared/AggregationTable/index.js";
|
|
10
7
|
import { onlyAggregatePropType } from "../../propTypes.js";
|
|
11
8
|
import { AfsTableWrapper } from "../shared/AfsTableWrapper/presenter.js";
|
|
12
|
-
import
|
|
13
|
-
var
|
|
14
|
-
componentId: 'JFhmr',
|
|
15
|
-
template: function template(theme) {
|
|
16
|
-
return "\n\n.JFhmr_cVld{max-width:100%;width:calc(25% + 350px)}";
|
|
17
|
-
},
|
|
18
|
-
'answerFrequencySummaryContainer': 'JFhmr_cVld'
|
|
19
|
-
};
|
|
20
|
-
import { themeable } from '@instructure/ui-themeable';
|
|
21
|
-
export var AggregationType = (_dec = themeable({}, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
9
|
+
import { AfsPartsContainer } from "../shared/AfsPartsContainer/presenter.js";
|
|
10
|
+
export var AggregationType = /*#__PURE__*/function (_Component) {
|
|
22
11
|
_inherits(AggregationType, _Component);
|
|
23
12
|
|
|
24
13
|
var _super = _createSuper(AggregationType);
|
|
@@ -38,19 +27,20 @@ export var AggregationType = (_dec = themeable({}, styles), _dec(_class = (_temp
|
|
|
38
27
|
var _this$props = _this.props,
|
|
39
28
|
answerSummary = _this$props.answerSummary,
|
|
40
29
|
itemId = _this$props.itemId;
|
|
41
|
-
return /*#__PURE__*/React.createElement(AfsTableWrapper, null, /*#__PURE__*/React.createElement(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}))
|
|
30
|
+
return /*#__PURE__*/React.createElement(AfsTableWrapper, null, /*#__PURE__*/React.createElement(AfsPartsContainer, {
|
|
31
|
+
aggregationTable: /*#__PURE__*/React.createElement(AggregationTable, {
|
|
32
|
+
itemId: itemId,
|
|
33
|
+
answerSummary: answerSummary
|
|
34
|
+
})
|
|
35
|
+
}));
|
|
47
36
|
};
|
|
48
37
|
|
|
49
38
|
return _this;
|
|
50
39
|
}
|
|
51
40
|
|
|
52
41
|
return AggregationType;
|
|
53
|
-
}(Component)
|
|
42
|
+
}(Component);
|
|
43
|
+
AggregationType.propTypes = {
|
|
54
44
|
itemId: PropTypes.number.isRequired,
|
|
55
45
|
answerSummary: onlyAggregatePropType
|
|
56
|
-
}.isRequired
|
|
46
|
+
}.isRequired;
|
|
@@ -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: '
|
|
17
|
+
componentId: 'dCEWT',
|
|
18
18
|
template: function template(theme) {
|
|
19
|
-
return "\n\n.
|
|
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)}");
|
|
20
20
|
},
|
|
21
|
-
'tableWrapper': '
|
|
22
|
-
'
|
|
21
|
+
'tableWrapper': 'dCEWT_rMrG',
|
|
22
|
+
'tableContainer': 'dCEWT_SVtU'
|
|
23
23
|
};
|
|
24
24
|
import theme from "./theme.js";
|
|
25
25
|
import AfsTableWrapper from "../shared/AfsTableWrapper/index.js";
|
|
@@ -79,7 +79,7 @@ export var ChoiceType = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
79
79
|
var respondentsHeaderId = "answer-frequency-summary-respondents-".concat(itemId);
|
|
80
80
|
var percentageHeaderId = "answer-frequency-summary-percentage-".concat(itemId);
|
|
81
81
|
return /*#__PURE__*/React.createElement(AfsTableWrapper, null, /*#__PURE__*/React.createElement("div", {
|
|
82
|
-
className: classNames(styles.
|
|
82
|
+
className: classNames(styles.tableContainer)
|
|
83
83
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
84
84
|
caption: t('Answer Frequency Summary')
|
|
85
85
|
}, /*#__PURE__*/React.createElement(Table.Head, null, /*#__PURE__*/React.createElement(Table.Row, null, /*#__PURE__*/React.createElement(Table.ColHeader, {
|
|
@@ -1,26 +1,14 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
1
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
2
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
3
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
|
|
6
|
-
var _dec, _class, _class2, _temp;
|
|
7
|
-
|
|
8
4
|
import React, { Component } from 'react';
|
|
9
5
|
import AfsTableWrapper from "../shared/AfsTableWrapper/index.js";
|
|
10
6
|
import MatchingTypeTable from "./MatchingTypeTable/index.js";
|
|
11
7
|
import PropTypes from 'prop-types';
|
|
12
8
|
import { matchingTypeAnswerSummaryPropType } from "../../propTypes.js";
|
|
13
9
|
import MatchingTypeOrderer from "./utils/matchingTypeOrderer.js";
|
|
14
|
-
import
|
|
15
|
-
var
|
|
16
|
-
componentId: 'JFhmr',
|
|
17
|
-
template: function template(theme) {
|
|
18
|
-
return "\n\n.JFhmr_cVld{max-width:100%;width:calc(25% + 350px)}";
|
|
19
|
-
},
|
|
20
|
-
'answerFrequencySummaryContainer': 'JFhmr_cVld'
|
|
21
|
-
};
|
|
22
|
-
import { themeable } from '@instructure/ui-themeable';
|
|
23
|
-
export var MatchingType = (_dec = themeable({}, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
10
|
+
import { AfsPartsContainer } from "../shared/AfsPartsContainer/presenter.js";
|
|
11
|
+
export var MatchingType = /*#__PURE__*/function (_Component) {
|
|
24
12
|
_inherits(MatchingType, _Component);
|
|
25
13
|
|
|
26
14
|
var _super = _createSuper(MatchingType);
|
|
@@ -46,22 +34,24 @@ export var MatchingType = (_dec = themeable({}, styles), _dec(_class = (_temp =
|
|
|
46
34
|
var answerKeys = Object.keys(exampleAnswers);
|
|
47
35
|
var orderedAnswerKeys = MatchingTypeOrderer.orderAnswerKeysForDiagonal(answerSummary, answerKeys);
|
|
48
36
|
var orderedQuestionKeys = MatchingTypeOrderer.orderQuestionKeysForDiagonal(answerSummary, questionKeys, orderedAnswerKeys);
|
|
49
|
-
var
|
|
50
|
-
return /*#__PURE__*/React.createElement(AfsTableWrapper, null, /*#__PURE__*/React.createElement(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
37
|
+
var tableHalfWidth = orderedAnswerKeys.length <= 3;
|
|
38
|
+
return /*#__PURE__*/React.createElement(AfsTableWrapper, null, /*#__PURE__*/React.createElement(AfsPartsContainer, {
|
|
39
|
+
tableHalfWidth: tableHalfWidth,
|
|
40
|
+
afsTable: /*#__PURE__*/React.createElement(MatchingTypeTable, {
|
|
41
|
+
itemId: itemId,
|
|
42
|
+
answerSummary: answerSummary,
|
|
43
|
+
orderedAnswerKeys: orderedAnswerKeys,
|
|
44
|
+
orderedQuestionKeys: orderedQuestionKeys
|
|
45
|
+
})
|
|
46
|
+
}));
|
|
58
47
|
};
|
|
59
48
|
|
|
60
49
|
return _this;
|
|
61
50
|
}
|
|
62
51
|
|
|
63
52
|
return MatchingType;
|
|
64
|
-
}(Component)
|
|
53
|
+
}(Component);
|
|
54
|
+
MatchingType.propTypes = {
|
|
65
55
|
itemId: PropTypes.number,
|
|
66
56
|
answerSummary: matchingTypeAnswerSummaryPropType
|
|
67
|
-
}.isRequired
|
|
57
|
+
}.isRequired;
|
|
@@ -27,6 +27,7 @@ import { IconCheckSolid } from '@instructure/ui-icons';
|
|
|
27
27
|
import { matchingTypeAnswerSummaryPropType } from "../../../propTypes.js";
|
|
28
28
|
import classNames from 'classnames';
|
|
29
29
|
import theme from "./theme.js";
|
|
30
|
+
import { extractTextFromHtml } from '@instructure/quiz-interactions';
|
|
30
31
|
|
|
31
32
|
var _ref = /*#__PURE__*/React.createElement(IconCheckSolid, null);
|
|
32
33
|
|
|
@@ -146,6 +147,8 @@ export var MatchingTypeTable = (_dec = themeable(theme, styles), _dec(_class = (
|
|
|
146
147
|
});
|
|
147
148
|
var questionRowHeaderId = "question-row-header-id-".concat(orderedQuestionKey, "-").concat(itemId);
|
|
148
149
|
var rowKey = "row-".concat(orderedQuestionKey, "-").concat(itemId);
|
|
150
|
+
var extractedQuestionBody = extractTextFromHtml(question.body);
|
|
151
|
+
var questionBody = extractedQuestionBody.trim().length > 0 ? extractedQuestionBody : question.body;
|
|
149
152
|
return /*#__PURE__*/React.createElement(Table.Row, {
|
|
150
153
|
key: rowKey
|
|
151
154
|
}, /*#__PURE__*/React.createElement(Table.Cell, {
|
|
@@ -154,7 +157,7 @@ export var MatchingTypeTable = (_dec = themeable(theme, styles), _dec(_class = (
|
|
|
154
157
|
theme: {
|
|
155
158
|
padding: '0 0 1px 0'
|
|
156
159
|
}
|
|
157
|
-
},
|
|
160
|
+
}, questionBody), answerCells);
|
|
158
161
|
};
|
|
159
162
|
|
|
160
163
|
_this.render = function () {
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
+
import React, { Component } from 'react';
|
|
6
|
+
import MatchingTypeOrderer from "./utils/matchingTypeOrderer.js";
|
|
7
|
+
import AfsTableWrapper from "../shared/AfsTableWrapper/index.js";
|
|
8
|
+
import MatchingTypeTable from "./MatchingTypeTable/index.js";
|
|
9
|
+
import PropTypes from 'prop-types';
|
|
10
|
+
import { matchingTypeAnswerSummaryPropType } from "../../propTypes.js";
|
|
11
|
+
import t from '@instructure/quiz-i18n/es/format-message';
|
|
12
|
+
import AggregationTable from "../shared/AggregationTable/index.js";
|
|
13
|
+
import { AfsPartsContainer } from "../shared/AfsPartsContainer/presenter.js";
|
|
14
|
+
export var OrderingType = /*#__PURE__*/function (_Component) {
|
|
15
|
+
_inherits(OrderingType, _Component);
|
|
16
|
+
|
|
17
|
+
var _super = _createSuper(OrderingType);
|
|
18
|
+
|
|
19
|
+
function OrderingType() {
|
|
20
|
+
var _this;
|
|
21
|
+
|
|
22
|
+
_classCallCheck(this, OrderingType);
|
|
23
|
+
|
|
24
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
25
|
+
args[_key] = arguments[_key];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
29
|
+
|
|
30
|
+
_this.updateAnswerBody = function (answerSummary) {
|
|
31
|
+
var translateBody = function translateBody(index) {
|
|
32
|
+
return "".concat(t('Order'), " ").concat(index);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
var answerSummaryCopy = _objectSpread({}, answerSummary);
|
|
36
|
+
|
|
37
|
+
Object.keys(answerSummaryCopy.questions).forEach(function (questionKey) {
|
|
38
|
+
Object.keys(answerSummaryCopy.questions[questionKey].answers).forEach(function (answerKey) {
|
|
39
|
+
var detail = answerSummaryCopy.questions[questionKey].answers[answerKey];
|
|
40
|
+
answerSummaryCopy.questions[questionKey].answers[answerKey] = _objectSpread(_objectSpread({}, detail), {}, {
|
|
41
|
+
// Body cannot be used because because re-render of the component add Order
|
|
42
|
+
// as many time we have to re-render. Only re-assignment works.
|
|
43
|
+
body: translateBody(Number(answerKey) + 1)
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
return answerSummaryCopy;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
_this.render = function () {
|
|
51
|
+
var _this$props = _this.props,
|
|
52
|
+
itemId = _this$props.itemId,
|
|
53
|
+
answerSummary = _this$props.answerSummary;
|
|
54
|
+
|
|
55
|
+
var updatedAnswerSummary = _this.updateAnswerBody(answerSummary);
|
|
56
|
+
|
|
57
|
+
var questions = updatedAnswerSummary.questions;
|
|
58
|
+
var questionKeys = Object.keys(questions);
|
|
59
|
+
var exampleAnswers = questions[questionKeys[0]].answers;
|
|
60
|
+
var answerKeys = Object.keys(exampleAnswers).sort();
|
|
61
|
+
var orderedAnswerKeys = MatchingTypeOrderer.orderAnswerKeysForDiagonal(updatedAnswerSummary, answerKeys);
|
|
62
|
+
var orderedQuestionKeys = MatchingTypeOrderer.orderQuestionKeysForDiagonal(updatedAnswerSummary, questionKeys, orderedAnswerKeys);
|
|
63
|
+
var tableHalfWidth = orderedAnswerKeys.length <= 3;
|
|
64
|
+
return /*#__PURE__*/React.createElement(AfsTableWrapper, null, /*#__PURE__*/React.createElement(AfsPartsContainer, {
|
|
65
|
+
tableHalfWidth: tableHalfWidth,
|
|
66
|
+
afsTable: /*#__PURE__*/React.createElement(MatchingTypeTable, {
|
|
67
|
+
itemId: itemId,
|
|
68
|
+
answerSummary: updatedAnswerSummary,
|
|
69
|
+
orderedAnswerKeys: orderedAnswerKeys,
|
|
70
|
+
orderedQuestionKeys: orderedQuestionKeys
|
|
71
|
+
}),
|
|
72
|
+
aggregationTable: /*#__PURE__*/React.createElement(AggregationTable, {
|
|
73
|
+
itemId: itemId,
|
|
74
|
+
answerSummary: updatedAnswerSummary
|
|
75
|
+
})
|
|
76
|
+
}));
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
return _this;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return OrderingType;
|
|
83
|
+
}(Component);
|
|
84
|
+
OrderingType.propTypes = {
|
|
85
|
+
itemId: PropTypes.number,
|
|
86
|
+
answerSummary: matchingTypeAnswerSummaryPropType
|
|
87
|
+
}.isRequired;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { MatchingType } from "./MatchingType.js";
|
|
1
|
+
export { MatchingType } from "./MatchingType.js";
|
|
2
|
+
export { OrderingType } from "./OrderingType.js";
|
package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/presenter.js
CHANGED
|
@@ -5,7 +5,7 @@ import React, { Component } from 'react';
|
|
|
5
5
|
import { PropTypes } from '@instructure/quiz-interactions';
|
|
6
6
|
import ChoiceType from "./ChoiceType/index.js";
|
|
7
7
|
import AggregationType from "./AggregationType/index.js";
|
|
8
|
-
import { MatchingType } from "./MatchingType/index.js";
|
|
8
|
+
import { MatchingType, OrderingType } from "./MatchingType/index.js";
|
|
9
9
|
import { answerSummaryPropType } from "../propTypes.js";
|
|
10
10
|
export var AnswerFrequencySummary = /*#__PURE__*/function (_Component) {
|
|
11
11
|
_inherits(AnswerFrequencySummary, _Component);
|
|
@@ -36,6 +36,10 @@ export var AnswerFrequencySummary = /*#__PURE__*/function (_Component) {
|
|
|
36
36
|
if (afsFlags.matchingEnabled) {
|
|
37
37
|
_this.afsTableComponentMap.set('matching', MatchingType);
|
|
38
38
|
}
|
|
39
|
+
|
|
40
|
+
if (afsFlags.orderingEnabled) {
|
|
41
|
+
_this.afsTableComponentMap.set('ordering', OrderingType);
|
|
42
|
+
}
|
|
39
43
|
};
|
|
40
44
|
|
|
41
45
|
_this.render = function () {
|
|
@@ -75,6 +79,8 @@ AnswerFrequencySummary.propTypes = {
|
|
|
75
79
|
interactionType: PropTypes.string.isRequired,
|
|
76
80
|
afsFlags: PropTypes.shape({
|
|
77
81
|
formulaEnabled: PropTypes.bool.isRequired,
|
|
78
|
-
matchingEnabled: PropTypes.bool.isRequired
|
|
82
|
+
matchingEnabled: PropTypes.bool.isRequired,
|
|
83
|
+
hotSpotEnabled: PropTypes.bool.isRequired,
|
|
84
|
+
orderingEnabled: PropTypes.bool.isRequired
|
|
79
85
|
})
|
|
80
86
|
}.isRequired;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AfsPartsContainer as default } from "./presenter.js";
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
+
|
|
6
|
+
var _dec, _class, _class2, _temp;
|
|
7
|
+
|
|
8
|
+
import React, { Component } from 'react';
|
|
9
|
+
import PropTypes from 'prop-types';
|
|
10
|
+
import { themeable } from '@instructure/ui-themeable';
|
|
11
|
+
var styles = {
|
|
12
|
+
componentId: 'dApXZ',
|
|
13
|
+
template: function template(theme) {
|
|
14
|
+
return "\n\n.dApXZ_SVtU{max-width:100%;width:calc(25% + 350px)}\n\n.dApXZ_ellB{margin-top:13px}";
|
|
15
|
+
},
|
|
16
|
+
'tableContainer': 'dApXZ_SVtU',
|
|
17
|
+
'aggregateContainer': 'dApXZ_ellB'
|
|
18
|
+
};
|
|
19
|
+
import classNames from 'classnames';
|
|
20
|
+
export var AfsPartsContainer = (_dec = themeable({}, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
21
|
+
_inherits(AfsPartsContainer, _Component);
|
|
22
|
+
|
|
23
|
+
var _super = _createSuper(AfsPartsContainer);
|
|
24
|
+
|
|
25
|
+
function AfsPartsContainer() {
|
|
26
|
+
var _this;
|
|
27
|
+
|
|
28
|
+
_classCallCheck(this, AfsPartsContainer);
|
|
29
|
+
|
|
30
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
31
|
+
args[_key] = arguments[_key];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
35
|
+
|
|
36
|
+
_this.renderAggregationTable = function () {
|
|
37
|
+
var _this$props = _this.props,
|
|
38
|
+
afsTable = _this$props.afsTable,
|
|
39
|
+
aggregationTable = _this$props.aggregationTable;
|
|
40
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
41
|
+
className: classNames(styles.tableContainer, _defineProperty({}, styles.aggregateContainer, afsTable))
|
|
42
|
+
}, aggregationTable);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
_this.renderAfsTable = function () {
|
|
46
|
+
var _this$props2 = _this.props,
|
|
47
|
+
afsTable = _this$props2.afsTable,
|
|
48
|
+
tableHalfWidth = _this$props2.tableHalfWidth;
|
|
49
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
50
|
+
className: classNames(_defineProperty({}, styles.tableContainer, tableHalfWidth))
|
|
51
|
+
}, afsTable);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
_this.render = function () {
|
|
55
|
+
var _this$props3 = _this.props,
|
|
56
|
+
afsTable = _this$props3.afsTable,
|
|
57
|
+
aggregationTable = _this$props3.aggregationTable;
|
|
58
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, afsTable && _this.renderAfsTable(), aggregationTable && _this.renderAggregationTable());
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
return _this;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return AfsPartsContainer;
|
|
65
|
+
}(Component), _class2.propTypes = {
|
|
66
|
+
tableHalfWidth: PropTypes.bool,
|
|
67
|
+
afsTable: PropTypes.node,
|
|
68
|
+
aggregationTable: PropTypes.node
|
|
69
|
+
}.isRequired, _class2.defaultProps = {
|
|
70
|
+
tableHalfWidth: true,
|
|
71
|
+
afsTable: null,
|
|
72
|
+
aggregationTable: null
|
|
73
|
+
}, _temp)) || _class);
|
|
@@ -16,17 +16,17 @@ import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
|
16
16
|
import { themeable } from '@instructure/ui-themeable';
|
|
17
17
|
import Card from "../../../../../common/components/shared/Card/index.js";
|
|
18
18
|
var styles = {
|
|
19
|
-
componentId: '
|
|
19
|
+
componentId: 'cnjis',
|
|
20
20
|
template: function template(theme) {
|
|
21
|
-
return "\n\n.
|
|
21
|
+
return "\n\n.cnjis_bqdH{column-gap:26px;display:flex;justify-content:flex-start;padding-bottom:".concat(theme.metricsPadding || 'inherit', ";row-gap:8px}\n\n.cnjis_PFlN{border-radius:").concat(theme.cardBorderRadius || 'inherit', ";box-shadow:").concat(theme.cardBoxShadow || 'inherit', ";display:inline-flex;flex-direction:column;margin:").concat(theme.cardMargin || 'inherit', ";padding:").concat(theme.cardPadding || 'inherit', ";width:").concat(theme.cardWidth || 'inherit', "}\n\n.cnjis_dJIh{height:").concat(theme.cardHeight || 'inherit', "}\n\n.cnjis_eWEX{align-items:flex-end;align-self:flex-end;display:flex;height:100%;justify-content:flex-end}\n\n.cnjis_blRb{max-width:160px;padding-right:10px}\n\n.cnjis_bxzy{border-bottom:1px solid ").concat(theme.quizSummaryBorderBottomColor || 'inherit', ";margin-bottom:15px;padding-bottom:15px}\n\n.cnjis_dKIc{padding-bottom:15px}\n\n@media only screen and (max-width:25rem){.cnjis_dJIh{height:auto}.cnjis_PFlN{max-width:").concat(theme.cardWidth || 'inherit', ";width:auto}.cnjis_bqdH{flex-wrap:wrap}}");
|
|
22
22
|
},
|
|
23
|
-
'metricsContainer': '
|
|
24
|
-
'reportCard': '
|
|
25
|
-
'emptyReportCard': '
|
|
26
|
-
'emptyCardBodyContainer': '
|
|
27
|
-
'dateContainer': '
|
|
28
|
-
'quizAnalysisSummary': '
|
|
29
|
-
'titleContainer': '
|
|
23
|
+
'metricsContainer': 'cnjis_bqdH',
|
|
24
|
+
'reportCard': 'cnjis_PFlN',
|
|
25
|
+
'emptyReportCard': 'cnjis_dJIh',
|
|
26
|
+
'emptyCardBodyContainer': 'cnjis_eWEX',
|
|
27
|
+
'dateContainer': 'cnjis_blRb',
|
|
28
|
+
'quizAnalysisSummary': 'cnjis_bxzy',
|
|
29
|
+
'titleContainer': 'cnjis_dKIc'
|
|
30
30
|
};
|
|
31
31
|
import theme from "./theme.js";
|
|
32
32
|
import classnames from 'classnames';
|
|
@@ -2,6 +2,9 @@ import t from '@instructure/quiz-i18n/es/format-message';
|
|
|
2
2
|
export var getFailedToFetchReports = function getFailedToFetchReports() {
|
|
3
3
|
return t('An error has occurred while loading this report. Please refresh the page.');
|
|
4
4
|
};
|
|
5
|
+
export var getFailedToExportReports = function getFailedToExportReports() {
|
|
6
|
+
return t('An error has occurred while exporting this report. Please try again.');
|
|
7
|
+
};
|
|
5
8
|
export var getLastReportGenerationFailed = function getLastReportGenerationFailed() {
|
|
6
9
|
return t('Report generation failed. Please try again.');
|
|
7
10
|
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
+
import { getFailedToExportReports } from "./errorMessages.js";
|
|
4
|
+
import contentDisposition from 'content-disposition';
|
|
5
|
+
export var exportReports = /*#__PURE__*/function () {
|
|
6
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
7
|
+
var getAnalysesExport, activeQuizId, filter, format, saveFile, addError, response, dispositionHeader, disposition, filename, blob;
|
|
8
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
9
|
+
while (1) {
|
|
10
|
+
switch (_context.prev = _context.next) {
|
|
11
|
+
case 0:
|
|
12
|
+
getAnalysesExport = _ref.getAnalysesExport, activeQuizId = _ref.activeQuizId, filter = _ref.filter, format = _ref.format, saveFile = _ref.saveFile, addError = _ref.addError;
|
|
13
|
+
_context.prev = 1;
|
|
14
|
+
_context.next = 4;
|
|
15
|
+
return getAnalysesExport(activeQuizId, format, filter);
|
|
16
|
+
|
|
17
|
+
case 4:
|
|
18
|
+
response = _context.sent;
|
|
19
|
+
dispositionHeader = response.headers.get('Content-Disposition');
|
|
20
|
+
|
|
21
|
+
if (dispositionHeader) {
|
|
22
|
+
_context.next = 8;
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
throw new Error('Response contains no Content-Disposition header.');
|
|
27
|
+
|
|
28
|
+
case 8:
|
|
29
|
+
disposition = contentDisposition.parse(dispositionHeader);
|
|
30
|
+
filename = disposition.parameters.filename;
|
|
31
|
+
|
|
32
|
+
if (filename) {
|
|
33
|
+
_context.next = 12;
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
throw new Error('Cannot determine filename to save.');
|
|
38
|
+
|
|
39
|
+
case 12:
|
|
40
|
+
_context.next = 14;
|
|
41
|
+
return response.blob();
|
|
42
|
+
|
|
43
|
+
case 14:
|
|
44
|
+
blob = _context.sent;
|
|
45
|
+
saveFile(blob, filename);
|
|
46
|
+
_context.next = 21;
|
|
47
|
+
break;
|
|
48
|
+
|
|
49
|
+
case 18:
|
|
50
|
+
_context.prev = 18;
|
|
51
|
+
_context.t0 = _context["catch"](1);
|
|
52
|
+
addError(getFailedToExportReports());
|
|
53
|
+
|
|
54
|
+
case 21:
|
|
55
|
+
case "end":
|
|
56
|
+
return _context.stop();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}, _callee, null, [[1, 18]]);
|
|
60
|
+
}));
|
|
61
|
+
|
|
62
|
+
return function exportReports(_x) {
|
|
63
|
+
return _ref2.apply(this, arguments);
|
|
64
|
+
};
|
|
65
|
+
}();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
2
|
+
import { saveAs } from 'file-saver';
|
|
2
3
|
|
|
3
4
|
var formatNumbers = function formatNumbers(value) {
|
|
4
5
|
if (typeof value === 'number') {
|
|
@@ -17,4 +18,7 @@ var getSanitizedMetricValue = function getSanitizedMetricValue(value, suffix) {
|
|
|
17
18
|
return suffix ? formattedValue + suffix : formattedValue;
|
|
18
19
|
};
|
|
19
20
|
|
|
21
|
+
export var saveFile = function saveFile(file, fileName) {
|
|
22
|
+
saveAs(file, fileName);
|
|
23
|
+
};
|
|
20
24
|
export { getSanitizedMetricValue };
|
|
@@ -4,6 +4,7 @@ import { setQuizAnalysis, setItemAnalyses, setFetchInProgress, setGenerationInPr
|
|
|
4
4
|
import { getQuizAnalysis as fetchQuizAnalysis } from "../../../api/getQuizAnalysis.js";
|
|
5
5
|
import { getItemAnalyses as fetchItemAnalyses } from "../../../api/getItemAnalyses.js";
|
|
6
6
|
import { getAnalysesStatus as fetchAnalysesStatus } from "../../../api/getAnalysesStatus.js";
|
|
7
|
+
import { getAnalysesExport } from "../../../api/getAnalysesExport.js";
|
|
7
8
|
import { connect } from "../../../../common/react-redux.js";
|
|
8
9
|
import { compose } from 'redux';
|
|
9
10
|
import { getActiveQuizId } from "../../../../common/selectors/quizzes.js";
|
|
@@ -21,6 +22,7 @@ export function mapStateToProps(state, ownProps) {
|
|
|
21
22
|
fetchQuizAnalysis: fetchQuizAnalysis,
|
|
22
23
|
fetchItemAnalyses: fetchItemAnalyses,
|
|
23
24
|
fetchAnalysesStatus: fetchAnalysesStatus,
|
|
25
|
+
getAnalysesExport: getAnalysesExport,
|
|
24
26
|
pollingInterval: ownProps.pollingInterval || DEFAULT_POLLING_INTERVAL
|
|
25
27
|
};
|
|
26
28
|
}
|