@instructure/quiz-core 20.17.3-rc.0 → 20.17.3-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/moderating/components/resources/ModerateTable/presenter.js +2 -1
- package/es/moderating/components/resources/ModerateTableRow/presenter.js +30 -32
- package/lib/moderating/components/resources/ModerateTable/presenter.js +2 -1
- package/lib/moderating/components/resources/ModerateTableRow/presenter.js +29 -31
- 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
|
}, {
|
|
@@ -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 = {
|
|
@@ -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
|
}, {
|
|
@@ -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 = {
|
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.1+7c49355a8",
|
|
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.1+7c49355a8",
|
|
48
|
+
"@instructure/quiz-i18n": "20.17.3-rc.1+7c49355a8",
|
|
49
|
+
"@instructure/quiz-interactions": "20.17.3-rc.1+7c49355a8",
|
|
50
|
+
"@instructure/quiz-number-input": "20.17.3-rc.1+7c49355a8",
|
|
51
|
+
"@instructure/quiz-rce": "20.17.3-rc.1+7c49355a8",
|
|
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.1+7c49355a8",
|
|
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.1+7c49355a8",
|
|
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": "7c49355a8b03cd20dabf480c2ba6c8c616a7eb65"
|
|
180
180
|
}
|