@instructure/quiz-core 17.38.1-rc.3 → 17.38.1-rc.5
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/banks/components/BankEntry/presenter.js +2 -2
- package/es/banks/components/BankEntryRow/presenter.js +2 -2
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +2 -2
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Header/index.js +2 -2
- package/es/building/components/resources/quizEntry/QuizEntryShow/presenter.js +4 -4
- package/es/common/components/Pin/presenter.js +2 -2
- package/es/common/components/SDKApp/index.js +2 -1
- package/es/common/components/layout/header/HeaderMenuButton/presenter.js +2 -2
- package/es/common/components/layout/sidebar/Sidebar/index.js +1 -1
- package/es/common/components/layout/sidebar/SidebarItem/presenter.js +1 -1
- package/es/common/components/layout/sidebar/Stimulus/Collection/presenter.js +2 -2
- package/es/common/components/resources/entry/EntrySave/presenter.js +3 -3
- package/es/common/components/resources/item/ItemEdit/presenter.js +1 -1
- package/es/common/components/resources/quiz/AddContent/Body/presenter.js +1 -1
- package/es/common/components/shared/drag_and_drop/DragHandle/presenter.js +4 -4
- package/es/common/records/QuizEntry.js +7 -7
- package/es/common/util/RceConfigProvider.js +23 -9
- package/lib/banks/components/BankEntry/presenter.js +2 -2
- package/lib/banks/components/BankEntryRow/presenter.js +2 -2
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +2 -2
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Header/index.js +2 -2
- package/lib/building/components/resources/quizEntry/QuizEntryShow/presenter.js +4 -4
- package/lib/common/components/Pin/presenter.js +2 -2
- package/lib/common/components/SDKApp/index.js +2 -1
- package/lib/common/components/layout/header/HeaderMenuButton/presenter.js +2 -2
- package/lib/common/components/layout/sidebar/Sidebar/index.js +1 -1
- package/lib/common/components/layout/sidebar/SidebarItem/presenter.js +1 -1
- package/lib/common/components/layout/sidebar/Stimulus/Collection/presenter.js +2 -2
- package/lib/common/components/resources/entry/EntrySave/presenter.js +3 -3
- package/lib/common/components/resources/item/ItemEdit/presenter.js +1 -1
- package/lib/common/components/resources/quiz/AddContent/Body/presenter.js +1 -1
- package/lib/common/components/shared/drag_and_drop/DragHandle/presenter.js +4 -4
- package/lib/common/records/QuizEntry.js +7 -7
- package/lib/common/util/RceConfigProvider.js +25 -9
- package/package.json +10 -10
|
@@ -537,10 +537,10 @@ export var BankEntry = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
537
537
|
|
|
538
538
|
if (this.props.entry.getWorkingInstance().hasFeedback()) {
|
|
539
539
|
icon = IconDiscussionSolid;
|
|
540
|
-
text = t('Edit
|
|
540
|
+
text = t('Edit Question Level Feedback (present)');
|
|
541
541
|
} else {
|
|
542
542
|
icon = IconDiscussionLine;
|
|
543
|
-
text = t('Edit
|
|
543
|
+
text = t('Edit Question Level Feedback');
|
|
544
544
|
}
|
|
545
545
|
|
|
546
546
|
return /*#__PURE__*/React.createElement(Button, {
|
|
@@ -176,12 +176,12 @@ export var BankEntryRow = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
176
176
|
}, {
|
|
177
177
|
key: "type",
|
|
178
178
|
value: function type() {
|
|
179
|
-
return this.isItemEntry() ? t('
|
|
179
|
+
return this.isItemEntry() ? t('Question') : t('Stimulus');
|
|
180
180
|
}
|
|
181
181
|
}, {
|
|
182
182
|
key: "entryIdentifier",
|
|
183
183
|
value: function entryIdentifier() {
|
|
184
|
-
return this.isItemEntry() ? t('
|
|
184
|
+
return this.isItemEntry() ? t('Question { itemBody }', {
|
|
185
185
|
itemBody: extractTextFromHtml(this.getEntry().title)
|
|
186
186
|
}) : t('Stimulus { title }', {
|
|
187
187
|
title: this.getEntry().title
|
|
@@ -156,10 +156,10 @@ export var QuizEntryEditFooter = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
156
156
|
|
|
157
157
|
if (workingEntry.hasFeedback()) {
|
|
158
158
|
icon = IconDiscussionSolid;
|
|
159
|
-
text = t('Edit
|
|
159
|
+
text = t('Edit Question Level Feedback (present)');
|
|
160
160
|
} else {
|
|
161
161
|
icon = IconDiscussionLine;
|
|
162
|
-
text = t('Edit
|
|
162
|
+
text = t('Edit Question Level Feedback');
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -112,7 +112,7 @@ var QuizEntryHeader = (_dec = themeable(theme, styles), _dec(_class = (_temp = _
|
|
|
112
112
|
switch (_context.prev = _context.next) {
|
|
113
113
|
case 0:
|
|
114
114
|
_this$props = _this.props, quizId = _this$props.quizId, workingQuizEntry = _this$props.workingQuizEntry, workingEntry = _this$props.workingEntry, richFITBEnabled = _this$props.richFITBEnabled, richFITBInteractionID = _this$props.richFITBInteractionID;
|
|
115
|
-
msg = t('
|
|
115
|
+
msg = t('Question {displayPosition} cannot be saved due to invalid input data.', {
|
|
116
116
|
displayPosition: _this.props.displayPosition
|
|
117
117
|
});
|
|
118
118
|
|
|
@@ -258,7 +258,7 @@ var QuizEntryHeader = (_dec = themeable(theme, styles), _dec(_class = (_temp = _
|
|
|
258
258
|
}, {
|
|
259
259
|
key: "renderLeftHeader",
|
|
260
260
|
value: function renderLeftHeader() {
|
|
261
|
-
var positionText = t('Edit
|
|
261
|
+
var positionText = t('Edit question at position {position, number}', {
|
|
262
262
|
position: this.props.displayPosition
|
|
263
263
|
});
|
|
264
264
|
var position = this.props.disabledForRegrade ? this.props.displayPosition : this.props.quizEntry.positionToDisplay(this.props.displayPosition);
|
|
@@ -76,7 +76,7 @@ var QuizEntryShow = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
if (!_this.props.quizEntryWithErrorsShowing) {
|
|
79
|
-
var msg = t('
|
|
79
|
+
var msg = t('Question switched to editing mode.');
|
|
80
80
|
|
|
81
81
|
_this.props.screenreaderNotification(msg);
|
|
82
82
|
|
|
@@ -98,7 +98,7 @@ var QuizEntryShow = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
if (_this.props.quizEntryWithErrorsShowing) {
|
|
101
|
-
_this.props.screenreaderNotification(t('
|
|
101
|
+
_this.props.screenreaderNotification(t('Question {itemPosition, number} cannot be saved due to invalid input data', {
|
|
102
102
|
itemPosition: Math.ceil(_this.props.quizEntryWithErrorsShowing.position)
|
|
103
103
|
}));
|
|
104
104
|
|
|
@@ -265,10 +265,10 @@ var QuizEntryShow = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
|
|
|
265
265
|
quizEntry = _this$props2.quizEntry,
|
|
266
266
|
stimulusOrientation = _this$props2.stimulusOrientation;
|
|
267
267
|
var positionToDisplay = this.props.quizEntry.positionToDisplay(displayPosition);
|
|
268
|
-
var positionText = t('Preview of
|
|
268
|
+
var positionText = t('Preview of question at position {position}', {
|
|
269
269
|
position: positionToDisplay
|
|
270
270
|
});
|
|
271
|
-
var srMsg = t('The following
|
|
271
|
+
var srMsg = t('The following question is a preview for the teacher. To edit this question, navigate back to the "Edit Question" button and click.');
|
|
272
272
|
var propsForDnDZone = {
|
|
273
273
|
draggingOver: draggingOver,
|
|
274
274
|
draggingAboveHalf: draggingAboveHalf
|
|
@@ -36,9 +36,9 @@ export var Pin = /*#__PURE__*/function (_Component) {
|
|
|
36
36
|
_createClass(Pin, [{
|
|
37
37
|
key: "render",
|
|
38
38
|
value: function render() {
|
|
39
|
-
var message = this.props.isPinned ? t('
|
|
39
|
+
var message = this.props.isPinned ? t('Question {position, number} is pinned. Click to unpin.', {
|
|
40
40
|
position: this.props.position
|
|
41
|
-
}) : t('
|
|
41
|
+
}) : t('Question {position, number} is unpinned. Click to pin.', {
|
|
42
42
|
position: this.props.position
|
|
43
43
|
});
|
|
44
44
|
return /*#__PURE__*/React.createElement(Button, {
|
|
@@ -162,7 +162,8 @@ export var SDKApp = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
|
|
|
162
162
|
canvasUserId: PropTypes.string.isRequired,
|
|
163
163
|
rcsHost: PropTypes.string.isRequired,
|
|
164
164
|
rcsJwt: PropTypes.string.isRequired,
|
|
165
|
-
rcsJwtRefreshFn: PropTypes.func.isRequired
|
|
165
|
+
rcsJwtRefreshFn: PropTypes.func.isRequired,
|
|
166
|
+
documentServiceHost: PropTypes.string.isRequired
|
|
166
167
|
}),
|
|
167
168
|
timeZone: PropTypes.string,
|
|
168
169
|
translations: PropTypes.objectOf(PropTypes.shape({
|
|
@@ -41,7 +41,7 @@ export var HeaderMenuButton = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
41
41
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
42
42
|
|
|
43
43
|
_this.toggleNavigator = function () {
|
|
44
|
-
var msg = _this.props.sidebarOpen ? t('Closed Question Navigator') : t('Opened Question Navigator');
|
|
44
|
+
var msg = _this.props.sidebarOpen ? t('Closed Question Navigator Menu') : t('Opened Question Navigator Menu');
|
|
45
45
|
|
|
46
46
|
_this.props.screenreaderNotification(msg);
|
|
47
47
|
|
|
@@ -69,7 +69,7 @@ export var HeaderMenuButton = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
69
69
|
onClick: this.toggleNavigator,
|
|
70
70
|
tabIndex: "0",
|
|
71
71
|
"data-automation": "sdk-hamburger-button"
|
|
72
|
-
}, _ref, /*#__PURE__*/React.createElement(ScreenReaderContent, null, sidebarOpen ? t('
|
|
72
|
+
}, _ref, /*#__PURE__*/React.createElement(ScreenReaderContent, null, sidebarOpen ? t('Hide Question Navigator Menu') : t('Show Question Navigator Menu'))));
|
|
73
73
|
}
|
|
74
74
|
}]);
|
|
75
75
|
|
|
@@ -183,7 +183,7 @@ export var Sidebar = (_dec = themeable(theme, styles), _dec(_class = (_temp = _c
|
|
|
183
183
|
"data-automation": "sidebar-toggle-button"
|
|
184
184
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
185
185
|
size: "small"
|
|
186
|
-
}, /*#__PURE__*/React.createElement(SidebarIcon, null)), /*#__PURE__*/React.createElement(ScreenReaderContent, null, sidebarOpen ? t('
|
|
186
|
+
}, /*#__PURE__*/React.createElement(SidebarIcon, null)), /*#__PURE__*/React.createElement(ScreenReaderContent, null, sidebarOpen ? t('Hide Question Navigator Menu') : t('Show Question Navigator Menu')))));
|
|
187
187
|
}
|
|
188
188
|
}, {
|
|
189
189
|
key: "renderTotalPointsPossible",
|
|
@@ -118,7 +118,7 @@ export var SidebarItem = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
118
118
|
"data-automation-item-id": itemId,
|
|
119
119
|
"data-automation": "sdk-sidebar-item-button"
|
|
120
120
|
}, /*#__PURE__*/React.createElement(AccessibleContent, {
|
|
121
|
-
alt: t('Navigate to
|
|
121
|
+
alt: t('Navigate to question at position {displayPosition}', {
|
|
122
122
|
displayPosition: displayPosition
|
|
123
123
|
})
|
|
124
124
|
}, this.renderPosition()));
|
|
@@ -102,7 +102,7 @@ export var Collection = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
102
102
|
variant: "icon",
|
|
103
103
|
onClick: this.handleSidebarHideItems,
|
|
104
104
|
icon: IconArrowOpenUpLine
|
|
105
|
-
}, /*#__PURE__*/React.createElement(ScreenReaderContent, null, t('Collapse stimulus
|
|
105
|
+
}, /*#__PURE__*/React.createElement(ScreenReaderContent, null, t('Collapse stimulus questions')))), /*#__PURE__*/React.createElement("div", null, itemComponents)));
|
|
106
106
|
}
|
|
107
107
|
}, {
|
|
108
108
|
key: "renderItemSummaryOnClosedSidear",
|
|
@@ -124,7 +124,7 @@ export var Collection = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
124
124
|
variant: "icon",
|
|
125
125
|
onClick: this.handleSidebarShowItems,
|
|
126
126
|
icon: IconArrowOpenDownLine
|
|
127
|
-
}, /*#__PURE__*/React.createElement(ScreenReaderContent, null, t('Expand stimulus
|
|
127
|
+
}, /*#__PURE__*/React.createElement(ScreenReaderContent, null, t('Expand stimulus questions')))));
|
|
128
128
|
}
|
|
129
129
|
}, {
|
|
130
130
|
key: "render",
|
|
@@ -32,7 +32,7 @@ export var EntrySave = /*#__PURE__*/function (_Component) {
|
|
|
32
32
|
|
|
33
33
|
_this.createScreenReaderNotification = function () {
|
|
34
34
|
var displayPosition = _this.props.displayPosition;
|
|
35
|
-
var msg = displayPosition === null ? t('This
|
|
35
|
+
var msg = displayPosition === null ? t('This question cannot be saved due to invalid input data.') : t('Question {displayPosition} cannot be saved due to invalid input data.', {
|
|
36
36
|
displayPosition: displayPosition
|
|
37
37
|
});
|
|
38
38
|
|
|
@@ -81,7 +81,7 @@ export var EntrySave = /*#__PURE__*/function (_Component) {
|
|
|
81
81
|
key: "componentWillUnmount",
|
|
82
82
|
value: function componentWillUnmount() {
|
|
83
83
|
this.clearChanges();
|
|
84
|
-
var msg = t('
|
|
84
|
+
var msg = t('Question editing mode turned off.');
|
|
85
85
|
this.props.screenreaderNotification(msg);
|
|
86
86
|
}
|
|
87
87
|
}, {
|
|
@@ -126,7 +126,7 @@ export var EntrySave = /*#__PURE__*/function (_Component) {
|
|
|
126
126
|
case 14:
|
|
127
127
|
this.props.switchOffEditing();
|
|
128
128
|
this.props.hideError(this.props.guid);
|
|
129
|
-
this.props.screenreaderNotification(t('Changes to
|
|
129
|
+
this.props.screenreaderNotification(t('Changes to question saved.'));
|
|
130
130
|
|
|
131
131
|
case 17:
|
|
132
132
|
case "end":
|
|
@@ -132,7 +132,7 @@ export var ItemEdit = /*#__PURE__*/function (_Component) {
|
|
|
132
132
|
var propsForInteraction = propsForInteractionEdit(this.props, this.additionalEditOptions());
|
|
133
133
|
return /*#__PURE__*/React.createElement(FormFieldGroup, {
|
|
134
134
|
messages: this.getError('onSelf'),
|
|
135
|
-
description: /*#__PURE__*/React.createElement(ScreenReaderContent, null, t('Edit
|
|
135
|
+
description: /*#__PURE__*/React.createElement(ScreenReaderContent, null, t('Edit question:')),
|
|
136
136
|
name: "edit_item_".concat(this.props.guid) // eslint-disable-line react/jsx-no-literals
|
|
137
137
|
|
|
138
138
|
}, /*#__PURE__*/React.createElement(Interaction, Object.assign({}, propsForInteraction, {
|
|
@@ -69,7 +69,7 @@ export var AddContentBody = (_dec = themeable(theme, styles), _dec(_class = (_te
|
|
|
69
69
|
|
|
70
70
|
_this.addItem = function (interactionTypeData) {
|
|
71
71
|
if (_this.props.quizEntryWithErrorsShowing) {
|
|
72
|
-
_this.props.screenreaderNotification(t('
|
|
72
|
+
_this.props.screenreaderNotification(t('Question {itemPosition, number} cannot be saved due to invalid input data', {
|
|
73
73
|
itemPosition: Math.ceil(_this.props.quizEntryWithErrorsShowing.position)
|
|
74
74
|
}));
|
|
75
75
|
} else {
|
|
@@ -41,7 +41,7 @@ export var DragHandle = /*#__PURE__*/function (_Component) {
|
|
|
41
41
|
_this.moveUp = function () {
|
|
42
42
|
_this.moveToPosition(_this.props.quizEntry.position - 1);
|
|
43
43
|
|
|
44
|
-
var msg = t('
|
|
44
|
+
var msg = t('Question moved one space up.');
|
|
45
45
|
|
|
46
46
|
_this.props.screenreaderNotification(msg);
|
|
47
47
|
};
|
|
@@ -49,7 +49,7 @@ export var DragHandle = /*#__PURE__*/function (_Component) {
|
|
|
49
49
|
_this.moveDown = function () {
|
|
50
50
|
_this.moveToPosition(_this.props.quizEntry.position + 1);
|
|
51
51
|
|
|
52
|
-
var msg = t('
|
|
52
|
+
var msg = t('Question moved one space down.');
|
|
53
53
|
|
|
54
54
|
_this.props.screenreaderNotification(msg);
|
|
55
55
|
};
|
|
@@ -57,7 +57,7 @@ export var DragHandle = /*#__PURE__*/function (_Component) {
|
|
|
57
57
|
_this.moveToTop = function () {
|
|
58
58
|
_this.moveQuizEntry(1, '');
|
|
59
59
|
|
|
60
|
-
var msg = t('
|
|
60
|
+
var msg = t('Question moved to top of assessment.');
|
|
61
61
|
|
|
62
62
|
_this.props.screenreaderNotification(msg);
|
|
63
63
|
};
|
|
@@ -65,7 +65,7 @@ export var DragHandle = /*#__PURE__*/function (_Component) {
|
|
|
65
65
|
_this.moveToBottom = function () {
|
|
66
66
|
_this.moveQuizEntry(_this.props.quizEntries.size, '');
|
|
67
67
|
|
|
68
|
-
var msg = t('
|
|
68
|
+
var msg = t('Question moved to bottom of assessment.');
|
|
69
69
|
|
|
70
70
|
_this.props.screenreaderNotification(msg);
|
|
71
71
|
};
|
|
@@ -300,9 +300,9 @@ export var QuizEntry = (_dec = withStateCache(function () {
|
|
|
300
300
|
end: displayPosition + this.numItems - 1
|
|
301
301
|
};
|
|
302
302
|
return {
|
|
303
|
-
Remove: t('Remove {type} containing
|
|
304
|
-
Edit: t('Edit {type} containing
|
|
305
|
-
Move: t('Move {type} containing
|
|
303
|
+
Remove: t('Remove {type} containing questions {start, number} through {end, number}.', opts),
|
|
304
|
+
Edit: t('Edit {type} containing questions {start, number} through {end, number}.', opts),
|
|
305
|
+
Move: t('Move {type} containing questions {start, number} through {end, number}.', opts)
|
|
306
306
|
}[verb];
|
|
307
307
|
} else if (this.numItems === 1) {
|
|
308
308
|
var _opts = {
|
|
@@ -310,9 +310,9 @@ export var QuizEntry = (_dec = withStateCache(function () {
|
|
|
310
310
|
start: displayPosition
|
|
311
311
|
};
|
|
312
312
|
return {
|
|
313
|
-
Remove: t('Remove {type} containing
|
|
314
|
-
Edit: t('Edit {type} containing
|
|
315
|
-
Move: t('Move {type} containing
|
|
313
|
+
Remove: t('Remove {type} containing question {start, number}.', _opts),
|
|
314
|
+
Edit: t('Edit {type} containing question {start, number}.', _opts),
|
|
315
|
+
Move: t('Move {type} containing question {start, number}.', _opts)
|
|
316
316
|
}[verb];
|
|
317
317
|
} else {
|
|
318
318
|
var _opts2 = {
|
|
@@ -326,7 +326,7 @@ export var QuizEntry = (_dec = withStateCache(function () {
|
|
|
326
326
|
}[verb];
|
|
327
327
|
}
|
|
328
328
|
} else {
|
|
329
|
-
type = this.isBankEntry ? t('Bank Entry') : t('
|
|
329
|
+
type = this.isBankEntry ? t('Bank Entry') : t('Question');
|
|
330
330
|
var _opts3 = {
|
|
331
331
|
verb: verb,
|
|
332
332
|
type: type,
|
|
@@ -3,8 +3,10 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
3
3
|
import React, { useState } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { connect } from "../../common/react-redux.js";
|
|
6
|
+
import store from "../../reduxStore.js";
|
|
6
7
|
import isNewRCEEnabled from "./rceChecker.js";
|
|
7
8
|
import { RceConfigContext, RceConfigKeys } from '@instructure/quiz-common';
|
|
9
|
+
import { addError } from "../actions/alerts.js";
|
|
8
10
|
|
|
9
11
|
var RceConfigProviderComponent = function RceConfigProviderComponent(props) {
|
|
10
12
|
var _useState = useState(props.rcsJwt),
|
|
@@ -12,12 +14,16 @@ var RceConfigProviderComponent = function RceConfigProviderComponent(props) {
|
|
|
12
14
|
jwt = _useState2[0],
|
|
13
15
|
setJwt = _useState2[1];
|
|
14
16
|
|
|
15
|
-
var
|
|
16
|
-
return props.useNewRce
|
|
17
|
+
var isNewRceEnabled = function isNewRceEnabled() {
|
|
18
|
+
return props.useNewRce;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
var hasAllPropsForRcs = function hasAllPropsForRcs() {
|
|
22
|
+
return !!(props.contextId && props.contextType && props.canvasUserId && props.rcsHost && props.rcsJwtRefreshFn && props.rcsJwt);
|
|
17
23
|
};
|
|
18
24
|
|
|
19
25
|
var getToken = function getToken() {
|
|
20
|
-
if (!
|
|
26
|
+
if (!hasAllPropsForRcs()) return;
|
|
21
27
|
return new Promise(function (resolve, reject) {
|
|
22
28
|
props.rcsJwtRefreshFn().then(function (response) {
|
|
23
29
|
var token = response.token;
|
|
@@ -36,14 +42,20 @@ var RceConfigProviderComponent = function RceConfigProviderComponent(props) {
|
|
|
36
42
|
});
|
|
37
43
|
};
|
|
38
44
|
|
|
45
|
+
var handleErrorFunc = function handleErrorFunc(errorMessage) {
|
|
46
|
+
store.dispatch(addError(errorMessage));
|
|
47
|
+
};
|
|
48
|
+
|
|
39
49
|
var getConfig = function getConfig() {
|
|
40
|
-
var
|
|
50
|
+
var _ref, _rendererEnhancement;
|
|
41
51
|
|
|
42
|
-
|
|
43
|
-
|
|
52
|
+
return {
|
|
53
|
+
rcs: hasAllPropsForRcs() ? (_ref = {}, _defineProperty(_ref, RceConfigKeys.useNewRce, props.useNewRce), _defineProperty(_ref, RceConfigKeys.canvasUserId, props.canvasUserId), _defineProperty(_ref, RceConfigKeys.contextId, props.contextId), _defineProperty(_ref, RceConfigKeys.contextType, props.contextType), _defineProperty(_ref, RceConfigKeys.rcsHost, props.rcsHost), _defineProperty(_ref, RceConfigKeys.rcsJwt, jwt), _defineProperty(_ref, RceConfigKeys.rcsJwtRefreshFn, refreshToken), _ref) : null,
|
|
54
|
+
rendererEnhancement: (_rendererEnhancement = {}, _defineProperty(_rendererEnhancement, RceConfigKeys.handleError, handleErrorFunc), _defineProperty(_rendererEnhancement, RceConfigKeys.documentServiceHost, props.documentServiceHost), _rendererEnhancement)
|
|
55
|
+
};
|
|
44
56
|
};
|
|
45
57
|
|
|
46
|
-
if (!
|
|
58
|
+
if (!isNewRceEnabled()) return /*#__PURE__*/React.createElement(React.Fragment, null, props.children);
|
|
47
59
|
return /*#__PURE__*/React.createElement(RceConfigContext.Provider, {
|
|
48
60
|
value: getConfig()
|
|
49
61
|
}, props.children);
|
|
@@ -57,7 +69,8 @@ RceConfigProviderComponent.propTypes = {
|
|
|
57
69
|
canvasUserId: PropTypes.string,
|
|
58
70
|
rcsHost: PropTypes.string,
|
|
59
71
|
rcsJwt: PropTypes.string,
|
|
60
|
-
rcsJwtRefreshFn: PropTypes.func
|
|
72
|
+
rcsJwtRefreshFn: PropTypes.func,
|
|
73
|
+
documentServiceHost: PropTypes.string
|
|
61
74
|
};
|
|
62
75
|
RceConfigProviderComponent.defaultProps = {
|
|
63
76
|
contextId: null,
|
|
@@ -65,7 +78,8 @@ RceConfigProviderComponent.defaultProps = {
|
|
|
65
78
|
canvasUserId: null,
|
|
66
79
|
rcsHost: null,
|
|
67
80
|
rcsJwt: null,
|
|
68
|
-
rcsJwtRefreshFn: null
|
|
81
|
+
rcsJwtRefreshFn: null,
|
|
82
|
+
documentServiceHost: null
|
|
69
83
|
};
|
|
70
84
|
|
|
71
85
|
var mapStateToProps = function mapStateToProps() {
|
|
@@ -589,10 +589,10 @@ var BankEntry = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _de
|
|
|
589
589
|
|
|
590
590
|
if (this.props.entry.getWorkingInstance().hasFeedback()) {
|
|
591
591
|
icon = _uiIcons.IconDiscussionSolid;
|
|
592
|
-
text = (0, _formatMessage.default)('Edit
|
|
592
|
+
text = (0, _formatMessage.default)('Edit Question Level Feedback (present)');
|
|
593
593
|
} else {
|
|
594
594
|
icon = _uiIcons.IconDiscussionLine;
|
|
595
|
-
text = (0, _formatMessage.default)('Edit
|
|
595
|
+
text = (0, _formatMessage.default)('Edit Question Level Feedback');
|
|
596
596
|
}
|
|
597
597
|
|
|
598
598
|
return /*#__PURE__*/_react.default.createElement(_uiButtons.Button, {
|
|
@@ -217,12 +217,12 @@ var BankEntryRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
217
217
|
}, {
|
|
218
218
|
key: "type",
|
|
219
219
|
value: function type() {
|
|
220
|
-
return this.isItemEntry() ? (0, _formatMessage.default)('
|
|
220
|
+
return this.isItemEntry() ? (0, _formatMessage.default)('Question') : (0, _formatMessage.default)('Stimulus');
|
|
221
221
|
}
|
|
222
222
|
}, {
|
|
223
223
|
key: "entryIdentifier",
|
|
224
224
|
value: function entryIdentifier() {
|
|
225
|
-
return this.isItemEntry() ? (0, _formatMessage.default)('
|
|
225
|
+
return this.isItemEntry() ? (0, _formatMessage.default)('Question { itemBody }', {
|
|
226
226
|
itemBody: (0, _quizInteractions.extractTextFromHtml)(this.getEntry().title)
|
|
227
227
|
}) : (0, _formatMessage.default)('Stimulus { title }', {
|
|
228
228
|
title: this.getEntry().title
|
|
@@ -186,10 +186,10 @@ var QuizEntryEditFooter = (_dec = (0, _uiThemeable.themeable)(_theme.default, st
|
|
|
186
186
|
|
|
187
187
|
if (workingEntry.hasFeedback()) {
|
|
188
188
|
icon = _uiIcons.IconDiscussionSolid;
|
|
189
|
-
text = (0, _formatMessage.default)('Edit
|
|
189
|
+
text = (0, _formatMessage.default)('Edit Question Level Feedback (present)');
|
|
190
190
|
} else {
|
|
191
191
|
icon = _uiIcons.IconDiscussionLine;
|
|
192
|
-
text = (0, _formatMessage.default)('Edit
|
|
192
|
+
text = (0, _formatMessage.default)('Edit Question Level Feedback');
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -144,7 +144,7 @@ var QuizEntryHeader = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
144
144
|
switch (_context.prev = _context.next) {
|
|
145
145
|
case 0:
|
|
146
146
|
_this$props = _this.props, quizId = _this$props.quizId, workingQuizEntry = _this$props.workingQuizEntry, workingEntry = _this$props.workingEntry, richFITBEnabled = _this$props.richFITBEnabled, richFITBInteractionID = _this$props.richFITBInteractionID;
|
|
147
|
-
msg = (0, _formatMessage.default)('
|
|
147
|
+
msg = (0, _formatMessage.default)('Question {displayPosition} cannot be saved due to invalid input data.', {
|
|
148
148
|
displayPosition: _this.props.displayPosition
|
|
149
149
|
});
|
|
150
150
|
|
|
@@ -290,7 +290,7 @@ var QuizEntryHeader = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
290
290
|
}, {
|
|
291
291
|
key: "renderLeftHeader",
|
|
292
292
|
value: function renderLeftHeader() {
|
|
293
|
-
var positionText = (0, _formatMessage.default)('Edit
|
|
293
|
+
var positionText = (0, _formatMessage.default)('Edit question at position {position, number}', {
|
|
294
294
|
position: this.props.displayPosition
|
|
295
295
|
});
|
|
296
296
|
var position = this.props.disabledForRegrade ? this.props.displayPosition : this.props.quizEntry.positionToDisplay(this.props.displayPosition);
|
|
@@ -109,7 +109,7 @@ var QuizEntryShow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
if (!_this.props.quizEntryWithErrorsShowing) {
|
|
112
|
-
var msg = (0, _formatMessage.default)('
|
|
112
|
+
var msg = (0, _formatMessage.default)('Question switched to editing mode.');
|
|
113
113
|
|
|
114
114
|
_this.props.screenreaderNotification(msg);
|
|
115
115
|
|
|
@@ -131,7 +131,7 @@ var QuizEntryShow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
if (_this.props.quizEntryWithErrorsShowing) {
|
|
134
|
-
_this.props.screenreaderNotification((0, _formatMessage.default)('
|
|
134
|
+
_this.props.screenreaderNotification((0, _formatMessage.default)('Question {itemPosition, number} cannot be saved due to invalid input data', {
|
|
135
135
|
itemPosition: Math.ceil(_this.props.quizEntryWithErrorsShowing.position)
|
|
136
136
|
}));
|
|
137
137
|
|
|
@@ -298,10 +298,10 @@ var QuizEntryShow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
298
298
|
quizEntry = _this$props2.quizEntry,
|
|
299
299
|
stimulusOrientation = _this$props2.stimulusOrientation;
|
|
300
300
|
var positionToDisplay = this.props.quizEntry.positionToDisplay(displayPosition);
|
|
301
|
-
var positionText = (0, _formatMessage.default)('Preview of
|
|
301
|
+
var positionText = (0, _formatMessage.default)('Preview of question at position {position}', {
|
|
302
302
|
position: positionToDisplay
|
|
303
303
|
});
|
|
304
|
-
var srMsg = (0, _formatMessage.default)('The following
|
|
304
|
+
var srMsg = (0, _formatMessage.default)('The following question is a preview for the teacher. To edit this question, navigate back to the "Edit Question" button and click.');
|
|
305
305
|
var propsForDnDZone = {
|
|
306
306
|
draggingOver: draggingOver,
|
|
307
307
|
draggingAboveHalf: draggingAboveHalf
|
|
@@ -57,9 +57,9 @@ var Pin = /*#__PURE__*/function (_Component) {
|
|
|
57
57
|
(0, _createClass2.default)(Pin, [{
|
|
58
58
|
key: "render",
|
|
59
59
|
value: function render() {
|
|
60
|
-
var message = this.props.isPinned ? (0, _formatMessage.default)('
|
|
60
|
+
var message = this.props.isPinned ? (0, _formatMessage.default)('Question {position, number} is pinned. Click to unpin.', {
|
|
61
61
|
position: this.props.position
|
|
62
|
-
}) : (0, _formatMessage.default)('
|
|
62
|
+
}) : (0, _formatMessage.default)('Question {position, number} is unpinned. Click to pin.', {
|
|
63
63
|
position: this.props.position
|
|
64
64
|
});
|
|
65
65
|
return /*#__PURE__*/_react.default.createElement(_uiButtons.Button, {
|
|
@@ -191,7 +191,8 @@ var SDKApp = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_
|
|
|
191
191
|
canvasUserId: _propTypes.default.string.isRequired,
|
|
192
192
|
rcsHost: _propTypes.default.string.isRequired,
|
|
193
193
|
rcsJwt: _propTypes.default.string.isRequired,
|
|
194
|
-
rcsJwtRefreshFn: _propTypes.default.func.isRequired
|
|
194
|
+
rcsJwtRefreshFn: _propTypes.default.func.isRequired,
|
|
195
|
+
documentServiceHost: _propTypes.default.string.isRequired
|
|
195
196
|
}),
|
|
196
197
|
timeZone: _propTypes.default.string,
|
|
197
198
|
translations: _propTypes.default.objectOf(_propTypes.default.shape({
|
|
@@ -63,7 +63,7 @@ var HeaderMenuButton = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
63
63
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
64
64
|
|
|
65
65
|
_this.toggleNavigator = function () {
|
|
66
|
-
var msg = _this.props.sidebarOpen ? (0, _formatMessage.default)('Closed Question Navigator') : (0, _formatMessage.default)('Opened Question Navigator');
|
|
66
|
+
var msg = _this.props.sidebarOpen ? (0, _formatMessage.default)('Closed Question Navigator Menu') : (0, _formatMessage.default)('Opened Question Navigator Menu');
|
|
67
67
|
|
|
68
68
|
_this.props.screenreaderNotification(msg);
|
|
69
69
|
|
|
@@ -91,7 +91,7 @@ var HeaderMenuButton = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
91
91
|
onClick: this.toggleNavigator,
|
|
92
92
|
tabIndex: "0",
|
|
93
93
|
"data-automation": "sdk-hamburger-button"
|
|
94
|
-
}, _ref, /*#__PURE__*/_react.default.createElement(_uiA11yContent.ScreenReaderContent, null, sidebarOpen ? (0, _formatMessage.default)('
|
|
94
|
+
}, _ref, /*#__PURE__*/_react.default.createElement(_uiA11yContent.ScreenReaderContent, null, sidebarOpen ? (0, _formatMessage.default)('Hide Question Navigator Menu') : (0, _formatMessage.default)('Show Question Navigator Menu'))));
|
|
95
95
|
}
|
|
96
96
|
}]);
|
|
97
97
|
HeaderMenuButton.displayName = "HeaderMenuButton";
|
|
@@ -217,7 +217,7 @@ var Sidebar = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(
|
|
|
217
217
|
"data-automation": "sidebar-toggle-button"
|
|
218
218
|
}, /*#__PURE__*/_react.default.createElement(_uiText.Text, {
|
|
219
219
|
size: "small"
|
|
220
|
-
}, /*#__PURE__*/_react.default.createElement(SidebarIcon, null)), /*#__PURE__*/_react.default.createElement(_uiA11yContent.ScreenReaderContent, null, sidebarOpen ? (0, _formatMessage.default)('
|
|
220
|
+
}, /*#__PURE__*/_react.default.createElement(SidebarIcon, null)), /*#__PURE__*/_react.default.createElement(_uiA11yContent.ScreenReaderContent, null, sidebarOpen ? (0, _formatMessage.default)('Hide Question Navigator Menu') : (0, _formatMessage.default)('Show Question Navigator Menu')))));
|
|
221
221
|
}
|
|
222
222
|
}, {
|
|
223
223
|
key: "renderTotalPointsPossible",
|
|
@@ -146,7 +146,7 @@ var SidebarItem = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _
|
|
|
146
146
|
"data-automation-item-id": itemId,
|
|
147
147
|
"data-automation": "sdk-sidebar-item-button"
|
|
148
148
|
}, /*#__PURE__*/_react.default.createElement(_uiA11yContent.AccessibleContent, {
|
|
149
|
-
alt: (0, _formatMessage.default)('Navigate to
|
|
149
|
+
alt: (0, _formatMessage.default)('Navigate to question at position {displayPosition}', {
|
|
150
150
|
displayPosition: displayPosition
|
|
151
151
|
})
|
|
152
152
|
}, this.renderPosition()));
|
|
@@ -130,7 +130,7 @@ var Collection = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _d
|
|
|
130
130
|
variant: "icon",
|
|
131
131
|
onClick: this.handleSidebarHideItems,
|
|
132
132
|
icon: _uiIcons.IconArrowOpenUpLine
|
|
133
|
-
}, /*#__PURE__*/_react.default.createElement(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('Collapse stimulus
|
|
133
|
+
}, /*#__PURE__*/_react.default.createElement(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('Collapse stimulus questions')))), /*#__PURE__*/_react.default.createElement("div", null, itemComponents)));
|
|
134
134
|
}
|
|
135
135
|
}, {
|
|
136
136
|
key: "renderItemSummaryOnClosedSidear",
|
|
@@ -152,7 +152,7 @@ var Collection = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _d
|
|
|
152
152
|
variant: "icon",
|
|
153
153
|
onClick: this.handleSidebarShowItems,
|
|
154
154
|
icon: _uiIcons.IconArrowOpenDownLine
|
|
155
|
-
}, /*#__PURE__*/_react.default.createElement(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('Expand stimulus
|
|
155
|
+
}, /*#__PURE__*/_react.default.createElement(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('Expand stimulus questions')))));
|
|
156
156
|
}
|
|
157
157
|
}, {
|
|
158
158
|
key: "render",
|
|
@@ -56,7 +56,7 @@ var EntrySave = /*#__PURE__*/function (_Component) {
|
|
|
56
56
|
|
|
57
57
|
_this.createScreenReaderNotification = function () {
|
|
58
58
|
var displayPosition = _this.props.displayPosition;
|
|
59
|
-
var msg = displayPosition === null ? (0, _formatMessage.default)('This
|
|
59
|
+
var msg = displayPosition === null ? (0, _formatMessage.default)('This question cannot be saved due to invalid input data.') : (0, _formatMessage.default)('Question {displayPosition} cannot be saved due to invalid input data.', {
|
|
60
60
|
displayPosition: displayPosition
|
|
61
61
|
});
|
|
62
62
|
|
|
@@ -105,7 +105,7 @@ var EntrySave = /*#__PURE__*/function (_Component) {
|
|
|
105
105
|
key: "componentWillUnmount",
|
|
106
106
|
value: function componentWillUnmount() {
|
|
107
107
|
this.clearChanges();
|
|
108
|
-
var msg = (0, _formatMessage.default)('
|
|
108
|
+
var msg = (0, _formatMessage.default)('Question editing mode turned off.');
|
|
109
109
|
this.props.screenreaderNotification(msg);
|
|
110
110
|
}
|
|
111
111
|
}, {
|
|
@@ -150,7 +150,7 @@ var EntrySave = /*#__PURE__*/function (_Component) {
|
|
|
150
150
|
case 14:
|
|
151
151
|
this.props.switchOffEditing();
|
|
152
152
|
this.props.hideError(this.props.guid);
|
|
153
|
-
this.props.screenreaderNotification((0, _formatMessage.default)('Changes to
|
|
153
|
+
this.props.screenreaderNotification((0, _formatMessage.default)('Changes to question saved.'));
|
|
154
154
|
|
|
155
155
|
case 17:
|
|
156
156
|
case "end":
|
|
@@ -162,7 +162,7 @@ var ItemEdit = /*#__PURE__*/function (_Component) {
|
|
|
162
162
|
var propsForInteraction = (0, _interactionTypePropsHelper.propsForInteractionEdit)(this.props, this.additionalEditOptions());
|
|
163
163
|
return /*#__PURE__*/_react.default.createElement(_uiFormField.FormFieldGroup, {
|
|
164
164
|
messages: this.getError('onSelf'),
|
|
165
|
-
description: /*#__PURE__*/_react.default.createElement(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('Edit
|
|
165
|
+
description: /*#__PURE__*/_react.default.createElement(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('Edit question:')),
|
|
166
166
|
name: "edit_item_".concat(this.props.guid) // eslint-disable-line react/jsx-no-literals
|
|
167
167
|
|
|
168
168
|
}, /*#__PURE__*/_react.default.createElement(Interaction, Object.assign({}, propsForInteraction, {
|
|
@@ -97,7 +97,7 @@ var AddContentBody = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles)
|
|
|
97
97
|
|
|
98
98
|
_this.addItem = function (interactionTypeData) {
|
|
99
99
|
if (_this.props.quizEntryWithErrorsShowing) {
|
|
100
|
-
_this.props.screenreaderNotification((0, _formatMessage.default)('
|
|
100
|
+
_this.props.screenreaderNotification((0, _formatMessage.default)('Question {itemPosition, number} cannot be saved due to invalid input data', {
|
|
101
101
|
itemPosition: Math.ceil(_this.props.quizEntryWithErrorsShowing.position)
|
|
102
102
|
}));
|
|
103
103
|
} else {
|
|
@@ -66,7 +66,7 @@ var DragHandle = /*#__PURE__*/function (_Component) {
|
|
|
66
66
|
_this.moveUp = function () {
|
|
67
67
|
_this.moveToPosition(_this.props.quizEntry.position - 1);
|
|
68
68
|
|
|
69
|
-
var msg = (0, _formatMessage.default)('
|
|
69
|
+
var msg = (0, _formatMessage.default)('Question moved one space up.');
|
|
70
70
|
|
|
71
71
|
_this.props.screenreaderNotification(msg);
|
|
72
72
|
};
|
|
@@ -74,7 +74,7 @@ var DragHandle = /*#__PURE__*/function (_Component) {
|
|
|
74
74
|
_this.moveDown = function () {
|
|
75
75
|
_this.moveToPosition(_this.props.quizEntry.position + 1);
|
|
76
76
|
|
|
77
|
-
var msg = (0, _formatMessage.default)('
|
|
77
|
+
var msg = (0, _formatMessage.default)('Question moved one space down.');
|
|
78
78
|
|
|
79
79
|
_this.props.screenreaderNotification(msg);
|
|
80
80
|
};
|
|
@@ -82,7 +82,7 @@ var DragHandle = /*#__PURE__*/function (_Component) {
|
|
|
82
82
|
_this.moveToTop = function () {
|
|
83
83
|
_this.moveQuizEntry(1, '');
|
|
84
84
|
|
|
85
|
-
var msg = (0, _formatMessage.default)('
|
|
85
|
+
var msg = (0, _formatMessage.default)('Question moved to top of assessment.');
|
|
86
86
|
|
|
87
87
|
_this.props.screenreaderNotification(msg);
|
|
88
88
|
};
|
|
@@ -90,7 +90,7 @@ var DragHandle = /*#__PURE__*/function (_Component) {
|
|
|
90
90
|
_this.moveToBottom = function () {
|
|
91
91
|
_this.moveQuizEntry(_this.props.quizEntries.size, '');
|
|
92
92
|
|
|
93
|
-
var msg = (0, _formatMessage.default)('
|
|
93
|
+
var msg = (0, _formatMessage.default)('Question moved to bottom of assessment.');
|
|
94
94
|
|
|
95
95
|
_this.props.screenreaderNotification(msg);
|
|
96
96
|
};
|
|
@@ -330,9 +330,9 @@ var QuizEntry = (_dec = (0, _withStateCache.default)(function () {
|
|
|
330
330
|
end: displayPosition + this.numItems - 1
|
|
331
331
|
};
|
|
332
332
|
return {
|
|
333
|
-
Remove: (0, _formatMessage.default)('Remove {type} containing
|
|
334
|
-
Edit: (0, _formatMessage.default)('Edit {type} containing
|
|
335
|
-
Move: (0, _formatMessage.default)('Move {type} containing
|
|
333
|
+
Remove: (0, _formatMessage.default)('Remove {type} containing questions {start, number} through {end, number}.', opts),
|
|
334
|
+
Edit: (0, _formatMessage.default)('Edit {type} containing questions {start, number} through {end, number}.', opts),
|
|
335
|
+
Move: (0, _formatMessage.default)('Move {type} containing questions {start, number} through {end, number}.', opts)
|
|
336
336
|
}[verb];
|
|
337
337
|
} else if (this.numItems === 1) {
|
|
338
338
|
var _opts = {
|
|
@@ -340,9 +340,9 @@ var QuizEntry = (_dec = (0, _withStateCache.default)(function () {
|
|
|
340
340
|
start: displayPosition
|
|
341
341
|
};
|
|
342
342
|
return {
|
|
343
|
-
Remove: (0, _formatMessage.default)('Remove {type} containing
|
|
344
|
-
Edit: (0, _formatMessage.default)('Edit {type} containing
|
|
345
|
-
Move: (0, _formatMessage.default)('Move {type} containing
|
|
343
|
+
Remove: (0, _formatMessage.default)('Remove {type} containing question {start, number}.', _opts),
|
|
344
|
+
Edit: (0, _formatMessage.default)('Edit {type} containing question {start, number}.', _opts),
|
|
345
|
+
Move: (0, _formatMessage.default)('Move {type} containing question {start, number}.', _opts)
|
|
346
346
|
}[verb];
|
|
347
347
|
} else {
|
|
348
348
|
var _opts2 = {
|
|
@@ -356,7 +356,7 @@ var QuizEntry = (_dec = (0, _withStateCache.default)(function () {
|
|
|
356
356
|
}[verb];
|
|
357
357
|
}
|
|
358
358
|
} else {
|
|
359
|
-
type = this.isBankEntry ? (0, _formatMessage.default)('Bank Entry') : (0, _formatMessage.default)('
|
|
359
|
+
type = this.isBankEntry ? (0, _formatMessage.default)('Bank Entry') : (0, _formatMessage.default)('Question');
|
|
360
360
|
var _opts3 = {
|
|
361
361
|
verb: verb,
|
|
362
362
|
type: type,
|
|
@@ -19,22 +19,30 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
19
19
|
|
|
20
20
|
var _reactRedux = require("../../common/react-redux.js");
|
|
21
21
|
|
|
22
|
+
var _reduxStore = _interopRequireDefault(require("../../reduxStore.js"));
|
|
23
|
+
|
|
22
24
|
var _rceChecker = _interopRequireDefault(require("./rceChecker.js"));
|
|
23
25
|
|
|
24
26
|
var _quizCommon = require("@instructure/quiz-common");
|
|
25
27
|
|
|
28
|
+
var _alerts = require("../actions/alerts.js");
|
|
29
|
+
|
|
26
30
|
var RceConfigProviderComponent = function RceConfigProviderComponent(props) {
|
|
27
31
|
var _useState = (0, _react.useState)(props.rcsJwt),
|
|
28
32
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
29
33
|
jwt = _useState2[0],
|
|
30
34
|
setJwt = _useState2[1];
|
|
31
35
|
|
|
32
|
-
var
|
|
33
|
-
return props.useNewRce
|
|
36
|
+
var isNewRceEnabled = function isNewRceEnabled() {
|
|
37
|
+
return props.useNewRce;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
var hasAllPropsForRcs = function hasAllPropsForRcs() {
|
|
41
|
+
return !!(props.contextId && props.contextType && props.canvasUserId && props.rcsHost && props.rcsJwtRefreshFn && props.rcsJwt);
|
|
34
42
|
};
|
|
35
43
|
|
|
36
44
|
var getToken = function getToken() {
|
|
37
|
-
if (!
|
|
45
|
+
if (!hasAllPropsForRcs()) return;
|
|
38
46
|
return new Promise(function (resolve, reject) {
|
|
39
47
|
props.rcsJwtRefreshFn().then(function (response) {
|
|
40
48
|
var token = response.token;
|
|
@@ -53,14 +61,20 @@ var RceConfigProviderComponent = function RceConfigProviderComponent(props) {
|
|
|
53
61
|
});
|
|
54
62
|
};
|
|
55
63
|
|
|
64
|
+
var handleErrorFunc = function handleErrorFunc(errorMessage) {
|
|
65
|
+
_reduxStore.default.dispatch((0, _alerts.addError)(errorMessage));
|
|
66
|
+
};
|
|
67
|
+
|
|
56
68
|
var getConfig = function getConfig() {
|
|
57
|
-
var
|
|
69
|
+
var _ref, _rendererEnhancement;
|
|
58
70
|
|
|
59
|
-
|
|
60
|
-
|
|
71
|
+
return {
|
|
72
|
+
rcs: hasAllPropsForRcs() ? (_ref = {}, (0, _defineProperty2.default)(_ref, _quizCommon.RceConfigKeys.useNewRce, props.useNewRce), (0, _defineProperty2.default)(_ref, _quizCommon.RceConfigKeys.canvasUserId, props.canvasUserId), (0, _defineProperty2.default)(_ref, _quizCommon.RceConfigKeys.contextId, props.contextId), (0, _defineProperty2.default)(_ref, _quizCommon.RceConfigKeys.contextType, props.contextType), (0, _defineProperty2.default)(_ref, _quizCommon.RceConfigKeys.rcsHost, props.rcsHost), (0, _defineProperty2.default)(_ref, _quizCommon.RceConfigKeys.rcsJwt, jwt), (0, _defineProperty2.default)(_ref, _quizCommon.RceConfigKeys.rcsJwtRefreshFn, refreshToken), _ref) : null,
|
|
73
|
+
rendererEnhancement: (_rendererEnhancement = {}, (0, _defineProperty2.default)(_rendererEnhancement, _quizCommon.RceConfigKeys.handleError, handleErrorFunc), (0, _defineProperty2.default)(_rendererEnhancement, _quizCommon.RceConfigKeys.documentServiceHost, props.documentServiceHost), _rendererEnhancement)
|
|
74
|
+
};
|
|
61
75
|
};
|
|
62
76
|
|
|
63
|
-
if (!
|
|
77
|
+
if (!isNewRceEnabled()) return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, props.children);
|
|
64
78
|
return /*#__PURE__*/_react.default.createElement(_quizCommon.RceConfigContext.Provider, {
|
|
65
79
|
value: getConfig()
|
|
66
80
|
}, props.children);
|
|
@@ -74,7 +88,8 @@ RceConfigProviderComponent.propTypes = {
|
|
|
74
88
|
canvasUserId: _propTypes.default.string,
|
|
75
89
|
rcsHost: _propTypes.default.string,
|
|
76
90
|
rcsJwt: _propTypes.default.string,
|
|
77
|
-
rcsJwtRefreshFn: _propTypes.default.func
|
|
91
|
+
rcsJwtRefreshFn: _propTypes.default.func,
|
|
92
|
+
documentServiceHost: _propTypes.default.string
|
|
78
93
|
};
|
|
79
94
|
RceConfigProviderComponent.defaultProps = {
|
|
80
95
|
contextId: null,
|
|
@@ -82,7 +97,8 @@ RceConfigProviderComponent.defaultProps = {
|
|
|
82
97
|
canvasUserId: null,
|
|
83
98
|
rcsHost: null,
|
|
84
99
|
rcsJwt: null,
|
|
85
|
-
rcsJwtRefreshFn: null
|
|
100
|
+
rcsJwtRefreshFn: null,
|
|
101
|
+
documentServiceHost: null
|
|
86
102
|
};
|
|
87
103
|
|
|
88
104
|
var mapStateToProps = function mapStateToProps() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/quiz-core",
|
|
3
|
-
"version": "17.38.1-rc.
|
|
3
|
+
"version": "17.38.1-rc.5+66894d81b",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The Quiz React SDK by Instructure Inc.",
|
|
6
6
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@instructure/outcomes-ui": "^2.1.2",
|
|
44
|
-
"@instructure/quiz-common": "17.38.1-rc.
|
|
45
|
-
"@instructure/quiz-i18n": "17.38.1-rc.
|
|
46
|
-
"@instructure/quiz-interactions": "17.38.1-rc.
|
|
47
|
-
"@instructure/quiz-number-input": "17.38.1-rc.
|
|
48
|
-
"@instructure/quiz-rce": "17.38.1-rc.
|
|
44
|
+
"@instructure/quiz-common": "17.38.1-rc.5+66894d81b",
|
|
45
|
+
"@instructure/quiz-i18n": "17.38.1-rc.5+66894d81b",
|
|
46
|
+
"@instructure/quiz-interactions": "17.38.1-rc.5+66894d81b",
|
|
47
|
+
"@instructure/quiz-number-input": "17.38.1-rc.5+66894d81b",
|
|
48
|
+
"@instructure/quiz-rce": "17.38.1-rc.5+66894d81b",
|
|
49
49
|
"@instructure/ui-a11y-content": "^7.20.0",
|
|
50
50
|
"@instructure/ui-alerts": "^7.20.0",
|
|
51
51
|
"@instructure/ui-avatar": "^7.20.0",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"eventemitter3": "^3.1.0",
|
|
107
107
|
"humps": "^2.0.0",
|
|
108
108
|
"immutable": "^3.8.1",
|
|
109
|
-
"instructure-validations": "17.38.1-rc.
|
|
109
|
+
"instructure-validations": "17.38.1-rc.5+66894d81b",
|
|
110
110
|
"ipaddr.js": "^1.5.4",
|
|
111
111
|
"isomorphic-fetch": "^2.2.0",
|
|
112
112
|
"isuuid": "^0.1.0",
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
"uuid": "^3.2.1"
|
|
138
138
|
},
|
|
139
139
|
"devDependencies": {
|
|
140
|
-
"@instructure/quiz-scripts": "17.38.1-rc.
|
|
140
|
+
"@instructure/quiz-scripts": "17.38.1-rc.5+66894d81b",
|
|
141
141
|
"@instructure/ui-axe-check": "^7.20.0",
|
|
142
142
|
"@instructure/ui-babel-preset": "^7.20.0",
|
|
143
143
|
"@instructure/ui-karma-config": "^7.20.0",
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
"intl": "^1.2.4",
|
|
157
157
|
"jquery": "^2.2.3",
|
|
158
158
|
"most-subject": "^5.3.0",
|
|
159
|
-
"quiz-presets": "17.38.1-rc.
|
|
159
|
+
"quiz-presets": "17.38.1-rc.5+66894d81b",
|
|
160
160
|
"react": "^16.8.6",
|
|
161
161
|
"react-addons-test-utils": "^15.6.2",
|
|
162
162
|
"react-dom": "^16.8.6",
|
|
@@ -172,5 +172,5 @@
|
|
|
172
172
|
"publishConfig": {
|
|
173
173
|
"access": "public"
|
|
174
174
|
},
|
|
175
|
-
"gitHead": "
|
|
175
|
+
"gitHead": "66894d81b265e6649ff8e62d100f8f33cf4a9fb5"
|
|
176
176
|
}
|