@instructure/quiz-core 18.4.1-rc.1 → 18.4.1-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/sidebar/SidebarItem/presenter.js +11 -5
- package/es/reporting/api/getAnalysesExport.js +54 -0
- package/es/reporting/components/charts/Distribution/theme.js +1 -1
- package/es/reporting/components/charts/QuintileDistribution/theme.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/presenter.js +1 -12
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +40 -10
- package/lib/common/components/layout/sidebar/SidebarItem/presenter.js +11 -5
- package/lib/reporting/api/getAnalysesExport.js +69 -0
- package/lib/reporting/components/charts/Distribution/theme.js +1 -1
- package/lib/reporting/components/charts/QuintileDistribution/theme.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/presenter.js +1 -13
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +40 -10
- package/package.json +9 -9
- package/es/reporting/api/newItemAnalyses.js +0 -38
- package/es/reporting/api/newQuizAnalysis.js +0 -38
- package/lib/reporting/api/newItemAnalyses.js +0 -51
- package/lib/reporting/api/newQuizAnalysis.js +0 -51
|
@@ -106,7 +106,13 @@ export var SidebarItem = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
106
106
|
value: function renderButton() {
|
|
107
107
|
var _this$props2 = this.props,
|
|
108
108
|
displayPosition = _this$props2.displayPosition,
|
|
109
|
-
itemId = _this$props2.itemId
|
|
109
|
+
itemId = _this$props2.itemId,
|
|
110
|
+
isAnswered = _this$props2.isAnswered;
|
|
111
|
+
var screenReaderContent = !isAnswered && isAnswered !== null ? t('Navigate to question at position {displayPosition}, unanswered', {
|
|
112
|
+
displayPosition: displayPosition
|
|
113
|
+
}) : t('Navigate to question at position {displayPosition}', {
|
|
114
|
+
displayPosition: displayPosition
|
|
115
|
+
});
|
|
110
116
|
return /*#__PURE__*/React.createElement(Link, {
|
|
111
117
|
href: "#",
|
|
112
118
|
size: "small",
|
|
@@ -117,9 +123,7 @@ export var SidebarItem = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
117
123
|
"data-automation-item-id": itemId,
|
|
118
124
|
"data-automation": "sdk-sidebar-item-button"
|
|
119
125
|
}, /*#__PURE__*/React.createElement(AccessibleContent, {
|
|
120
|
-
alt:
|
|
121
|
-
displayPosition: displayPosition
|
|
122
|
-
})
|
|
126
|
+
alt: screenReaderContent
|
|
123
127
|
}, this.renderPosition()));
|
|
124
128
|
}
|
|
125
129
|
}, {
|
|
@@ -181,6 +185,7 @@ export var SidebarItem = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
181
185
|
itemBody: PropTypes.string,
|
|
182
186
|
itemName: PropTypes.string.isRequired,
|
|
183
187
|
inStimulus: PropTypes.bool,
|
|
188
|
+
isAnswered: PropTypes.bool,
|
|
184
189
|
position: PropTypes.number.isRequired,
|
|
185
190
|
pointsPossible: PropTypes.number.isRequired,
|
|
186
191
|
preventScrollToItem: PropTypes.bool.isRequired,
|
|
@@ -193,6 +198,7 @@ export var SidebarItem = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
193
198
|
children: null,
|
|
194
199
|
inStimulus: false,
|
|
195
200
|
itemBody: '',
|
|
196
|
-
quizEntry: null
|
|
201
|
+
quizEntry: null,
|
|
202
|
+
isAnswered: null
|
|
197
203
|
}, _temp)) || _class);
|
|
198
204
|
export default SidebarItem;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
+
import Fetcher from "../../common/util/Fetcher.js";
|
|
4
|
+
|
|
5
|
+
var getFetcher = function getFetcher(format) {
|
|
6
|
+
var mimeType = formatsToMimeTypes.get(format);
|
|
7
|
+
|
|
8
|
+
if (!mimeType) {
|
|
9
|
+
throw new Error("Unknown export format ".concat(format, "!"));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return new Fetcher({
|
|
13
|
+
headers: {
|
|
14
|
+
'Accept': mimeType
|
|
15
|
+
},
|
|
16
|
+
asyncResponseHandler: function asyncResponseHandler(response) {
|
|
17
|
+
return response;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export var csvFormat = 'csv';
|
|
23
|
+
var formatsToMimeTypes = new Map().set(csvFormat, 'text/csv');
|
|
24
|
+
export var getAnalysesExport = /*#__PURE__*/function () {
|
|
25
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(quizId, format) {
|
|
26
|
+
var filter,
|
|
27
|
+
fetcher,
|
|
28
|
+
url,
|
|
29
|
+
_args = arguments;
|
|
30
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
31
|
+
while (1) {
|
|
32
|
+
switch (_context.prev = _context.next) {
|
|
33
|
+
case 0:
|
|
34
|
+
filter = _args.length > 2 && _args[2] !== void 0 ? _args[2] : 'last_attempt';
|
|
35
|
+
fetcher = getFetcher(format);
|
|
36
|
+
url = "/api/quizzes/".concat(quizId, "/analyses/export?filter=").concat(filter);
|
|
37
|
+
_context.next = 5;
|
|
38
|
+
return fetcher.get(url);
|
|
39
|
+
|
|
40
|
+
case 5:
|
|
41
|
+
return _context.abrupt("return", _context.sent);
|
|
42
|
+
|
|
43
|
+
case 6:
|
|
44
|
+
case "end":
|
|
45
|
+
return _context.stop();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}, _callee);
|
|
49
|
+
}));
|
|
50
|
+
|
|
51
|
+
return function getAnalysesExport(_x, _x2) {
|
|
52
|
+
return _ref.apply(this, arguments);
|
|
53
|
+
};
|
|
54
|
+
}();
|
|
@@ -6,7 +6,7 @@ export default function generator(_ref) {
|
|
|
6
6
|
barStarFillColor: colors.fire,
|
|
7
7
|
barLabelColor: colors.textDarkest,
|
|
8
8
|
barLabelFontFamily: typography.fontFamily,
|
|
9
|
-
barLabelFontSize: typography.
|
|
9
|
+
barLabelFontSize: typography.fontSizeSmall,
|
|
10
10
|
xAxisColor: colors.textDarkest
|
|
11
11
|
};
|
|
12
12
|
}
|
package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js
CHANGED
|
@@ -108,7 +108,7 @@ export var NewItemAnalysis = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
108
108
|
|
|
109
109
|
_this.renderInteractionType = function (interactionType) {
|
|
110
110
|
return /*#__PURE__*/React.createElement(Text, {
|
|
111
|
-
size: "
|
|
111
|
+
size: "medium",
|
|
112
112
|
weight: "bold",
|
|
113
113
|
transform: "capitalize"
|
|
114
114
|
}, _this.mapInteractionTypeToTranslation(interactionType));
|
package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/presenter.js
CHANGED
|
@@ -5,7 +5,6 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
5
5
|
|
|
6
6
|
var _dec, _class, _class2, _temp;
|
|
7
7
|
|
|
8
|
-
import { Heading } from '@instructure/ui-heading';
|
|
9
8
|
import React, { Component } from 'react';
|
|
10
9
|
var styles = {
|
|
11
10
|
componentId: 'eHqQt',
|
|
@@ -80,21 +79,11 @@ export var NewQuizAnalysis = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
80
79
|
_this.renderContent = function () {
|
|
81
80
|
var quizAnalysis = _this.props.quizAnalysis;
|
|
82
81
|
var scores = quizAnalysis.scores,
|
|
83
|
-
attempts = quizAnalysis.attempts
|
|
84
|
-
metadata = quizAnalysis.metadata;
|
|
82
|
+
attempts = quizAnalysis.attempts;
|
|
85
83
|
var expanded = _this.state.expanded;
|
|
86
84
|
return /*#__PURE__*/React.createElement(Card, {
|
|
87
85
|
className: styles.cardWrapper
|
|
88
86
|
}, /*#__PURE__*/React.createElement("div", {
|
|
89
|
-
className: styles.heading
|
|
90
|
-
}, /*#__PURE__*/React.createElement(Heading, {
|
|
91
|
-
level: "h2",
|
|
92
|
-
theme: {
|
|
93
|
-
h2FontWeight: 700
|
|
94
|
-
},
|
|
95
|
-
margin: "0 x-large 0 0",
|
|
96
|
-
color: "primary"
|
|
97
|
-
}, t('Quiz summary:'), " ", metadata === null || metadata === void 0 ? void 0 : metadata.quiz_title)), /*#__PURE__*/React.createElement("div", {
|
|
98
87
|
className: styles.metricGroup
|
|
99
88
|
}, /*#__PURE__*/React.createElement("div", {
|
|
100
89
|
className: styles.metricsWrapper
|
|
@@ -47,6 +47,9 @@ export var NewQuizAndItemAnalysisPresenter = /*#__PURE__*/function (_Component)
|
|
|
47
47
|
var itemAnalyses = _this.props.itemAnalyses || [];
|
|
48
48
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Heading, {
|
|
49
49
|
level: "h2",
|
|
50
|
+
theme: {
|
|
51
|
+
h2FontWeight: 700
|
|
52
|
+
},
|
|
50
53
|
color: "primary"
|
|
51
54
|
}, t('Item Analysis')), /*#__PURE__*/React.createElement("div", null, itemAnalyses.map(function (itemAnalysis) {
|
|
52
55
|
return /*#__PURE__*/React.createElement(NewItemAnalysis, {
|
|
@@ -85,6 +88,27 @@ export var NewQuizAndItemAnalysisPresenter = /*#__PURE__*/function (_Component)
|
|
|
85
88
|
}, getFailedToFetchReports())));
|
|
86
89
|
};
|
|
87
90
|
|
|
91
|
+
_this.renderHeader = function () {
|
|
92
|
+
var _quizAnalysis$metadat;
|
|
93
|
+
|
|
94
|
+
var quizAnalysis = _this.props.quizAnalysis;
|
|
95
|
+
return /*#__PURE__*/React.createElement(Flex, {
|
|
96
|
+
alignItems: "center",
|
|
97
|
+
width: "auto",
|
|
98
|
+
margin: "auto",
|
|
99
|
+
direction: "column"
|
|
100
|
+
}, /*#__PURE__*/React.createElement(Flex.Item, {
|
|
101
|
+
overflowY: "hidden"
|
|
102
|
+
}, /*#__PURE__*/React.createElement(Heading, {
|
|
103
|
+
level: "h2",
|
|
104
|
+
theme: {
|
|
105
|
+
h2FontWeight: 700
|
|
106
|
+
},
|
|
107
|
+
margin: "0 x-large 0 0",
|
|
108
|
+
color: "primary"
|
|
109
|
+
}, quizAnalysis === null || quizAnalysis === void 0 ? void 0 : (_quizAnalysis$metadat = quizAnalysis.metadata) === null || _quizAnalysis$metadat === void 0 ? void 0 : _quizAnalysis$metadat.quiz_title)));
|
|
110
|
+
};
|
|
111
|
+
|
|
88
112
|
_this.renderTop = function () {
|
|
89
113
|
var _this$props = _this.props,
|
|
90
114
|
analysisError = _this$props.analysisError,
|
|
@@ -92,19 +116,28 @@ export var NewQuizAndItemAnalysisPresenter = /*#__PURE__*/function (_Component)
|
|
|
92
116
|
quizAnalysis = _this$props.quizAnalysis;
|
|
93
117
|
var shouldShowError = analysisError && !generationInProgress;
|
|
94
118
|
return /*#__PURE__*/React.createElement(Flex, {
|
|
95
|
-
|
|
96
|
-
|
|
119
|
+
justifyItems: "space-between",
|
|
120
|
+
alignItems: "center",
|
|
121
|
+
wrap: "wrap",
|
|
122
|
+
width: "auto",
|
|
97
123
|
margin: "auto",
|
|
98
|
-
direction: "
|
|
124
|
+
direction: "row"
|
|
125
|
+
}, /*#__PURE__*/React.createElement(Flex.Item, null, _this.renderHeader()), /*#__PURE__*/React.createElement(Flex.Item, null, /*#__PURE__*/React.createElement(Flex, {
|
|
126
|
+
alignItems: "center",
|
|
127
|
+
width: "auto",
|
|
128
|
+
margin: "auto",
|
|
129
|
+
direction: "row"
|
|
99
130
|
}, /*#__PURE__*/React.createElement(Flex.Item, {
|
|
131
|
+
margin: "small"
|
|
132
|
+
}, /*#__PURE__*/React.createElement(AnalysisUpdateDate, {
|
|
133
|
+
date: quizAnalysis === null || quizAnalysis === void 0 ? void 0 : quizAnalysis.created_timestamp
|
|
134
|
+
})), /*#__PURE__*/React.createElement(Flex.Item, {
|
|
100
135
|
overflowY: "visible"
|
|
101
136
|
}, _this.renderGenerationButton()), /*#__PURE__*/React.createElement(Flex.Item, null, shouldShowError && /*#__PURE__*/React.createElement(Text, {
|
|
102
137
|
size: "x-small",
|
|
103
138
|
weight: "bold",
|
|
104
139
|
color: "danger"
|
|
105
|
-
}, analysisError))
|
|
106
|
-
date: quizAnalysis === null || quizAnalysis === void 0 ? void 0 : quizAnalysis.created_timestamp
|
|
107
|
-
})));
|
|
140
|
+
}, analysisError)))));
|
|
108
141
|
};
|
|
109
142
|
|
|
110
143
|
_this.renderTopOnFailedFetch = function () {
|
|
@@ -148,10 +181,7 @@ export var NewQuizAndItemAnalysisPresenter = /*#__PURE__*/function (_Component)
|
|
|
148
181
|
_this.renderGenerationButton = function () {
|
|
149
182
|
var generationInProgress = _this.props.generationInProgress;
|
|
150
183
|
var buttonVariant = generationInProgress ? _this.renderOngoingGenerationButton() : _this.renderStartGenerationButton();
|
|
151
|
-
return /*#__PURE__*/React.createElement(
|
|
152
|
-
align: "end",
|
|
153
|
-
padding: "xx-small"
|
|
154
|
-
}, buttonVariant);
|
|
184
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, buttonVariant);
|
|
155
185
|
};
|
|
156
186
|
|
|
157
187
|
_this.renderBody = function () {
|
|
@@ -133,7 +133,13 @@ var SidebarItem = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _
|
|
|
133
133
|
value: function renderButton() {
|
|
134
134
|
var _this$props2 = this.props,
|
|
135
135
|
displayPosition = _this$props2.displayPosition,
|
|
136
|
-
itemId = _this$props2.itemId
|
|
136
|
+
itemId = _this$props2.itemId,
|
|
137
|
+
isAnswered = _this$props2.isAnswered;
|
|
138
|
+
var screenReaderContent = !isAnswered && isAnswered !== null ? (0, _formatMessage.default)('Navigate to question at position {displayPosition}, unanswered', {
|
|
139
|
+
displayPosition: displayPosition
|
|
140
|
+
}) : (0, _formatMessage.default)('Navigate to question at position {displayPosition}', {
|
|
141
|
+
displayPosition: displayPosition
|
|
142
|
+
});
|
|
137
143
|
return /*#__PURE__*/_react.default.createElement(_uiLink.Link, {
|
|
138
144
|
href: "#",
|
|
139
145
|
size: "small",
|
|
@@ -144,9 +150,7 @@ var SidebarItem = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _
|
|
|
144
150
|
"data-automation-item-id": itemId,
|
|
145
151
|
"data-automation": "sdk-sidebar-item-button"
|
|
146
152
|
}, /*#__PURE__*/_react.default.createElement(_uiA11yContent.AccessibleContent, {
|
|
147
|
-
alt:
|
|
148
|
-
displayPosition: displayPosition
|
|
149
|
-
})
|
|
153
|
+
alt: screenReaderContent
|
|
150
154
|
}, this.renderPosition()));
|
|
151
155
|
}
|
|
152
156
|
}, {
|
|
@@ -207,6 +211,7 @@ var SidebarItem = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _
|
|
|
207
211
|
itemBody: _propTypes.default.string,
|
|
208
212
|
itemName: _propTypes.default.string.isRequired,
|
|
209
213
|
inStimulus: _propTypes.default.bool,
|
|
214
|
+
isAnswered: _propTypes.default.bool,
|
|
210
215
|
position: _propTypes.default.number.isRequired,
|
|
211
216
|
pointsPossible: _propTypes.default.number.isRequired,
|
|
212
217
|
preventScrollToItem: _propTypes.default.bool.isRequired,
|
|
@@ -219,7 +224,8 @@ var SidebarItem = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _
|
|
|
219
224
|
children: null,
|
|
220
225
|
inStimulus: false,
|
|
221
226
|
itemBody: '',
|
|
222
|
-
quizEntry: null
|
|
227
|
+
quizEntry: null,
|
|
228
|
+
isAnswered: null
|
|
223
229
|
}, _temp)) || _class);
|
|
224
230
|
exports.SidebarItem = SidebarItem;
|
|
225
231
|
var _default = SidebarItem;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.getAnalysesExport = exports.csvFormat = void 0;
|
|
9
|
+
|
|
10
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
+
|
|
12
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
+
|
|
14
|
+
var _Fetcher = _interopRequireDefault(require("../../common/util/Fetcher.js"));
|
|
15
|
+
|
|
16
|
+
var getFetcher = function getFetcher(format) {
|
|
17
|
+
var mimeType = formatsToMimeTypes.get(format);
|
|
18
|
+
|
|
19
|
+
if (!mimeType) {
|
|
20
|
+
throw new Error("Unknown export format ".concat(format, "!"));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return new _Fetcher.default({
|
|
24
|
+
headers: {
|
|
25
|
+
'Accept': mimeType
|
|
26
|
+
},
|
|
27
|
+
asyncResponseHandler: function asyncResponseHandler(response) {
|
|
28
|
+
return response;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
var csvFormat = 'csv';
|
|
34
|
+
exports.csvFormat = csvFormat;
|
|
35
|
+
var formatsToMimeTypes = new Map().set(csvFormat, 'text/csv');
|
|
36
|
+
|
|
37
|
+
var getAnalysesExport = /*#__PURE__*/function () {
|
|
38
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(quizId, format) {
|
|
39
|
+
var filter,
|
|
40
|
+
fetcher,
|
|
41
|
+
url,
|
|
42
|
+
_args = arguments;
|
|
43
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
44
|
+
while (1) {
|
|
45
|
+
switch (_context.prev = _context.next) {
|
|
46
|
+
case 0:
|
|
47
|
+
filter = _args.length > 2 && _args[2] !== void 0 ? _args[2] : 'last_attempt';
|
|
48
|
+
fetcher = getFetcher(format);
|
|
49
|
+
url = "/api/quizzes/".concat(quizId, "/analyses/export?filter=").concat(filter);
|
|
50
|
+
_context.next = 5;
|
|
51
|
+
return fetcher.get(url);
|
|
52
|
+
|
|
53
|
+
case 5:
|
|
54
|
+
return _context.abrupt("return", _context.sent);
|
|
55
|
+
|
|
56
|
+
case 6:
|
|
57
|
+
case "end":
|
|
58
|
+
return _context.stop();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}, _callee);
|
|
62
|
+
}));
|
|
63
|
+
|
|
64
|
+
return function getAnalysesExport(_x, _x2) {
|
|
65
|
+
return _ref.apply(this, arguments);
|
|
66
|
+
};
|
|
67
|
+
}();
|
|
68
|
+
|
|
69
|
+
exports.getAnalysesExport = getAnalysesExport;
|
|
@@ -13,7 +13,7 @@ function generator(_ref) {
|
|
|
13
13
|
barStarFillColor: colors.fire,
|
|
14
14
|
barLabelColor: colors.textDarkest,
|
|
15
15
|
barLabelFontFamily: typography.fontFamily,
|
|
16
|
-
barLabelFontSize: typography.
|
|
16
|
+
barLabelFontSize: typography.fontSizeSmall,
|
|
17
17
|
xAxisColor: colors.textDarkest
|
|
18
18
|
};
|
|
19
19
|
}
|
package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js
CHANGED
|
@@ -143,7 +143,7 @@ var NewItemAnalysis = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
143
143
|
|
|
144
144
|
_this.renderInteractionType = function (interactionType) {
|
|
145
145
|
return /*#__PURE__*/_react.default.createElement(_uiText.Text, {
|
|
146
|
-
size: "
|
|
146
|
+
size: "medium",
|
|
147
147
|
weight: "bold",
|
|
148
148
|
transform: "capitalize"
|
|
149
149
|
}, _this.mapInteractionTypeToTranslation(interactionType));
|
package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/presenter.js
CHANGED
|
@@ -17,8 +17,6 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
17
17
|
|
|
18
18
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
19
19
|
|
|
20
|
-
var _uiHeading = require("@instructure/ui-heading");
|
|
21
|
-
|
|
22
20
|
var _react = _interopRequireWildcard(require("react"));
|
|
23
21
|
|
|
24
22
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
@@ -109,21 +107,11 @@ var NewQuizAnalysis = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
109
107
|
_this.renderContent = function () {
|
|
110
108
|
var quizAnalysis = _this.props.quizAnalysis;
|
|
111
109
|
var scores = quizAnalysis.scores,
|
|
112
|
-
attempts = quizAnalysis.attempts
|
|
113
|
-
metadata = quizAnalysis.metadata;
|
|
110
|
+
attempts = quizAnalysis.attempts;
|
|
114
111
|
var expanded = _this.state.expanded;
|
|
115
112
|
return /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
116
113
|
className: styles.cardWrapper
|
|
117
114
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
118
|
-
className: styles.heading
|
|
119
|
-
}, /*#__PURE__*/_react.default.createElement(_uiHeading.Heading, {
|
|
120
|
-
level: "h2",
|
|
121
|
-
theme: {
|
|
122
|
-
h2FontWeight: 700
|
|
123
|
-
},
|
|
124
|
-
margin: "0 x-large 0 0",
|
|
125
|
-
color: "primary"
|
|
126
|
-
}, (0, _formatMessage.default)('Quiz summary:'), " ", metadata === null || metadata === void 0 ? void 0 : metadata.quiz_title)), /*#__PURE__*/_react.default.createElement("div", {
|
|
127
115
|
className: styles.metricGroup
|
|
128
116
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
129
117
|
className: styles.metricsWrapper
|
|
@@ -78,6 +78,9 @@ var NewQuizAndItemAnalysisPresenter = /*#__PURE__*/function (_Component) {
|
|
|
78
78
|
var itemAnalyses = _this.props.itemAnalyses || [];
|
|
79
79
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_uiHeading.Heading, {
|
|
80
80
|
level: "h2",
|
|
81
|
+
theme: {
|
|
82
|
+
h2FontWeight: 700
|
|
83
|
+
},
|
|
81
84
|
color: "primary"
|
|
82
85
|
}, (0, _formatMessage.default)('Item Analysis')), /*#__PURE__*/_react.default.createElement("div", null, itemAnalyses.map(function (itemAnalysis) {
|
|
83
86
|
return /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
@@ -116,6 +119,27 @@ var NewQuizAndItemAnalysisPresenter = /*#__PURE__*/function (_Component) {
|
|
|
116
119
|
}, (0, _errorMessages.getFailedToFetchReports)())));
|
|
117
120
|
};
|
|
118
121
|
|
|
122
|
+
_this.renderHeader = function () {
|
|
123
|
+
var _quizAnalysis$metadat;
|
|
124
|
+
|
|
125
|
+
var quizAnalysis = _this.props.quizAnalysis;
|
|
126
|
+
return /*#__PURE__*/_react.default.createElement(_uiFlex.Flex, {
|
|
127
|
+
alignItems: "center",
|
|
128
|
+
width: "auto",
|
|
129
|
+
margin: "auto",
|
|
130
|
+
direction: "column"
|
|
131
|
+
}, /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, {
|
|
132
|
+
overflowY: "hidden"
|
|
133
|
+
}, /*#__PURE__*/_react.default.createElement(_uiHeading.Heading, {
|
|
134
|
+
level: "h2",
|
|
135
|
+
theme: {
|
|
136
|
+
h2FontWeight: 700
|
|
137
|
+
},
|
|
138
|
+
margin: "0 x-large 0 0",
|
|
139
|
+
color: "primary"
|
|
140
|
+
}, quizAnalysis === null || quizAnalysis === void 0 ? void 0 : (_quizAnalysis$metadat = quizAnalysis.metadata) === null || _quizAnalysis$metadat === void 0 ? void 0 : _quizAnalysis$metadat.quiz_title)));
|
|
141
|
+
};
|
|
142
|
+
|
|
119
143
|
_this.renderTop = function () {
|
|
120
144
|
var _this$props = _this.props,
|
|
121
145
|
analysisError = _this$props.analysisError,
|
|
@@ -123,19 +147,28 @@ var NewQuizAndItemAnalysisPresenter = /*#__PURE__*/function (_Component) {
|
|
|
123
147
|
quizAnalysis = _this$props.quizAnalysis;
|
|
124
148
|
var shouldShowError = analysisError && !generationInProgress;
|
|
125
149
|
return /*#__PURE__*/_react.default.createElement(_uiFlex.Flex, {
|
|
126
|
-
|
|
127
|
-
|
|
150
|
+
justifyItems: "space-between",
|
|
151
|
+
alignItems: "center",
|
|
152
|
+
wrap: "wrap",
|
|
153
|
+
width: "auto",
|
|
128
154
|
margin: "auto",
|
|
129
|
-
direction: "
|
|
155
|
+
direction: "row"
|
|
156
|
+
}, /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, null, _this.renderHeader()), /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, null, /*#__PURE__*/_react.default.createElement(_uiFlex.Flex, {
|
|
157
|
+
alignItems: "center",
|
|
158
|
+
width: "auto",
|
|
159
|
+
margin: "auto",
|
|
160
|
+
direction: "row"
|
|
130
161
|
}, /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, {
|
|
162
|
+
margin: "small"
|
|
163
|
+
}, /*#__PURE__*/_react.default.createElement(_index3.AnalysisUpdateDate, {
|
|
164
|
+
date: quizAnalysis === null || quizAnalysis === void 0 ? void 0 : quizAnalysis.created_timestamp
|
|
165
|
+
})), /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, {
|
|
131
166
|
overflowY: "visible"
|
|
132
167
|
}, _this.renderGenerationButton()), /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, null, shouldShowError && /*#__PURE__*/_react.default.createElement(_uiText.Text, {
|
|
133
168
|
size: "x-small",
|
|
134
169
|
weight: "bold",
|
|
135
170
|
color: "danger"
|
|
136
|
-
}, analysisError))
|
|
137
|
-
date: quizAnalysis === null || quizAnalysis === void 0 ? void 0 : quizAnalysis.created_timestamp
|
|
138
|
-
})));
|
|
171
|
+
}, analysisError)))));
|
|
139
172
|
};
|
|
140
173
|
|
|
141
174
|
_this.renderTopOnFailedFetch = function () {
|
|
@@ -179,10 +212,7 @@ var NewQuizAndItemAnalysisPresenter = /*#__PURE__*/function (_Component) {
|
|
|
179
212
|
_this.renderGenerationButton = function () {
|
|
180
213
|
var generationInProgress = _this.props.generationInProgress;
|
|
181
214
|
var buttonVariant = generationInProgress ? _this.renderOngoingGenerationButton() : _this.renderStartGenerationButton();
|
|
182
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
183
|
-
align: "end",
|
|
184
|
-
padding: "xx-small"
|
|
185
|
-
}, buttonVariant);
|
|
215
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, buttonVariant);
|
|
186
216
|
};
|
|
187
217
|
|
|
188
218
|
_this.renderBody = function () {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/quiz-core",
|
|
3
|
-
"version": "18.4.1-rc.
|
|
3
|
+
"version": "18.4.1-rc.10+b738b7995",
|
|
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.4.1-rc.
|
|
47
|
-
"@instructure/quiz-i18n": "18.4.1-rc.
|
|
48
|
-
"@instructure/quiz-interactions": "18.4.1-rc.
|
|
49
|
-
"@instructure/quiz-number-input": "18.4.1-rc.
|
|
50
|
-
"@instructure/quiz-rce": "18.4.1-rc.
|
|
46
|
+
"@instructure/quiz-common": "18.4.1-rc.10+b738b7995",
|
|
47
|
+
"@instructure/quiz-i18n": "18.4.1-rc.10+b738b7995",
|
|
48
|
+
"@instructure/quiz-interactions": "18.4.1-rc.10+b738b7995",
|
|
49
|
+
"@instructure/quiz-number-input": "18.4.1-rc.10+b738b7995",
|
|
50
|
+
"@instructure/quiz-rce": "18.4.1-rc.10+b738b7995",
|
|
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.4.1-rc.
|
|
111
|
+
"instructure-validations": "18.4.1-rc.10+b738b7995",
|
|
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.4.1-rc.
|
|
162
|
+
"quiz-presets": "18.4.1-rc.10+b738b7995",
|
|
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": "b738b799598bad6be16d070e16e14c1a33df3d24"
|
|
179
179
|
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
-
export var getItemAnalyses = /*#__PURE__*/function () {
|
|
4
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(quizId) {
|
|
5
|
-
var response;
|
|
6
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
7
|
-
while (1) {
|
|
8
|
-
switch (_context.prev = _context.next) {
|
|
9
|
-
case 0:
|
|
10
|
-
_context.prev = 0;
|
|
11
|
-
_context.next = 3;
|
|
12
|
-
return fetch("http://".concat(window.ENV.API_HOST, "/api/quizzes/").concat(quizId, "/stats/new_item_analyses"));
|
|
13
|
-
|
|
14
|
-
case 3:
|
|
15
|
-
response = _context.sent;
|
|
16
|
-
_context.next = 6;
|
|
17
|
-
return response.json();
|
|
18
|
-
|
|
19
|
-
case 6:
|
|
20
|
-
return _context.abrupt("return", _context.sent);
|
|
21
|
-
|
|
22
|
-
case 9:
|
|
23
|
-
_context.prev = 9;
|
|
24
|
-
_context.t0 = _context["catch"](0);
|
|
25
|
-
console.error(_context.t0);
|
|
26
|
-
|
|
27
|
-
case 12:
|
|
28
|
-
case "end":
|
|
29
|
-
return _context.stop();
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}, _callee, null, [[0, 9]]);
|
|
33
|
-
}));
|
|
34
|
-
|
|
35
|
-
return function getItemAnalyses(_x) {
|
|
36
|
-
return _ref.apply(this, arguments);
|
|
37
|
-
};
|
|
38
|
-
}();
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
-
export var getQuizAnalysis = /*#__PURE__*/function () {
|
|
4
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(quizId) {
|
|
5
|
-
var response;
|
|
6
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
7
|
-
while (1) {
|
|
8
|
-
switch (_context.prev = _context.next) {
|
|
9
|
-
case 0:
|
|
10
|
-
_context.prev = 0;
|
|
11
|
-
_context.next = 3;
|
|
12
|
-
return fetch("http://".concat(window.ENV.API_HOST, "/api/quizzes/").concat(quizId, "/stats/new_quiz_analysis"));
|
|
13
|
-
|
|
14
|
-
case 3:
|
|
15
|
-
response = _context.sent;
|
|
16
|
-
_context.next = 6;
|
|
17
|
-
return response.json();
|
|
18
|
-
|
|
19
|
-
case 6:
|
|
20
|
-
return _context.abrupt("return", _context.sent);
|
|
21
|
-
|
|
22
|
-
case 9:
|
|
23
|
-
_context.prev = 9;
|
|
24
|
-
_context.t0 = _context["catch"](0);
|
|
25
|
-
console.error(_context.t0);
|
|
26
|
-
|
|
27
|
-
case 12:
|
|
28
|
-
case "end":
|
|
29
|
-
return _context.stop();
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}, _callee, null, [[0, 9]]);
|
|
33
|
-
}));
|
|
34
|
-
|
|
35
|
-
return function getQuizAnalysis(_x) {
|
|
36
|
-
return _ref.apply(this, arguments);
|
|
37
|
-
};
|
|
38
|
-
}();
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.getItemAnalyses = void 0;
|
|
9
|
-
|
|
10
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
-
|
|
12
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
-
|
|
14
|
-
var getItemAnalyses = /*#__PURE__*/function () {
|
|
15
|
-
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(quizId) {
|
|
16
|
-
var response;
|
|
17
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
18
|
-
while (1) {
|
|
19
|
-
switch (_context.prev = _context.next) {
|
|
20
|
-
case 0:
|
|
21
|
-
_context.prev = 0;
|
|
22
|
-
_context.next = 3;
|
|
23
|
-
return fetch("http://".concat(window.ENV.API_HOST, "/api/quizzes/").concat(quizId, "/stats/new_item_analyses"));
|
|
24
|
-
|
|
25
|
-
case 3:
|
|
26
|
-
response = _context.sent;
|
|
27
|
-
_context.next = 6;
|
|
28
|
-
return response.json();
|
|
29
|
-
|
|
30
|
-
case 6:
|
|
31
|
-
return _context.abrupt("return", _context.sent);
|
|
32
|
-
|
|
33
|
-
case 9:
|
|
34
|
-
_context.prev = 9;
|
|
35
|
-
_context.t0 = _context["catch"](0);
|
|
36
|
-
console.error(_context.t0);
|
|
37
|
-
|
|
38
|
-
case 12:
|
|
39
|
-
case "end":
|
|
40
|
-
return _context.stop();
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}, _callee, null, [[0, 9]]);
|
|
44
|
-
}));
|
|
45
|
-
|
|
46
|
-
return function getItemAnalyses(_x) {
|
|
47
|
-
return _ref.apply(this, arguments);
|
|
48
|
-
};
|
|
49
|
-
}();
|
|
50
|
-
|
|
51
|
-
exports.getItemAnalyses = getItemAnalyses;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.getQuizAnalysis = void 0;
|
|
9
|
-
|
|
10
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
-
|
|
12
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
-
|
|
14
|
-
var getQuizAnalysis = /*#__PURE__*/function () {
|
|
15
|
-
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(quizId) {
|
|
16
|
-
var response;
|
|
17
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
18
|
-
while (1) {
|
|
19
|
-
switch (_context.prev = _context.next) {
|
|
20
|
-
case 0:
|
|
21
|
-
_context.prev = 0;
|
|
22
|
-
_context.next = 3;
|
|
23
|
-
return fetch("http://".concat(window.ENV.API_HOST, "/api/quizzes/").concat(quizId, "/stats/new_quiz_analysis"));
|
|
24
|
-
|
|
25
|
-
case 3:
|
|
26
|
-
response = _context.sent;
|
|
27
|
-
_context.next = 6;
|
|
28
|
-
return response.json();
|
|
29
|
-
|
|
30
|
-
case 6:
|
|
31
|
-
return _context.abrupt("return", _context.sent);
|
|
32
|
-
|
|
33
|
-
case 9:
|
|
34
|
-
_context.prev = 9;
|
|
35
|
-
_context.t0 = _context["catch"](0);
|
|
36
|
-
console.error(_context.t0);
|
|
37
|
-
|
|
38
|
-
case 12:
|
|
39
|
-
case "end":
|
|
40
|
-
return _context.stop();
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}, _callee, null, [[0, 9]]);
|
|
44
|
-
}));
|
|
45
|
-
|
|
46
|
-
return function getQuizAnalysis(_x) {
|
|
47
|
-
return _ref.apply(this, arguments);
|
|
48
|
-
};
|
|
49
|
-
}();
|
|
50
|
-
|
|
51
|
-
exports.getQuizAnalysis = getQuizAnalysis;
|