@instructure/quiz-core 20.16.1-rc.9 → 20.17.1-rc.0
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/CHANGELOG.md +18 -0
- package/es/banks/components/BankEntry/presenter.js +7 -1
- package/es/building/components/resources/AddToBankOptions/index.js +42 -15
- package/es/building/components/resources/quizEntry/QuizEntry/presenter.js +18 -2
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +4 -1
- package/es/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +3 -1
- package/es/common/components/layout/header/Timer/presenter.js +2 -1
- package/es/common/components/resources/entry/EntrySave/presenter.js +66 -25
- package/es/common/components/resources/sessionItemResult/ResultStimulus/styles.js +2 -1
- package/es/common/components/resources/stimulus/StimulusEdit/presenter.js +1 -0
- package/lib/banks/components/BankEntry/presenter.js +7 -1
- package/lib/building/components/resources/AddToBankOptions/index.js +48 -19
- package/lib/building/components/resources/quizEntry/QuizEntry/presenter.js +20 -2
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +4 -1
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +3 -1
- package/lib/common/components/layout/header/Timer/presenter.js +2 -1
- package/lib/common/components/resources/entry/EntrySave/presenter.js +68 -25
- package/lib/common/components/resources/sessionItemResult/ResultStimulus/styles.js +2 -1
- package/lib/common/components/resources/stimulus/StimulusEdit/presenter.js +1 -0
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [20.17.0](https://gerrit.instructure.com/quizzes-ui/compare/v20.16.0...v20.17.0) (2024-08-06)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **a11y:** correct timer command for OS X ([80dd509](https://gerrit.instructure.com/quizzes-ui/commits/80dd509d088767c8d222f534bbf703a95c183760))
|
|
12
|
+
* **a11y:** Focus isn't trapped inside of tray ([073433a](https://gerrit.instructure.com/quizzes-ui/commits/073433a328d7716fc320698f01fd6f39523ff5f5))
|
|
13
|
+
* **a11y:** hide instructions after first question for screen reader ([df1b9be](https://gerrit.instructure.com/quizzes-ui/commits/df1b9bee393ed2585ecf8d3ff526e93bfe07e7b8))
|
|
14
|
+
* **a11y:** localize strings for shortcut command ([521b894](https://gerrit.instructure.com/quizzes-ui/commits/521b894fd318297561afdcd7a76d5c2f5d5028e2))
|
|
15
|
+
* **a11y:** make access code success message polite ([16f4c9e](https://gerrit.instructure.com/quizzes-ui/commits/16f4c9eaacdcb4f53aeb94b4acce383ded3fe00a))
|
|
16
|
+
* **a11y:** move user's focus to topmost error field ([87e7691](https://gerrit.instructure.com/quizzes-ui/commits/87e7691b12c61f2e48b34923c61445242309181a))
|
|
17
|
+
* **alerts:** make all alerts assertive by default ([18b632a](https://gerrit.instructure.com/quizzes-ui/commits/18b632a902fb06139b6b080bc39f5c750c984f43))
|
|
18
|
+
* **ResultStimulus:** add width constraint ([7ddad6d](https://gerrit.instructure.com/quizzes-ui/commits/7ddad6d3e06a83b7348f630dba07c3420bcc8b81))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
# [20.16.0](https://gerrit.instructure.com/quizzes-ui/compare/v20.15.0...v20.16.0) (2024-07-08)
|
|
7
25
|
|
|
8
26
|
|
|
@@ -155,6 +155,10 @@ export var BankEntry = (_dec = withStyle(generateStyle, generateComponentTheme),
|
|
|
155
155
|
}, _callee, null, [[0, 10]]);
|
|
156
156
|
}));
|
|
157
157
|
|
|
158
|
+
_this.handleRef = function (node) {
|
|
159
|
+
_this.itemEditArea = node;
|
|
160
|
+
};
|
|
161
|
+
|
|
158
162
|
_this.clearChanges = function () {
|
|
159
163
|
_this.clearValidationErrorsFromApi(CLEAR_ALL_INPUT_VALIDATION_ERRORS);
|
|
160
164
|
|
|
@@ -185,6 +189,7 @@ export var BankEntry = (_dec = withStyle(generateStyle, generateComponentTheme),
|
|
|
185
189
|
entry: entry,
|
|
186
190
|
guid: "".concat(_this.props.bankEntry.id, "_bank_entry_edit"),
|
|
187
191
|
handleQuizEntryPointsChange: _this.handlePointsChange,
|
|
192
|
+
itemEditArea: _this.itemEditArea,
|
|
188
193
|
parentId: _this.props.bankId,
|
|
189
194
|
parentType: PARENT_TYPE_BANK,
|
|
190
195
|
shouldValidateShareableContent: true,
|
|
@@ -643,7 +648,8 @@ export var BankEntry = (_dec = withStyle(generateStyle, generateComponentTheme),
|
|
|
643
648
|
}
|
|
644
649
|
|
|
645
650
|
return jsx(Page, null, this.renderNav(), jsx("div", {
|
|
646
|
-
css: this.props.styles.content
|
|
651
|
+
css: this.props.styles.content,
|
|
652
|
+
ref: this.handleRef
|
|
647
653
|
}, this.props.iceTopNavBarEnabled && jsx("div", {
|
|
648
654
|
css: this.props.styles.breadcrumb
|
|
649
655
|
}, jsx(HeaderBreadCrumb, {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
1
3
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
4
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
5
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
@@ -30,25 +32,47 @@ export var AddToBankOptions = (_dec = withStyle(generateStyle, generateComponent
|
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
35
|
+
_this.openAddToBankModal = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
36
|
+
var displayPosition, msg;
|
|
37
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
38
|
+
while (1) {
|
|
39
|
+
switch (_context.prev = _context.next) {
|
|
40
|
+
case 0:
|
|
41
|
+
displayPosition = _this.props.displayPosition;
|
|
33
42
|
|
|
34
|
-
|
|
35
|
-
|
|
43
|
+
if (!_this.props.isValid) {
|
|
44
|
+
_context.next = 5;
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
36
47
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
});
|
|
41
|
-
} else {
|
|
42
|
-
var msg = t('{entryType} {displayPosition, number} cannot be saved due to invalid input data.', {
|
|
43
|
-
entryType: _this.props.entryType,
|
|
44
|
-
displayPosition: displayPosition
|
|
45
|
-
});
|
|
48
|
+
_this.props.openModal([ADD_TO_BANK_MODAL, _this.props.entryType, _this.props.guid].join(':'), {
|
|
49
|
+
modalTrigger: _this.addToBankLink
|
|
50
|
+
});
|
|
46
51
|
|
|
47
|
-
|
|
52
|
+
_context.next = 10;
|
|
53
|
+
break;
|
|
48
54
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
55
|
+
case 5:
|
|
56
|
+
msg = t('{entryType} {displayPosition, number} cannot be saved due to invalid input data.', {
|
|
57
|
+
entryType: _this.props.entryType,
|
|
58
|
+
displayPosition: displayPosition
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
_this.props.screenreaderNotification(msg);
|
|
62
|
+
|
|
63
|
+
_context.next = 9;
|
|
64
|
+
return _this.props.showError(_this.props.guid);
|
|
65
|
+
|
|
66
|
+
case 9:
|
|
67
|
+
_this.props.focusFirstErrorField();
|
|
68
|
+
|
|
69
|
+
case 10:
|
|
70
|
+
case "end":
|
|
71
|
+
return _context.stop();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}, _callee);
|
|
75
|
+
}));
|
|
52
76
|
|
|
53
77
|
_this.storeAddToBankLinkRef = function (c) {
|
|
54
78
|
_this.addToBankLink = c;
|
|
@@ -78,11 +102,14 @@ export var AddToBankOptions = (_dec = withStyle(generateStyle, generateComponent
|
|
|
78
102
|
}(Component), _class2.propTypes = {
|
|
79
103
|
displayPosition: PropTypes.number.isRequired,
|
|
80
104
|
entryType: PropTypes.string.isRequired,
|
|
105
|
+
focusFirstErrorField: PropTypes.func,
|
|
81
106
|
guid: PropTypes.string.isRequired,
|
|
82
107
|
isValid: PropTypes.bool.isRequired,
|
|
83
108
|
openModal: PropTypes.func.isRequired,
|
|
84
109
|
screenreaderNotification: PropTypes.func.isRequired,
|
|
85
110
|
showError: PropTypes.func.isRequired,
|
|
86
111
|
styles: PropTypes.object
|
|
112
|
+
}, _class2.defaultProps = {
|
|
113
|
+
focusFirstErrorField: function focusFirstErrorField() {}
|
|
87
114
|
}, _temp)) || _class);
|
|
88
115
|
export default AddToBankOptions;
|
|
@@ -14,6 +14,7 @@ import { List } from 'immutable';
|
|
|
14
14
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
15
15
|
import pick from 'lodash/pick';
|
|
16
16
|
import partial from 'lodash/partial';
|
|
17
|
+
import ReactDOM from 'react-dom';
|
|
17
18
|
import { withStyle, jsx } from '@instructure/emotion';
|
|
18
19
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
19
20
|
import WarningWrapper from "../../../../../common/components/resources/WarningWrapper/index.js";
|
|
@@ -63,6 +64,7 @@ export var QuizEntry = (_dec = withStyle(generateStyle, generateComponentTheme),
|
|
|
63
64
|
return jsx(AddToBankOptions, {
|
|
64
65
|
displayPosition: _this.props.displayPosition,
|
|
65
66
|
entryType: _this.props.quizEntry.entryType,
|
|
67
|
+
focusFirstErrorField: _this.focusFirstErrorField,
|
|
66
68
|
guid: _this.props.guid,
|
|
67
69
|
isValid: _this.props.workingEntry.isValid(),
|
|
68
70
|
openModal: _this.props.openModal,
|
|
@@ -80,6 +82,18 @@ export var QuizEntry = (_dec = withStyle(generateStyle, generateComponentTheme),
|
|
|
80
82
|
_this.props.changeQuizEntryPoints(_this.props.quizEntry.id, points);
|
|
81
83
|
};
|
|
82
84
|
|
|
85
|
+
_this.handleRef = function (node) {
|
|
86
|
+
_this.itemEditArea = node;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
_this.focusFirstErrorField = function () {
|
|
90
|
+
if (_this.itemEditArea) {
|
|
91
|
+
var editArea = ReactDOM.findDOMNode(_this.itemEditArea);
|
|
92
|
+
var firstErrorField = editArea === null || editArea === void 0 ? void 0 : editArea.querySelector('[aria-invalid="true"]');
|
|
93
|
+
firstErrorField && firstErrorField.focus();
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
83
97
|
_this.renderPrintableItemBankSample = function (sampleItem, index) {
|
|
84
98
|
var quizEntry = QuizEntryRecord.create(sampleItem.toObject());
|
|
85
99
|
var entryMutable = quizEntry.entry.toJS();
|
|
@@ -166,7 +180,8 @@ export var QuizEntry = (_dec = withStyle(generateStyle, generateComponentTheme),
|
|
|
166
180
|
initialFocusId: this.props.initialFocusId,
|
|
167
181
|
handleValidationErrorsFromApi: this.props.handleValidationErrorsFromApi,
|
|
168
182
|
clearValidationErrorsFromApi: this.props.clearValidationErrorsFromApi,
|
|
169
|
-
haveValidationErrorsFromApi: Boolean(Object.values(this.props.validationErrorsFromApi).length)
|
|
183
|
+
haveValidationErrorsFromApi: Boolean(Object.values(this.props.validationErrorsFromApi).length),
|
|
184
|
+
itemEditArea: this.itemEditArea
|
|
170
185
|
}, pick(this.props, ['displayPosition', 'guid', 'draggingOnBuild', 'newHoverPosition', 'quizEntry', 'quizEntries', 'quizId', 'isContentLockedByBlueprint', 'setUi', 'switchOffEditing', 'switchOnEditing', 'shouldClone', 'scrollKey', 'editQuizEntryToggle', 'onEditQuizEntryToggle', 'stimulusOrientation']));
|
|
171
186
|
}
|
|
172
187
|
}, {
|
|
@@ -321,7 +336,8 @@ export var QuizEntry = (_dec = withStyle(generateStyle, generateComponentTheme),
|
|
|
321
336
|
key: "render",
|
|
322
337
|
value: function render() {
|
|
323
338
|
return this.props.connectDropTarget(jsx("div", {
|
|
324
|
-
tabIndex: "-1"
|
|
339
|
+
tabIndex: "-1",
|
|
340
|
+
ref: this.handleRef
|
|
325
341
|
}, this.renderQuizEntryByType()));
|
|
326
342
|
}
|
|
327
343
|
}]);
|
|
@@ -211,7 +211,8 @@ export var QuizEntryEditFooter = (_dec = withStyle(generateStyle, generateCompon
|
|
|
211
211
|
guid: this.props.guid,
|
|
212
212
|
isValid: this.props.isValid,
|
|
213
213
|
submitHandler: this.props.successfulSubmit,
|
|
214
|
-
initialFocusId: this.props.initialFocusId
|
|
214
|
+
initialFocusId: this.props.initialFocusId,
|
|
215
|
+
itemEditArea: this.props.itemEditArea
|
|
215
216
|
});
|
|
216
217
|
}
|
|
217
218
|
}, {
|
|
@@ -245,6 +246,7 @@ export var QuizEntryEditFooter = (_dec = withStyle(generateStyle, generateCompon
|
|
|
245
246
|
guid: PropTypes.string.isRequired,
|
|
246
247
|
initialFocusId: PropTypes.string,
|
|
247
248
|
isValid: PropTypes.bool.isRequired,
|
|
249
|
+
itemEditArea: PropTypes.object,
|
|
248
250
|
openModal: PropTypes.func.isRequired,
|
|
249
251
|
quizEntry: ImmutablePropTypes.record.isRequired,
|
|
250
252
|
setUi: PropTypes.func.isRequired,
|
|
@@ -259,6 +261,7 @@ export var QuizEntryEditFooter = (_dec = withStyle(generateStyle, generateCompon
|
|
|
259
261
|
alternativeRightFooter: null,
|
|
260
262
|
disableSubmit: false,
|
|
261
263
|
initialFocusId: null,
|
|
264
|
+
itemEditArea: null,
|
|
262
265
|
shouldClone: false
|
|
263
266
|
}, _temp)) || _class);
|
|
264
267
|
export default QuizEntryEditFooter;
|
|
@@ -370,7 +370,7 @@ var QuizEntryEdit = (_dec = withStyle(generateStyle, generateComponentTheme), _d
|
|
|
370
370
|
value: function renderFooter() {
|
|
371
371
|
var isItemOrBankEntry = this.props.quizEntry.isItem || this.props.quizEntry.isBankEntry;
|
|
372
372
|
if (!(isItemOrBankEntry || this.props.disabledForRegrade)) return;
|
|
373
|
-
var footerProps = pick(this.props, ['alternativeRightFooter', 'changeQuizEntryPoints', 'clearTemporaryItem', 'displayPosition', 'entry', 'guid', 'initialFocusId', 'openModal', 'quizEntry', 'setUi', 'shouldClone', 'workingQuizEntry']);
|
|
373
|
+
var footerProps = pick(this.props, ['alternativeRightFooter', 'changeQuizEntryPoints', 'clearTemporaryItem', 'displayPosition', 'entry', 'guid', 'initialFocusId', 'itemEditArea', 'openModal', 'quizEntry', 'setUi', 'shouldClone', 'workingQuizEntry']);
|
|
374
374
|
return jsx(QuizEntryEditFooter, Object.assign({
|
|
375
375
|
clearChanges: this.clearChanges,
|
|
376
376
|
isValid: this.isValid(),
|
|
@@ -466,6 +466,7 @@ var QuizEntryEdit = (_dec = withStyle(generateStyle, generateComponentTheme), _d
|
|
|
466
466
|
// from connected component
|
|
467
467
|
initialFocusId: PropTypes.string,
|
|
468
468
|
isOccluded: PropTypes.bool,
|
|
469
|
+
itemEditArea: PropTypes.object,
|
|
469
470
|
name: PropTypes.string,
|
|
470
471
|
newActiveBank: PropTypes.func,
|
|
471
472
|
nextQuizEntry: ImmutablePropTypes.map,
|
|
@@ -501,6 +502,7 @@ var QuizEntryEdit = (_dec = withStyle(generateStyle, generateComponentTheme), _d
|
|
|
501
502
|
haveValidationErrorsFromApi: false,
|
|
502
503
|
initialFocusId: null,
|
|
503
504
|
isOccluded: false,
|
|
505
|
+
itemEditArea: null,
|
|
504
506
|
name: null,
|
|
505
507
|
nextQuizEntry: null,
|
|
506
508
|
newActiveBank: null,
|
|
@@ -112,7 +112,8 @@ export var Timer = (_dec = withStyle(generateStyle, generateComponentTheme), _de
|
|
|
112
112
|
}, {
|
|
113
113
|
key: "renderHelpScreenreaderText",
|
|
114
114
|
value: function renderHelpScreenreaderText() {
|
|
115
|
-
|
|
115
|
+
// command based on operating system
|
|
116
|
+
var shortcutKey = platform.os.toString().startsWith('OS X') ? t('Option+Shift+T') : t('Alt+Shift+T');
|
|
116
117
|
return jsx(ScreenReaderContent, null, t('During the quiz, press {shortcutKey} to have the remaining time read', {
|
|
117
118
|
shortcutKey: shortcutKey
|
|
118
119
|
}));
|
|
@@ -7,6 +7,7 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
7
7
|
import React, { Component } from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
10
|
+
import ReactDOM from 'react-dom';
|
|
10
11
|
import { Button } from '@instructure/ui-buttons';
|
|
11
12
|
import { View } from '@instructure/ui-view';
|
|
12
13
|
import { API_INPUT_VALIDATION_ERROR } from '@instructure/quiz-common';
|
|
@@ -100,21 +101,59 @@ export var EntrySave = /*#__PURE__*/function (_Component) {
|
|
|
100
101
|
}());
|
|
101
102
|
};
|
|
102
103
|
|
|
103
|
-
_this.onSubmit = function (
|
|
104
|
-
|
|
104
|
+
_this.onSubmit = /*#__PURE__*/function () {
|
|
105
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(e) {
|
|
106
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
107
|
+
while (1) {
|
|
108
|
+
switch (_context2.prev = _context2.next) {
|
|
109
|
+
case 0:
|
|
110
|
+
e.preventDefault();
|
|
111
|
+
|
|
112
|
+
if (!_this.props.isValid) {
|
|
113
|
+
_context2.next = 5;
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (_this.props.checkBankedContentShareabilityEnabled && _this.props.shouldValidateShareableContent) {
|
|
118
|
+
_this.confirmShareableContent();
|
|
119
|
+
} else {
|
|
120
|
+
_this.successfulSubmit();
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
_context2.next = 10;
|
|
124
|
+
break;
|
|
125
|
+
|
|
126
|
+
case 5:
|
|
127
|
+
_this.createScreenReaderNotification();
|
|
128
|
+
|
|
129
|
+
_context2.next = 8;
|
|
130
|
+
return _this.props.showError(_this.props.guid);
|
|
105
131
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
_this.confirmShareableContent();
|
|
109
|
-
} else {
|
|
110
|
-
_this.successfulSubmit();
|
|
111
|
-
}
|
|
112
|
-
} else {
|
|
113
|
-
_this.createScreenReaderNotification();
|
|
132
|
+
case 8:
|
|
133
|
+
_this.props.clearNextQuizEntry();
|
|
114
134
|
|
|
115
|
-
|
|
135
|
+
_this.focusFirstErrorField();
|
|
116
136
|
|
|
117
|
-
|
|
137
|
+
case 10:
|
|
138
|
+
case "end":
|
|
139
|
+
return _context2.stop();
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}, _callee2);
|
|
143
|
+
}));
|
|
144
|
+
|
|
145
|
+
return function (_x2) {
|
|
146
|
+
return _ref2.apply(this, arguments);
|
|
147
|
+
};
|
|
148
|
+
}();
|
|
149
|
+
|
|
150
|
+
_this.focusFirstErrorField = function () {
|
|
151
|
+
var itemEditArea = _this.props.itemEditArea;
|
|
152
|
+
|
|
153
|
+
if (itemEditArea) {
|
|
154
|
+
var editArea = ReactDOM.findDOMNode(itemEditArea);
|
|
155
|
+
var firstErrorField = editArea === null || editArea === void 0 ? void 0 : editArea.querySelector('[aria-invalid="true"]');
|
|
156
|
+
firstErrorField && firstErrorField.focus();
|
|
118
157
|
}
|
|
119
158
|
};
|
|
120
159
|
|
|
@@ -152,24 +191,24 @@ export var EntrySave = /*#__PURE__*/function (_Component) {
|
|
|
152
191
|
}, {
|
|
153
192
|
key: "successfulSubmit",
|
|
154
193
|
value: function () {
|
|
155
|
-
var _successfulSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
194
|
+
var _successfulSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
156
195
|
var validationResult;
|
|
157
|
-
return _regeneratorRuntime.wrap(function
|
|
196
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
158
197
|
while (1) {
|
|
159
|
-
switch (
|
|
198
|
+
switch (_context3.prev = _context3.next) {
|
|
160
199
|
case 0:
|
|
161
200
|
this.setState({
|
|
162
201
|
canSubmit: false
|
|
163
202
|
});
|
|
164
|
-
|
|
165
|
-
|
|
203
|
+
_context3.prev = 1;
|
|
204
|
+
_context3.next = 4;
|
|
166
205
|
return this.props.submitHandler();
|
|
167
206
|
|
|
168
207
|
case 4:
|
|
169
|
-
validationResult =
|
|
208
|
+
validationResult = _context3.sent;
|
|
170
209
|
|
|
171
210
|
if (!(validationResult === API_INPUT_VALIDATION_ERROR)) {
|
|
172
|
-
|
|
211
|
+
_context3.next = 8;
|
|
173
212
|
break;
|
|
174
213
|
}
|
|
175
214
|
|
|
@@ -177,16 +216,16 @@ export var EntrySave = /*#__PURE__*/function (_Component) {
|
|
|
177
216
|
throw new Error('User input validation error received from API.');
|
|
178
217
|
|
|
179
218
|
case 8:
|
|
180
|
-
|
|
219
|
+
_context3.next = 14;
|
|
181
220
|
break;
|
|
182
221
|
|
|
183
222
|
case 10:
|
|
184
|
-
|
|
185
|
-
|
|
223
|
+
_context3.prev = 10;
|
|
224
|
+
_context3.t0 = _context3["catch"](1);
|
|
186
225
|
this.setState({
|
|
187
226
|
canSubmit: true
|
|
188
227
|
});
|
|
189
|
-
return
|
|
228
|
+
return _context3.abrupt("return");
|
|
190
229
|
|
|
191
230
|
case 14:
|
|
192
231
|
this.props.switchOffEditing();
|
|
@@ -195,10 +234,10 @@ export var EntrySave = /*#__PURE__*/function (_Component) {
|
|
|
195
234
|
|
|
196
235
|
case 17:
|
|
197
236
|
case "end":
|
|
198
|
-
return
|
|
237
|
+
return _context3.stop();
|
|
199
238
|
}
|
|
200
239
|
}
|
|
201
|
-
},
|
|
240
|
+
}, _callee3, this, [[1, 10]]);
|
|
202
241
|
}));
|
|
203
242
|
|
|
204
243
|
function successfulSubmit() {
|
|
@@ -247,6 +286,7 @@ EntrySave.propTypes = {
|
|
|
247
286
|
hideError: PropTypes.func.isRequired,
|
|
248
287
|
initialFocusId: PropTypes.string,
|
|
249
288
|
isValid: PropTypes.bool.isRequired,
|
|
289
|
+
itemEditArea: PropTypes.object,
|
|
250
290
|
showError: PropTypes.func.isRequired,
|
|
251
291
|
screenreaderNotification: PropTypes.func.isRequired,
|
|
252
292
|
shouldValidateShareableContent: PropTypes.bool,
|
|
@@ -264,6 +304,7 @@ EntrySave.defaultProps = {
|
|
|
264
304
|
disableSubmit: false,
|
|
265
305
|
guid: null,
|
|
266
306
|
initialFocusId: null,
|
|
307
|
+
itemEditArea: null,
|
|
267
308
|
shouldValidateShareableContent: false
|
|
268
309
|
};
|
|
269
310
|
export default EntrySave;
|
|
@@ -381,6 +381,7 @@ export var StimulusEdit = (_dec = withStyle(generateStyle, generateComponentThem
|
|
|
381
381
|
}, jsx(AddToBankOptions, {
|
|
382
382
|
displayPosition: this.props.displayPosition,
|
|
383
383
|
entryType: this.props.quizEntry.entryType,
|
|
384
|
+
focusFirstErrorField: this.focusFirstErrorField,
|
|
384
385
|
guid: this.props.guid,
|
|
385
386
|
isValid: this.props.workingStimulus.isValid(),
|
|
386
387
|
openModal: this.props.openModal,
|
|
@@ -205,6 +205,10 @@ var BankEntry = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
|
|
|
205
205
|
}, _callee, null, [[0, 10]]);
|
|
206
206
|
}));
|
|
207
207
|
|
|
208
|
+
_this.handleRef = function (node) {
|
|
209
|
+
_this.itemEditArea = node;
|
|
210
|
+
};
|
|
211
|
+
|
|
208
212
|
_this.clearChanges = function () {
|
|
209
213
|
_this.clearValidationErrorsFromApi(_quizCommon.CLEAR_ALL_INPUT_VALIDATION_ERRORS);
|
|
210
214
|
|
|
@@ -235,6 +239,7 @@ var BankEntry = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
|
|
|
235
239
|
entry: entry,
|
|
236
240
|
guid: "".concat(_this.props.bankEntry.id, "_bank_entry_edit"),
|
|
237
241
|
handleQuizEntryPointsChange: _this.handlePointsChange,
|
|
242
|
+
itemEditArea: _this.itemEditArea,
|
|
238
243
|
parentId: _this.props.bankId,
|
|
239
244
|
parentType: _quizCommon.PARENT_TYPE_BANK,
|
|
240
245
|
shouldValidateShareableContent: true,
|
|
@@ -693,7 +698,8 @@ var BankEntry = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
|
|
|
693
698
|
}
|
|
694
699
|
|
|
695
700
|
return (0, _emotion.jsx)(_index6.default, null, this.renderNav(), (0, _emotion.jsx)("div", {
|
|
696
|
-
css: this.props.styles.content
|
|
701
|
+
css: this.props.styles.content,
|
|
702
|
+
ref: this.handleRef
|
|
697
703
|
}, this.props.iceTopNavBarEnabled && (0, _emotion.jsx)("div", {
|
|
698
704
|
css: this.props.styles.breadcrumb
|
|
699
705
|
}, (0, _emotion.jsx)(_index.HeaderBreadCrumb, {
|
|
@@ -7,6 +7,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = exports.AddToBankOptions = void 0;
|
|
9
9
|
|
|
10
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
+
|
|
12
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
+
|
|
10
14
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
15
|
|
|
12
16
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -50,25 +54,47 @@ var AddToBankOptions = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.d
|
|
|
50
54
|
}
|
|
51
55
|
|
|
52
56
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
57
|
+
_this.openAddToBankModal = /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
58
|
+
var displayPosition, msg;
|
|
59
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
60
|
+
while (1) {
|
|
61
|
+
switch (_context.prev = _context.next) {
|
|
62
|
+
case 0:
|
|
63
|
+
displayPosition = _this.props.displayPosition;
|
|
64
|
+
|
|
65
|
+
if (!_this.props.isValid) {
|
|
66
|
+
_context.next = 5;
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
_this.props.openModal([_quizCommon.ADD_TO_BANK_MODAL, _this.props.entryType, _this.props.guid].join(':'), {
|
|
71
|
+
modalTrigger: _this.addToBankLink
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
_context.next = 10;
|
|
75
|
+
break;
|
|
76
|
+
|
|
77
|
+
case 5:
|
|
78
|
+
msg = (0, _formatMessage.default)('{entryType} {displayPosition, number} cannot be saved due to invalid input data.', {
|
|
79
|
+
entryType: _this.props.entryType,
|
|
80
|
+
displayPosition: displayPosition
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
_this.props.screenreaderNotification(msg);
|
|
84
|
+
|
|
85
|
+
_context.next = 9;
|
|
86
|
+
return _this.props.showError(_this.props.guid);
|
|
87
|
+
|
|
88
|
+
case 9:
|
|
89
|
+
_this.props.focusFirstErrorField();
|
|
90
|
+
|
|
91
|
+
case 10:
|
|
92
|
+
case "end":
|
|
93
|
+
return _context.stop();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}, _callee);
|
|
97
|
+
}));
|
|
72
98
|
|
|
73
99
|
_this.storeAddToBankLinkRef = function (c) {
|
|
74
100
|
_this.addToBankLink = c;
|
|
@@ -97,12 +123,15 @@ var AddToBankOptions = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.d
|
|
|
97
123
|
}(_react.Component), _class2.propTypes = {
|
|
98
124
|
displayPosition: _propTypes.default.number.isRequired,
|
|
99
125
|
entryType: _propTypes.default.string.isRequired,
|
|
126
|
+
focusFirstErrorField: _propTypes.default.func,
|
|
100
127
|
guid: _propTypes.default.string.isRequired,
|
|
101
128
|
isValid: _propTypes.default.bool.isRequired,
|
|
102
129
|
openModal: _propTypes.default.func.isRequired,
|
|
103
130
|
screenreaderNotification: _propTypes.default.func.isRequired,
|
|
104
131
|
showError: _propTypes.default.func.isRequired,
|
|
105
132
|
styles: _propTypes.default.object
|
|
133
|
+
}, _class2.defaultProps = {
|
|
134
|
+
focusFirstErrorField: function focusFirstErrorField() {}
|
|
106
135
|
}, _temp)) || _class);
|
|
107
136
|
exports.AddToBankOptions = AddToBankOptions;
|
|
108
137
|
var _default = AddToBankOptions;
|
|
@@ -31,6 +31,8 @@ var _pick = _interopRequireDefault(require("lodash/pick"));
|
|
|
31
31
|
|
|
32
32
|
var _partial = _interopRequireDefault(require("lodash/partial"));
|
|
33
33
|
|
|
34
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
35
|
+
|
|
34
36
|
var _emotion = require("@instructure/emotion");
|
|
35
37
|
|
|
36
38
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
@@ -101,6 +103,7 @@ var QuizEntry = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
|
|
|
101
103
|
return (0, _emotion.jsx)(_index7.default, {
|
|
102
104
|
displayPosition: _this.props.displayPosition,
|
|
103
105
|
entryType: _this.props.quizEntry.entryType,
|
|
106
|
+
focusFirstErrorField: _this.focusFirstErrorField,
|
|
104
107
|
guid: _this.props.guid,
|
|
105
108
|
isValid: _this.props.workingEntry.isValid(),
|
|
106
109
|
openModal: _this.props.openModal,
|
|
@@ -118,6 +121,19 @@ var QuizEntry = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
|
|
|
118
121
|
_this.props.changeQuizEntryPoints(_this.props.quizEntry.id, points);
|
|
119
122
|
};
|
|
120
123
|
|
|
124
|
+
_this.handleRef = function (node) {
|
|
125
|
+
_this.itemEditArea = node;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
_this.focusFirstErrorField = function () {
|
|
129
|
+
if (_this.itemEditArea) {
|
|
130
|
+
var editArea = _reactDom.default.findDOMNode(_this.itemEditArea);
|
|
131
|
+
|
|
132
|
+
var firstErrorField = editArea === null || editArea === void 0 ? void 0 : editArea.querySelector('[aria-invalid="true"]');
|
|
133
|
+
firstErrorField && firstErrorField.focus();
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
|
|
121
137
|
_this.renderPrintableItemBankSample = function (sampleItem, index) {
|
|
122
138
|
var quizEntry = _QuizEntry.default.create(sampleItem.toObject());
|
|
123
139
|
|
|
@@ -205,7 +221,8 @@ var QuizEntry = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
|
|
|
205
221
|
initialFocusId: this.props.initialFocusId,
|
|
206
222
|
handleValidationErrorsFromApi: this.props.handleValidationErrorsFromApi,
|
|
207
223
|
clearValidationErrorsFromApi: this.props.clearValidationErrorsFromApi,
|
|
208
|
-
haveValidationErrorsFromApi: Boolean(Object.values(this.props.validationErrorsFromApi).length)
|
|
224
|
+
haveValidationErrorsFromApi: Boolean(Object.values(this.props.validationErrorsFromApi).length),
|
|
225
|
+
itemEditArea: this.itemEditArea
|
|
209
226
|
}, (0, _pick.default)(this.props, ['displayPosition', 'guid', 'draggingOnBuild', 'newHoverPosition', 'quizEntry', 'quizEntries', 'quizId', 'isContentLockedByBlueprint', 'setUi', 'switchOffEditing', 'switchOnEditing', 'shouldClone', 'scrollKey', 'editQuizEntryToggle', 'onEditQuizEntryToggle', 'stimulusOrientation']));
|
|
210
227
|
}
|
|
211
228
|
}, {
|
|
@@ -360,7 +377,8 @@ var QuizEntry = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
|
|
|
360
377
|
key: "render",
|
|
361
378
|
value: function render() {
|
|
362
379
|
return this.props.connectDropTarget((0, _emotion.jsx)("div", {
|
|
363
|
-
tabIndex: "-1"
|
|
380
|
+
tabIndex: "-1",
|
|
381
|
+
ref: this.handleRef
|
|
364
382
|
}, this.renderQuizEntryByType()));
|
|
365
383
|
}
|
|
366
384
|
}]);
|
|
@@ -238,7 +238,8 @@ var QuizEntryEditFooter = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
238
238
|
guid: this.props.guid,
|
|
239
239
|
isValid: this.props.isValid,
|
|
240
240
|
submitHandler: this.props.successfulSubmit,
|
|
241
|
-
initialFocusId: this.props.initialFocusId
|
|
241
|
+
initialFocusId: this.props.initialFocusId,
|
|
242
|
+
itemEditArea: this.props.itemEditArea
|
|
242
243
|
});
|
|
243
244
|
}
|
|
244
245
|
}, {
|
|
@@ -271,6 +272,7 @@ var QuizEntryEditFooter = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
271
272
|
guid: _propTypes.default.string.isRequired,
|
|
272
273
|
initialFocusId: _propTypes.default.string,
|
|
273
274
|
isValid: _propTypes.default.bool.isRequired,
|
|
275
|
+
itemEditArea: _propTypes.default.object,
|
|
274
276
|
openModal: _propTypes.default.func.isRequired,
|
|
275
277
|
quizEntry: _reactImmutableProptypes.default.record.isRequired,
|
|
276
278
|
setUi: _propTypes.default.func.isRequired,
|
|
@@ -285,6 +287,7 @@ var QuizEntryEditFooter = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
285
287
|
alternativeRightFooter: null,
|
|
286
288
|
disableSubmit: false,
|
|
287
289
|
initialFocusId: null,
|
|
290
|
+
itemEditArea: null,
|
|
288
291
|
shouldClone: false
|
|
289
292
|
}, _temp)) || _class);
|
|
290
293
|
exports.QuizEntryEditFooter = QuizEntryEditFooter;
|
|
@@ -402,7 +402,7 @@ var QuizEntryEdit = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defa
|
|
|
402
402
|
value: function renderFooter() {
|
|
403
403
|
var isItemOrBankEntry = this.props.quizEntry.isItem || this.props.quizEntry.isBankEntry;
|
|
404
404
|
if (!(isItemOrBankEntry || this.props.disabledForRegrade)) return;
|
|
405
|
-
var footerProps = (0, _pick.default)(this.props, ['alternativeRightFooter', 'changeQuizEntryPoints', 'clearTemporaryItem', 'displayPosition', 'entry', 'guid', 'initialFocusId', 'openModal', 'quizEntry', 'setUi', 'shouldClone', 'workingQuizEntry']);
|
|
405
|
+
var footerProps = (0, _pick.default)(this.props, ['alternativeRightFooter', 'changeQuizEntryPoints', 'clearTemporaryItem', 'displayPosition', 'entry', 'guid', 'initialFocusId', 'itemEditArea', 'openModal', 'quizEntry', 'setUi', 'shouldClone', 'workingQuizEntry']);
|
|
406
406
|
return (0, _emotion.jsx)(_index4.default, Object.assign({
|
|
407
407
|
clearChanges: this.clearChanges,
|
|
408
408
|
isValid: this.isValid(),
|
|
@@ -497,6 +497,7 @@ var QuizEntryEdit = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defa
|
|
|
497
497
|
// from connected component
|
|
498
498
|
initialFocusId: _propTypes.default.string,
|
|
499
499
|
isOccluded: _propTypes.default.bool,
|
|
500
|
+
itemEditArea: _propTypes.default.object,
|
|
500
501
|
name: _propTypes.default.string,
|
|
501
502
|
newActiveBank: _propTypes.default.func,
|
|
502
503
|
nextQuizEntry: _reactImmutableProptypes.default.map,
|
|
@@ -532,6 +533,7 @@ var QuizEntryEdit = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defa
|
|
|
532
533
|
haveValidationErrorsFromApi: false,
|
|
533
534
|
initialFocusId: null,
|
|
534
535
|
isOccluded: false,
|
|
536
|
+
itemEditArea: null,
|
|
535
537
|
name: null,
|
|
536
538
|
nextQuizEntry: null,
|
|
537
539
|
newActiveBank: null,
|
|
@@ -139,7 +139,8 @@ var Timer = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
139
139
|
}, {
|
|
140
140
|
key: "renderHelpScreenreaderText",
|
|
141
141
|
value: function renderHelpScreenreaderText() {
|
|
142
|
-
|
|
142
|
+
// command based on operating system
|
|
143
|
+
var shortcutKey = platform.os.toString().startsWith('OS X') ? (0, _formatMessage.default)('Option+Shift+T') : (0, _formatMessage.default)('Alt+Shift+T');
|
|
143
144
|
return (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('During the quiz, press {shortcutKey} to have the remaining time read', {
|
|
144
145
|
shortcutKey: shortcutKey
|
|
145
146
|
}));
|
|
@@ -27,6 +27,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
27
27
|
|
|
28
28
|
var _reactImmutableProptypes = _interopRequireDefault(require("react-immutable-proptypes"));
|
|
29
29
|
|
|
30
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
31
|
+
|
|
30
32
|
var _uiButtons = require("@instructure/ui-buttons");
|
|
31
33
|
|
|
32
34
|
var _uiView = require("@instructure/ui-view");
|
|
@@ -125,21 +127,60 @@ var EntrySave = /*#__PURE__*/function (_Component) {
|
|
|
125
127
|
}());
|
|
126
128
|
};
|
|
127
129
|
|
|
128
|
-
_this.onSubmit = function (
|
|
129
|
-
|
|
130
|
+
_this.onSubmit = /*#__PURE__*/function () {
|
|
131
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(e) {
|
|
132
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
133
|
+
while (1) {
|
|
134
|
+
switch (_context2.prev = _context2.next) {
|
|
135
|
+
case 0:
|
|
136
|
+
e.preventDefault();
|
|
137
|
+
|
|
138
|
+
if (!_this.props.isValid) {
|
|
139
|
+
_context2.next = 5;
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (_this.props.checkBankedContentShareabilityEnabled && _this.props.shouldValidateShareableContent) {
|
|
144
|
+
_this.confirmShareableContent();
|
|
145
|
+
} else {
|
|
146
|
+
_this.successfulSubmit();
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
_context2.next = 10;
|
|
150
|
+
break;
|
|
151
|
+
|
|
152
|
+
case 5:
|
|
153
|
+
_this.createScreenReaderNotification();
|
|
154
|
+
|
|
155
|
+
_context2.next = 8;
|
|
156
|
+
return _this.props.showError(_this.props.guid);
|
|
130
157
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
158
|
+
case 8:
|
|
159
|
+
_this.props.clearNextQuizEntry();
|
|
160
|
+
|
|
161
|
+
_this.focusFirstErrorField();
|
|
162
|
+
|
|
163
|
+
case 10:
|
|
164
|
+
case "end":
|
|
165
|
+
return _context2.stop();
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}, _callee2);
|
|
169
|
+
}));
|
|
170
|
+
|
|
171
|
+
return function (_x2) {
|
|
172
|
+
return _ref2.apply(this, arguments);
|
|
173
|
+
};
|
|
174
|
+
}();
|
|
175
|
+
|
|
176
|
+
_this.focusFirstErrorField = function () {
|
|
177
|
+
var itemEditArea = _this.props.itemEditArea;
|
|
139
178
|
|
|
140
|
-
|
|
179
|
+
if (itemEditArea) {
|
|
180
|
+
var editArea = _reactDom.default.findDOMNode(itemEditArea);
|
|
141
181
|
|
|
142
|
-
|
|
182
|
+
var firstErrorField = editArea === null || editArea === void 0 ? void 0 : editArea.querySelector('[aria-invalid="true"]');
|
|
183
|
+
firstErrorField && firstErrorField.focus();
|
|
143
184
|
}
|
|
144
185
|
};
|
|
145
186
|
|
|
@@ -177,24 +218,24 @@ var EntrySave = /*#__PURE__*/function (_Component) {
|
|
|
177
218
|
}, {
|
|
178
219
|
key: "successfulSubmit",
|
|
179
220
|
value: function () {
|
|
180
|
-
var _successfulSubmit = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
221
|
+
var _successfulSubmit = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
181
222
|
var validationResult;
|
|
182
|
-
return _regenerator.default.wrap(function
|
|
223
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
183
224
|
while (1) {
|
|
184
|
-
switch (
|
|
225
|
+
switch (_context3.prev = _context3.next) {
|
|
185
226
|
case 0:
|
|
186
227
|
this.setState({
|
|
187
228
|
canSubmit: false
|
|
188
229
|
});
|
|
189
|
-
|
|
190
|
-
|
|
230
|
+
_context3.prev = 1;
|
|
231
|
+
_context3.next = 4;
|
|
191
232
|
return this.props.submitHandler();
|
|
192
233
|
|
|
193
234
|
case 4:
|
|
194
|
-
validationResult =
|
|
235
|
+
validationResult = _context3.sent;
|
|
195
236
|
|
|
196
237
|
if (!(validationResult === _quizCommon.API_INPUT_VALIDATION_ERROR)) {
|
|
197
|
-
|
|
238
|
+
_context3.next = 8;
|
|
198
239
|
break;
|
|
199
240
|
}
|
|
200
241
|
|
|
@@ -202,16 +243,16 @@ var EntrySave = /*#__PURE__*/function (_Component) {
|
|
|
202
243
|
throw new Error('User input validation error received from API.');
|
|
203
244
|
|
|
204
245
|
case 8:
|
|
205
|
-
|
|
246
|
+
_context3.next = 14;
|
|
206
247
|
break;
|
|
207
248
|
|
|
208
249
|
case 10:
|
|
209
|
-
|
|
210
|
-
|
|
250
|
+
_context3.prev = 10;
|
|
251
|
+
_context3.t0 = _context3["catch"](1);
|
|
211
252
|
this.setState({
|
|
212
253
|
canSubmit: true
|
|
213
254
|
});
|
|
214
|
-
return
|
|
255
|
+
return _context3.abrupt("return");
|
|
215
256
|
|
|
216
257
|
case 14:
|
|
217
258
|
this.props.switchOffEditing();
|
|
@@ -220,10 +261,10 @@ var EntrySave = /*#__PURE__*/function (_Component) {
|
|
|
220
261
|
|
|
221
262
|
case 17:
|
|
222
263
|
case "end":
|
|
223
|
-
return
|
|
264
|
+
return _context3.stop();
|
|
224
265
|
}
|
|
225
266
|
}
|
|
226
|
-
},
|
|
267
|
+
}, _callee3, this, [[1, 10]]);
|
|
227
268
|
}));
|
|
228
269
|
|
|
229
270
|
function successfulSubmit() {
|
|
@@ -273,6 +314,7 @@ EntrySave.propTypes = {
|
|
|
273
314
|
hideError: _propTypes.default.func.isRequired,
|
|
274
315
|
initialFocusId: _propTypes.default.string,
|
|
275
316
|
isValid: _propTypes.default.bool.isRequired,
|
|
317
|
+
itemEditArea: _propTypes.default.object,
|
|
276
318
|
showError: _propTypes.default.func.isRequired,
|
|
277
319
|
screenreaderNotification: _propTypes.default.func.isRequired,
|
|
278
320
|
shouldValidateShareableContent: _propTypes.default.bool,
|
|
@@ -290,6 +332,7 @@ EntrySave.defaultProps = {
|
|
|
290
332
|
disableSubmit: false,
|
|
291
333
|
guid: null,
|
|
292
334
|
initialFocusId: null,
|
|
335
|
+
itemEditArea: null,
|
|
293
336
|
shouldValidateShareableContent: false
|
|
294
337
|
};
|
|
295
338
|
var _default = EntrySave;
|
|
@@ -67,7 +67,8 @@ var generateStyle = function generateStyle(componentTheme, props) {
|
|
|
67
67
|
width: '100%'
|
|
68
68
|
})),
|
|
69
69
|
stimulusItem: {
|
|
70
|
-
flex: '1 1 auto'
|
|
70
|
+
flex: '1 1 auto',
|
|
71
|
+
width: '100%'
|
|
71
72
|
},
|
|
72
73
|
stimulusGroup: (0, _objectSpread6.default)((0, _objectSpread6.default)({
|
|
73
74
|
display: 'flex',
|
|
@@ -416,6 +416,7 @@ var StimulusEdit = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defau
|
|
|
416
416
|
}, (0, _emotion.jsx)(_index2.default, {
|
|
417
417
|
displayPosition: this.props.displayPosition,
|
|
418
418
|
entryType: this.props.quizEntry.entryType,
|
|
419
|
+
focusFirstErrorField: this.focusFirstErrorField,
|
|
419
420
|
guid: this.props.guid,
|
|
420
421
|
isValid: this.props.workingStimulus.isValid(),
|
|
421
422
|
openModal: this.props.openModal,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/quiz-core",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.17.1-rc.0+793cefcb1",
|
|
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.
|
|
48
|
-
"@instructure/quiz-i18n": "20.
|
|
49
|
-
"@instructure/quiz-interactions": "20.
|
|
50
|
-
"@instructure/quiz-number-input": "20.
|
|
51
|
-
"@instructure/quiz-rce": "20.
|
|
47
|
+
"@instructure/quiz-common": "20.17.1-rc.0+793cefcb1",
|
|
48
|
+
"@instructure/quiz-i18n": "20.17.1-rc.0+793cefcb1",
|
|
49
|
+
"@instructure/quiz-interactions": "20.17.1-rc.0+793cefcb1",
|
|
50
|
+
"@instructure/quiz-number-input": "20.17.1-rc.0+793cefcb1",
|
|
51
|
+
"@instructure/quiz-rce": "20.17.1-rc.0+793cefcb1",
|
|
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",
|
|
@@ -93,8 +93,8 @@
|
|
|
93
93
|
"@instructure/ui-themes": "^8.51.0",
|
|
94
94
|
"@instructure/ui-toggle-details": "^8.51.0",
|
|
95
95
|
"@instructure/ui-tooltip": "^8.51.0",
|
|
96
|
-
"@instructure/ui-top-nav-bar": "^8.
|
|
97
|
-
"@instructure/ui-tray": "
|
|
96
|
+
"@instructure/ui-top-nav-bar": "^8.55.0",
|
|
97
|
+
"@instructure/ui-tray": "8.55.1",
|
|
98
98
|
"@instructure/ui-truncate-text": "^8.51.0",
|
|
99
99
|
"@instructure/ui-utils": "^8.51.0",
|
|
100
100
|
"@instructure/ui-view": "^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.
|
|
114
|
+
"instructure-validations": "20.17.1-rc.0+793cefcb1",
|
|
115
115
|
"ipaddr.js": "^1.5.4",
|
|
116
116
|
"isomorphic-fetch": "^2.2.0",
|
|
117
117
|
"isuuid": "^0.1.0",
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
"uuid": "^3.2.1"
|
|
143
143
|
},
|
|
144
144
|
"devDependencies": {
|
|
145
|
-
"@instructure/quiz-scripts": "20.
|
|
145
|
+
"@instructure/quiz-scripts": "20.17.0",
|
|
146
146
|
"@instructure/ui-axe-check": "^8.51.0",
|
|
147
147
|
"@instructure/ui-babel-preset": "^7.22.1",
|
|
148
148
|
"@instructure/ui-karma-config": "^7.22.1",
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
"jquery": "^2.2.3",
|
|
164
164
|
"karma-junit-reporter": "^2.0.1",
|
|
165
165
|
"most-subject": "^5.3.0",
|
|
166
|
-
"quiz-presets": "20.
|
|
166
|
+
"quiz-presets": "20.17.1-rc.0+793cefcb1",
|
|
167
167
|
"react": "^16.8.6",
|
|
168
168
|
"react-addons-test-utils": "^15.6.2",
|
|
169
169
|
"react-dom": "^16.8.6",
|
|
@@ -179,5 +179,5 @@
|
|
|
179
179
|
"publishConfig": {
|
|
180
180
|
"access": "public"
|
|
181
181
|
},
|
|
182
|
-
"gitHead": "
|
|
182
|
+
"gitHead": "793cefcb1a484b93a2d896cce280df3801407bc6"
|
|
183
183
|
}
|