@instructure/quiz-core 20.11.2 → 20.11.3-rc.10
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/common/components/layout/navbar/presenter.js +24 -18
- package/es/common/components/layout/navbar/styles.js +8 -0
- package/es/common/components/layout/navbar/theme.js +10 -0
- package/es/moderating/components/resources/ModerateTable/presenter.js +44 -46
- package/es/moderating/components/resources/ModerateTable/styles.js +23 -0
- package/es/moderating/components/resources/ModerateTable/theme.js +4 -2
- package/es/moderating/components/resources/ModerateTableRow/presenter.js +63 -68
- package/es/moderating/components/resources/ModerateTableRow/styles.js +25 -0
- package/es/moderating/components/resources/ModerateTableRow/theme.js +4 -2
- package/es/reporting/components/itemAnalysis/AnswerFrequencySummary/index.js +1 -1
- package/es/reporting/components/quizAnalysis/QuizAnalysisOverview.js +34 -41
- package/es/reporting/components/quizAnalysis/styles.js +27 -0
- package/es/reporting/components/quizAnalysis/theme.js +4 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/presenter.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/Table/index.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/presenter.js +33 -27
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/styles.js +14 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/theme.js +4 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/presenter.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js +80 -79
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/styles.js +75 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/theme.js +4 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +47 -49
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/styles.js +14 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/theme.js +4 -2
- package/lib/common/components/layout/navbar/presenter.js +26 -22
- package/lib/common/components/layout/navbar/styles.js +16 -0
- package/lib/common/components/layout/navbar/theme.js +18 -0
- package/lib/moderating/components/resources/ModerateTable/presenter.js +43 -50
- package/lib/moderating/components/resources/ModerateTable/styles.js +33 -0
- package/lib/moderating/components/resources/ModerateTable/theme.js +6 -3
- package/lib/moderating/components/resources/ModerateTableRow/presenter.js +61 -70
- package/lib/moderating/components/resources/ModerateTableRow/styles.js +33 -0
- package/lib/moderating/components/resources/ModerateTableRow/theme.js +6 -3
- package/lib/reporting/components/itemAnalysis/AnswerFrequencySummary/index.js +1 -1
- package/lib/reporting/components/quizAnalysis/QuizAnalysisOverview.js +33 -43
- package/lib/reporting/components/quizAnalysis/styles.js +37 -0
- package/lib/reporting/components/quizAnalysis/theme.js +6 -3
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/presenter.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/Table/index.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/presenter.js +29 -27
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/styles.js +24 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/theme.js +6 -3
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/presenter.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js +82 -84
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/styles.js +85 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/theme.js +6 -3
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +43 -48
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/styles.js +22 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/theme.js +6 -3
- package/package.json +10 -10
package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
1
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
@@ -6,36 +5,21 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
6
5
|
|
|
7
6
|
var _dec, _class, _class2, _temp;
|
|
8
7
|
|
|
8
|
+
/** @jsx jsx */
|
|
9
9
|
import { Heading } from '@instructure/ui-heading';
|
|
10
10
|
import { PresentationContent } from '@instructure/ui-a11y-content';
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
template: function template(theme) {
|
|
15
|
-
return "\n\n.eObAE_eKXQ{padding:".concat(theme.cardWrapperPadding || 'inherit', "}\n\n.eObAE_bwlc{gap:24px;justify-content:space-between;position:relative;row-gap:32px}\n\n.eObAE_bwlc,.eObAE_bqdH{align-items:flex-start;display:flex;flex-direction:row;flex-wrap:wrap}\n\n.eObAE_bqdH{row-gap:24px}\n\n.eObAE_eTaq{align-items:center;border:1px solid ").concat(theme.blankBorderColor || 'inherit', ";border-radius:").concat(theme.blankBorderRadius || 'inherit', ";display:inline-flex;height:").concat(theme.blankHeight || 'inherit', ";justify-content:center;min-width:").concat(theme.blankMinWidth || 'inherit', ";padding:2px 2px;vertical-align:middle}\n\n.eObAE_NpIG{position:absolute;right:").concat(theme.viewPaddingRight || 'inherit', ";top:0}\n\n.eObAE_eoBe{font-size:").concat(theme.metricNumberContextFontSize || 'inherit', ";font-weight:").concat(theme.metricNumberContextFontWeight || 'inherit', "}\n\n.eObAE_fFDJ{display:none}\n\n.eObAE_fxkJ{margin-top:-8px}\n\n.eObAE_esVF{min-height:48px}\n\n.eObAE_eTZq{position:relative}\n\n.eObAE_eTZq:after{background:linear-gradient(180deg,hsla(0,0%,100%,0),#fff);content:\"\";height:48px;left:0;position:absolute;top:0;width:100%}\n\n.eObAE_cVld{max-width:100%;width:calc(25% + 350px)}");
|
|
16
|
-
},
|
|
17
|
-
'cardWrapper': 'eObAE_eKXQ',
|
|
18
|
-
'itemCardInnerContainer': 'eObAE_bwlc',
|
|
19
|
-
'metricsContainer': 'eObAE_bqdH',
|
|
20
|
-
'blankSpace': 'eObAE_eTaq',
|
|
21
|
-
'itemCardToggleButtonWrapper': 'eObAE_NpIG',
|
|
22
|
-
'metricNumberContext': 'eObAE_eoBe',
|
|
23
|
-
'hiddenMetrics': 'eObAE_fFDJ',
|
|
24
|
-
'itemBodyToggleButtonWrapper': 'eObAE_fxkJ',
|
|
25
|
-
'itemBody': 'eObAE_esVF',
|
|
26
|
-
'hiddenItemBody': 'eObAE_eTZq',
|
|
27
|
-
'answerFrequencySummaryContainer': 'eObAE_cVld'
|
|
28
|
-
};
|
|
11
|
+
import PropTypes from 'prop-types';
|
|
12
|
+
import { Component } from 'react';
|
|
13
|
+
import generateStyle from "./styles.js";
|
|
29
14
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
30
15
|
import ExpandButton from "../../../../../common/components/shared/ExpandButton/index.js";
|
|
31
16
|
import { Text } from '@instructure/ui-text';
|
|
32
|
-
import {
|
|
33
|
-
import
|
|
17
|
+
import { withStyle, jsx, css } from '@instructure/emotion';
|
|
18
|
+
import generateComponentTheme from "./theme.js";
|
|
34
19
|
import { difficultyIndex, discriminationIndex, pearsonCorrelation } from "./popoverContent.js";
|
|
35
20
|
import Card from "../../../../../common/components/shared/Card/index.js";
|
|
36
21
|
import AnalysisMetric from "../AnalysisMetric/index.js";
|
|
37
22
|
import AnalysisPopoverMetric from "../AnalysisPopoverMetric/index.js";
|
|
38
|
-
import classnames from 'classnames';
|
|
39
23
|
import { interactionTypesNameDictionary } from "../../../../../common/util/interactionTypeMetadata.js";
|
|
40
24
|
import AnswerFrequencySummary from "../AnswerFrequencySummary/index.js";
|
|
41
25
|
import { afsFlags, itemAnalysisPropType } from "../propTypes.js";
|
|
@@ -46,7 +30,7 @@ import { RICH_FILL_BLANK_SLUG } from '@instructure/quiz-common';
|
|
|
46
30
|
var parser = new DOMParser();
|
|
47
31
|
var parsererrorElement = 'parsererror';
|
|
48
32
|
var parseType = 'text/html';
|
|
49
|
-
export var NewItemAnalysis = (_dec =
|
|
33
|
+
export var NewItemAnalysis = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
50
34
|
_inherits(NewItemAnalysis, _Component);
|
|
51
35
|
|
|
52
36
|
var _super = _createSuper(NewItemAnalysis);
|
|
@@ -91,9 +75,9 @@ export var NewItemAnalysis = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
91
75
|
return t.rich('{score, number}<s>/{possible, number} PTS</s>', {
|
|
92
76
|
s: function s(_ref) {
|
|
93
77
|
var children = _ref.children;
|
|
94
|
-
return
|
|
78
|
+
return jsx("span", {
|
|
95
79
|
key: metricKey,
|
|
96
|
-
|
|
80
|
+
css: _this.props.styles.metricNumberContext
|
|
97
81
|
}, children);
|
|
98
82
|
},
|
|
99
83
|
score: metricValue,
|
|
@@ -102,7 +86,7 @@ export var NewItemAnalysis = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
102
86
|
};
|
|
103
87
|
|
|
104
88
|
_this.renderTitle = function (title) {
|
|
105
|
-
return
|
|
89
|
+
return jsx(Heading, {
|
|
106
90
|
margin: "0 x-large small 0",
|
|
107
91
|
level: "h3",
|
|
108
92
|
color: "primary"
|
|
@@ -110,7 +94,7 @@ export var NewItemAnalysis = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
110
94
|
};
|
|
111
95
|
|
|
112
96
|
_this.renderInteractionType = function (interactionType) {
|
|
113
|
-
return
|
|
97
|
+
return jsx(Text, {
|
|
114
98
|
size: "medium",
|
|
115
99
|
weight: "bold",
|
|
116
100
|
transform: "capitalize"
|
|
@@ -138,85 +122,88 @@ export var NewItemAnalysis = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
138
122
|
return _this.isBlank(span);
|
|
139
123
|
}).forEach(function (span, index) {
|
|
140
124
|
var newSpan = span.cloneNode();
|
|
141
|
-
newSpan.setAttribute('
|
|
125
|
+
newSpan.setAttribute('style', css(_this.props.styles.blankSpace).styles);
|
|
142
126
|
newSpan.innerHTML = "".concat(index + 1);
|
|
143
127
|
span.replaceWith(newSpan);
|
|
144
128
|
});
|
|
145
129
|
return tempDoc.querySelector('body').innerHTML;
|
|
146
130
|
};
|
|
147
131
|
|
|
148
|
-
_this.renderRichContent = function (itemBody,
|
|
149
|
-
return
|
|
132
|
+
_this.renderRichContent = function (itemBody, itemId) {
|
|
133
|
+
return jsx(Flex, {
|
|
150
134
|
direction: "row",
|
|
151
135
|
alignItems: "start"
|
|
152
|
-
},
|
|
136
|
+
}, jsx(Flex.Item, {
|
|
153
137
|
shouldShrink: true,
|
|
154
138
|
shouldGrow: true
|
|
155
|
-
},
|
|
139
|
+
}, jsx("div", {
|
|
156
140
|
id: _this.itemCardBodyId(itemId),
|
|
157
|
-
|
|
158
|
-
},
|
|
141
|
+
css: _this.props.styles.itemBody
|
|
142
|
+
}, jsx(RichContentRenderer, {
|
|
159
143
|
content: itemBody
|
|
160
|
-
}))),
|
|
144
|
+
}))), jsx(Flex.Item, {
|
|
161
145
|
margin: "none none none x-small"
|
|
162
|
-
},
|
|
163
|
-
|
|
164
|
-
}, _this.isBodyHigherThanContainer() &&
|
|
146
|
+
}, jsx("div", {
|
|
147
|
+
css: _this.props.styles.itemBodyToggleButtonWrapper
|
|
148
|
+
}, _this.isBodyHigherThanContainer() && jsx(PresentationContent, null, jsx(ExpandButton, {
|
|
165
149
|
onClick: _this.handleBodyToggle,
|
|
166
150
|
title: _this.state.bodyExpanded ? t('collapse question stem') : t('expand question stem'),
|
|
167
151
|
isExpanded: _this.state.bodyExpanded
|
|
168
152
|
})))));
|
|
169
153
|
};
|
|
170
154
|
|
|
171
|
-
_this.renderMetrics = function (scores
|
|
172
|
-
return
|
|
155
|
+
_this.renderMetrics = function (scores) {
|
|
156
|
+
return jsx(Flex, {
|
|
173
157
|
direction: "column"
|
|
174
|
-
},
|
|
158
|
+
}, jsx(Flex.Item, {
|
|
175
159
|
overflowY: "visible"
|
|
176
|
-
},
|
|
177
|
-
|
|
178
|
-
|
|
160
|
+
}, jsx(Flex, {
|
|
161
|
+
wrap: "wrap",
|
|
162
|
+
direction: "row",
|
|
163
|
+
alignItems: "start",
|
|
164
|
+
gap: "medium"
|
|
165
|
+
}, jsx(Flex.Item, {
|
|
179
166
|
margin: "none medium none none"
|
|
180
|
-
},
|
|
167
|
+
}, jsx(AnalysisPopoverMetric, {
|
|
181
168
|
metricKey: "difficulty_index",
|
|
182
169
|
label: t('Item Difficulty'),
|
|
183
170
|
value: scores.difficulty_index,
|
|
184
171
|
popoverDescription: difficultyIndex
|
|
185
|
-
})),
|
|
172
|
+
})), jsx(Flex.Item, {
|
|
186
173
|
margin: "none medium none none"
|
|
187
|
-
},
|
|
174
|
+
}, jsx(AnalysisMetric, {
|
|
188
175
|
metricKey: "mean",
|
|
189
176
|
label: t('Mean Earned Points'),
|
|
190
177
|
value: _this.calculateValueWithPointsPossible('mean', scores.mean)
|
|
191
|
-
})),
|
|
178
|
+
})), jsx(Flex.Item, {
|
|
192
179
|
margin: "none medium none none"
|
|
193
|
-
},
|
|
180
|
+
}, jsx(AnalysisMetric, {
|
|
194
181
|
metricKey: "median",
|
|
195
182
|
label: t('Median Earned Points'),
|
|
196
183
|
value: _this.calculateValueWithPointsPossible('median', scores.median)
|
|
197
|
-
})),
|
|
184
|
+
})), jsx(Flex.Item, {
|
|
198
185
|
margin: "none large none none"
|
|
199
|
-
},
|
|
186
|
+
}, jsx(AnalysisPopoverMetric, {
|
|
200
187
|
metricKey: "discrimination_index",
|
|
201
188
|
label: t('Discrimination Index'),
|
|
202
189
|
value: scores.discrimination_index,
|
|
203
190
|
popoverDescription: discriminationIndex
|
|
204
|
-
})))),
|
|
205
|
-
|
|
206
|
-
},
|
|
191
|
+
})))), jsx(Flex.Item, null, jsx("div", {
|
|
192
|
+
css: _this.props.styles.itemCardToggleButtonWrapper
|
|
193
|
+
}, jsx(ExpandButton, {
|
|
207
194
|
onClick: _this.handleMetricToggle,
|
|
208
195
|
title: _this.state.metricsExpanded ? t('collapse item card') : t('expand item card'),
|
|
209
196
|
isExpanded: _this.state.metricsExpanded
|
|
210
|
-
}))),
|
|
197
|
+
}))), jsx(Flex.Item, {
|
|
211
198
|
overflowY: "visible",
|
|
212
199
|
margin: "medium none none none"
|
|
213
|
-
},
|
|
214
|
-
|
|
215
|
-
},
|
|
216
|
-
|
|
217
|
-
},
|
|
200
|
+
}, jsx("div", {
|
|
201
|
+
css: _this.props.styles.hiddenWhenNotExpanded
|
|
202
|
+
}, jsx("div", {
|
|
203
|
+
css: _this.props.styles.metricsContainer
|
|
204
|
+
}, jsx(Flex.Item, {
|
|
218
205
|
margin: "none medium none none"
|
|
219
|
-
},
|
|
206
|
+
}, jsx(AnalysisPopoverMetric, {
|
|
220
207
|
metricKey: "pearson_correlation",
|
|
221
208
|
label: t('Corrected Item-Total Correlation Coefficient'),
|
|
222
209
|
value: scores.pearson_correlation,
|
|
@@ -224,10 +211,10 @@ export var NewItemAnalysis = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
224
211
|
}))))));
|
|
225
212
|
};
|
|
226
213
|
|
|
227
|
-
_this.renderAnswerSummaryTable = function (itemId, answer_summary,
|
|
228
|
-
return
|
|
229
|
-
|
|
230
|
-
},
|
|
214
|
+
_this.renderAnswerSummaryTable = function (itemId, answer_summary, interactionType, afsFlags) {
|
|
215
|
+
return jsx(Flex.Item, null, jsx("div", {
|
|
216
|
+
css: _this.props.styles.hiddenWhenNotExpanded
|
|
217
|
+
}, jsx(AnswerFrequencySummary, {
|
|
231
218
|
itemId: itemId,
|
|
232
219
|
answerSummary: answer_summary,
|
|
233
220
|
interactionType: interactionType,
|
|
@@ -247,10 +234,24 @@ export var NewItemAnalysis = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
247
234
|
}
|
|
248
235
|
|
|
249
236
|
_createClass(NewItemAnalysis, [{
|
|
237
|
+
key: "componentDidUpdate",
|
|
238
|
+
value: function componentDidUpdate() {
|
|
239
|
+
this.props.makeStyles({
|
|
240
|
+
metricsExpanded: this.state.metricsExpanded,
|
|
241
|
+
itemCardBodyHeight: this.state.itemCardBodyHeight,
|
|
242
|
+
bodyExpanded: this.state.bodyExpanded
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
}, {
|
|
250
246
|
key: "componentDidMount",
|
|
251
247
|
value: function componentDidMount() {
|
|
252
248
|
var _this2 = this;
|
|
253
249
|
|
|
250
|
+
this.props.makeStyles({
|
|
251
|
+
metricsExpanded: this.state.metricsExpanded,
|
|
252
|
+
itemCardBodyHeight: this.state.itemCardBodyHeight,
|
|
253
|
+
bodyExpanded: this.state.bodyExpanded
|
|
254
|
+
});
|
|
254
255
|
ensureRCEContentIsLoaded().then(function () {
|
|
255
256
|
return _this2.calculateItemCardBodyHeight(_this2.props.itemAnalysis.metadata.item_id);
|
|
256
257
|
});
|
|
@@ -291,31 +292,29 @@ export var NewItemAnalysis = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
291
292
|
scores = itemAnalysis.scores;
|
|
292
293
|
var itemId = metadata.item_id;
|
|
293
294
|
var interactionType = metadata.interaction_type;
|
|
294
|
-
var metricsClass = classnames(_defineProperty({}, styles.hiddenMetrics, !this.state.metricsExpanded));
|
|
295
|
-
var itemBodyClass = classnames(styles.itemBody, _defineProperty({}, styles.hiddenItemBody, this.isBodyHigherThanContainer() && !this.state.bodyExpanded));
|
|
296
295
|
var title = (_metadata$item_title = metadata.item_title) !== null && _metadata$item_title !== void 0 ? _metadata$item_title : t('Untitled item');
|
|
297
296
|
var itemBodyEnhanced = this.shouldEnhanceItemBody() ? this.enhanceItemBody(metadata.item_body) : metadata.item_body;
|
|
298
|
-
return
|
|
299
|
-
|
|
300
|
-
},
|
|
297
|
+
return jsx(Card, {
|
|
298
|
+
css: this.props.styles.cardWrapper
|
|
299
|
+
}, jsx(Flex, {
|
|
301
300
|
direction: "column"
|
|
302
|
-
},
|
|
301
|
+
}, jsx(Flex.Item, {
|
|
303
302
|
overflowY: "visible"
|
|
304
|
-
},
|
|
305
|
-
|
|
306
|
-
},
|
|
303
|
+
}, jsx("div", {
|
|
304
|
+
css: this.props.styles.itemCardInnerContainer
|
|
305
|
+
}, jsx(Flex.Item, {
|
|
307
306
|
shouldGrow: true,
|
|
308
307
|
shouldShrink: true,
|
|
309
308
|
size: "45%"
|
|
310
|
-
},
|
|
309
|
+
}, jsx(Flex, {
|
|
311
310
|
direction: "column",
|
|
312
311
|
justifyItems: "start"
|
|
313
|
-
},
|
|
312
|
+
}, jsx(Flex.Item, null, this.renderTitle(title)), jsx(Flex.Item, null, this.renderInteractionType(metadata.interaction_type)), jsx(Flex.Item, {
|
|
314
313
|
shouldShrink: true,
|
|
315
314
|
padding: "small xx-small none none",
|
|
316
315
|
overflowY: "hidden",
|
|
317
316
|
size: !this.state.bodyExpanded ? '60px' : void 0
|
|
318
|
-
}, this.renderRichContent(itemBodyEnhanced,
|
|
317
|
+
}, this.renderRichContent(itemBodyEnhanced, itemId)))), jsx(Flex.Item, null, this.renderMetrics(scores)))), this.renderAnswerSummaryTable(itemId, answer_summary, interactionType, afsFlags)));
|
|
319
318
|
}
|
|
320
319
|
}]);
|
|
321
320
|
|
|
@@ -323,5 +322,7 @@ export var NewItemAnalysis = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
323
322
|
return NewItemAnalysis;
|
|
324
323
|
}(Component), _class2.propTypes = {
|
|
325
324
|
itemAnalysis: itemAnalysisPropType,
|
|
326
|
-
afsFlags: afsFlags
|
|
327
|
-
|
|
325
|
+
afsFlags: afsFlags,
|
|
326
|
+
styles: PropTypes.object,
|
|
327
|
+
makeStyles: PropTypes.func
|
|
328
|
+
}, _temp)) || _class);
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
|
|
3
|
+
var generateStyle = function generateStyle(componentTheme, props, state) {
|
|
4
|
+
var isBodyHigherThanContainer = state.itemCardBodyHeight > 48;
|
|
5
|
+
return {
|
|
6
|
+
cardWrapper: {
|
|
7
|
+
padding: componentTheme.cardWrapperPadding
|
|
8
|
+
},
|
|
9
|
+
itemCardInnerContainer: {
|
|
10
|
+
position: 'relative',
|
|
11
|
+
display: 'flex',
|
|
12
|
+
flexDirection: 'row',
|
|
13
|
+
justifyContent: 'space-between',
|
|
14
|
+
alignItems: 'flex-start',
|
|
15
|
+
flexWrap: 'wrap',
|
|
16
|
+
gap: '24px',
|
|
17
|
+
rowGap: '32px'
|
|
18
|
+
},
|
|
19
|
+
metricsContainer: {
|
|
20
|
+
display: 'flex',
|
|
21
|
+
flexDirection: 'row',
|
|
22
|
+
alignItems: 'flex-start',
|
|
23
|
+
flexWrap: 'wrap',
|
|
24
|
+
rowGap: '24px'
|
|
25
|
+
},
|
|
26
|
+
hiddenWhenNotExpanded: _objectSpread({
|
|
27
|
+
display: 'block'
|
|
28
|
+
}, !state.metricsExpanded && {
|
|
29
|
+
display: 'none'
|
|
30
|
+
}),
|
|
31
|
+
blankSpace: {
|
|
32
|
+
display: 'inline-flex',
|
|
33
|
+
justifyContent: 'center',
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
height: componentTheme.blankHeight,
|
|
36
|
+
minWidth: componentTheme.blankMinWidth,
|
|
37
|
+
verticalAlign: 'middle',
|
|
38
|
+
border: "1px solid ".concat(componentTheme.blankBorderColor),
|
|
39
|
+
borderRadius: componentTheme.blankBorderRadius,
|
|
40
|
+
padding: '2px 2px'
|
|
41
|
+
},
|
|
42
|
+
itemCardToggleButtonWrapper: {
|
|
43
|
+
position: 'absolute',
|
|
44
|
+
top: '0',
|
|
45
|
+
right: componentTheme.viewPaddingRight
|
|
46
|
+
},
|
|
47
|
+
metricNumberContext: {
|
|
48
|
+
fontSize: componentTheme.metricNumberContextFontSize,
|
|
49
|
+
fontWeight: componentTheme.metricNumberContextFontWeight
|
|
50
|
+
},
|
|
51
|
+
itemBodyToggleButtonWrapper: {
|
|
52
|
+
marginTop: '-8px'
|
|
53
|
+
},
|
|
54
|
+
itemBody: _objectSpread({
|
|
55
|
+
minHeight: '48px'
|
|
56
|
+
}, isBodyHigherThanContainer && !state.bodyExpanded && {
|
|
57
|
+
position: 'relative',
|
|
58
|
+
':after': {
|
|
59
|
+
left: '0',
|
|
60
|
+
top: '0',
|
|
61
|
+
content: '""',
|
|
62
|
+
height: '48px',
|
|
63
|
+
width: '100%',
|
|
64
|
+
position: 'absolute',
|
|
65
|
+
background: 'linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff)'
|
|
66
|
+
}
|
|
67
|
+
}),
|
|
68
|
+
answerFrequencySummaryContainer: {
|
|
69
|
+
width: 'calc(25% + 350px)',
|
|
70
|
+
maxWidth: '100%'
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export default generateStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var spacing = _ref.spacing,
|
|
3
3
|
breakpoints = _ref.breakpoints,
|
|
4
4
|
typography = _ref.typography,
|
|
@@ -14,4 +14,6 @@ export default function generator(_ref) {
|
|
|
14
14
|
blankMinWidth: '20px',
|
|
15
15
|
blankHeight: '20px'
|
|
16
16
|
};
|
|
17
|
-
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default generateComponentTheme;
|
|
@@ -5,6 +5,9 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
5
5
|
|
|
6
6
|
var _dec, _class, _class2, _temp;
|
|
7
7
|
|
|
8
|
+
/** @jsx jsx */
|
|
9
|
+
|
|
10
|
+
/* eslint-disable-next-line no-unused-vars */
|
|
8
11
|
import React, { Component } from 'react';
|
|
9
12
|
import { Heading } from '@instructure/ui-heading';
|
|
10
13
|
import NewItemAnalysis from "./NewItemAnalysis/index.js";
|
|
@@ -24,24 +27,18 @@ import errorImage from './downForRepair.svg';
|
|
|
24
27
|
import { PresentationContent, ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
25
28
|
import { csvFormat } from "./exportFormats.js";
|
|
26
29
|
import { ExportButton } from "./ExportButton/index.js";
|
|
27
|
-
import {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
'headerButtonsContainer': 'edRct_bJHk'
|
|
34
|
-
};
|
|
35
|
-
import theme from "./theme.js";
|
|
36
|
-
|
|
37
|
-
var _ref = /*#__PURE__*/React.createElement(Flex.Item, {
|
|
30
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
31
|
+
import generateStyle from "./styles.js";
|
|
32
|
+
import generateComponentTheme from "./theme.js";
|
|
33
|
+
|
|
34
|
+
var _ref = jsx(Flex.Item, {
|
|
38
35
|
align: "center"
|
|
39
|
-
},
|
|
36
|
+
}, jsx(PresentationContent, null, jsx(Img, {
|
|
40
37
|
src: errorImage,
|
|
41
38
|
alt: ""
|
|
42
39
|
})));
|
|
43
40
|
|
|
44
|
-
export var NewQuizAndItemAnalysisPresenter = (_dec =
|
|
41
|
+
export var NewQuizAndItemAnalysisPresenter = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
45
42
|
_inherits(NewQuizAndItemAnalysisPresenter, _Component);
|
|
46
43
|
|
|
47
44
|
var _super = _createSuper(NewQuizAndItemAnalysisPresenter);
|
|
@@ -59,14 +56,14 @@ export var NewQuizAndItemAnalysisPresenter = (_dec = themeable(theme, styles), _
|
|
|
59
56
|
|
|
60
57
|
_this.renderItemAnalyses = function () {
|
|
61
58
|
var itemAnalyses = _this.props.itemAnalyses || [];
|
|
62
|
-
return
|
|
59
|
+
return jsx(React.Fragment, null, jsx(Heading, {
|
|
63
60
|
level: "h2",
|
|
64
61
|
themeOverride: {
|
|
65
62
|
h2FontWeight: 700
|
|
66
63
|
},
|
|
67
64
|
color: "primary"
|
|
68
|
-
}, t('Item Analysis')),
|
|
69
|
-
return
|
|
65
|
+
}, t('Item Analysis')), jsx("div", null, itemAnalyses.map(function (itemAnalysis) {
|
|
66
|
+
return jsx(NewItemAnalysis, {
|
|
70
67
|
key: itemAnalysis.metadata.item_id,
|
|
71
68
|
itemAnalysis: itemAnalysis
|
|
72
69
|
});
|
|
@@ -74,29 +71,29 @@ export var NewQuizAndItemAnalysisPresenter = (_dec = themeable(theme, styles), _
|
|
|
74
71
|
};
|
|
75
72
|
|
|
76
73
|
_this.renderSpinner = function () {
|
|
77
|
-
return
|
|
74
|
+
return jsx(Flex, {
|
|
78
75
|
padding: "medium",
|
|
79
76
|
justifyItems: "center",
|
|
80
77
|
alignItems: "center"
|
|
81
|
-
},
|
|
78
|
+
}, jsx(Spinner, {
|
|
82
79
|
renderTitle: t('Loading item analyses data')
|
|
83
80
|
}));
|
|
84
81
|
};
|
|
85
82
|
|
|
86
83
|
_this.renderBodyOnFailedFetch = function () {
|
|
87
|
-
return
|
|
84
|
+
return jsx(Flex, {
|
|
88
85
|
alignItems: "end",
|
|
89
86
|
width: "82.5rem",
|
|
90
87
|
margin: "auto",
|
|
91
88
|
direction: "column"
|
|
92
|
-
}, _ref,
|
|
89
|
+
}, _ref, jsx(Flex.Item, {
|
|
93
90
|
align: "center"
|
|
94
|
-
},
|
|
91
|
+
}, jsx(Text, {
|
|
95
92
|
size: "x-large",
|
|
96
93
|
color: "primary"
|
|
97
|
-
}, t('Error'))),
|
|
94
|
+
}, t('Error'))), jsx(Flex.Item, {
|
|
98
95
|
align: "center"
|
|
99
|
-
},
|
|
96
|
+
}, jsx(ScreenReaderContent, null, getFailedToFetchReports()), jsx(Text, {
|
|
100
97
|
size: "x-small",
|
|
101
98
|
color: "primary"
|
|
102
99
|
}, getFailedToFetchReports())));
|
|
@@ -106,14 +103,14 @@ export var NewQuizAndItemAnalysisPresenter = (_dec = themeable(theme, styles), _
|
|
|
106
103
|
var _quizAnalysis$metadat;
|
|
107
104
|
|
|
108
105
|
var quizAnalysis = _this.props.quizAnalysis;
|
|
109
|
-
return
|
|
106
|
+
return jsx(Flex, {
|
|
110
107
|
alignItems: "center",
|
|
111
108
|
width: "auto",
|
|
112
109
|
margin: "small auto",
|
|
113
110
|
direction: "column"
|
|
114
|
-
},
|
|
111
|
+
}, jsx(Flex.Item, {
|
|
115
112
|
overflowY: "hidden"
|
|
116
|
-
},
|
|
113
|
+
}, jsx(Heading, {
|
|
117
114
|
level: "h2",
|
|
118
115
|
themeOverride: {
|
|
119
116
|
h2FontWeight: 700
|
|
@@ -130,14 +127,14 @@ export var NewQuizAndItemAnalysisPresenter = (_dec = themeable(theme, styles), _
|
|
|
130
127
|
quizAnalysis = _this$props.quizAnalysis;
|
|
131
128
|
var shouldShowError = analysisError && !generationInProgress;
|
|
132
129
|
var timeStamp = quizAnalysis === null || quizAnalysis === void 0 ? void 0 : quizAnalysis.created_timestamp;
|
|
133
|
-
return
|
|
130
|
+
return jsx(Flex, {
|
|
134
131
|
alignItems: "end",
|
|
135
132
|
width: "auto",
|
|
136
133
|
margin: "small auto",
|
|
137
134
|
direction: "column"
|
|
138
|
-
},
|
|
135
|
+
}, jsx(Flex.Item, null, timeStamp && jsx(AnalysisUpdateDate, {
|
|
139
136
|
date: timeStamp
|
|
140
|
-
})),
|
|
137
|
+
})), jsx(Flex.Item, null, shouldShowError && jsx(Text, {
|
|
141
138
|
size: "x-small",
|
|
142
139
|
weight: "medium",
|
|
143
140
|
color: "danger"
|
|
@@ -146,20 +143,20 @@ export var NewQuizAndItemAnalysisPresenter = (_dec = themeable(theme, styles), _
|
|
|
146
143
|
|
|
147
144
|
_this.renderRightSide = function () {
|
|
148
145
|
var exportEnabled = _this.props.exportEnabled;
|
|
149
|
-
return
|
|
146
|
+
return jsx(Flex, {
|
|
150
147
|
alignItems: "center",
|
|
151
148
|
justifyItems: "end",
|
|
152
149
|
width: "auto",
|
|
153
150
|
direction: "row",
|
|
154
151
|
wrap: "wrap-reverse"
|
|
155
|
-
},
|
|
152
|
+
}, jsx(Flex.Item, {
|
|
156
153
|
padding: "0 small 0 0",
|
|
157
154
|
margin: "0 0 0 auto"
|
|
158
|
-
}, _this.renderUpdateDateWithError()),
|
|
159
|
-
|
|
160
|
-
}, exportEnabled &&
|
|
155
|
+
}, _this.renderUpdateDateWithError()), jsx(Flex.Item, null, jsx("div", {
|
|
156
|
+
css: _this.props.styles.headerButtonsContainer
|
|
157
|
+
}, exportEnabled && jsx(Flex.Item, {
|
|
161
158
|
margin: "0 0 0 auto"
|
|
162
|
-
}, _this.renderExport()),
|
|
159
|
+
}, _this.renderExport()), jsx(Flex.Item, {
|
|
163
160
|
margin: "0 0 0 auto"
|
|
164
161
|
}, _this.renderGenerationButton()))));
|
|
165
162
|
};
|
|
@@ -168,7 +165,7 @@ export var NewQuizAndItemAnalysisPresenter = (_dec = themeable(theme, styles), _
|
|
|
168
165
|
var _this$props2 = _this.props,
|
|
169
166
|
quizAnalysis = _this$props2.quizAnalysis,
|
|
170
167
|
generationInProgress = _this$props2.generationInProgress;
|
|
171
|
-
return
|
|
168
|
+
return jsx(ExportButton, {
|
|
172
169
|
quizAnalysis: quizAnalysis,
|
|
173
170
|
generationInProgress: generationInProgress,
|
|
174
171
|
handleExport: _this.handleExport
|
|
@@ -185,14 +182,14 @@ export var NewQuizAndItemAnalysisPresenter = (_dec = themeable(theme, styles), _
|
|
|
185
182
|
};
|
|
186
183
|
|
|
187
184
|
_this.renderTop = function () {
|
|
188
|
-
return
|
|
185
|
+
return jsx(Flex, {
|
|
189
186
|
justifyItems: "space-between",
|
|
190
187
|
alignItems: "center",
|
|
191
188
|
wrap: "wrap",
|
|
192
189
|
width: "auto",
|
|
193
190
|
margin: "0 auto small 0",
|
|
194
191
|
direction: "row"
|
|
195
|
-
},
|
|
192
|
+
}, jsx(Flex.Item, null, _this.renderHeader()), jsx(Flex.Item, {
|
|
196
193
|
margin: "0 0 0 auto"
|
|
197
194
|
}, _this.renderRightSide()));
|
|
198
195
|
};
|
|
@@ -203,25 +200,25 @@ export var NewQuizAndItemAnalysisPresenter = (_dec = themeable(theme, styles), _
|
|
|
203
200
|
|
|
204
201
|
_this.renderTopOnFailedFetch = function () {
|
|
205
202
|
var exportEnabled = _this.props.exportEnabled;
|
|
206
|
-
return
|
|
203
|
+
return jsx(Flex, {
|
|
207
204
|
direction: "row",
|
|
208
205
|
justifyItems: "end",
|
|
209
206
|
wrap: "wrap",
|
|
210
207
|
width: "auto",
|
|
211
208
|
margin: "auto"
|
|
212
|
-
}, exportEnabled &&
|
|
209
|
+
}, exportEnabled && jsx(Flex.Item, {
|
|
213
210
|
overflowY: "visible"
|
|
214
|
-
}, _this.renderExport()),
|
|
211
|
+
}, _this.renderExport()), jsx(Flex.Item, {
|
|
215
212
|
overflowY: "visible"
|
|
216
213
|
}, _this.renderGenerationButton()));
|
|
217
214
|
};
|
|
218
215
|
|
|
219
216
|
_this.renderOngoingGenerationButton = function () {
|
|
220
|
-
return
|
|
217
|
+
return jsx(Button, {
|
|
221
218
|
color: "primary-inverse",
|
|
222
219
|
interaction: "disabled",
|
|
223
220
|
margin: "auto"
|
|
224
|
-
},
|
|
221
|
+
}, jsx(QuizzesSpinner, {
|
|
225
222
|
size: "x-small",
|
|
226
223
|
color: "brand",
|
|
227
224
|
minHeight: "0",
|
|
@@ -231,14 +228,14 @@ export var NewQuizAndItemAnalysisPresenter = (_dec = themeable(theme, styles), _
|
|
|
231
228
|
};
|
|
232
229
|
|
|
233
230
|
_this.renderStartGenerationButton = function () {
|
|
234
|
-
return
|
|
231
|
+
return jsx(Button, {
|
|
235
232
|
color: "secondary",
|
|
236
233
|
margin: "auto",
|
|
237
234
|
onClick: _this.handleGeneration,
|
|
238
235
|
themeOverride: {
|
|
239
236
|
lineHeight: '24px'
|
|
240
237
|
}
|
|
241
|
-
},
|
|
238
|
+
}, jsx(Text, {
|
|
242
239
|
size: "medium"
|
|
243
240
|
}, t('Generate Report')));
|
|
244
241
|
};
|
|
@@ -246,7 +243,7 @@ export var NewQuizAndItemAnalysisPresenter = (_dec = themeable(theme, styles), _
|
|
|
246
243
|
_this.renderGenerationButton = function () {
|
|
247
244
|
var generationInProgress = _this.props.generationInProgress;
|
|
248
245
|
var buttonVariant = generationInProgress ? _this.renderOngoingGenerationButton() : _this.renderStartGenerationButton();
|
|
249
|
-
return
|
|
246
|
+
return jsx(React.Fragment, null, buttonVariant);
|
|
250
247
|
};
|
|
251
248
|
|
|
252
249
|
_this.renderBody = function () {
|
|
@@ -254,7 +251,7 @@ export var NewQuizAndItemAnalysisPresenter = (_dec = themeable(theme, styles), _
|
|
|
254
251
|
fetchInProgress = _this$props4.fetchInProgress,
|
|
255
252
|
quizAnalysis = _this$props4.quizAnalysis; // TODO need to refactor the NewQuizAnalysis to move out spinner logic
|
|
256
253
|
|
|
257
|
-
return
|
|
254
|
+
return jsx(React.Fragment, null, (fetchInProgress || quizAnalysis) && jsx(NewQuizAnalysis, {
|
|
258
255
|
quizAnalysis: quizAnalysis,
|
|
259
256
|
fetchInProgress: fetchInProgress
|
|
260
257
|
}), fetchInProgress ? _this.renderSpinner() : _this.renderItemAnalyses());
|
|
@@ -286,7 +283,7 @@ export var NewQuizAndItemAnalysisPresenter = (_dec = themeable(theme, styles), _
|
|
|
286
283
|
var _this$props5 = this.props,
|
|
287
284
|
analysisFetchError = _this$props5.analysisFetchError,
|
|
288
285
|
fetchInProgress = _this$props5.fetchInProgress;
|
|
289
|
-
return
|
|
286
|
+
return jsx("div", {
|
|
290
287
|
className: "fs-mask"
|
|
291
288
|
}, !fetchInProgress && (analysisFetchError ? this.renderTopOnFailedFetch() : this.renderTopOnSuccessfulFetch()), analysisFetchError ? this.renderBodyOnFailedFetch() : this.renderBodyOnSuccessfulFetch());
|
|
292
289
|
}
|
|
@@ -303,7 +300,8 @@ export var NewQuizAndItemAnalysisPresenter = (_dec = themeable(theme, styles), _
|
|
|
303
300
|
analysisError: PropTypes.string,
|
|
304
301
|
generateReports: PropTypes.func.isRequired,
|
|
305
302
|
exportReports: PropTypes.func.isRequired,
|
|
306
|
-
exportEnabled: PropTypes.bool.isRequired
|
|
303
|
+
exportEnabled: PropTypes.bool.isRequired,
|
|
304
|
+
styles: PropTypes.object
|
|
307
305
|
}, _class2.defaultProps = {
|
|
308
306
|
analysisError: void 0,
|
|
309
307
|
quizAnalysis: void 0,
|