@instructure/quiz-core 20.17.3-rc.0 → 20.17.3-rc.2
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/moderating/components/resources/ModerateTable/presenter.js +6 -3
- package/es/moderating/components/resources/ModerateTableRow/presenter.js +30 -32
- package/es/moderating/components/sidebar/ModerateTray/presenter.js +54 -28
- package/lib/moderating/components/resources/ModerateTable/presenter.js +6 -3
- package/lib/moderating/components/resources/ModerateTableRow/presenter.js +29 -31
- package/lib/moderating/components/sidebar/ModerateTray/presenter.js +53 -27
- package/package.json +9 -9
|
@@ -270,7 +270,8 @@ export var ModerateTable = (_dec = withStyle(generateStyle, generateComponentThe
|
|
|
270
270
|
withBackground: false,
|
|
271
271
|
withBorder: false,
|
|
272
272
|
screenReaderLabel: this.scoreToggleScreenreaderMessage(),
|
|
273
|
-
onClick: this.handleScoreToggle
|
|
273
|
+
onClick: this.handleScoreToggle,
|
|
274
|
+
"data-automation": "moderation-table-score-toggle"
|
|
274
275
|
}, _IconConfigureLine || (_IconConfigureLine = jsx(IconConfigureLine, null))));
|
|
275
276
|
}
|
|
276
277
|
}, {
|
|
@@ -321,8 +322,9 @@ export var ModerateTable = (_dec = withStyle(generateStyle, generateComponentThe
|
|
|
321
322
|
return jsx("div", {
|
|
322
323
|
css: this.props.styles.page
|
|
323
324
|
}, jsx(ModerateTray, {
|
|
324
|
-
onClose: this.onCloseTray
|
|
325
|
-
|
|
325
|
+
onClose: this.onCloseTray,
|
|
326
|
+
onSave: this.props.onSaveTray
|
|
327
|
+
}, jsx(Flex.Item, null, !this.props.anonymousGrading && (_ResetQuiz || (_ResetQuiz = jsx(ResetQuiz, null)))), this.props.children), this.renderContent());
|
|
326
328
|
}
|
|
327
329
|
}]);
|
|
328
330
|
}(Component), _ModerateTable.propTypes = {
|
|
@@ -336,6 +338,7 @@ export var ModerateTable = (_dec = withStyle(generateStyle, generateComponentThe
|
|
|
336
338
|
onOpenTray: PropTypes.func,
|
|
337
339
|
onResultsLinkClick: PropTypes.func,
|
|
338
340
|
openTray: PropTypes.func.isRequired,
|
|
341
|
+
onSaveTray: PropTypes.func.isRequired,
|
|
339
342
|
sessionTimeLimitInSeconds: PropTypes.number,
|
|
340
343
|
hasSessionTimeLimit: PropTypes.bool,
|
|
341
344
|
sendSessionTimeLimit: PropTypes.func,
|
|
@@ -2,7 +2,7 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
3
|
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
4
4
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
-
var _dec, _class, _ModerateTableRow;
|
|
5
|
+
var _dec, _class, _ModerateTableRow, _IconEditLine;
|
|
6
6
|
/** @jsx jsx */
|
|
7
7
|
/* eslint "array-callback-return": "warn" */
|
|
8
8
|
import { Component } from 'react';
|
|
@@ -14,10 +14,9 @@ import { Text } from '@instructure/ui-text';
|
|
|
14
14
|
import { Link } from '@instructure/ui-link';
|
|
15
15
|
import { Avatar } from '@instructure/ui-avatar';
|
|
16
16
|
import { View } from '@instructure/ui-view';
|
|
17
|
-
import { Flex } from '@instructure/ui-flex';
|
|
18
17
|
import { Table } from '@instructure/ui-table';
|
|
19
18
|
import { IconEditLine, IconWarningLine } from '@instructure/ui-icons';
|
|
20
|
-
import {
|
|
19
|
+
import { IconButton } from '@instructure/ui-buttons';
|
|
21
20
|
import { withStyle, jsx } from '@instructure/emotion';
|
|
22
21
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
23
22
|
import { withI18nSupport } from '@instructure/quiz-common';
|
|
@@ -43,26 +42,27 @@ export var ModerateTableRow = (_dec = withStyle(generateStyle, generateComponent
|
|
|
43
42
|
_this.props.onModerateButtonClick(_this.props.rowData);
|
|
44
43
|
};
|
|
45
44
|
_this.onAccommodationsClick = function () {
|
|
45
|
+
if (!_this.props.onAccommodationsClick) return;
|
|
46
46
|
_this.props.onAccommodationsClick(_this.props.rowData);
|
|
47
47
|
};
|
|
48
48
|
_this.generateAttemptLink = function (autogradefailed, message, quizSessionId, attemptNumber) {
|
|
49
49
|
var iconTitle = t('Autograde error on attempt { attemptNumber }.', {
|
|
50
50
|
attemptNumber: attemptNumber
|
|
51
51
|
});
|
|
52
|
-
var
|
|
53
|
-
onClick: _this.onResultsLinkClick(quizSessionId),
|
|
52
|
+
var autoGradeFailedProps = {
|
|
54
53
|
icon: jsx(IconWarningLine, {
|
|
55
54
|
color: "warning",
|
|
56
55
|
title: iconTitle
|
|
57
56
|
}),
|
|
58
|
-
iconPlacement:
|
|
59
|
-
}
|
|
60
|
-
onClick: _this.onResultsLinkClick(quizSessionId)
|
|
61
|
-
}, message);
|
|
57
|
+
iconPlacement: 'end'
|
|
58
|
+
};
|
|
62
59
|
return jsx("div", {
|
|
63
60
|
key: quizSessionId,
|
|
64
61
|
css: _this.props.styles.tableDataItem
|
|
65
|
-
},
|
|
62
|
+
}, jsx(Link, Object.assign({
|
|
63
|
+
onClick: _this.onResultsLinkClick(quizSessionId),
|
|
64
|
+
"data-automation": "sdk-moderation-attempts-results-link"
|
|
65
|
+
}, autogradefailed && autoGradeFailedProps), message));
|
|
66
66
|
};
|
|
67
67
|
_this.generateAttemptText = function (autogradefailed, message, quizSessionId, attemptNumber) {
|
|
68
68
|
var iconTitle = t('Autograde error on attempt { attemptNumber }.', {
|
|
@@ -235,7 +235,8 @@ export var ModerateTableRow = (_dec = withStyle(generateStyle, generateComponent
|
|
|
235
235
|
key: quizSessionId,
|
|
236
236
|
css: _this6.props.styles.tableDataItem
|
|
237
237
|
}, jsx(Link, {
|
|
238
|
-
onClick: onClick
|
|
238
|
+
onClick: onClick,
|
|
239
|
+
"data-automation": "sdk-moderation-moderate-session-log-link"
|
|
239
240
|
}, message));
|
|
240
241
|
});
|
|
241
242
|
}
|
|
@@ -263,21 +264,9 @@ export var ModerateTableRow = (_dec = withStyle(generateStyle, generateComponent
|
|
|
263
264
|
|
|
264
265
|
// Display the Accommodations and the button in a flex container with reverse order
|
|
265
266
|
// so that the screen reader will read the accommodations first, and then the button
|
|
266
|
-
return jsx(Table.Cell,
|
|
267
|
-
direction: "row-reverse",
|
|
268
|
-
justifyItems: "end"
|
|
269
|
-
}, jsx(Flex.Item, {
|
|
270
|
-
shouldShrink: true,
|
|
267
|
+
return jsx(Table.Cell, {
|
|
271
268
|
"data-automation": "sdk-moderate-accommodations-text"
|
|
272
|
-
}, displayContent)
|
|
273
|
-
margin: "0 x-small 0 0",
|
|
274
|
-
withBackground: false,
|
|
275
|
-
withBorder: false,
|
|
276
|
-
renderIcon: IconEditLine,
|
|
277
|
-
onClick: this.onAccommodationsClick,
|
|
278
|
-
"data-automation": "sdk-moderate-accommodations-edit",
|
|
279
|
-
screenReaderLabel: t('Edit student accommodations')
|
|
280
|
-
}))));
|
|
269
|
+
}, displayContent);
|
|
281
270
|
}
|
|
282
271
|
}
|
|
283
272
|
}, {
|
|
@@ -286,14 +275,25 @@ export var ModerateTableRow = (_dec = withStyle(generateStyle, generateComponent
|
|
|
286
275
|
if (this.props.shouldRenderModerateButton) {
|
|
287
276
|
return jsx(Table.Cell, null, jsx("div", {
|
|
288
277
|
css: this.props.styles.moderateButton
|
|
289
|
-
}, jsx(
|
|
290
|
-
size: "small",
|
|
278
|
+
}, jsx(IconButton, {
|
|
291
279
|
onClick: this.onModerateButtonClick,
|
|
292
280
|
ref: this.handleModerateRef,
|
|
293
|
-
"data-automation": "sdk-moderation-moderate-button"
|
|
294
|
-
|
|
281
|
+
"data-automation": "sdk-moderation-moderate-button",
|
|
282
|
+
screenReaderLabel: t('Moderate')
|
|
283
|
+
}, _IconEditLine || (_IconEditLine = jsx(IconEditLine, null)))));
|
|
295
284
|
}
|
|
296
285
|
}
|
|
286
|
+
}, {
|
|
287
|
+
key: "renderName",
|
|
288
|
+
value: function renderName(name, avatarName) {
|
|
289
|
+
return jsx(Link, {
|
|
290
|
+
onClick: this.onAccommodationsClick,
|
|
291
|
+
screenReaderLabel: t('Edit student accommodations'),
|
|
292
|
+
"data-automation": "sdk-moderate-accommodations-edit",
|
|
293
|
+
margin: "0 small",
|
|
294
|
+
css: avatarName
|
|
295
|
+
}, name);
|
|
296
|
+
}
|
|
297
297
|
}, {
|
|
298
298
|
key: "render",
|
|
299
299
|
value: function render() {
|
|
@@ -312,9 +312,7 @@ export var ModerateTableRow = (_dec = withStyle(generateStyle, generateComponent
|
|
|
312
312
|
name: name,
|
|
313
313
|
src: avatarUrl,
|
|
314
314
|
size: "small"
|
|
315
|
-
})), jsx(
|
|
316
|
-
css: avatarName
|
|
317
|
-
}, 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());
|
|
315
|
+
})), this.renderName(name, avatarName))), !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());
|
|
318
316
|
}
|
|
319
317
|
}]);
|
|
320
318
|
}(withI18nSupport(Component)), _ModerateTableRow.propTypes = {
|
|
@@ -5,11 +5,13 @@ import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
|
5
5
|
import React, { Component } from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
8
|
+
import { Flex } from '@instructure/ui-flex';
|
|
8
9
|
import { View } from '@instructure/ui-view';
|
|
9
10
|
import { Tooltip } from '@instructure/ui-tooltip';
|
|
10
11
|
import { Tray } from '@instructure/ui-tray';
|
|
11
|
-
import { CloseButton } from '@instructure/ui-buttons';
|
|
12
|
+
import { Button, CloseButton } from '@instructure/ui-buttons';
|
|
12
13
|
import { TruncateText } from '@instructure/ui-truncate-text';
|
|
14
|
+
import { Modal } from '@instructure/ui-modal';
|
|
13
15
|
import { liveRegion } from '@instructure/quiz-common';
|
|
14
16
|
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
15
17
|
export var ModerateTray = /*#__PURE__*/function (_Component) {
|
|
@@ -38,6 +40,38 @@ export var ModerateTray = /*#__PURE__*/function (_Component) {
|
|
|
38
40
|
isTruncated: false
|
|
39
41
|
});
|
|
40
42
|
};
|
|
43
|
+
_this.setCloseRef = function (el) {
|
|
44
|
+
return _this.closeRef = el;
|
|
45
|
+
};
|
|
46
|
+
_this.setTrayRef = function (el) {
|
|
47
|
+
return _this.trayRef = el;
|
|
48
|
+
};
|
|
49
|
+
_this.getTrayRef = function () {
|
|
50
|
+
return _this.trayRef;
|
|
51
|
+
};
|
|
52
|
+
_this.handleSave = function () {
|
|
53
|
+
_this.props.onSave();
|
|
54
|
+
_this.props.closeTray();
|
|
55
|
+
};
|
|
56
|
+
_this.renderTitleAndCloseButton = function () {
|
|
57
|
+
return /*#__PURE__*/React.createElement(Flex, null, /*#__PURE__*/React.createElement(Flex.Item, {
|
|
58
|
+
shouldGrow: true,
|
|
59
|
+
shouldShrink: true
|
|
60
|
+
}, _this.state.isTruncated ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
61
|
+
placement: "start",
|
|
62
|
+
renderTip: _this.labelText(),
|
|
63
|
+
mountNode: _this.getTrayRef || null
|
|
64
|
+
}, function (_ref) {
|
|
65
|
+
var focused = _ref.focused;
|
|
66
|
+
return _this.renderName({
|
|
67
|
+
focused: focused
|
|
68
|
+
});
|
|
69
|
+
}) : _this.renderName()), /*#__PURE__*/React.createElement(Flex.Item, null, /*#__PURE__*/React.createElement(CloseButton, {
|
|
70
|
+
onClick: _this.props.closeTray,
|
|
71
|
+
elementRef: _this.setCloseRef,
|
|
72
|
+
screenReaderLabel: t('Close')
|
|
73
|
+
})));
|
|
74
|
+
};
|
|
41
75
|
_this.renderChildren = function () {
|
|
42
76
|
return React.Children.map(_this.props.children, function (child) {
|
|
43
77
|
if (!child) return null;
|
|
@@ -48,14 +82,15 @@ export var ModerateTray = /*#__PURE__*/function (_Component) {
|
|
|
48
82
|
});
|
|
49
83
|
});
|
|
50
84
|
};
|
|
51
|
-
_this.
|
|
52
|
-
return
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
85
|
+
_this.renderFooter = function () {
|
|
86
|
+
return /*#__PURE__*/React.createElement(Modal.Footer, null, /*#__PURE__*/React.createElement(Button, {
|
|
87
|
+
onClick: _this.props.closeTray,
|
|
88
|
+
margin: "0 x-small 0 0"
|
|
89
|
+
}, t('Cancel')), /*#__PURE__*/React.createElement(Button, {
|
|
90
|
+
color: "primary",
|
|
91
|
+
type: "submit",
|
|
92
|
+
onClick: _this.handleSave
|
|
93
|
+
}, t('Apply')));
|
|
59
94
|
};
|
|
60
95
|
return _this;
|
|
61
96
|
}
|
|
@@ -95,7 +130,6 @@ export var ModerateTray = /*#__PURE__*/function (_Component) {
|
|
|
95
130
|
}, {
|
|
96
131
|
key: "render",
|
|
97
132
|
value: function render() {
|
|
98
|
-
var _this2 = this;
|
|
99
133
|
return /*#__PURE__*/React.createElement(Tray, {
|
|
100
134
|
label: this.labelText(),
|
|
101
135
|
liveRegion: liveRegion,
|
|
@@ -106,25 +140,16 @@ export var ModerateTray = /*#__PURE__*/function (_Component) {
|
|
|
106
140
|
placement: "end",
|
|
107
141
|
shouldCloseOnDocumentClick: true,
|
|
108
142
|
ref: this.setTrayRef
|
|
109
|
-
}, /*#__PURE__*/React.createElement(
|
|
110
|
-
placement: "start",
|
|
111
|
-
offset: "x-small",
|
|
112
|
-
onClick: this.props.closeTray,
|
|
113
|
-
elementRef: this.setCloseRef,
|
|
114
|
-
screenReaderLabel: t('Close')
|
|
115
|
-
}), /*#__PURE__*/React.createElement(View, {
|
|
143
|
+
}, /*#__PURE__*/React.createElement(Flex, {
|
|
116
144
|
as: "div",
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
focused: focused
|
|
126
|
-
});
|
|
127
|
-
}) : this.renderName(), this.renderChildren()));
|
|
145
|
+
direction: "column",
|
|
146
|
+
height: "100vh"
|
|
147
|
+
}, /*#__PURE__*/React.createElement(Flex.Item, {
|
|
148
|
+
padding: "small medium"
|
|
149
|
+
}, this.renderTitleAndCloseButton()), /*#__PURE__*/React.createElement(Flex.Item, {
|
|
150
|
+
shouldGrow: true,
|
|
151
|
+
padding: "0 medium"
|
|
152
|
+
}, this.renderChildren()), /*#__PURE__*/React.createElement(Flex.Item, null, this.renderFooter())));
|
|
128
153
|
}
|
|
129
154
|
}]);
|
|
130
155
|
}(Component);
|
|
@@ -133,6 +158,7 @@ ModerateTray.propTypes = {
|
|
|
133
158
|
closeTray: PropTypes.func.isRequired,
|
|
134
159
|
isOpen: PropTypes.bool.isRequired,
|
|
135
160
|
onClose: PropTypes.func,
|
|
161
|
+
onSave: PropTypes.func.isRequired,
|
|
136
162
|
participantName: PropTypes.string
|
|
137
163
|
};
|
|
138
164
|
ModerateTray.defaultProps = {
|
|
@@ -277,7 +277,8 @@ var ModerateTable = exports.ModerateTable = (_dec = (0, _emotion.withStyle)(_sty
|
|
|
277
277
|
withBackground: false,
|
|
278
278
|
withBorder: false,
|
|
279
279
|
screenReaderLabel: this.scoreToggleScreenreaderMessage(),
|
|
280
|
-
onClick: this.handleScoreToggle
|
|
280
|
+
onClick: this.handleScoreToggle,
|
|
281
|
+
"data-automation": "moderation-table-score-toggle"
|
|
281
282
|
}, _IconConfigureLine || (_IconConfigureLine = (0, _emotion.jsx)(_uiIcons.IconConfigureLine, null))));
|
|
282
283
|
}
|
|
283
284
|
}, {
|
|
@@ -328,8 +329,9 @@ var ModerateTable = exports.ModerateTable = (_dec = (0, _emotion.withStyle)(_sty
|
|
|
328
329
|
return (0, _emotion.jsx)("div", {
|
|
329
330
|
css: this.props.styles.page
|
|
330
331
|
}, (0, _emotion.jsx)(_ModerateTray.default, {
|
|
331
|
-
onClose: this.onCloseTray
|
|
332
|
-
|
|
332
|
+
onClose: this.onCloseTray,
|
|
333
|
+
onSave: this.props.onSaveTray
|
|
334
|
+
}, (0, _emotion.jsx)(_uiFlex.Flex.Item, null, !this.props.anonymousGrading && (_ResetQuiz || (_ResetQuiz = (0, _emotion.jsx)(_ResetQuiz2.default, null)))), this.props.children), this.renderContent());
|
|
333
335
|
}
|
|
334
336
|
}]);
|
|
335
337
|
}(_react.Component), _ModerateTable.propTypes = {
|
|
@@ -343,6 +345,7 @@ var ModerateTable = exports.ModerateTable = (_dec = (0, _emotion.withStyle)(_sty
|
|
|
343
345
|
onOpenTray: _propTypes.default.func,
|
|
344
346
|
onResultsLinkClick: _propTypes.default.func,
|
|
345
347
|
openTray: _propTypes.default.func.isRequired,
|
|
348
|
+
onSaveTray: _propTypes.default.func.isRequired,
|
|
346
349
|
sessionTimeLimitInSeconds: _propTypes.default.number,
|
|
347
350
|
hasSessionTimeLimit: _propTypes.default.bool,
|
|
348
351
|
sendSessionTimeLimit: _propTypes.default.func,
|
|
@@ -18,7 +18,6 @@ var _uiText = require("@instructure/ui-text");
|
|
|
18
18
|
var _uiLink = require("@instructure/ui-link");
|
|
19
19
|
var _uiAvatar = require("@instructure/ui-avatar");
|
|
20
20
|
var _uiView = require("@instructure/ui-view");
|
|
21
|
-
var _uiFlex = require("@instructure/ui-flex");
|
|
22
21
|
var _uiTable = require("@instructure/ui-table");
|
|
23
22
|
var _uiIcons = require("@instructure/ui-icons");
|
|
24
23
|
var _uiButtons = require("@instructure/ui-buttons");
|
|
@@ -28,7 +27,7 @@ var _quizCommon = require("@instructure/quiz-common");
|
|
|
28
27
|
var _FormattedDuration = _interopRequireDefault(require("../../../../common/components/shared/FormattedDuration"));
|
|
29
28
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
30
29
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
31
|
-
var _dec, _class, _ModerateTableRow;
|
|
30
|
+
var _dec, _class, _ModerateTableRow, _IconEditLine;
|
|
32
31
|
/** @jsx jsx */
|
|
33
32
|
/* eslint "array-callback-return": "warn" */
|
|
34
33
|
var DASHES = '---';
|
|
@@ -50,26 +49,27 @@ var ModerateTableRow = exports.ModerateTableRow = (_dec = (0, _emotion.withStyle
|
|
|
50
49
|
_this.props.onModerateButtonClick(_this.props.rowData);
|
|
51
50
|
};
|
|
52
51
|
_this.onAccommodationsClick = function () {
|
|
52
|
+
if (!_this.props.onAccommodationsClick) return;
|
|
53
53
|
_this.props.onAccommodationsClick(_this.props.rowData);
|
|
54
54
|
};
|
|
55
55
|
_this.generateAttemptLink = function (autogradefailed, message, quizSessionId, attemptNumber) {
|
|
56
56
|
var iconTitle = (0, _formatMessage.default)('Autograde error on attempt { attemptNumber }.', {
|
|
57
57
|
attemptNumber: attemptNumber
|
|
58
58
|
});
|
|
59
|
-
var
|
|
60
|
-
onClick: _this.onResultsLinkClick(quizSessionId),
|
|
59
|
+
var autoGradeFailedProps = {
|
|
61
60
|
icon: (0, _emotion.jsx)(_uiIcons.IconWarningLine, {
|
|
62
61
|
color: "warning",
|
|
63
62
|
title: iconTitle
|
|
64
63
|
}),
|
|
65
|
-
iconPlacement:
|
|
66
|
-
}
|
|
67
|
-
onClick: _this.onResultsLinkClick(quizSessionId)
|
|
68
|
-
}, message);
|
|
64
|
+
iconPlacement: 'end'
|
|
65
|
+
};
|
|
69
66
|
return (0, _emotion.jsx)("div", {
|
|
70
67
|
key: quizSessionId,
|
|
71
68
|
css: _this.props.styles.tableDataItem
|
|
72
|
-
},
|
|
69
|
+
}, (0, _emotion.jsx)(_uiLink.Link, Object.assign({
|
|
70
|
+
onClick: _this.onResultsLinkClick(quizSessionId),
|
|
71
|
+
"data-automation": "sdk-moderation-attempts-results-link"
|
|
72
|
+
}, autogradefailed && autoGradeFailedProps), message));
|
|
73
73
|
};
|
|
74
74
|
_this.generateAttemptText = function (autogradefailed, message, quizSessionId, attemptNumber) {
|
|
75
75
|
var iconTitle = (0, _formatMessage.default)('Autograde error on attempt { attemptNumber }.', {
|
|
@@ -242,7 +242,8 @@ var ModerateTableRow = exports.ModerateTableRow = (_dec = (0, _emotion.withStyle
|
|
|
242
242
|
key: quizSessionId,
|
|
243
243
|
css: _this6.props.styles.tableDataItem
|
|
244
244
|
}, (0, _emotion.jsx)(_uiLink.Link, {
|
|
245
|
-
onClick: onClick
|
|
245
|
+
onClick: onClick,
|
|
246
|
+
"data-automation": "sdk-moderation-moderate-session-log-link"
|
|
246
247
|
}, message));
|
|
247
248
|
});
|
|
248
249
|
}
|
|
@@ -270,21 +271,9 @@ var ModerateTableRow = exports.ModerateTableRow = (_dec = (0, _emotion.withStyle
|
|
|
270
271
|
|
|
271
272
|
// Display the Accommodations and the button in a flex container with reverse order
|
|
272
273
|
// so that the screen reader will read the accommodations first, and then the button
|
|
273
|
-
return (0, _emotion.jsx)(_uiTable.Table.Cell,
|
|
274
|
-
direction: "row-reverse",
|
|
275
|
-
justifyItems: "end"
|
|
276
|
-
}, (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
277
|
-
shouldShrink: true,
|
|
274
|
+
return (0, _emotion.jsx)(_uiTable.Table.Cell, {
|
|
278
275
|
"data-automation": "sdk-moderate-accommodations-text"
|
|
279
|
-
}, displayContent)
|
|
280
|
-
margin: "0 x-small 0 0",
|
|
281
|
-
withBackground: false,
|
|
282
|
-
withBorder: false,
|
|
283
|
-
renderIcon: _uiIcons.IconEditLine,
|
|
284
|
-
onClick: this.onAccommodationsClick,
|
|
285
|
-
"data-automation": "sdk-moderate-accommodations-edit",
|
|
286
|
-
screenReaderLabel: (0, _formatMessage.default)('Edit student accommodations')
|
|
287
|
-
}))));
|
|
276
|
+
}, displayContent);
|
|
288
277
|
}
|
|
289
278
|
}
|
|
290
279
|
}, {
|
|
@@ -293,14 +282,25 @@ var ModerateTableRow = exports.ModerateTableRow = (_dec = (0, _emotion.withStyle
|
|
|
293
282
|
if (this.props.shouldRenderModerateButton) {
|
|
294
283
|
return (0, _emotion.jsx)(_uiTable.Table.Cell, null, (0, _emotion.jsx)("div", {
|
|
295
284
|
css: this.props.styles.moderateButton
|
|
296
|
-
}, (0, _emotion.jsx)(_uiButtons.
|
|
297
|
-
size: "small",
|
|
285
|
+
}, (0, _emotion.jsx)(_uiButtons.IconButton, {
|
|
298
286
|
onClick: this.onModerateButtonClick,
|
|
299
287
|
ref: this.handleModerateRef,
|
|
300
|
-
"data-automation": "sdk-moderation-moderate-button"
|
|
301
|
-
|
|
288
|
+
"data-automation": "sdk-moderation-moderate-button",
|
|
289
|
+
screenReaderLabel: (0, _formatMessage.default)('Moderate')
|
|
290
|
+
}, _IconEditLine || (_IconEditLine = (0, _emotion.jsx)(_uiIcons.IconEditLine, null)))));
|
|
302
291
|
}
|
|
303
292
|
}
|
|
293
|
+
}, {
|
|
294
|
+
key: "renderName",
|
|
295
|
+
value: function renderName(name, avatarName) {
|
|
296
|
+
return (0, _emotion.jsx)(_uiLink.Link, {
|
|
297
|
+
onClick: this.onAccommodationsClick,
|
|
298
|
+
screenReaderLabel: (0, _formatMessage.default)('Edit student accommodations'),
|
|
299
|
+
"data-automation": "sdk-moderate-accommodations-edit",
|
|
300
|
+
margin: "0 small",
|
|
301
|
+
css: avatarName
|
|
302
|
+
}, name);
|
|
303
|
+
}
|
|
304
304
|
}, {
|
|
305
305
|
key: "render",
|
|
306
306
|
value: function render() {
|
|
@@ -319,9 +319,7 @@ var ModerateTableRow = exports.ModerateTableRow = (_dec = (0, _emotion.withStyle
|
|
|
319
319
|
name: name,
|
|
320
320
|
src: avatarUrl,
|
|
321
321
|
size: "small"
|
|
322
|
-
})), (0, _emotion.jsx)(
|
|
323
|
-
css: avatarName
|
|
324
|
-
}, name))), !this.props.anonymousGrading && (0, _emotion.jsx)(_uiTable.Table.Cell, null, this.renderAttempts(quizSessions, maxAttempts)), !this.props.anonymousGrading && (0, _emotion.jsx)(_uiTable.Table.Cell, null, this.renderScores(quizSessions)), !this.props.anonymousGrading && (0, _emotion.jsx)(_uiTable.Table.Cell, null, this.renderTimes(quizSessions)), !this.props.anonymousGrading && (0, _emotion.jsx)(_uiTable.Table.Cell, null, this.renderLogLinks(quizSessions)), !this.props.anonymousGrading && this.renderAccommodations(accommodations), this.renderModerate());
|
|
322
|
+
})), this.renderName(name, avatarName))), !this.props.anonymousGrading && (0, _emotion.jsx)(_uiTable.Table.Cell, null, this.renderAttempts(quizSessions, maxAttempts)), !this.props.anonymousGrading && (0, _emotion.jsx)(_uiTable.Table.Cell, null, this.renderScores(quizSessions)), !this.props.anonymousGrading && (0, _emotion.jsx)(_uiTable.Table.Cell, null, this.renderTimes(quizSessions)), !this.props.anonymousGrading && (0, _emotion.jsx)(_uiTable.Table.Cell, null, this.renderLogLinks(quizSessions)), !this.props.anonymousGrading && this.renderAccommodations(accommodations), this.renderModerate());
|
|
325
323
|
}
|
|
326
324
|
}]);
|
|
327
325
|
}((0, _quizCommon.withI18nSupport)(_react.Component)), _ModerateTableRow.propTypes = {
|
|
@@ -13,11 +13,13 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
15
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
16
|
+
var _uiFlex = require("@instructure/ui-flex");
|
|
16
17
|
var _uiView = require("@instructure/ui-view");
|
|
17
18
|
var _uiTooltip = require("@instructure/ui-tooltip");
|
|
18
19
|
var _uiTray = require("@instructure/ui-tray");
|
|
19
20
|
var _uiButtons = require("@instructure/ui-buttons");
|
|
20
21
|
var _uiTruncateText = require("@instructure/ui-truncate-text");
|
|
22
|
+
var _uiModal = require("@instructure/ui-modal");
|
|
21
23
|
var _quizCommon = require("@instructure/quiz-common");
|
|
22
24
|
var _uiA11yContent = require("@instructure/ui-a11y-content");
|
|
23
25
|
var ModerateTray = exports.ModerateTray = /*#__PURE__*/function (_Component) {
|
|
@@ -46,6 +48,38 @@ var ModerateTray = exports.ModerateTray = /*#__PURE__*/function (_Component) {
|
|
|
46
48
|
isTruncated: false
|
|
47
49
|
});
|
|
48
50
|
};
|
|
51
|
+
_this.setCloseRef = function (el) {
|
|
52
|
+
return _this.closeRef = el;
|
|
53
|
+
};
|
|
54
|
+
_this.setTrayRef = function (el) {
|
|
55
|
+
return _this.trayRef = el;
|
|
56
|
+
};
|
|
57
|
+
_this.getTrayRef = function () {
|
|
58
|
+
return _this.trayRef;
|
|
59
|
+
};
|
|
60
|
+
_this.handleSave = function () {
|
|
61
|
+
_this.props.onSave();
|
|
62
|
+
_this.props.closeTray();
|
|
63
|
+
};
|
|
64
|
+
_this.renderTitleAndCloseButton = function () {
|
|
65
|
+
return /*#__PURE__*/_react.default.createElement(_uiFlex.Flex, null, /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, {
|
|
66
|
+
shouldGrow: true,
|
|
67
|
+
shouldShrink: true
|
|
68
|
+
}, _this.state.isTruncated ? /*#__PURE__*/_react.default.createElement(_uiTooltip.Tooltip, {
|
|
69
|
+
placement: "start",
|
|
70
|
+
renderTip: _this.labelText(),
|
|
71
|
+
mountNode: _this.getTrayRef || null
|
|
72
|
+
}, function (_ref) {
|
|
73
|
+
var focused = _ref.focused;
|
|
74
|
+
return _this.renderName({
|
|
75
|
+
focused: focused
|
|
76
|
+
});
|
|
77
|
+
}) : _this.renderName()), /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, null, /*#__PURE__*/_react.default.createElement(_uiButtons.CloseButton, {
|
|
78
|
+
onClick: _this.props.closeTray,
|
|
79
|
+
elementRef: _this.setCloseRef,
|
|
80
|
+
screenReaderLabel: (0, _formatMessage.default)('Close')
|
|
81
|
+
})));
|
|
82
|
+
};
|
|
49
83
|
_this.renderChildren = function () {
|
|
50
84
|
return _react.default.Children.map(_this.props.children, function (child) {
|
|
51
85
|
if (!child) return null;
|
|
@@ -56,14 +90,15 @@ var ModerateTray = exports.ModerateTray = /*#__PURE__*/function (_Component) {
|
|
|
56
90
|
});
|
|
57
91
|
});
|
|
58
92
|
};
|
|
59
|
-
_this.
|
|
60
|
-
return
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
93
|
+
_this.renderFooter = function () {
|
|
94
|
+
return /*#__PURE__*/_react.default.createElement(_uiModal.Modal.Footer, null, /*#__PURE__*/_react.default.createElement(_uiButtons.Button, {
|
|
95
|
+
onClick: _this.props.closeTray,
|
|
96
|
+
margin: "0 x-small 0 0"
|
|
97
|
+
}, (0, _formatMessage.default)('Cancel')), /*#__PURE__*/_react.default.createElement(_uiButtons.Button, {
|
|
98
|
+
color: "primary",
|
|
99
|
+
type: "submit",
|
|
100
|
+
onClick: _this.handleSave
|
|
101
|
+
}, (0, _formatMessage.default)('Apply')));
|
|
67
102
|
};
|
|
68
103
|
return _this;
|
|
69
104
|
}
|
|
@@ -103,7 +138,6 @@ var ModerateTray = exports.ModerateTray = /*#__PURE__*/function (_Component) {
|
|
|
103
138
|
}, {
|
|
104
139
|
key: "render",
|
|
105
140
|
value: function render() {
|
|
106
|
-
var _this2 = this;
|
|
107
141
|
return /*#__PURE__*/_react.default.createElement(_uiTray.Tray, {
|
|
108
142
|
label: this.labelText(),
|
|
109
143
|
liveRegion: _quizCommon.liveRegion,
|
|
@@ -114,25 +148,16 @@ var ModerateTray = exports.ModerateTray = /*#__PURE__*/function (_Component) {
|
|
|
114
148
|
placement: "end",
|
|
115
149
|
shouldCloseOnDocumentClick: true,
|
|
116
150
|
ref: this.setTrayRef
|
|
117
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
118
|
-
placement: "start",
|
|
119
|
-
offset: "x-small",
|
|
120
|
-
onClick: this.props.closeTray,
|
|
121
|
-
elementRef: this.setCloseRef,
|
|
122
|
-
screenReaderLabel: (0, _formatMessage.default)('Close')
|
|
123
|
-
}), /*#__PURE__*/_react.default.createElement(_uiView.View, {
|
|
151
|
+
}, /*#__PURE__*/_react.default.createElement(_uiFlex.Flex, {
|
|
124
152
|
as: "div",
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
focused: focused
|
|
134
|
-
});
|
|
135
|
-
}) : this.renderName(), this.renderChildren()));
|
|
153
|
+
direction: "column",
|
|
154
|
+
height: "100vh"
|
|
155
|
+
}, /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, {
|
|
156
|
+
padding: "small medium"
|
|
157
|
+
}, this.renderTitleAndCloseButton()), /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, {
|
|
158
|
+
shouldGrow: true,
|
|
159
|
+
padding: "0 medium"
|
|
160
|
+
}, this.renderChildren()), /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, null, this.renderFooter())));
|
|
136
161
|
}
|
|
137
162
|
}]);
|
|
138
163
|
}(_react.Component);
|
|
@@ -141,6 +166,7 @@ ModerateTray.propTypes = {
|
|
|
141
166
|
closeTray: _propTypes.default.func.isRequired,
|
|
142
167
|
isOpen: _propTypes.default.bool.isRequired,
|
|
143
168
|
onClose: _propTypes.default.func,
|
|
169
|
+
onSave: _propTypes.default.func.isRequired,
|
|
144
170
|
participantName: _propTypes.default.string
|
|
145
171
|
};
|
|
146
172
|
ModerateTray.defaultProps = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/quiz-core",
|
|
3
|
-
"version": "20.17.3-rc.
|
|
3
|
+
"version": "20.17.3-rc.2+e41ad88aa",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The Quiz React SDK by Instructure Inc.",
|
|
6
6
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"@instructure/emotion": "^8.51.0",
|
|
45
45
|
"@instructure/grading-utils": "^1.0.0",
|
|
46
46
|
"@instructure/outcomes-ui": "^3.2.2",
|
|
47
|
-
"@instructure/quiz-common": "20.17.3-rc.
|
|
48
|
-
"@instructure/quiz-i18n": "20.17.3-rc.
|
|
49
|
-
"@instructure/quiz-interactions": "20.17.3-rc.
|
|
50
|
-
"@instructure/quiz-number-input": "20.17.3-rc.
|
|
51
|
-
"@instructure/quiz-rce": "20.17.3-rc.
|
|
47
|
+
"@instructure/quiz-common": "20.17.3-rc.2+e41ad88aa",
|
|
48
|
+
"@instructure/quiz-i18n": "20.17.3-rc.2+e41ad88aa",
|
|
49
|
+
"@instructure/quiz-interactions": "20.17.3-rc.2+e41ad88aa",
|
|
50
|
+
"@instructure/quiz-number-input": "20.17.3-rc.2+e41ad88aa",
|
|
51
|
+
"@instructure/quiz-rce": "20.17.3-rc.2+e41ad88aa",
|
|
52
52
|
"@instructure/ui-a11y-content": "^8.51.0",
|
|
53
53
|
"@instructure/ui-alerts": "^8.51.0",
|
|
54
54
|
"@instructure/ui-avatar": "^8.51.0",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"file-saver": "~2.0.5",
|
|
112
112
|
"humps": "^2.0.0",
|
|
113
113
|
"immutable": "^3.8.1",
|
|
114
|
-
"instructure-validations": "20.17.3-rc.
|
|
114
|
+
"instructure-validations": "20.17.3-rc.2+e41ad88aa",
|
|
115
115
|
"ipaddr.js": "^1.5.4",
|
|
116
116
|
"isomorphic-fetch": "^2.2.0",
|
|
117
117
|
"isuuid": "^0.1.0",
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
"jquery": "^2.2.3",
|
|
161
161
|
"karma-junit-reporter": "^2.0.1",
|
|
162
162
|
"most-subject": "^5.3.0",
|
|
163
|
-
"quiz-presets": "20.17.3-rc.
|
|
163
|
+
"quiz-presets": "20.17.3-rc.2+e41ad88aa",
|
|
164
164
|
"react": "^16.8.6",
|
|
165
165
|
"react-addons-test-utils": "^15.6.2",
|
|
166
166
|
"react-dom": "^16.8.6",
|
|
@@ -176,5 +176,5 @@
|
|
|
176
176
|
"publishConfig": {
|
|
177
177
|
"access": "public"
|
|
178
178
|
},
|
|
179
|
-
"gitHead": "
|
|
179
|
+
"gitHead": "e41ad88aaef2af576f53ff0e212c6d793db74bf4"
|
|
180
180
|
}
|