@instructure/quiz-core 20.4.1 → 20.4.2-rc.1
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/Caption/index.js +13 -18
- package/es/reporting/components/Caption/styles.js +12 -0
- package/es/reporting/components/Caption/theme.js +4 -2
- package/es/reporting/components/charts/Legend/index.js +45 -33
- package/es/reporting/components/charts/Legend/styles.js +44 -0
- package/es/reporting/components/charts/Legend/theme.js +4 -2
- package/es/reporting/components/itemAnalysis/ItemAnalysisRow/presenter.js +61 -79
- package/es/reporting/components/itemAnalysis/ItemAnalysisRow/styles.js +100 -0
- package/es/reporting/components/itemAnalysis/ItemAnalysisRow/theme.js +4 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/presenter.js +34 -44
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/styles.js +40 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/theme.js +4 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/charts/ScoreDistribution/presenter.js +27 -26
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/charts/ScoreDistribution/styles.js +20 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/charts/ScoreDistribution/theme.js +4 -2
- package/lib/reporting/components/Caption/index.js +12 -19
- package/lib/reporting/components/Caption/styles.js +20 -0
- package/lib/reporting/components/Caption/theme.js +6 -3
- package/lib/reporting/components/charts/Legend/index.js +44 -34
- package/lib/reporting/components/charts/Legend/styles.js +54 -0
- package/lib/reporting/components/charts/Legend/theme.js +6 -3
- package/lib/reporting/components/itemAnalysis/ItemAnalysisRow/presenter.js +61 -80
- package/lib/reporting/components/itemAnalysis/ItemAnalysisRow/styles.js +110 -0
- package/lib/reporting/components/itemAnalysis/ItemAnalysisRow/theme.js +6 -3
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/presenter.js +33 -45
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/styles.js +48 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/theme.js +6 -3
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/charts/ScoreDistribution/presenter.js +27 -26
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/charts/ScoreDistribution/styles.js +28 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/charts/ScoreDistribution/theme.js +6 -3
- package/package.json +10 -11
|
@@ -31,7 +31,7 @@ var _uiHeading = require("@instructure/ui-heading");
|
|
|
31
31
|
|
|
32
32
|
var _uiA11yContent = require("@instructure/ui-a11y-content");
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _emotion = require("@instructure/emotion");
|
|
35
35
|
|
|
36
36
|
var _quizRce = require("@instructure/quiz-rce");
|
|
37
37
|
|
|
@@ -55,37 +55,15 @@ var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/f
|
|
|
55
55
|
|
|
56
56
|
var _quizCommon = require("@instructure/quiz-common");
|
|
57
57
|
|
|
58
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
59
|
+
|
|
58
60
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
59
61
|
|
|
60
62
|
var _dec, _class, _class2, _temp;
|
|
61
63
|
|
|
62
|
-
var
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return "\n\n.eCUxk_cQXk{margin-bottom:".concat(theme.itemAnalysisRowMargin || 'inherit', ";padding:").concat(theme.itemAnalysisRowPadding || 'inherit', ";position:relative}\n\n.eCUxk_dlpV{align-items:flex-start;display:flex;flex-direction:row;justify-content:space-between}\n\n.eCUxk_fAhB{color:").concat(theme.headerTextColor || 'inherit', ";font-size:").concat(theme.headerTextFontSize || 'inherit', "}\n\n.eCUxk_dzph{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;padding-bottom:").concat(theme.metricsRowLowerPadding || 'inherit', "}\n\n.eCUxk_dFNV{color:").concat(theme.metricNoteColor || 'inherit', ";font-size:").concat(theme.metricNoteFontSize || 'inherit', "}\n\n.eCUxk_cloC{flex:1 0 35%;font-size:").concat(theme.stemFontSize || 'inherit', ";line-height:").concat(theme.stemLineHeight || 'inherit', ";margin-bottom:").concat(theme.stemMargin || 'inherit', "}\n\n.eCUxk_cloC p{margin:0}\n\n.eCUxk_bQrf{flex:0 1 42rem}\n\n.eCUxk_eiMu{justify-content:center}\n\n.eCUxk_bwKH{color:").concat(theme.emptyTextColor || 'inherit', ";flex:0 1 42rem;padding:").concat(theme.emptyTextPadding || 'inherit', ";text-align:center}\n\n[dir=ltr] .eCUxk_bwKH,[dir=rtl] .eCUxk_bwKH{text-align:center}\n\n.eCUxk_sIdV{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;margin:0 -1rem}\n\n.eCUxk_dvfr{flex:10 1 45%}\n\n.eCUxk_dYYR{flex:1 1 auto;min-width:1%}\n\n.eCUxk_eFpQ{align-items:center;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;padding:0 ").concat(theme.answerDistributionPadding || 'inherit', ";position:relative}\n\n.eCUxk_dFwC{padding:0 ").concat(theme.answerDistributionChartPadding || 'inherit', ";width:19rem}\n\n.eCUxk_bqaR{padding:0 ").concat(theme.answerDistributionLegendPadding || 'inherit', "}\n\n.eCUxk_RMvh{background-color:").concat(theme.answerDistributionSwatchColor || 'inherit', "}\n\n.eCUxk_dMVr{display:flex;margin:0 -1rem}\n\n@media screen and (--phoneBreakPoint){.eCUxk_eFpQ{padding:0}.eCUxk_eiMu{flex-basis:50%}}");
|
|
66
|
-
},
|
|
67
|
-
'itemAnalysisRow': 'eCUxk_cQXk',
|
|
68
|
-
'headerRow': 'eCUxk_dlpV',
|
|
69
|
-
'headerText': 'eCUxk_fAhB',
|
|
70
|
-
'metricsRow': 'eCUxk_dzph',
|
|
71
|
-
'metricNote': 'eCUxk_dFNV',
|
|
72
|
-
'stem': 'eCUxk_cloC',
|
|
73
|
-
'metrics': 'eCUxk_bQrf',
|
|
74
|
-
'metric': 'eCUxk_eiMu',
|
|
75
|
-
'emptyText': 'eCUxk_bwKH',
|
|
76
|
-
'answerAnalysis': 'eCUxk_sIdV',
|
|
77
|
-
'answerTableSection': 'eCUxk_dvfr',
|
|
78
|
-
'answerDistributionSection': 'eCUxk_dYYR',
|
|
79
|
-
'answerDistribution': 'eCUxk_eFpQ',
|
|
80
|
-
'answerDistributionChart': 'eCUxk_dFwC',
|
|
81
|
-
'answerDistributionLegend': 'eCUxk_bqaR',
|
|
82
|
-
'answerDistributionSwatch': 'eCUxk_RMvh',
|
|
83
|
-
'outcomeAlignments': 'eCUxk_dMVr'
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
var _ref2 = /*#__PURE__*/_react.default.createElement(_Spinner.default, null);
|
|
87
|
-
|
|
88
|
-
var ItemAnalysisRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_withI18nSupport) {
|
|
64
|
+
var _ref2 = (0, _emotion.jsx)(_Spinner.default, null);
|
|
65
|
+
|
|
66
|
+
var ItemAnalysisRow = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_withI18nSupport) {
|
|
89
67
|
(0, _inherits2.default)(ItemAnalysisRow, _withI18nSupport);
|
|
90
68
|
|
|
91
69
|
var _super = (0, _createSuper2.default)(ItemAnalysisRow);
|
|
@@ -128,7 +106,7 @@ var ItemAnalysisRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
128
106
|
position: position,
|
|
129
107
|
expanded: expanded
|
|
130
108
|
});
|
|
131
|
-
return
|
|
109
|
+
return (0, _emotion.jsx)(_index2.default, {
|
|
132
110
|
onClick: this.toggleExpanded,
|
|
133
111
|
title: title,
|
|
134
112
|
isExpanded: expanded,
|
|
@@ -142,74 +120,76 @@ var ItemAnalysisRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
142
120
|
var interactionType = this.props.itemAnalysis.interactionTypeName();
|
|
143
121
|
var pointsPossible = this.props.itemAnalysis.pointsPossible;
|
|
144
122
|
var separator = ' | ';
|
|
145
|
-
return
|
|
146
|
-
|
|
147
|
-
},
|
|
148
|
-
|
|
149
|
-
},
|
|
123
|
+
return (0, _emotion.jsx)("div", {
|
|
124
|
+
css: this.props.styles.headerRow
|
|
125
|
+
}, (0, _emotion.jsx)("div", {
|
|
126
|
+
css: this.props.styles.headerText
|
|
127
|
+
}, (0, _emotion.jsx)(_uiHeading.Heading, {
|
|
150
128
|
level: "reset",
|
|
151
129
|
as: "h3"
|
|
152
|
-
},
|
|
130
|
+
}, (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('Question {position, number}', {
|
|
153
131
|
position: position
|
|
154
|
-
})), interactionType,
|
|
132
|
+
})), interactionType, (0, _emotion.jsx)(_uiA11yContent.PresentationContent, null, separator), (0, _formatMessage.default)('{pointsPossible, number} points possible', {
|
|
155
133
|
pointsPossible: pointsPossible
|
|
156
134
|
}))), this.props.itemAnalysis.isPresent() && this.renderExpandButton());
|
|
157
135
|
}
|
|
158
136
|
}, {
|
|
159
137
|
key: "renderStem",
|
|
160
138
|
value: function renderStem() {
|
|
161
|
-
return
|
|
162
|
-
customStyles: styles.stem,
|
|
139
|
+
return (0, _emotion.jsx)(_quizRce.RichContentRenderer, {
|
|
140
|
+
customStyles: this.props.styles.stem,
|
|
163
141
|
content: this.props.itemAnalysis.itemBody
|
|
164
142
|
});
|
|
165
143
|
}
|
|
166
144
|
}, {
|
|
167
145
|
key: "defaultMetricsList",
|
|
168
146
|
value: function defaultMetricsList() {
|
|
147
|
+
var _this2 = this;
|
|
148
|
+
|
|
169
149
|
var mean = _formatMessage.default.rich('{score}<0>/{possible, number} pts</0>', {
|
|
170
150
|
0: function _(_ref) {
|
|
171
151
|
var children = _ref.children;
|
|
172
|
-
return
|
|
152
|
+
return (0, _emotion.jsx)("span", {
|
|
173
153
|
key: "mean",
|
|
174
|
-
|
|
154
|
+
css: _this2.props.styles.metricNote
|
|
175
155
|
}, children);
|
|
176
156
|
},
|
|
177
157
|
score: this.props.itemAnalysis.meanScore(this.locale) || 0,
|
|
178
158
|
possible: this.props.itemAnalysis.pointsPossible
|
|
179
159
|
});
|
|
180
160
|
|
|
181
|
-
return
|
|
161
|
+
return (0, _emotion.jsx)(_uiMetric.MetricGroup, null, (0, _emotion.jsx)(_index7.default, {
|
|
182
162
|
key: "difficultyIndex",
|
|
183
163
|
renderLabel: (0, _formatMessage.default)('Difficulty Index'),
|
|
184
164
|
renderValue: this.props.itemAnalysis.difficultyIndex(this.locale),
|
|
185
|
-
|
|
165
|
+
css: this.props.styles.metric,
|
|
186
166
|
isGroupChild: true
|
|
187
|
-
}),
|
|
167
|
+
}), (0, _emotion.jsx)(_index7.default, {
|
|
188
168
|
key: "discriminationIndex",
|
|
189
169
|
renderLabel: (0, _formatMessage.default)('Discrimination Index'),
|
|
190
170
|
renderValue: this.props.itemAnalysis.discriminationIndex(this.locale),
|
|
191
|
-
|
|
171
|
+
css: this.props.styles.metric,
|
|
192
172
|
isGroupChild: true
|
|
193
|
-
}),
|
|
173
|
+
}), (0, _emotion.jsx)(_index7.default, {
|
|
194
174
|
key: "rpb",
|
|
195
175
|
renderLabel: (0, _formatMessage.default)('RPB'),
|
|
196
176
|
renderValue: this.props.itemAnalysis.pointBiserial(this.locale),
|
|
197
|
-
|
|
177
|
+
css: this.props.styles.metric,
|
|
198
178
|
isGroupChild: true
|
|
199
|
-
}),
|
|
179
|
+
}), (0, _emotion.jsx)(_index7.default, {
|
|
200
180
|
key: "meanEarnedScore",
|
|
201
181
|
renderLabel: (0, _formatMessage.default)('Mean Earned Score'),
|
|
202
182
|
renderValue: mean,
|
|
203
|
-
|
|
183
|
+
css: this.props.styles.metric,
|
|
204
184
|
isGroupChild: true
|
|
205
185
|
}));
|
|
206
186
|
}
|
|
207
187
|
}, {
|
|
208
188
|
key: "renderMetrics",
|
|
209
189
|
value: function renderMetrics() {
|
|
210
|
-
var list = _react.default.Children.count(this.props.children) === 0 ? this.defaultMetricsList() :
|
|
211
|
-
return
|
|
212
|
-
|
|
190
|
+
var list = _react.default.Children.count(this.props.children) === 0 ? this.defaultMetricsList() : (0, _emotion.jsx)(_uiMetric.MetricGroup, null, this.props.children);
|
|
191
|
+
return (0, _emotion.jsx)("div", {
|
|
192
|
+
css: this.props.styles.metrics
|
|
213
193
|
}, list);
|
|
214
194
|
}
|
|
215
195
|
}, {
|
|
@@ -219,11 +199,11 @@ var ItemAnalysisRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
219
199
|
return;
|
|
220
200
|
}
|
|
221
201
|
|
|
222
|
-
return
|
|
223
|
-
|
|
224
|
-
},
|
|
202
|
+
return (0, _emotion.jsx)("div", {
|
|
203
|
+
css: this.props.styles.answerTableSection
|
|
204
|
+
}, (0, _emotion.jsx)(_index6.default, {
|
|
225
205
|
text: (0, _formatMessage.default)('Answer Frequency Summary')
|
|
226
|
-
},
|
|
206
|
+
}, (0, _emotion.jsx)(_index3.default, {
|
|
227
207
|
itemAnalysis: this.props.itemAnalysis
|
|
228
208
|
})));
|
|
229
209
|
}
|
|
@@ -232,26 +212,26 @@ var ItemAnalysisRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
232
212
|
value: function renderAnswerAnalysis() {
|
|
233
213
|
if (this.props.expanded) {
|
|
234
214
|
var quintile = this.props.itemAnalysis.quintile();
|
|
235
|
-
return
|
|
236
|
-
|
|
237
|
-
}, this.renderAnswerAnalysisChart(),
|
|
238
|
-
|
|
215
|
+
return (0, _emotion.jsx)("div", {
|
|
216
|
+
css: this.props.styles.answerAnalysis
|
|
217
|
+
}, this.renderAnswerAnalysisChart(), (0, _emotion.jsx)("div", {
|
|
218
|
+
css: this.props.styles.answerDistributionSection,
|
|
239
219
|
"data-automation": "sdk-reporting-answer-distribution"
|
|
240
|
-
},
|
|
220
|
+
}, (0, _emotion.jsx)(_index6.default, {
|
|
241
221
|
text: (0, _formatMessage.default)('Performance by Quintile')
|
|
242
|
-
},
|
|
243
|
-
|
|
244
|
-
},
|
|
245
|
-
|
|
246
|
-
},
|
|
222
|
+
}, (0, _emotion.jsx)("div", {
|
|
223
|
+
css: this.props.styles.answerDistribution
|
|
224
|
+
}, (0, _emotion.jsx)("div", {
|
|
225
|
+
css: this.props.styles.answerDistributionChart
|
|
226
|
+
}, (0, _emotion.jsx)(_index4.default, {
|
|
247
227
|
visualDistribution: quintile,
|
|
248
228
|
animateDelay: this.props.animateDelay,
|
|
249
229
|
animateDuration: this.props.animateDuration
|
|
250
|
-
})),
|
|
251
|
-
|
|
252
|
-
},
|
|
230
|
+
})), (0, _emotion.jsx)("div", {
|
|
231
|
+
css: this.props.styles.answerDistributionLegend
|
|
232
|
+
}, (0, _emotion.jsx)(_index5.default, {
|
|
253
233
|
series: [{
|
|
254
|
-
|
|
234
|
+
customStyles: this.props.styles.answerDistributionSwatch,
|
|
255
235
|
label: (0, _formatMessage.default)('Number of Students')
|
|
256
236
|
}]
|
|
257
237
|
}))))));
|
|
@@ -267,11 +247,11 @@ var ItemAnalysisRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
267
247
|
outcomesToken = _this$props3.outcomesToken;
|
|
268
248
|
|
|
269
249
|
if (expanded && outcomesEndpoint && itemAnalysis.outcomeAlignmentSetGuid) {
|
|
270
|
-
return
|
|
271
|
-
|
|
272
|
-
},
|
|
250
|
+
return (0, _emotion.jsx)("div", {
|
|
251
|
+
css: this.props.styles.outcomeAlignments
|
|
252
|
+
}, (0, _emotion.jsx)(_index6.default, {
|
|
273
253
|
text: (0, _formatMessage.default)('Outcomes')
|
|
274
|
-
},
|
|
254
|
+
}, (0, _emotion.jsx)(_OutcomeList.default, {
|
|
275
255
|
artifactType: "quizzes.item",
|
|
276
256
|
artifactId: itemAnalysis.itemId,
|
|
277
257
|
alignmentSetId: itemAnalysis.outcomeAlignmentSetGuid,
|
|
@@ -286,8 +266,8 @@ var ItemAnalysisRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
286
266
|
}, {
|
|
287
267
|
key: "renderNotFound",
|
|
288
268
|
value: function renderNotFound() {
|
|
289
|
-
return
|
|
290
|
-
|
|
269
|
+
return (0, _emotion.jsx)("div", {
|
|
270
|
+
css: this.props.styles.emptyText
|
|
291
271
|
}, (0, _formatMessage.default)('No submissions yet'));
|
|
292
272
|
}
|
|
293
273
|
}, {
|
|
@@ -298,11 +278,11 @@ var ItemAnalysisRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
298
278
|
}
|
|
299
279
|
|
|
300
280
|
var present = this.props.itemAnalysis.isPresent();
|
|
301
|
-
return
|
|
281
|
+
return (0, _emotion.jsx)(_index.default, {
|
|
302
282
|
key: this.props.itemId,
|
|
303
|
-
|
|
304
|
-
}, this.renderHeader(),
|
|
305
|
-
|
|
283
|
+
css: this.props.styles.itemAnalysisRow
|
|
284
|
+
}, this.renderHeader(), (0, _emotion.jsx)("div", {
|
|
285
|
+
css: this.props.styles.metricsRow
|
|
306
286
|
}, this.renderStem(), present ? this.renderMetrics() : this.renderNotFound()), present && this.renderAnswerAnalysis(), this.renderOutcomeAlignments());
|
|
307
287
|
}
|
|
308
288
|
}]);
|
|
@@ -320,7 +300,8 @@ var ItemAnalysisRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
320
300
|
outcomesToken: _propTypes.default.string,
|
|
321
301
|
screenreaderNotification: _propTypes.default.func.isRequired,
|
|
322
302
|
children: _propTypes.default.arrayOf(_propTypes.default.node),
|
|
323
|
-
locale: _propTypes.default.string
|
|
303
|
+
locale: _propTypes.default.string,
|
|
304
|
+
styles: _propTypes.default.object
|
|
324
305
|
}, _class2.defaultProps = {
|
|
325
306
|
animateDelay: void 0,
|
|
326
307
|
animateDuration: void 0,
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
13
|
+
var mq = "@media screen and (".concat(componentTheme.phoneBreakPoint, ")");
|
|
14
|
+
return {
|
|
15
|
+
itemAnalysisRow: {
|
|
16
|
+
padding: componentTheme.itemAnalysisRowPadding,
|
|
17
|
+
marginBottom: componentTheme.itemAnalysisRowMargin,
|
|
18
|
+
position: 'relative'
|
|
19
|
+
},
|
|
20
|
+
headerRow: {
|
|
21
|
+
display: 'flex',
|
|
22
|
+
flexDirection: 'row',
|
|
23
|
+
justifyContent: 'space-between',
|
|
24
|
+
alignItems: 'flex-start'
|
|
25
|
+
},
|
|
26
|
+
headerText: {
|
|
27
|
+
color: componentTheme.headerTextColor,
|
|
28
|
+
fontSize: componentTheme.headerTextFontSize
|
|
29
|
+
},
|
|
30
|
+
metricsRow: {
|
|
31
|
+
display: 'flex',
|
|
32
|
+
flexDirection: 'row',
|
|
33
|
+
flexWrap: 'wrap',
|
|
34
|
+
justifyContent: 'center',
|
|
35
|
+
paddingBottom: componentTheme.metricsRowLowerPadding
|
|
36
|
+
},
|
|
37
|
+
metricNote: {
|
|
38
|
+
fontSize: componentTheme.metricNoteFontSize,
|
|
39
|
+
color: componentTheme.metricNoteColor
|
|
40
|
+
},
|
|
41
|
+
stem: {
|
|
42
|
+
flex: '1 0 35%',
|
|
43
|
+
fontSize: componentTheme.stemFontSize,
|
|
44
|
+
lineHeight: componentTheme.stemLineHeight,
|
|
45
|
+
marginBottom: componentTheme.stemMargin,
|
|
46
|
+
'& p': {
|
|
47
|
+
margin: 0
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
metrics: {
|
|
51
|
+
flex: '0 1 42rem'
|
|
52
|
+
},
|
|
53
|
+
metric: (0, _defineProperty2.default)({
|
|
54
|
+
justifyContent: 'center'
|
|
55
|
+
}, mq, {
|
|
56
|
+
flexBasis: '50%'
|
|
57
|
+
}),
|
|
58
|
+
emptyText: {
|
|
59
|
+
flex: '0 1 42rem',
|
|
60
|
+
padding: componentTheme.emptyTextPadding,
|
|
61
|
+
textAlign: 'center',
|
|
62
|
+
color: componentTheme.emptyTextColor
|
|
63
|
+
},
|
|
64
|
+
answerAnalysis: {
|
|
65
|
+
display: 'flex',
|
|
66
|
+
flexDirection: 'row',
|
|
67
|
+
flexWrap: 'wrap',
|
|
68
|
+
justifyContent: 'center',
|
|
69
|
+
margin: '0 -1rem'
|
|
70
|
+
},
|
|
71
|
+
answerTableSection: {
|
|
72
|
+
/* Explicit flex-basis is a workaround for https://bugs.webkit.org/show_bug.cgi?id=136041 */
|
|
73
|
+
flex: '10 1 45%'
|
|
74
|
+
},
|
|
75
|
+
answerDistributionSection: {
|
|
76
|
+
flex: '1 1 auto',
|
|
77
|
+
|
|
78
|
+
/* Non-zero width for IE11 flex-wrap */
|
|
79
|
+
minWidth: '1%'
|
|
80
|
+
},
|
|
81
|
+
answerDistribution: (0, _defineProperty2.default)({
|
|
82
|
+
display: 'flex',
|
|
83
|
+
flexDirection: 'row',
|
|
84
|
+
flexWrap: 'wrap',
|
|
85
|
+
justifyContent: 'center',
|
|
86
|
+
alignItems: 'center',
|
|
87
|
+
padding: "0 ".concat(componentTheme.answerDistributionPadding),
|
|
88
|
+
position: 'relative'
|
|
89
|
+
}, mq, {
|
|
90
|
+
padding: 0
|
|
91
|
+
}),
|
|
92
|
+
answerDistributionChart: {
|
|
93
|
+
width: '19rem',
|
|
94
|
+
padding: "0 ".concat(componentTheme.answerDistributionChartPadding)
|
|
95
|
+
},
|
|
96
|
+
answerDistributionLegend: {
|
|
97
|
+
padding: "0 ".concat(componentTheme.answerDistributionLegendPadding)
|
|
98
|
+
},
|
|
99
|
+
answerDistributionSwatch: {
|
|
100
|
+
backgroundColor: componentTheme.answerDistributionSwatchColor
|
|
101
|
+
},
|
|
102
|
+
outcomeAlignments: {
|
|
103
|
+
display: 'flex',
|
|
104
|
+
margin: '0 - 1rem'
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
var _default = generateStyle;
|
|
110
|
+
exports.default = _default;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
function
|
|
8
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
9
9
|
var spacing = _ref.spacing,
|
|
10
10
|
colors = _ref.colors,
|
|
11
11
|
typography = _ref.typography,
|
|
@@ -29,4 +29,7 @@ function generator(_ref) {
|
|
|
29
29
|
answerDistributionSwatchColor: colors.electric,
|
|
30
30
|
phoneBreakPoint: "max-width: ".concat(breakpoints.medium)
|
|
31
31
|
};
|
|
32
|
-
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
var _default = generateComponentTheme;
|
|
35
|
+
exports.default = _default;
|
package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/presenter.js
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
@@ -19,13 +17,15 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
19
17
|
|
|
20
18
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
21
19
|
|
|
22
|
-
var _react =
|
|
20
|
+
var _react = require("react");
|
|
21
|
+
|
|
22
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
23
23
|
|
|
24
24
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
25
25
|
|
|
26
26
|
var _index = _interopRequireDefault(require("../../../../../common/components/shared/ExpandButton/index.js"));
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _emotion = require("@instructure/emotion");
|
|
29
29
|
|
|
30
30
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
31
31
|
|
|
@@ -49,20 +49,7 @@ var _popoverContent = require("./popoverContent.js");
|
|
|
49
49
|
|
|
50
50
|
var _dec, _class, _class2, _temp;
|
|
51
51
|
|
|
52
|
-
var
|
|
53
|
-
componentId: 'eHqQt',
|
|
54
|
-
template: function template(theme) {
|
|
55
|
-
return "\n\n.eHqQt_eDnN{display:flex;justify-content:space-between;padding-bottom:".concat(theme.headingPadding || 'inherit', "}\n\n.eHqQt_eKXQ{margin:").concat(theme.cardTopMargin || 'inherit', " auto ").concat(theme.cardBottomMargin || 'inherit', " auto;padding:").concat(theme.cardWrapperPadding || 'inherit', ";position:relative}\n\n.eHqQt_dYbQ{align-items:center;display:flex;height:502px;justify-content:center;padding:").concat(theme.cardWrapperPadding || 'inherit', "}\n\n.eHqQt_crZr{padding-top:").concat(theme.metricGroupPaddingTop || 'inherit', "}\n\n.eHqQt_bTHH{position:absolute;right:calc(").concat(theme.viewPaddingRight || 'inherit', " + ").concat(theme.viewPaddingRightAdjust || 'inherit', ");top:").concat(theme.viewPaddingTop || 'inherit', "}\n\n.eHqQt_dPzc,.eHqQt_cpZE{column-gap:").concat(theme.metricsColumnGap || 'inherit', ";display:flex;flex-wrap:wrap;justify-content:flex-start;row-gap:1.5rem}");
|
|
56
|
-
},
|
|
57
|
-
'heading': 'eHqQt_eDnN',
|
|
58
|
-
'cardWrapper': 'eHqQt_eKXQ',
|
|
59
|
-
'skeletonCardWrapper': 'eHqQt_dYbQ',
|
|
60
|
-
'container': 'eHqQt_crZr',
|
|
61
|
-
'expandButtonContainer': 'eHqQt_bTHH',
|
|
62
|
-
'metricGroup': 'eHqQt_dPzc',
|
|
63
|
-
'metricsWrapper': 'eHqQt_cpZE'
|
|
64
|
-
};
|
|
65
|
-
var NewQuizAnalysis = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
52
|
+
var NewQuizAnalysis = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
66
53
|
(0, _inherits2.default)(NewQuizAnalysis, _Component);
|
|
67
54
|
|
|
68
55
|
var _super = (0, _createSuper2.default)(NewQuizAnalysis);
|
|
@@ -89,16 +76,16 @@ var NewQuizAnalysis = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
89
76
|
|
|
90
77
|
_this.renderExpanded = function () {
|
|
91
78
|
var scores = _this.props.quizAnalysis.scores;
|
|
92
|
-
return
|
|
93
|
-
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
},
|
|
79
|
+
return (0, _emotion.jsx)("div", {
|
|
80
|
+
css: _this.props.styles.container
|
|
81
|
+
}, (0, _emotion.jsx)("div", {
|
|
82
|
+
css: _this.props.styles.metricGroup
|
|
83
|
+
}, (0, _emotion.jsx)(_index3.default, {
|
|
97
84
|
metricKey: "stddev",
|
|
98
85
|
value: scores === null || scores === void 0 ? void 0 : scores.stddev,
|
|
99
86
|
label: (0, _formatMessage.default)('Standard Deviation'),
|
|
100
87
|
popoverDescription: _popoverContent.standardDeviation
|
|
101
|
-
}),
|
|
88
|
+
}), (0, _emotion.jsx)(_index3.default, {
|
|
102
89
|
metricKey: "cronbachs_alpha",
|
|
103
90
|
value: scores === null || scores === void 0 ? void 0 : scores.cronbachs_alpha,
|
|
104
91
|
label: (0, _formatMessage.default)('Cronbach\'s Alpha'),
|
|
@@ -111,45 +98,45 @@ var NewQuizAnalysis = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
111
98
|
var scores = quizAnalysis.scores,
|
|
112
99
|
attempts = quizAnalysis.attempts;
|
|
113
100
|
var expanded = _this.state.expanded;
|
|
114
|
-
return
|
|
115
|
-
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
},
|
|
119
|
-
|
|
120
|
-
},
|
|
101
|
+
return (0, _emotion.jsx)(_index2.default, {
|
|
102
|
+
css: _this.props.styles.cardWrapper
|
|
103
|
+
}, (0, _emotion.jsx)("div", {
|
|
104
|
+
css: _this.props.styles.metricGroup
|
|
105
|
+
}, (0, _emotion.jsx)("div", {
|
|
106
|
+
css: _this.props.styles.metricsWrapper
|
|
107
|
+
}, (0, _emotion.jsx)(_index4.default, {
|
|
121
108
|
metricKey: "highscore",
|
|
122
109
|
label: (0, _formatMessage.default)('High Score'),
|
|
123
110
|
value: scores === null || scores === void 0 ? void 0 : scores.max_percentage,
|
|
124
111
|
suffix: "%"
|
|
125
|
-
}),
|
|
112
|
+
}), (0, _emotion.jsx)(_index4.default, {
|
|
126
113
|
metricKey: "lowscore",
|
|
127
114
|
label: (0, _formatMessage.default)('Low Score'),
|
|
128
115
|
value: scores === null || scores === void 0 ? void 0 : scores.min_percentage,
|
|
129
116
|
suffix: "%"
|
|
130
|
-
}),
|
|
117
|
+
}), (0, _emotion.jsx)(_index4.default, {
|
|
131
118
|
metricKey: "meanscore",
|
|
132
119
|
label: (0, _formatMessage.default)('Mean Score'),
|
|
133
120
|
value: scores === null || scores === void 0 ? void 0 : scores.mean_percentage,
|
|
134
121
|
suffix: "%"
|
|
135
|
-
})),
|
|
136
|
-
|
|
137
|
-
},
|
|
122
|
+
})), (0, _emotion.jsx)("div", {
|
|
123
|
+
css: _this.props.styles.metricsWrapper
|
|
124
|
+
}, (0, _emotion.jsx)(_index4.default, {
|
|
138
125
|
metricKey: "median_percentage",
|
|
139
126
|
label: (0, _formatMessage.default)('Median Score'),
|
|
140
127
|
value: scores === null || scores === void 0 ? void 0 : scores.median_percentage,
|
|
141
128
|
suffix: "%"
|
|
142
|
-
}),
|
|
129
|
+
}), (0, _emotion.jsx)(_index4.default, {
|
|
143
130
|
metricKey: "mean_elapsed_sec",
|
|
144
131
|
label: (0, _formatMessage.default)('Mean Elapsed Time'),
|
|
145
132
|
value: (0, _formatTimespan.formatTimeToFullNumeric)(attempts === null || attempts === void 0 ? void 0 : attempts.mean_elapsed_sec)
|
|
146
|
-
})),
|
|
147
|
-
|
|
148
|
-
},
|
|
133
|
+
})), (0, _emotion.jsx)("div", {
|
|
134
|
+
css: _this.props.styles.expandButtonContainer
|
|
135
|
+
}, (0, _emotion.jsx)(_index.default, {
|
|
149
136
|
onClick: _this.handleToggle,
|
|
150
137
|
title: expanded ? (0, _formatMessage.default)('collapse quiz analysis') : (0, _formatMessage.default)('expand quiz analysis'),
|
|
151
138
|
isExpanded: expanded
|
|
152
|
-
}))), expanded && _this.renderExpanded(),
|
|
139
|
+
}))), expanded && _this.renderExpanded(), (0, _emotion.jsx)(_presenter.ScoreDistribution, {
|
|
153
140
|
decileDistribution: _this.getPreparedDecileDistribution()
|
|
154
141
|
}));
|
|
155
142
|
};
|
|
@@ -180,9 +167,9 @@ var NewQuizAnalysis = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
180
167
|
var fetchInProgress = this.props.fetchInProgress;
|
|
181
168
|
|
|
182
169
|
if (fetchInProgress) {
|
|
183
|
-
return
|
|
184
|
-
|
|
185
|
-
},
|
|
170
|
+
return (0, _emotion.jsx)(_index2.default, {
|
|
171
|
+
css: this.props.styles.skeletonCardWrapper
|
|
172
|
+
}, (0, _emotion.jsx)(_uiSpinner.Spinner, {
|
|
186
173
|
renderTitle: (0, _formatMessage.default)('Loading quiz analysis data')
|
|
187
174
|
}));
|
|
188
175
|
} else {
|
|
@@ -194,7 +181,8 @@ var NewQuizAnalysis = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
194
181
|
return NewQuizAnalysis;
|
|
195
182
|
}(_react.Component), _class2.propTypes = {
|
|
196
183
|
quizAnalysis: _propTypes.quizAnalysisPropType,
|
|
197
|
-
fetchInProgress: _propTypes2.default.bool
|
|
184
|
+
fetchInProgress: _propTypes2.default.bool,
|
|
185
|
+
styles: _propTypes2.default.object
|
|
198
186
|
}.isRequired, _class2.defaultProps = {
|
|
199
187
|
quizAnalysis: {}
|
|
200
188
|
}, _temp)) || _class);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
9
|
+
var metric = {
|
|
10
|
+
flexWrap: 'wrap',
|
|
11
|
+
display: 'flex',
|
|
12
|
+
justifyContent: 'flex-start',
|
|
13
|
+
columnGap: componentTheme.metricsColumnGap,
|
|
14
|
+
rowGap: '1.5rem'
|
|
15
|
+
};
|
|
16
|
+
return {
|
|
17
|
+
heading: {
|
|
18
|
+
display: 'flex',
|
|
19
|
+
justifyContent: 'space-between',
|
|
20
|
+
paddingBottom: componentTheme.headingPadding
|
|
21
|
+
},
|
|
22
|
+
cardWrapper: {
|
|
23
|
+
padding: componentTheme.cardWrapperPadding,
|
|
24
|
+
position: 'relative',
|
|
25
|
+
margin: "".concat(componentTheme.cardTopMargin, " auto ").concat(componentTheme.cardBottomMargin, " auto")
|
|
26
|
+
},
|
|
27
|
+
skeletonCardWrapper: {
|
|
28
|
+
padding: componentTheme.cardWrapperPadding,
|
|
29
|
+
height: '502px',
|
|
30
|
+
display: 'flex',
|
|
31
|
+
alignItems: 'center',
|
|
32
|
+
justifyContent: 'center'
|
|
33
|
+
},
|
|
34
|
+
container: {
|
|
35
|
+
paddingTop: componentTheme.metricGroupPaddingTop
|
|
36
|
+
},
|
|
37
|
+
expandButtonContainer: {
|
|
38
|
+
position: 'absolute',
|
|
39
|
+
right: "calc(".concat(componentTheme.viewPaddingRight, " + ").concat(componentTheme.viewPaddingRightAdjust, ")"),
|
|
40
|
+
top: componentTheme.viewPaddingTop
|
|
41
|
+
},
|
|
42
|
+
metricsWrapper: metric,
|
|
43
|
+
metricGroup: metric
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
var _default = generateStyle;
|
|
48
|
+
exports.default = _default;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
function
|
|
8
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
9
9
|
var spacing = _ref.spacing;
|
|
10
10
|
return {
|
|
11
11
|
metricGroupPaddingTop: spacing.medium,
|
|
@@ -18,4 +18,7 @@ function generator(_ref) {
|
|
|
18
18
|
cardWrapperPadding: spacing.medium,
|
|
19
19
|
metricsColumnGap: '82px'
|
|
20
20
|
};
|
|
21
|
-
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
var _default = generateComponentTheme;
|
|
24
|
+
exports.default = _default;
|