@instructure/quiz-core 18.5.1-rc.7 → 18.5.1-rc.8
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/es/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/presenter.js +20 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/charts/ScoreDistribution/presenter.js +16 -3
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/propTypes.js +8 -3
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/presenter.js +20 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/charts/ScoreDistribution/presenter.js +16 -3
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/propTypes.js +12 -4
- package/package.json +9 -9
package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/presenter.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
1
2
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
3
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
4
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
@@ -120,7 +121,7 @@ export var NewQuizAnalysis = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
120
121
|
title: expanded ? t('collapse quiz analysis') : t('expand quiz analysis'),
|
|
121
122
|
isExpanded: expanded
|
|
122
123
|
}))), expanded && _this.renderExpanded(), /*#__PURE__*/React.createElement(ScoreDistribution, {
|
|
123
|
-
decileDistribution:
|
|
124
|
+
decileDistribution: _this.getPreparedDecileDistribution()
|
|
124
125
|
}));
|
|
125
126
|
};
|
|
126
127
|
|
|
@@ -128,6 +129,24 @@ export var NewQuizAnalysis = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
128
129
|
}
|
|
129
130
|
|
|
130
131
|
_createClass(NewQuizAnalysis, [{
|
|
132
|
+
key: "getPreparedDecileDistribution",
|
|
133
|
+
value: function getPreparedDecileDistribution() {
|
|
134
|
+
var quizAnalysis = this.props.quizAnalysis;
|
|
135
|
+
var scores = quizAnalysis.scores,
|
|
136
|
+
metadata = quizAnalysis.metadata;
|
|
137
|
+
|
|
138
|
+
var decileDistribution = _toConsumableArray(scores === null || scores === void 0 ? void 0 : scores.decile_distribution);
|
|
139
|
+
|
|
140
|
+
if (metadata.decile_distribution && (metadata.decile_distribution.high_extreme_values_count > 0 || metadata.decile_distribution.low_extreme_values_count > 0)) {
|
|
141
|
+
var _metadata$decile_dist, _metadata$decile_dist2;
|
|
142
|
+
|
|
143
|
+
decileDistribution.unshift((_metadata$decile_dist = metadata.decile_distribution) === null || _metadata$decile_dist === void 0 ? void 0 : _metadata$decile_dist.low_extreme_values_count);
|
|
144
|
+
decileDistribution.push((_metadata$decile_dist2 = metadata.decile_distribution) === null || _metadata$decile_dist2 === void 0 ? void 0 : _metadata$decile_dist2.high_extreme_values_count);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return decileDistribution;
|
|
148
|
+
}
|
|
149
|
+
}, {
|
|
131
150
|
key: "render",
|
|
132
151
|
value: function render() {
|
|
133
152
|
var fetchInProgress = this.props.fetchInProgress;
|
|
@@ -39,7 +39,19 @@ export var ScoreDistribution = (_dec = themeable(theme, styles), _dec(_class = (
|
|
|
39
39
|
|
|
40
40
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
41
41
|
|
|
42
|
-
_this.
|
|
42
|
+
_this.calculateLabelForColumnsWithExtremeValues = function (index, length) {
|
|
43
|
+
if (index === 0) {
|
|
44
|
+
return t('< 0%');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (index === length - 1) {
|
|
48
|
+
return t('> 100%');
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return _this.calculateLabelForColumns(index - 1, length - 2);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
_this.calculateLabelForColumns = function (index, length) {
|
|
43
55
|
var label = Math.floor(index * 100 / length);
|
|
44
56
|
return t('{label, number}%', {
|
|
45
57
|
label: label
|
|
@@ -52,6 +64,7 @@ export var ScoreDistribution = (_dec = themeable(theme, styles), _dec(_class = (
|
|
|
52
64
|
_createClass(ScoreDistribution, [{
|
|
53
65
|
key: "render",
|
|
54
66
|
value: function render() {
|
|
67
|
+
var decileDistribution = this.props.decileDistribution;
|
|
55
68
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
56
69
|
className: styles.headingContainer
|
|
57
70
|
}, /*#__PURE__*/React.createElement(Heading, {
|
|
@@ -62,8 +75,8 @@ export var ScoreDistribution = (_dec = themeable(theme, styles), _dec(_class = (
|
|
|
62
75
|
}, t('Score Distribution'))), /*#__PURE__*/React.createElement(QuintileDistribution, {
|
|
63
76
|
animateDelay: 1000,
|
|
64
77
|
animateDuration: 1000,
|
|
65
|
-
visualDistribution:
|
|
66
|
-
calculateLabelForColumn: this.
|
|
78
|
+
visualDistribution: decileDistribution || [],
|
|
79
|
+
calculateLabelForColumn: decileDistribution.length > 10 ? this.calculateLabelForColumnsWithExtremeValues : this.calculateLabelForColumns
|
|
67
80
|
}), /*#__PURE__*/React.createElement("div", {
|
|
68
81
|
"aria-hidden": "true",
|
|
69
82
|
className: styles.chartLabel
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
+
export var quizAnalysisMetadata = PropTypes.shape({
|
|
3
|
+
quiz_title: PropTypes.string,
|
|
4
|
+
decile_distribution: PropTypes.shape({
|
|
5
|
+
high_extreme_values_count: PropTypes.number,
|
|
6
|
+
low_extreme_values_count: PropTypes.number
|
|
7
|
+
})
|
|
8
|
+
});
|
|
2
9
|
export var quizAnalysisPropType = PropTypes.shape({
|
|
3
10
|
created_timestamp: PropTypes.string.isRequired,
|
|
4
|
-
metadata:
|
|
5
|
-
quiz_title: PropTypes.string
|
|
6
|
-
}).isRequired,
|
|
11
|
+
metadata: quizAnalysisMetadata.isRequired,
|
|
7
12
|
scores: PropTypes.shape({
|
|
8
13
|
decile_distribution: PropTypes.arrayOf(PropTypes.number),
|
|
9
14
|
cronbachs_alpha: PropTypes.number,
|
package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/presenter.js
CHANGED
|
@@ -9,6 +9,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports.NewQuizAnalysis = void 0;
|
|
11
11
|
|
|
12
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
+
|
|
12
14
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
15
|
|
|
14
16
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -148,7 +150,7 @@ var NewQuizAnalysis = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
148
150
|
title: expanded ? (0, _formatMessage.default)('collapse quiz analysis') : (0, _formatMessage.default)('expand quiz analysis'),
|
|
149
151
|
isExpanded: expanded
|
|
150
152
|
}))), expanded && _this.renderExpanded(), /*#__PURE__*/_react.default.createElement(_presenter.ScoreDistribution, {
|
|
151
|
-
decileDistribution:
|
|
153
|
+
decileDistribution: _this.getPreparedDecileDistribution()
|
|
152
154
|
}));
|
|
153
155
|
};
|
|
154
156
|
|
|
@@ -156,6 +158,23 @@ var NewQuizAnalysis = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
156
158
|
}
|
|
157
159
|
|
|
158
160
|
(0, _createClass2.default)(NewQuizAnalysis, [{
|
|
161
|
+
key: "getPreparedDecileDistribution",
|
|
162
|
+
value: function getPreparedDecileDistribution() {
|
|
163
|
+
var quizAnalysis = this.props.quizAnalysis;
|
|
164
|
+
var scores = quizAnalysis.scores,
|
|
165
|
+
metadata = quizAnalysis.metadata;
|
|
166
|
+
var decileDistribution = (0, _toConsumableArray2.default)(scores === null || scores === void 0 ? void 0 : scores.decile_distribution);
|
|
167
|
+
|
|
168
|
+
if (metadata.decile_distribution && (metadata.decile_distribution.high_extreme_values_count > 0 || metadata.decile_distribution.low_extreme_values_count > 0)) {
|
|
169
|
+
var _metadata$decile_dist, _metadata$decile_dist2;
|
|
170
|
+
|
|
171
|
+
decileDistribution.unshift((_metadata$decile_dist = metadata.decile_distribution) === null || _metadata$decile_dist === void 0 ? void 0 : _metadata$decile_dist.low_extreme_values_count);
|
|
172
|
+
decileDistribution.push((_metadata$decile_dist2 = metadata.decile_distribution) === null || _metadata$decile_dist2 === void 0 ? void 0 : _metadata$decile_dist2.high_extreme_values_count);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return decileDistribution;
|
|
176
|
+
}
|
|
177
|
+
}, {
|
|
159
178
|
key: "render",
|
|
160
179
|
value: function render() {
|
|
161
180
|
var fetchInProgress = this.props.fetchInProgress;
|
|
@@ -61,7 +61,19 @@ var ScoreDistribution = (_dec = (0, _uiThemeable.themeable)(_theme.default, styl
|
|
|
61
61
|
|
|
62
62
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
63
63
|
|
|
64
|
-
_this.
|
|
64
|
+
_this.calculateLabelForColumnsWithExtremeValues = function (index, length) {
|
|
65
|
+
if (index === 0) {
|
|
66
|
+
return (0, _formatMessage.default)('< 0%');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (index === length - 1) {
|
|
70
|
+
return (0, _formatMessage.default)('> 100%');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return _this.calculateLabelForColumns(index - 1, length - 2);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
_this.calculateLabelForColumns = function (index, length) {
|
|
65
77
|
var label = Math.floor(index * 100 / length);
|
|
66
78
|
return (0, _formatMessage.default)('{label, number}%', {
|
|
67
79
|
label: label
|
|
@@ -74,6 +86,7 @@ var ScoreDistribution = (_dec = (0, _uiThemeable.themeable)(_theme.default, styl
|
|
|
74
86
|
(0, _createClass2.default)(ScoreDistribution, [{
|
|
75
87
|
key: "render",
|
|
76
88
|
value: function render() {
|
|
89
|
+
var decileDistribution = this.props.decileDistribution;
|
|
77
90
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
78
91
|
className: styles.headingContainer
|
|
79
92
|
}, /*#__PURE__*/_react.default.createElement(_uiHeading.Heading, {
|
|
@@ -84,8 +97,8 @@ var ScoreDistribution = (_dec = (0, _uiThemeable.themeable)(_theme.default, styl
|
|
|
84
97
|
}, (0, _formatMessage.default)('Score Distribution'))), /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
85
98
|
animateDelay: 1000,
|
|
86
99
|
animateDuration: 1000,
|
|
87
|
-
visualDistribution:
|
|
88
|
-
calculateLabelForColumn: this.
|
|
100
|
+
visualDistribution: decileDistribution || [],
|
|
101
|
+
calculateLabelForColumn: decileDistribution.length > 10 ? this.calculateLabelForColumnsWithExtremeValues : this.calculateLabelForColumns
|
|
89
102
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
90
103
|
"aria-hidden": "true",
|
|
91
104
|
className: styles.chartLabel
|
|
@@ -5,15 +5,23 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.afsFlags = exports.answerSummaryPropType = exports.matchingTypeAnswerSummaryPropType = exports.choiceTypeAnswerSummaryPropType = exports.onlyAggregatePropType = exports.itemAnalysisPropType = exports.quizAnalysisPropType = void 0;
|
|
8
|
+
exports.afsFlags = exports.answerSummaryPropType = exports.matchingTypeAnswerSummaryPropType = exports.choiceTypeAnswerSummaryPropType = exports.onlyAggregatePropType = exports.itemAnalysisPropType = exports.quizAnalysisPropType = exports.quizAnalysisMetadata = void 0;
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
|
+
var quizAnalysisMetadata = _propTypes.default.shape({
|
|
13
|
+
quiz_title: _propTypes.default.string,
|
|
14
|
+
decile_distribution: _propTypes.default.shape({
|
|
15
|
+
high_extreme_values_count: _propTypes.default.number,
|
|
16
|
+
low_extreme_values_count: _propTypes.default.number
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
exports.quizAnalysisMetadata = quizAnalysisMetadata;
|
|
21
|
+
|
|
12
22
|
var quizAnalysisPropType = _propTypes.default.shape({
|
|
13
23
|
created_timestamp: _propTypes.default.string.isRequired,
|
|
14
|
-
metadata:
|
|
15
|
-
quiz_title: _propTypes.default.string
|
|
16
|
-
}).isRequired,
|
|
24
|
+
metadata: quizAnalysisMetadata.isRequired,
|
|
17
25
|
scores: _propTypes.default.shape({
|
|
18
26
|
decile_distribution: _propTypes.default.arrayOf(_propTypes.default.number),
|
|
19
27
|
cronbachs_alpha: _propTypes.default.number,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/quiz-core",
|
|
3
|
-
"version": "18.5.1-rc.
|
|
3
|
+
"version": "18.5.1-rc.8+846b42d6f",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The Quiz React SDK by Instructure Inc.",
|
|
6
6
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@instructure/grading-utils": "^1.0.0",
|
|
45
45
|
"@instructure/outcomes-ui": "^2.1.9",
|
|
46
|
-
"@instructure/quiz-common": "18.5.1-rc.
|
|
47
|
-
"@instructure/quiz-i18n": "18.5.1-rc.
|
|
48
|
-
"@instructure/quiz-interactions": "18.5.1-rc.
|
|
49
|
-
"@instructure/quiz-number-input": "18.5.1-rc.
|
|
50
|
-
"@instructure/quiz-rce": "18.5.1-rc.
|
|
46
|
+
"@instructure/quiz-common": "18.5.1-rc.8+846b42d6f",
|
|
47
|
+
"@instructure/quiz-i18n": "18.5.1-rc.8+846b42d6f",
|
|
48
|
+
"@instructure/quiz-interactions": "18.5.1-rc.8+846b42d6f",
|
|
49
|
+
"@instructure/quiz-number-input": "18.5.1-rc.8+846b42d6f",
|
|
50
|
+
"@instructure/quiz-rce": "18.5.1-rc.8+846b42d6f",
|
|
51
51
|
"@instructure/ui-a11y-content": "^7.22.1",
|
|
52
52
|
"@instructure/ui-alerts": "^7.22.1",
|
|
53
53
|
"@instructure/ui-avatar": "^7.22.1",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"eventemitter3": "^3.1.0",
|
|
109
109
|
"humps": "^2.0.0",
|
|
110
110
|
"immutable": "^3.8.1",
|
|
111
|
-
"instructure-validations": "18.5.1-rc.
|
|
111
|
+
"instructure-validations": "18.5.1-rc.8+846b42d6f",
|
|
112
112
|
"ipaddr.js": "^1.5.4",
|
|
113
113
|
"isomorphic-fetch": "^2.2.0",
|
|
114
114
|
"isuuid": "^0.1.0",
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
"intl": "^1.2.4",
|
|
160
160
|
"jquery": "^2.2.3",
|
|
161
161
|
"most-subject": "^5.3.0",
|
|
162
|
-
"quiz-presets": "18.5.1-rc.
|
|
162
|
+
"quiz-presets": "18.5.1-rc.8+846b42d6f",
|
|
163
163
|
"react": "^16.8.6",
|
|
164
164
|
"react-addons-test-utils": "^15.6.2",
|
|
165
165
|
"react-dom": "^16.8.6",
|
|
@@ -175,5 +175,5 @@
|
|
|
175
175
|
"publishConfig": {
|
|
176
176
|
"access": "public"
|
|
177
177
|
},
|
|
178
|
-
"gitHead": "
|
|
178
|
+
"gitHead": "846b42d6fbb1d77bb36641c1fa31725bb5b42b47"
|
|
179
179
|
}
|