@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
|
@@ -3,18 +3,25 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
4
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
5
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
var _dec, _class, _class2, _temp;
|
|
8
|
+
|
|
9
|
+
/** @jsx jsx */
|
|
10
|
+
import { Component } from 'react';
|
|
7
11
|
import PropTypes from 'prop-types';
|
|
8
12
|
import { TopNavBar } from '@instructure/ui-top-nav-bar';
|
|
9
13
|
import { IconQuizLine } from '@instructure/ui-icons';
|
|
10
14
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
15
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
16
|
+
import generateStyle from "./styles.js";
|
|
17
|
+
import generateComponentTheme from "./theme.js";
|
|
11
18
|
|
|
12
|
-
var _ref =
|
|
19
|
+
var _ref = jsx(IconQuizLine, {
|
|
13
20
|
color: "primary",
|
|
14
21
|
size: "small"
|
|
15
22
|
});
|
|
16
23
|
|
|
17
|
-
export var NavBar = /*#__PURE__*/function (_Component) {
|
|
24
|
+
export var NavBar = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
18
25
|
_inherits(NavBar, _Component);
|
|
19
26
|
|
|
20
27
|
var _super = _createSuper(NavBar);
|
|
@@ -50,15 +57,15 @@ export var NavBar = /*#__PURE__*/function (_Component) {
|
|
|
50
57
|
value: function render() {
|
|
51
58
|
var _this2 = this;
|
|
52
59
|
|
|
53
|
-
return
|
|
54
|
-
breakpoint:
|
|
60
|
+
return jsx(TopNavBar, {
|
|
61
|
+
breakpoint: this.props.styles.phoneBreakPoint,
|
|
55
62
|
mediaQueryMatch: "element",
|
|
56
63
|
inverseColor: true
|
|
57
64
|
}, function () {
|
|
58
|
-
return
|
|
65
|
+
return jsx(TopNavBar.Layout, {
|
|
59
66
|
themeOverride: {
|
|
60
|
-
desktopBackgroundInverse:
|
|
61
|
-
smallViewportBackgroundInverse:
|
|
67
|
+
desktopBackgroundInverse: _this2.props.styles.backgroundColor,
|
|
68
|
+
smallViewportBackgroundInverse: _this2.props.styles.backgroundColor
|
|
62
69
|
},
|
|
63
70
|
navLabel: t('Quizzes navigation bar'),
|
|
64
71
|
desktopConfig: {
|
|
@@ -68,16 +75,16 @@ export var NavBar = /*#__PURE__*/function (_Component) {
|
|
|
68
75
|
dropdownMenuToggleButtonLabel: t('Toggle Menu'),
|
|
69
76
|
dropdownMenuLabel: t('Main Menu')
|
|
70
77
|
},
|
|
71
|
-
renderBrand:
|
|
78
|
+
renderBrand: jsx(TopNavBar.Brand, {
|
|
72
79
|
screenReaderLabel: t('Quizzes'),
|
|
73
80
|
renderIcon: _ref
|
|
74
81
|
}),
|
|
75
|
-
renderMenuItems:
|
|
82
|
+
renderMenuItems: jsx(TopNavBar.MenuItems, {
|
|
76
83
|
listLabel: t('Page navigation'),
|
|
77
84
|
currentPageId: window.location.pathname,
|
|
78
85
|
renderHiddenItemsMenuTriggerLabel: _this2.hiddenMenuItemsMenuTriggerLabel
|
|
79
86
|
}, _this2.props.menuItems.map(function (menuItem) {
|
|
80
|
-
return
|
|
87
|
+
return jsx(TopNavBar.Item, {
|
|
81
88
|
id: menuItem.path,
|
|
82
89
|
key: menuItem.path,
|
|
83
90
|
onClick: function onClick() {
|
|
@@ -86,7 +93,7 @@ export var NavBar = /*#__PURE__*/function (_Component) {
|
|
|
86
93
|
|
|
87
94
|
}, menuItem.text);
|
|
88
95
|
})),
|
|
89
|
-
renderActionItems:
|
|
96
|
+
renderActionItems: jsx(TopNavBar.ActionItems, {
|
|
90
97
|
listLabel: t('Actions'),
|
|
91
98
|
renderHiddenItemsMenuTriggerLabel: _this2.hiddenActionItemsMenuTriggerLabel
|
|
92
99
|
}, _toConsumableArray(_this2.props.actionItems))
|
|
@@ -97,18 +104,17 @@ export var NavBar = /*#__PURE__*/function (_Component) {
|
|
|
97
104
|
|
|
98
105
|
NavBar.displayName = "NavBar";
|
|
99
106
|
return NavBar;
|
|
100
|
-
}(Component)
|
|
101
|
-
NavBar.propTypes = {
|
|
107
|
+
}(Component), _class2.propTypes = {
|
|
102
108
|
menuItems: PropTypes.arrayOf(PropTypes.shape({
|
|
103
109
|
path: PropTypes.string.isRequired,
|
|
104
110
|
text: PropTypes.string.isRequired
|
|
105
111
|
})),
|
|
106
112
|
handleMenuItemChange: PropTypes.func,
|
|
107
|
-
actionItems: PropTypes.arrayOf(PropTypes.node)
|
|
108
|
-
|
|
109
|
-
|
|
113
|
+
actionItems: PropTypes.arrayOf(PropTypes.node),
|
|
114
|
+
styles: PropTypes.object
|
|
115
|
+
}, _class2.defaultProps = {
|
|
110
116
|
menuItems: [],
|
|
111
117
|
handleMenuItemChange: function handleMenuItemChange() {},
|
|
112
118
|
actionItems: []
|
|
113
|
-
};
|
|
119
|
+
}, _temp)) || _class);
|
|
114
120
|
export default NavBar;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
|
+
var breakpoints = _ref.breakpoints,
|
|
3
|
+
colors = _ref.colors;
|
|
4
|
+
return {
|
|
5
|
+
backgroundColor: colors.porcelain,
|
|
6
|
+
phoneBreakPoint: breakpoints.medium
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default generateComponentTheme;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
1
|
import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
|
|
3
2
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
4
3
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
@@ -8,10 +7,10 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
8
7
|
|
|
9
8
|
var _dec, _class, _class2, _temp;
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
/** @jsx jsx */
|
|
11
|
+
import { Component } from 'react';
|
|
12
12
|
import PropTypes from 'prop-types';
|
|
13
13
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
14
|
-
import classNames from 'classnames';
|
|
15
14
|
import { Text } from '@instructure/ui-text';
|
|
16
15
|
import { Link } from '@instructure/ui-link';
|
|
17
16
|
import { Flex } from '@instructure/ui-flex';
|
|
@@ -19,37 +18,28 @@ import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
|
19
18
|
import { Table } from '@instructure/ui-table';
|
|
20
19
|
import { IconButton } from '@instructure/ui-buttons';
|
|
21
20
|
import { IconInfoLine, IconConfigureLine } from '@instructure/ui-icons';
|
|
22
|
-
import {
|
|
21
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
23
22
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
24
23
|
import ModerateTableRow from "../ModerateTableRow/index.js";
|
|
25
24
|
import IfFeature from "../../../../common/components/shared/IfFeature/index.js";
|
|
26
25
|
import OutstandingQuizzesModal from "../OutstandingQuizzesModal/index.js";
|
|
27
26
|
import ModerateTray from "../../sidebar/ModerateTray/index.js";
|
|
28
27
|
import Spinner from "../../../../common/components/shared/spinner/Spinner.js";
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
template: function template(theme) {
|
|
32
|
-
return "\n\n.eDRzW_bwKH{display:block;margin:".concat(theme.emptyTextMargin || 'inherit', " 0 0 0}\n\n.eDRzW_xNcP{background-color:").concat(theme.pageBackgroundColor || 'inherit', ";flex:1;overflow:auto}\n\n.eDRzW_eeML{display:inline-block;transition:transform 0.3s}\n\n.eDRzW_XujX{transform:scaleX(-1)}");
|
|
33
|
-
},
|
|
34
|
-
'emptyText': 'eDRzW_bwKH',
|
|
35
|
-
'page': 'eDRzW_xNcP',
|
|
36
|
-
'scoreToggleWrapper': 'eDRzW_eeML',
|
|
37
|
-
'mirror': 'eDRzW_XujX'
|
|
38
|
-
};
|
|
39
|
-
import theme from "./theme.js";
|
|
28
|
+
import generateStyle from "./styles.js";
|
|
29
|
+
import generateComponentTheme from "./theme.js";
|
|
40
30
|
import ResetQuiz from "../../sidebar/ResetQuiz/index.js";
|
|
41
31
|
import { OUTSTANDING_QUIZZES_MODAL } from '@instructure/quiz-common';
|
|
42
32
|
import { chunk } from 'lodash';
|
|
43
33
|
|
|
44
|
-
var _ref2 =
|
|
34
|
+
var _ref2 = jsx(Flex.Item, null, jsx(IconInfoLine, null));
|
|
45
35
|
|
|
46
|
-
var _ref4 =
|
|
36
|
+
var _ref4 = jsx(IconConfigureLine, null);
|
|
47
37
|
|
|
48
|
-
var _ref5 =
|
|
38
|
+
var _ref5 = jsx(Spinner, null);
|
|
49
39
|
|
|
50
|
-
var _ref6 =
|
|
40
|
+
var _ref6 = jsx(ResetQuiz, null);
|
|
51
41
|
|
|
52
|
-
export var ModerateTable = (_dec =
|
|
42
|
+
export var ModerateTable = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
53
43
|
_inherits(ModerateTable, _Component);
|
|
54
44
|
|
|
55
45
|
var _super = _createSuper(ModerateTable);
|
|
@@ -180,6 +170,9 @@ export var ModerateTable = (_dec = themeable(theme, styles), _dec(_class = (_tem
|
|
|
180
170
|
_createClass(ModerateTable, [{
|
|
181
171
|
key: "componentDidMount",
|
|
182
172
|
value: function componentDidMount() {
|
|
173
|
+
this.props.makeStyles({
|
|
174
|
+
displayScoreAsPercentage: this.state.displayScoreAsPercentage
|
|
175
|
+
});
|
|
183
176
|
this.fetchData();
|
|
184
177
|
var _this$props2 = this.props,
|
|
185
178
|
hasSessionTimeLimit = _this$props2.hasSessionTimeLimit,
|
|
@@ -192,6 +185,9 @@ export var ModerateTable = (_dec = themeable(theme, styles), _dec(_class = (_tem
|
|
|
192
185
|
}, {
|
|
193
186
|
key: "componentDidUpdate",
|
|
194
187
|
value: function componentDidUpdate(prevProps) {
|
|
188
|
+
this.props.makeStyles({
|
|
189
|
+
displayScoreAsPercentage: this.state.displayScoreAsPercentage
|
|
190
|
+
});
|
|
195
191
|
var _this$props3 = this.props,
|
|
196
192
|
hasSessionTimeLimit = _this$props3.hasSessionTimeLimit,
|
|
197
193
|
sessionTimeLimitInSeconds = _this$props3.sessionTimeLimitInSeconds;
|
|
@@ -241,7 +237,7 @@ export var ModerateTable = (_dec = themeable(theme, styles), _dec(_class = (_tem
|
|
|
241
237
|
shouldRenderModerateButton = _this$props4.shouldRenderModerateButton;
|
|
242
238
|
return this.props.tableData.map(function (rowData) {
|
|
243
239
|
var id = rowData.id;
|
|
244
|
-
return
|
|
240
|
+
return jsx(ModerateTableRow, {
|
|
245
241
|
anonymousGrading: _this2.props.anonymousGrading,
|
|
246
242
|
onResultsLinkClick: onResultsLinkClick,
|
|
247
243
|
onAccommodationsClick: _this2.props.onAccommodationsClick,
|
|
@@ -289,23 +285,23 @@ export var ModerateTable = (_dec = themeable(theme, styles), _dec(_class = (_tem
|
|
|
289
285
|
value: function renderAlertContent(outstandingAttemptsCount) {
|
|
290
286
|
var _this3 = this;
|
|
291
287
|
|
|
292
|
-
return
|
|
288
|
+
return jsx("div", null, jsx(IfFeature, {
|
|
293
289
|
name: "manual_submission"
|
|
294
|
-
},
|
|
290
|
+
}, jsx(Flex, null, _ref2, jsx(Flex.Item, {
|
|
295
291
|
padding: "xx-small"
|
|
296
292
|
}, t.rich('This assessment has <0>{count, plural, one {# attempt} other {# attempts}}</0> in progress.', {
|
|
297
293
|
count: outstandingAttemptsCount,
|
|
298
294
|
0: function _(_ref3) {
|
|
299
295
|
var children = _ref3.children;
|
|
300
|
-
return
|
|
296
|
+
return jsx(Link, {
|
|
301
297
|
key: "0",
|
|
302
298
|
onClick: _this3.openModalOnClick,
|
|
303
299
|
"data-automation": "sdk-outstanding-quizzes-modal-open"
|
|
304
300
|
}, children);
|
|
305
301
|
}
|
|
306
|
-
})))),
|
|
302
|
+
})))), jsx(IfFeature, {
|
|
307
303
|
name: "manual_submission"
|
|
308
|
-
},
|
|
304
|
+
}, jsx(OutstandingQuizzesModal, {
|
|
309
305
|
quizSessionsData: this.props.quizSessionsData,
|
|
310
306
|
quizSessionIdsAndUsers: this.props.quizSessionIdsAndUsers,
|
|
311
307
|
handleSubmissionAndPoll: this.handleSubmissionAndPoll,
|
|
@@ -315,9 +311,9 @@ export var ModerateTable = (_dec = themeable(theme, styles), _dec(_class = (_tem
|
|
|
315
311
|
}, {
|
|
316
312
|
key: "renderScoreToggle",
|
|
317
313
|
value: function renderScoreToggle() {
|
|
318
|
-
return
|
|
319
|
-
|
|
320
|
-
},
|
|
314
|
+
return jsx("div", {
|
|
315
|
+
css: this.props.styles.scoreToggleWrapper
|
|
316
|
+
}, jsx(IconButton, {
|
|
321
317
|
size: "small",
|
|
322
318
|
margin: "0 x-small",
|
|
323
319
|
withBackground: false,
|
|
@@ -330,28 +326,28 @@ export var ModerateTable = (_dec = themeable(theme, styles), _dec(_class = (_tem
|
|
|
330
326
|
key: "renderTable",
|
|
331
327
|
value: function renderTable() {
|
|
332
328
|
var outstandingAttemptsCount = this.countOutstandingAttempts();
|
|
333
|
-
return
|
|
329
|
+
return jsx("div", {
|
|
334
330
|
className: "fs-mask"
|
|
335
|
-
}, outstandingAttemptsCount ? this.renderAlertContent(outstandingAttemptsCount) : null,
|
|
331
|
+
}, outstandingAttemptsCount ? this.renderAlertContent(outstandingAttemptsCount) : null, jsx(Table, {
|
|
336
332
|
caption: t('Moderation Table')
|
|
337
|
-
},
|
|
333
|
+
}, jsx(Table.Head, null, jsx(Table.Row, null, jsx(Table.ColHeader, {
|
|
338
334
|
id: "moderation-table-student"
|
|
339
|
-
}, t('Student')), !this.props.anonymousGrading &&
|
|
335
|
+
}, t('Student')), !this.props.anonymousGrading && jsx(Table.ColHeader, {
|
|
340
336
|
id: "moderation-table-attempts"
|
|
341
|
-
}, t('Attempts')), !this.props.anonymousGrading &&
|
|
337
|
+
}, t('Attempts')), !this.props.anonymousGrading && jsx(Table.ColHeader, {
|
|
342
338
|
id: "moderation-table-score"
|
|
343
|
-
}, t('Score'), this.renderScoreToggle()), !this.props.anonymousGrading &&
|
|
339
|
+
}, t('Score'), this.renderScoreToggle()), !this.props.anonymousGrading && jsx(Table.ColHeader, {
|
|
344
340
|
id: "moderation-table-time"
|
|
345
|
-
}, t('Time')), !this.props.anonymousGrading &&
|
|
341
|
+
}, t('Time')), !this.props.anonymousGrading && jsx(Table.ColHeader, {
|
|
346
342
|
id: "moderation-table-log"
|
|
347
|
-
}, t('Log')), this.props.onAccommodationsClick && !this.props.anonymousGrading &&
|
|
343
|
+
}, t('Log')), this.props.onAccommodationsClick && !this.props.anonymousGrading && jsx(Table.ColHeader, {
|
|
348
344
|
id: "moderation-table-accommodations"
|
|
349
345
|
}, t({
|
|
350
346
|
default: 'Accommodations',
|
|
351
347
|
description: 'Support for students with who need extra time or attempts.'
|
|
352
|
-
})), this.props.shouldRenderModerateButton &&
|
|
348
|
+
})), this.props.shouldRenderModerateButton && jsx(Table.ColHeader, {
|
|
353
349
|
id: "moderation-table-moderate"
|
|
354
|
-
},
|
|
350
|
+
}, jsx(ScreenReaderContent, null, t('Moderate'))))), jsx(Table.Body, null, this.renderTableRows())));
|
|
355
351
|
}
|
|
356
352
|
}, {
|
|
357
353
|
key: "renderContent",
|
|
@@ -362,18 +358,18 @@ export var ModerateTable = (_dec = themeable(theme, styles), _dec(_class = (_tem
|
|
|
362
358
|
emptyMessage = _this$props5.emptyMessage;
|
|
363
359
|
if (isFetching || this.state.isWaiting) return _ref5;
|
|
364
360
|
if (tableData.length) return this.renderTable();
|
|
365
|
-
return
|
|
366
|
-
|
|
367
|
-
},
|
|
361
|
+
return jsx("span", {
|
|
362
|
+
css: this.props.styles.emptyText
|
|
363
|
+
}, jsx(Text, {
|
|
368
364
|
color: "primary"
|
|
369
365
|
}, emptyMessage));
|
|
370
366
|
}
|
|
371
367
|
}, {
|
|
372
368
|
key: "render",
|
|
373
369
|
value: function render() {
|
|
374
|
-
return
|
|
375
|
-
|
|
376
|
-
},
|
|
370
|
+
return jsx("div", {
|
|
371
|
+
css: this.props.styles.page
|
|
372
|
+
}, jsx(ModerateTray, {
|
|
377
373
|
onClose: this.onCloseTray
|
|
378
374
|
}, !this.props.anonymousGrading && _ref6, this.props.children), this.renderContent());
|
|
379
375
|
}
|
|
@@ -427,7 +423,9 @@ export var ModerateTable = (_dec = themeable(theme, styles), _dec(_class = (_tem
|
|
|
427
423
|
})).isRequired,
|
|
428
424
|
quizId: PropTypes.string.isRequired,
|
|
429
425
|
getQuizSessions: PropTypes.func.isRequired,
|
|
430
|
-
addSuccess: PropTypes.func.isRequired
|
|
426
|
+
addSuccess: PropTypes.func.isRequired,
|
|
427
|
+
styles: PropTypes.object,
|
|
428
|
+
makeStyles: PropTypes.func
|
|
431
429
|
}, _class2.defaultProps = {
|
|
432
430
|
anonymousGrading: false,
|
|
433
431
|
children: void 0,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
|
|
3
|
+
var generateStyle = function generateStyle(componentTheme, props, state) {
|
|
4
|
+
return {
|
|
5
|
+
emptyText: {
|
|
6
|
+
display: 'block',
|
|
7
|
+
margin: "".concat(componentTheme.emptyTextMargin, " 0 0 0")
|
|
8
|
+
},
|
|
9
|
+
page: {
|
|
10
|
+
overflow: 'auto',
|
|
11
|
+
flex: '1',
|
|
12
|
+
backgroundColor: componentTheme.pageBackgroundColor
|
|
13
|
+
},
|
|
14
|
+
scoreToggleWrapper: _objectSpread({
|
|
15
|
+
display: 'inline-block',
|
|
16
|
+
transition: 'transform 0.3s'
|
|
17
|
+
}, !state.displayScoreAsPercentage && {
|
|
18
|
+
transform: 'scaleX(-1)'
|
|
19
|
+
})
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default generateStyle;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var spacing = _ref.spacing,
|
|
3
3
|
colors = _ref.colors;
|
|
4
4
|
return {
|
|
5
5
|
emptyTextMargin: spacing.small,
|
|
6
6
|
pageBackgroundColor: colors.white
|
|
7
7
|
};
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default generateComponentTheme;
|
|
@@ -5,8 +5,10 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
5
5
|
|
|
6
6
|
var _dec, _class, _class2, _temp;
|
|
7
7
|
|
|
8
|
+
/** @jsx jsx */
|
|
9
|
+
|
|
8
10
|
/* eslint "array-callback-return": "warn" */
|
|
9
|
-
import
|
|
11
|
+
import { Component } from 'react';
|
|
10
12
|
import PropTypes from 'prop-types';
|
|
11
13
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
12
14
|
import { AccessibleContent, PresentationContent } from '@instructure/ui-a11y-content';
|
|
@@ -19,24 +21,14 @@ import { Flex } from '@instructure/ui-flex';
|
|
|
19
21
|
import { Table } from '@instructure/ui-table';
|
|
20
22
|
import { IconEditLine, IconWarningLine } from '@instructure/ui-icons';
|
|
21
23
|
import { Button, IconButton } from '@instructure/ui-buttons';
|
|
22
|
-
import {
|
|
24
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
23
25
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
24
26
|
import { withI18nSupport } from '@instructure/quiz-common';
|
|
25
27
|
import FormattedDuration from "../../../../common/components/shared/FormattedDuration/index.js";
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
template: function template(theme) {
|
|
29
|
-
return "\n\n.FXOGU_ffXX,[dir=ltr] .FXOGU_ffXX,[dir=rtl] .FXOGU_ffXX{float:right}\n\n.FXOGU_clcl{max-width:15rem}\n\n.FXOGU_ecVa{align-items:center;display:flex}\n\n.FXOGU_eTxg{font-weight:400;margin-left:".concat(theme.avatarNameMargin || 'inherit', ";overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n\n.FXOGU_cCBI:not(:first-child){padding-top:").concat(theme.tableDataItemPadding || 'inherit', "}");
|
|
30
|
-
},
|
|
31
|
-
'moderateButton': 'FXOGU_ffXX',
|
|
32
|
-
'tableData': 'FXOGU_clcl',
|
|
33
|
-
'avatarRow': 'FXOGU_ecVa',
|
|
34
|
-
'avatarName': 'FXOGU_eTxg',
|
|
35
|
-
'tableDataItem': 'FXOGU_cCBI'
|
|
36
|
-
};
|
|
37
|
-
import theme from "./theme.js";
|
|
28
|
+
import generateStyle from "./styles.js";
|
|
29
|
+
import generateComponentTheme from "./theme.js";
|
|
38
30
|
var DASHES = '---';
|
|
39
|
-
export var ModerateTableRow = (_dec =
|
|
31
|
+
export var ModerateTableRow = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_withI18nSupport) {
|
|
40
32
|
_inherits(ModerateTableRow, _withI18nSupport);
|
|
41
33
|
|
|
42
34
|
var _super = _createSuper(ModerateTableRow);
|
|
@@ -68,19 +60,19 @@ export var ModerateTableRow = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
68
60
|
var iconTitle = t('Autograde error on attempt { attemptNumber }.', {
|
|
69
61
|
attemptNumber: attemptNumber
|
|
70
62
|
});
|
|
71
|
-
var link = autogradefailed ?
|
|
63
|
+
var link = autogradefailed ? jsx(Link, {
|
|
72
64
|
onClick: _this.onResultsLinkClick(quizSessionId),
|
|
73
|
-
icon:
|
|
65
|
+
icon: jsx(IconWarningLine, {
|
|
74
66
|
color: "warning",
|
|
75
67
|
title: iconTitle
|
|
76
68
|
}),
|
|
77
69
|
iconPlacement: "end"
|
|
78
|
-
}, message) :
|
|
70
|
+
}, message) : jsx(Link, {
|
|
79
71
|
onClick: _this.onResultsLinkClick(quizSessionId)
|
|
80
72
|
}, message);
|
|
81
|
-
return
|
|
73
|
+
return jsx("div", {
|
|
82
74
|
key: quizSessionId,
|
|
83
|
-
|
|
75
|
+
css: _this.props.styles.tableDataItem
|
|
84
76
|
}, link);
|
|
85
77
|
};
|
|
86
78
|
|
|
@@ -88,14 +80,14 @@ export var ModerateTableRow = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
88
80
|
var iconTitle = t('Autograde error on attempt { attemptNumber }.', {
|
|
89
81
|
attemptNumber: attemptNumber
|
|
90
82
|
});
|
|
91
|
-
var icon = autogradefailed ?
|
|
83
|
+
var icon = autogradefailed ? jsx(IconWarningLine, {
|
|
92
84
|
color: "warning",
|
|
93
85
|
title: iconTitle
|
|
94
86
|
}) : null;
|
|
95
|
-
return
|
|
87
|
+
return jsx("div", {
|
|
96
88
|
key: quizSessionId,
|
|
97
|
-
|
|
98
|
-
},
|
|
89
|
+
css: _this.props.styles.tableDataItem
|
|
90
|
+
}, jsx(View, {
|
|
99
91
|
margin: "0 x-small 0 0"
|
|
100
92
|
}, message), icon);
|
|
101
93
|
};
|
|
@@ -127,9 +119,9 @@ export var ModerateTableRow = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
127
119
|
value: function renderScores(quizSessions) {
|
|
128
120
|
var _this3 = this;
|
|
129
121
|
|
|
130
|
-
var noScore =
|
|
131
|
-
|
|
132
|
-
},
|
|
122
|
+
var noScore = jsx("div", {
|
|
123
|
+
css: this.props.styles.tableDataItem
|
|
124
|
+
}, jsx(AccessibleContent, {
|
|
133
125
|
alt: t('No Score')
|
|
134
126
|
}, DASHES));
|
|
135
127
|
if (!quizSessions.length) return noScore;
|
|
@@ -157,14 +149,14 @@ export var ModerateTableRow = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
157
149
|
|
|
158
150
|
if (quizSession.inProgress() || quizSession.reopeningGraded()) {
|
|
159
151
|
var alt = t('In progress, score not available');
|
|
160
|
-
message =
|
|
152
|
+
message = jsx(AccessibleContent, {
|
|
161
153
|
alt: alt
|
|
162
154
|
}, DASHES);
|
|
163
155
|
}
|
|
164
156
|
|
|
165
|
-
renderedScores.push(
|
|
157
|
+
renderedScores.push(jsx("div", {
|
|
166
158
|
key: result.get('id'),
|
|
167
|
-
|
|
159
|
+
css: _this3.props.styles.tableDataItem
|
|
168
160
|
}, message));
|
|
169
161
|
return renderedScores;
|
|
170
162
|
}, []);
|
|
@@ -195,9 +187,9 @@ export var ModerateTableRow = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
195
187
|
var maxAttempts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : quizSessions.length;
|
|
196
188
|
|
|
197
189
|
if (!quizSessions.length) {
|
|
198
|
-
return
|
|
199
|
-
|
|
200
|
-
},
|
|
190
|
+
return jsx("div", {
|
|
191
|
+
css: this.props.styles.tableDataItem
|
|
192
|
+
}, jsx(AccessibleContent, {
|
|
201
193
|
alt: t('No Attempt')
|
|
202
194
|
}, DASHES));
|
|
203
195
|
}
|
|
@@ -218,39 +210,43 @@ export var ModerateTableRow = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
218
210
|
}, {
|
|
219
211
|
key: "renderTimes",
|
|
220
212
|
value: function renderTimes(quizSessions) {
|
|
213
|
+
var _this5 = this;
|
|
214
|
+
|
|
221
215
|
if (!quizSessions.length) {
|
|
222
|
-
return
|
|
223
|
-
|
|
224
|
-
},
|
|
216
|
+
return jsx("div", {
|
|
217
|
+
css: this.props.styles.tableDataItem
|
|
218
|
+
}, jsx(AccessibleContent, {
|
|
225
219
|
alt: t('No Time')
|
|
226
220
|
}, DASHES));
|
|
227
221
|
}
|
|
228
222
|
|
|
229
223
|
return quizSessions.map(function (quizSession, idx) {
|
|
230
|
-
var message =
|
|
224
|
+
var message = jsx(FormattedDuration, {
|
|
231
225
|
seconds: quizSession.elapsedTime
|
|
232
226
|
});
|
|
233
227
|
|
|
234
228
|
if (quizSession.inProgress() || quizSession.reopeningGraded()) {
|
|
235
229
|
var alt = t('In progress, time not available');
|
|
236
|
-
message =
|
|
230
|
+
message = jsx(AccessibleContent, {
|
|
237
231
|
alt: alt
|
|
238
232
|
}, DASHES);
|
|
239
233
|
}
|
|
240
234
|
|
|
241
|
-
return
|
|
235
|
+
return jsx("div", {
|
|
242
236
|
key: quizSession.get('id'),
|
|
243
|
-
|
|
237
|
+
css: _this5.props.styles.tableDataItem
|
|
244
238
|
}, message);
|
|
245
239
|
});
|
|
246
240
|
}
|
|
247
241
|
}, {
|
|
248
242
|
key: "renderLogLinks",
|
|
249
243
|
value: function renderLogLinks(quizSessions) {
|
|
244
|
+
var _this6 = this;
|
|
245
|
+
|
|
250
246
|
if (!quizSessions.length) {
|
|
251
|
-
return
|
|
252
|
-
|
|
253
|
-
},
|
|
247
|
+
return jsx("div", {
|
|
248
|
+
css: this.props.styles.tableDataItem
|
|
249
|
+
}, jsx(AccessibleContent, {
|
|
254
250
|
alt: t('No Log')
|
|
255
251
|
}, DASHES));
|
|
256
252
|
}
|
|
@@ -270,10 +266,10 @@ export var ModerateTableRow = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
270
266
|
});
|
|
271
267
|
}
|
|
272
268
|
|
|
273
|
-
return
|
|
269
|
+
return jsx("div", {
|
|
274
270
|
key: quizSessionId,
|
|
275
|
-
|
|
276
|
-
},
|
|
271
|
+
css: _this6.props.styles.tableDataItem
|
|
272
|
+
}, jsx(Link, {
|
|
277
273
|
onClick: onClick
|
|
278
274
|
}, message));
|
|
279
275
|
});
|
|
@@ -286,16 +282,16 @@ export var ModerateTableRow = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
286
282
|
var displayContent;
|
|
287
283
|
|
|
288
284
|
if (!accommodations || accommodations.length === 0) {
|
|
289
|
-
displayContent =
|
|
285
|
+
displayContent = jsx(Text, {
|
|
290
286
|
color: "secondary"
|
|
291
287
|
}, t('None'));
|
|
292
288
|
} else {
|
|
293
|
-
displayContent =
|
|
289
|
+
displayContent = jsx(List, {
|
|
294
290
|
isUnstyled: true
|
|
295
291
|
}, accommodations.map(function (elem) {
|
|
296
|
-
return
|
|
292
|
+
return jsx(List.Item, {
|
|
297
293
|
key: elem.name
|
|
298
|
-
},
|
|
294
|
+
}, jsx(Text, {
|
|
299
295
|
color: "primary"
|
|
300
296
|
}, t('{ name }: { value }', elem)));
|
|
301
297
|
}));
|
|
@@ -303,13 +299,13 @@ export var ModerateTableRow = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
303
299
|
// so that the screen reader will read the accommodations first, and then the button
|
|
304
300
|
|
|
305
301
|
|
|
306
|
-
return
|
|
302
|
+
return jsx(Table.Cell, null, jsx(Flex, {
|
|
307
303
|
direction: "row-reverse",
|
|
308
304
|
justifyItems: "end"
|
|
309
|
-
},
|
|
305
|
+
}, jsx(Flex.Item, {
|
|
310
306
|
shouldShrink: true,
|
|
311
307
|
"data-automation": "sdk-moderate-accommodations-text"
|
|
312
|
-
}, displayContent),
|
|
308
|
+
}, displayContent), jsx(Flex.Item, null, jsx(IconButton, {
|
|
313
309
|
margin: "0 x-small 0 0",
|
|
314
310
|
withBackground: false,
|
|
315
311
|
withBorder: false,
|
|
@@ -324,9 +320,9 @@ export var ModerateTableRow = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
324
320
|
key: "renderModerate",
|
|
325
321
|
value: function renderModerate() {
|
|
326
322
|
if (this.props.shouldRenderModerateButton) {
|
|
327
|
-
return
|
|
328
|
-
|
|
329
|
-
},
|
|
323
|
+
return jsx(Table.Cell, null, jsx("div", {
|
|
324
|
+
css: this.props.styles.moderateButton
|
|
325
|
+
}, jsx(Button, {
|
|
330
326
|
size: "small",
|
|
331
327
|
onClick: this.onModerateButtonClick,
|
|
332
328
|
ref: this.handleModerateRef,
|
|
@@ -343,20 +339,18 @@ export var ModerateTableRow = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
343
339
|
avatarUrl = _this$props$rowData.avatar,
|
|
344
340
|
maxAttempts = _this$props$rowData.maxAttempts,
|
|
345
341
|
accommodations = _this$props$rowData.accommodations;
|
|
346
|
-
var
|
|
347
|
-
avatarRow = styles.avatarRow,
|
|
348
|
-
avatarName = styles.avatarName;
|
|
349
|
-
return
|
|
350
|
-
|
|
351
|
-
},
|
|
352
|
-
className: avatarRow
|
|
353
|
-
}, /*#__PURE__*/React.createElement(PresentationContent, null, /*#__PURE__*/React.createElement(Avatar, {
|
|
342
|
+
var _this$props$styles = this.props.styles,
|
|
343
|
+
avatarRow = _this$props$styles.avatarRow,
|
|
344
|
+
avatarName = _this$props$styles.avatarName;
|
|
345
|
+
return jsx(Table.Row, null, jsx(Table.RowHeader, null, jsx("span", {
|
|
346
|
+
css: avatarRow
|
|
347
|
+
}, jsx(PresentationContent, null, jsx(Avatar, {
|
|
354
348
|
name: name,
|
|
355
349
|
src: avatarUrl,
|
|
356
350
|
size: "small"
|
|
357
|
-
})),
|
|
358
|
-
|
|
359
|
-
}, name))), !this.props.anonymousGrading &&
|
|
351
|
+
})), jsx("span", {
|
|
352
|
+
css: avatarName
|
|
353
|
+
}, name))), !this.props.anonymousGrading && jsx(Table.Cell, null, this.renderAttempts(quizSessions, maxAttempts)), !this.props.anonymousGrading && jsx(Table.Cell, null, this.renderScores(quizSessions)), !this.props.anonymousGrading && jsx(Table.Cell, null, this.renderTimes(quizSessions)), !this.props.anonymousGrading && jsx(Table.Cell, null, this.renderLogLinks(quizSessions)), !this.props.anonymousGrading && this.renderAccommodations(accommodations), this.renderModerate());
|
|
360
354
|
}
|
|
361
355
|
}]);
|
|
362
356
|
|
|
@@ -383,7 +377,8 @@ export var ModerateTableRow = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
383
377
|
}))
|
|
384
378
|
}).isRequired,
|
|
385
379
|
shouldRenderModerateButton: PropTypes.bool,
|
|
386
|
-
focusTarget: PropTypes.string
|
|
380
|
+
focusTarget: PropTypes.string,
|
|
381
|
+
styles: PropTypes.object
|
|
387
382
|
}, _class2.defaultProps = {
|
|
388
383
|
displayScoreAsPercentage: true,
|
|
389
384
|
shouldRenderModerateButton: true,
|