@instructure/quiz-core 20.36.1-rc.4 → 20.36.1-rc.40
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/BankSearch/presenter.js +1 -2
- package/es/banks/components/Banks/index.js +0 -1
- package/es/banks/components/Banks/presenter.js +4 -6
- package/es/banks/components/CreateBankModal/presenter.js +22 -24
- package/es/banks/components/EditBankModal/presenter.js +24 -22
- package/es/banks/components/SharingModal/index.js +0 -2
- package/es/banks/components/SharingModal/presenter.js +17 -80
- package/es/building/api/stimuli.js +2 -1
- package/es/building/components/resources/DeleteStimulusModal/presenter.js +14 -7
- package/es/building/components/resources/quizEntry/QuizEntry/presenter.js +11 -4
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +1 -2
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Header/index.js +40 -22
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Header/styles.js +1 -29
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Header/theme.js +1 -5
- package/es/common/actions/modifications.js +3 -2
- package/es/common/components/layout/Page/styles.js +7 -4
- package/es/common/components/layout/Page/theme.js +1 -2
- package/es/common/components/layout/navbar/SecondaryNavBarButton/index.js +13 -32
- package/es/common/components/layout/navbar/index.js +0 -3
- package/es/common/components/layout/sidebar/Sidebar/index.js +26 -4
- package/es/common/components/layout/sidebar/SidebarItem/presenter.js +13 -7
- package/es/common/components/layout/sidebar/Stimulus/presenter.js +14 -7
- package/es/common/components/resources/item/ItemEdit/presenter.js +1 -7
- package/es/common/components/resources/quiz/AddContent/Body/presenter.js +2 -2
- package/es/common/components/resources/quiz/AddContent/Popover/presenter.js +0 -4
- package/es/common/components/resources/quiz/instructions/styles.js +8 -6
- package/es/common/components/resources/quiz/instructions/theme.js +1 -2
- package/es/common/components/resources/sessionItemResult/SessionItemResult/presenter.js +1 -1
- package/es/common/components/resources/stimulus/Stimulus/presenter.js +3 -2
- package/es/common/components/resources/stimulus/StimulusEdit/presenter.js +14 -4
- package/es/common/components/resources/stimulus/StimulusEdit/styles.js +1 -5
- package/es/common/components/resources/stimulus/StimulusEdit/theme.js +0 -2
- package/es/common/components/resources/stimulus/StimulusEditInfo/presenter.js +51 -35
- package/es/common/components/resources/stimulus/StimulusShow/index.js +10 -4
- package/es/common/components/resources/stimulus/StimulusShow/styles.js +0 -7
- package/es/common/components/resources/stimulus/StimulusShow/theme.js +0 -3
- package/es/common/components/shared/InteractionTypes/index.js +4 -1
- package/es/common/components/shared/InteractionTypes/presenter.js +38 -15
- package/es/common/components/shared/PrintTrigger/presenter.js +0 -5
- package/es/common/components/shared/TimeUnitsInput/index.js +9 -8
- package/es/common/components/shared/drag_and_drop/dragAndDropUtils.js +3 -0
- package/es/common/records/QuizEntry.js +5 -0
- package/es/common/records/Stimulus.js +2 -1
- package/es/common/reducers/modifications.js +6 -3
- package/es/common/util/warningHelpers.js +15 -5
- package/es/moderating/components/resources/ModerateTable/presenter.js +1 -2
- package/es/moderating/components/sidebar/ModerateTray/presenter.js +1 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +1 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/presenter.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/presenter.js +1 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/ChoiceGroupTypeTable/presenter.js +1 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsTableWrapper/presenter.js +1 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +1 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/presenter.js +1 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/presenter.js +1 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js +1 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/presenter.js +1 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +1 -2
- package/es/reporting/components/resources/OutcomeAnalysis/presenter.js +1 -11
- package/es/reporting/components/resources/ReportCard/index.js +1 -2
- package/es/reporting/components/resources/StudentAnalysis/ReportCard/presenter.js +1 -2
- package/es/reporting/components/resources/common/AnalysisUpdateDate/index.js +1 -1
- package/es/taking/api/taking.js +4 -0
- package/lib/banks/components/BankSearch/presenter.js +3 -4
- package/lib/banks/components/Banks/index.js +0 -1
- package/lib/banks/components/Banks/presenter.js +4 -6
- package/lib/banks/components/CreateBankModal/presenter.js +23 -24
- package/lib/banks/components/EditBankModal/presenter.js +25 -22
- package/lib/banks/components/SharingModal/index.js +0 -2
- package/lib/banks/components/SharingModal/presenter.js +17 -80
- package/lib/building/api/stimuli.js +2 -1
- package/lib/building/components/resources/DeleteStimulusModal/presenter.js +14 -7
- package/lib/building/components/resources/quizEntry/QuizEntry/presenter.js +11 -4
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +3 -4
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Header/index.js +39 -21
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Header/styles.js +1 -29
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Header/theme.js +1 -5
- package/lib/common/actions/modifications.js +3 -2
- package/lib/common/components/layout/Page/styles.js +7 -4
- package/lib/common/components/layout/Page/theme.js +1 -2
- package/lib/common/components/layout/navbar/SecondaryNavBarButton/index.js +13 -32
- package/lib/common/components/layout/navbar/index.js +0 -3
- package/lib/common/components/layout/sidebar/Sidebar/index.js +25 -3
- package/lib/common/components/layout/sidebar/SidebarItem/presenter.js +15 -9
- package/lib/common/components/layout/sidebar/Stimulus/presenter.js +16 -9
- package/lib/common/components/resources/item/ItemEdit/presenter.js +1 -7
- package/lib/common/components/resources/quiz/AddContent/Body/presenter.js +2 -2
- package/lib/common/components/resources/quiz/AddContent/Popover/presenter.js +0 -4
- package/lib/common/components/resources/quiz/instructions/styles.js +8 -6
- package/lib/common/components/resources/quiz/instructions/theme.js +1 -2
- package/lib/common/components/resources/sessionItemResult/SessionItemResult/presenter.js +1 -1
- package/lib/common/components/resources/stimulus/Stimulus/presenter.js +3 -2
- package/lib/common/components/resources/stimulus/StimulusEdit/presenter.js +14 -4
- package/lib/common/components/resources/stimulus/StimulusEdit/styles.js +1 -5
- package/lib/common/components/resources/stimulus/StimulusEdit/theme.js +0 -2
- package/lib/common/components/resources/stimulus/StimulusEditInfo/presenter.js +52 -36
- package/lib/common/components/resources/stimulus/StimulusShow/index.js +9 -3
- package/lib/common/components/resources/stimulus/StimulusShow/styles.js +0 -7
- package/lib/common/components/resources/stimulus/StimulusShow/theme.js +0 -3
- package/lib/common/components/shared/InteractionTypes/index.js +4 -1
- package/lib/common/components/shared/InteractionTypes/presenter.js +38 -15
- package/lib/common/components/shared/PrintTrigger/presenter.js +0 -5
- package/lib/common/components/shared/TimeUnitsInput/index.js +10 -9
- package/lib/common/components/shared/drag_and_drop/dragAndDropUtils.js +3 -0
- package/lib/common/records/QuizEntry.js +5 -0
- package/lib/common/records/Stimulus.js +2 -1
- package/lib/common/reducers/modifications.js +6 -3
- package/lib/common/util/warningHelpers.js +15 -5
- package/lib/moderating/components/resources/ModerateTable/presenter.js +3 -4
- package/lib/moderating/components/sidebar/ModerateTray/presenter.js +5 -6
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +6 -7
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/presenter.js +9 -9
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/presenter.js +2 -3
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/ChoiceGroupTypeTable/presenter.js +5 -6
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsTableWrapper/presenter.js +4 -5
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +3 -4
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/presenter.js +3 -4
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/presenter.js +8 -9
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js +20 -21
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/presenter.js +9 -10
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +20 -21
- package/lib/reporting/components/resources/OutcomeAnalysis/presenter.js +1 -11
- package/lib/reporting/components/resources/ReportCard/index.js +1 -2
- package/lib/reporting/components/resources/StudentAnalysis/ReportCard/presenter.js +9 -10
- package/lib/reporting/components/resources/common/AnalysisUpdateDate/index.js +2 -2
- package/lib/taking/api/taking.js +4 -0
- package/package.json +55 -60
- package/es/banks/components/CreateBankModal/styles.js +0 -15
- package/es/banks/components/CreateBankModal/theme.js +0 -10
- package/es/banks/components/EditBankModal/styles.js +0 -12
- package/es/banks/components/EditBankModal/theme.js +0 -9
- package/es/common/components/layout/navbar/SecondaryNavBarButton/styles.js +0 -9
- package/es/common/components/layout/navbar/SecondaryNavBarButton/theme.js +0 -10
- package/lib/banks/components/CreateBankModal/styles.js +0 -22
- package/lib/banks/components/CreateBankModal/theme.js +0 -17
- package/lib/banks/components/EditBankModal/styles.js +0 -19
- package/lib/banks/components/EditBankModal/theme.js +0 -16
- package/lib/common/components/layout/navbar/SecondaryNavBarButton/styles.js +0 -16
- package/lib/common/components/layout/navbar/SecondaryNavBarButton/theme.js +0 -17
|
@@ -12,7 +12,6 @@ import { IconPlusLine } from '@instructure/ui-icons';
|
|
|
12
12
|
import { Button, CondensedButton } from '@instructure/ui-buttons';
|
|
13
13
|
import { Checkbox } from '@instructure/ui-checkbox';
|
|
14
14
|
import { View } from '@instructure/ui-view';
|
|
15
|
-
import { Flex } from '@instructure/ui-flex';
|
|
16
15
|
import { Text } from '@instructure/ui-text';
|
|
17
16
|
import { AccessibleContent, ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
18
17
|
import { jsx } from '@instructure/emotion';
|
|
@@ -21,7 +20,7 @@ import TagSuggestSelect from "../../../common/components/shared/TagSuggestSelect
|
|
|
21
20
|
import { interactionTypesNameDictionary } from "../../../common/util/interactionTypeMetadata.js";
|
|
22
21
|
import generateStyle from "./styles.js";
|
|
23
22
|
import generateComponentTheme from "./theme.js";
|
|
24
|
-
import { TextInput, withStyleOverrides } from '@instructure/quiz-common';
|
|
23
|
+
import { Flex, TextInput, withStyleOverrides } from '@instructure/quiz-common';
|
|
25
24
|
var tagShape = PropTypes.shape({
|
|
26
25
|
tag: PropTypes.shape({
|
|
27
26
|
id: PropTypes.string,
|
|
@@ -19,7 +19,6 @@ function mapStateToProps(state, props) {
|
|
|
19
19
|
return {
|
|
20
20
|
itemBankSearchTableEnabled: featureOn('item_bank_search_table'),
|
|
21
21
|
usedByCourseEnabled: featureOn('filter_item_banks_used_by_course'),
|
|
22
|
-
subAccountBankSharingEnabled: featureOn('sub_account_bank_sharing'),
|
|
23
22
|
scopeType: scopeType,
|
|
24
23
|
sortBy: sortBy,
|
|
25
24
|
sortOrder: sortOrder,
|
|
@@ -222,7 +222,7 @@ export var Banks = (_dec = withStyleOverrides(generateStyle, generateComponentTh
|
|
|
222
222
|
}, {
|
|
223
223
|
key: "topLevelBankFilterName",
|
|
224
224
|
value: function topLevelBankFilterName() {
|
|
225
|
-
return
|
|
225
|
+
return t('Shared with Me');
|
|
226
226
|
}
|
|
227
227
|
}, {
|
|
228
228
|
key: "renderFilters",
|
|
@@ -235,7 +235,7 @@ export var Banks = (_dec = withStyleOverrides(generateStyle, generateComponentTh
|
|
|
235
235
|
translation: t('Institution Banks')
|
|
236
236
|
}, {
|
|
237
237
|
slug: 'courses',
|
|
238
|
-
translation:
|
|
238
|
+
translation: t('Shared with Courses')
|
|
239
239
|
}];
|
|
240
240
|
if (this.props.scope.uuid) {
|
|
241
241
|
scopeOptions.push({
|
|
@@ -243,7 +243,7 @@ export var Banks = (_dec = withStyleOverrides(generateStyle, generateComponentTh
|
|
|
243
243
|
translation: t('This Course')
|
|
244
244
|
});
|
|
245
245
|
}
|
|
246
|
-
if (this.
|
|
246
|
+
if (this.isSubAccountLaunch()) {
|
|
247
247
|
// Put this option below "Insitution Banks"
|
|
248
248
|
scopeOptions.splice(2, 0, {
|
|
249
249
|
slug: 'this_account',
|
|
@@ -302,7 +302,7 @@ export var Banks = (_dec = withStyleOverrides(generateStyle, generateComponentTh
|
|
|
302
302
|
onChange: this.handleSearchInputChange,
|
|
303
303
|
placeholder: t('Search Banks'),
|
|
304
304
|
"data-automation": "sdk-search-bank-textinput"
|
|
305
|
-
})),
|
|
305
|
+
})), !this.hideAccountSearch() && jsx(Grid.Col, {
|
|
306
306
|
width: 4
|
|
307
307
|
}, jsx(AsyncSearch, {
|
|
308
308
|
getShareableSubaccounts: this.props.getShareableSubaccounts,
|
|
@@ -488,7 +488,6 @@ export var Banks = (_dec = withStyleOverrides(generateStyle, generateComponentTh
|
|
|
488
488
|
usedByCourseEnabled: PropTypes.bool,
|
|
489
489
|
itemBankSearchTableEnabled: PropTypes.bool,
|
|
490
490
|
setUI: PropTypes.func.isRequired,
|
|
491
|
-
subAccountBankSharingEnabled: PropTypes.bool,
|
|
492
491
|
iceTopNavBarEnabled: PropTypes.bool,
|
|
493
492
|
styles: PropTypes.object,
|
|
494
493
|
rootAccountUuid: PropTypes.string
|
|
@@ -515,7 +514,6 @@ export var Banks = (_dec = withStyleOverrides(generateStyle, generateComponentTh
|
|
|
515
514
|
searchSelection: [],
|
|
516
515
|
usedByCourseEnabled: false,
|
|
517
516
|
itemBankSearchTableEnabled: false,
|
|
518
|
-
subAccountBankSharingEnabled: false,
|
|
519
517
|
iceTopNavBarEnabled: false,
|
|
520
518
|
rootAccountUuid: null
|
|
521
519
|
}, _Banks.contextTypes = {
|
|
@@ -2,9 +2,9 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
var
|
|
5
|
+
var _CreateBankModal;
|
|
6
6
|
/** @jsx jsx */
|
|
7
|
-
import { Component } from 'react';
|
|
7
|
+
import React, { Component } from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import { Button, CloseButton } from '@instructure/ui-buttons';
|
|
10
10
|
import { Checkbox } from '@instructure/ui-checkbox';
|
|
@@ -14,19 +14,14 @@ import { jsx } from '@instructure/emotion';
|
|
|
14
14
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
15
15
|
import Bank from "../../../common/records/Bank.js";
|
|
16
16
|
import { toErrors } from "../../../common/util/instUIMessages.js";
|
|
17
|
-
import { Modal, ModalHeader, ModalBody, ModalFooter, TextInput, XSMALL_SIDE_MARGIN
|
|
18
|
-
|
|
19
|
-
import generateComponentTheme from "./theme.js";
|
|
20
|
-
export var CreateBankModal = (_dec = withStyleOverrides(generateStyle, generateComponentTheme), _dec(_class = (_CreateBankModal = /*#__PURE__*/function (_Component) {
|
|
17
|
+
import { Modal, ModalHeader, ModalBody, ModalFooter, TextInput, XSMALL_SIDE_MARGIN } from '@instructure/quiz-common';
|
|
18
|
+
export var CreateBankModal = /*#__PURE__*/function (_Component) {
|
|
21
19
|
_inherits(CreateBankModal, _Component);
|
|
22
20
|
var _super = _createSuper(CreateBankModal);
|
|
23
|
-
function CreateBankModal() {
|
|
21
|
+
function CreateBankModal(props) {
|
|
24
22
|
var _this;
|
|
25
23
|
_classCallCheck(this, CreateBankModal);
|
|
26
|
-
|
|
27
|
-
args[_key] = arguments[_key];
|
|
28
|
-
}
|
|
29
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
24
|
+
_this = _super.call(this, props);
|
|
30
25
|
_this.state = {
|
|
31
26
|
shareWithCourse: false
|
|
32
27
|
};
|
|
@@ -38,7 +33,8 @@ export var CreateBankModal = (_dec = withStyleOverrides(generateStyle, generateC
|
|
|
38
33
|
_this.props.onCreateBank();
|
|
39
34
|
_this.closeAction();
|
|
40
35
|
} else {
|
|
41
|
-
_this
|
|
36
|
+
var _this$bankNameInput$c;
|
|
37
|
+
(_this$bankNameInput$c = _this.bankNameInput.current) === null || _this$bankNameInput$c === void 0 ? void 0 : _this$bankNameInput$c.focus();
|
|
42
38
|
}
|
|
43
39
|
};
|
|
44
40
|
_this.closeAction = function () {
|
|
@@ -68,6 +64,7 @@ export var CreateBankModal = (_dec = withStyleOverrides(generateStyle, generateC
|
|
|
68
64
|
shareWithCourse: event.target.checked
|
|
69
65
|
});
|
|
70
66
|
};
|
|
67
|
+
_this.bankNameInput = /*#__PURE__*/React.createRef();
|
|
71
68
|
return _this;
|
|
72
69
|
}
|
|
73
70
|
_createClass(CreateBankModal, [{
|
|
@@ -92,17 +89,14 @@ export var CreateBankModal = (_dec = withStyleOverrides(generateStyle, generateC
|
|
|
92
89
|
}, {
|
|
93
90
|
key: "renderContent",
|
|
94
91
|
value: function renderContent() {
|
|
95
|
-
return jsx("div", {
|
|
96
|
-
css: this.props.styles.bankNameInput
|
|
97
|
-
}, jsx(TextInput, {
|
|
92
|
+
return jsx("div", null, jsx(TextInput, {
|
|
98
93
|
messages: this.getErrors(),
|
|
99
94
|
onChange: this.onNameChange,
|
|
100
|
-
renderLabel:
|
|
101
|
-
|
|
102
|
-
}, t('Bank Name')),
|
|
95
|
+
renderLabel: t('Bank Name'),
|
|
96
|
+
isRequired: true,
|
|
103
97
|
type: "text",
|
|
104
|
-
|
|
105
|
-
|
|
98
|
+
"data-automation": "sdk-create-bank-name-textinput",
|
|
99
|
+
ref: this.bankNameInput
|
|
106
100
|
}), this.renderCheckbox());
|
|
107
101
|
}
|
|
108
102
|
}, {
|
|
@@ -134,7 +128,6 @@ export var CreateBankModal = (_dec = withStyleOverrides(generateStyle, generateC
|
|
|
134
128
|
label: t('Item Bank'),
|
|
135
129
|
"data-automation": "sdk-create-bank-modal"
|
|
136
130
|
}, jsx(ModalHeader, null, jsx(Heading, {
|
|
137
|
-
level: "reset",
|
|
138
131
|
as: "h2"
|
|
139
132
|
}, t('New Item Bank')), jsx(CloseButton, {
|
|
140
133
|
onClick: this.closeAction,
|
|
@@ -146,7 +139,11 @@ export var CreateBankModal = (_dec = withStyleOverrides(generateStyle, generateC
|
|
|
146
139
|
}]);
|
|
147
140
|
CreateBankModal.displayName = "CreateBankModal";
|
|
148
141
|
return CreateBankModal;
|
|
149
|
-
}(Component)
|
|
142
|
+
}(Component);
|
|
143
|
+
_CreateBankModal = CreateBankModal;
|
|
144
|
+
CreateBankModal.displayName = 'CreateBankModal';
|
|
145
|
+
CreateBankModal.componentId = "Quizzes".concat(_CreateBankModal.displayName);
|
|
146
|
+
CreateBankModal.propTypes = {
|
|
150
147
|
modalOpen: PropTypes.bool.isRequired,
|
|
151
148
|
modalTrigger: PropTypes.instanceOf(Component),
|
|
152
149
|
temporaryBank: PropTypes.instanceOf(Bank).isRequired,
|
|
@@ -169,11 +166,12 @@ export var CreateBankModal = (_dec = withStyleOverrides(generateStyle, generateC
|
|
|
169
166
|
root_account_name: PropTypes.string
|
|
170
167
|
}),
|
|
171
168
|
styles: PropTypes.object
|
|
172
|
-
}
|
|
169
|
+
};
|
|
170
|
+
CreateBankModal.defaultProps = {
|
|
173
171
|
displayError: false,
|
|
174
172
|
modalTrigger: null,
|
|
175
173
|
showShareBankOnCreate: false,
|
|
176
174
|
itemBanksScope: {},
|
|
177
175
|
onCreateBank: function onCreateBank() {}
|
|
178
|
-
}
|
|
176
|
+
};
|
|
179
177
|
export default CreateBankModal;
|
|
@@ -2,34 +2,32 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
var
|
|
5
|
+
var _EditBankModal;
|
|
6
6
|
/** @jsx jsx */
|
|
7
|
-
import { Component } from 'react';
|
|
7
|
+
import React, { Component } from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import { Button, CloseButton } from '@instructure/ui-buttons';
|
|
10
10
|
import { Heading } from '@instructure/ui-heading';
|
|
11
11
|
import { jsx } from '@instructure/emotion';
|
|
12
12
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
13
13
|
import { toErrors } from "../../../common/util/instUIMessages.js";
|
|
14
|
-
import { Modal, ModalHeader, ModalBody, ModalFooter, TextInput, XSMALL_SIDE_MARGIN
|
|
14
|
+
import { Modal, ModalHeader, ModalBody, ModalFooter, TextInput, XSMALL_SIDE_MARGIN } from '@instructure/quiz-common';
|
|
15
15
|
import Bank from "../../../common/records/Bank.js";
|
|
16
|
-
|
|
17
|
-
import generateComponentTheme from "./theme.js";
|
|
18
|
-
export var EditBankModal = (_dec = withStyleOverrides(generateStyle, generateComponentTheme), _dec(_class = (_EditBankModal = /*#__PURE__*/function (_Component) {
|
|
16
|
+
export var EditBankModal = /*#__PURE__*/function (_Component) {
|
|
19
17
|
_inherits(EditBankModal, _Component);
|
|
20
18
|
var _super = _createSuper(EditBankModal);
|
|
21
|
-
function EditBankModal() {
|
|
19
|
+
function EditBankModal(props) {
|
|
22
20
|
var _this;
|
|
23
21
|
_classCallCheck(this, EditBankModal);
|
|
24
|
-
|
|
25
|
-
args[_key] = arguments[_key];
|
|
26
|
-
}
|
|
27
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
22
|
+
_this = _super.call(this, props);
|
|
28
23
|
_this.continueAction = function () {
|
|
29
24
|
_this.props.showError(_this.props.errorKey);
|
|
30
25
|
if (_this.props.workingBank.isValid()) {
|
|
31
26
|
_this.props.updateBank(_this.props.workingBank);
|
|
32
27
|
_this.closeAction();
|
|
28
|
+
} else {
|
|
29
|
+
var _this$bankNameInput$c;
|
|
30
|
+
(_this$bankNameInput$c = _this.bankNameInput.current) === null || _this$bankNameInput$c === void 0 ? void 0 : _this$bankNameInput$c.focus();
|
|
33
31
|
}
|
|
34
32
|
};
|
|
35
33
|
_this.closeAction = function () {
|
|
@@ -51,6 +49,7 @@ export var EditBankModal = (_dec = withStyleOverrides(generateStyle, generateCom
|
|
|
51
49
|
return toErrors(_this.props.workingBank.errorsFor('title').toJS());
|
|
52
50
|
}
|
|
53
51
|
};
|
|
52
|
+
_this.bankNameInput = /*#__PURE__*/React.createRef();
|
|
54
53
|
return _this;
|
|
55
54
|
}
|
|
56
55
|
_createClass(EditBankModal, [{
|
|
@@ -75,17 +74,16 @@ export var EditBankModal = (_dec = withStyleOverrides(generateStyle, generateCom
|
|
|
75
74
|
}, {
|
|
76
75
|
key: "renderContent",
|
|
77
76
|
value: function renderContent() {
|
|
78
|
-
return jsx(
|
|
79
|
-
css: this.props.styles.bankNameInput
|
|
80
|
-
}, jsx(TextInput, {
|
|
77
|
+
return jsx(TextInput, {
|
|
81
78
|
value: this.props.workingBank.title,
|
|
82
79
|
messages: this.getErrors(),
|
|
83
80
|
onChange: this.onNameChange,
|
|
84
|
-
renderLabel:
|
|
81
|
+
renderLabel: t('Bank Name'),
|
|
85
82
|
type: "text",
|
|
86
|
-
|
|
87
|
-
"data-automation": "sdk-edit-bank-name-textinput"
|
|
88
|
-
|
|
83
|
+
isRequired: true,
|
|
84
|
+
"data-automation": "sdk-edit-bank-name-textinput",
|
|
85
|
+
ref: this.bankNameInput
|
|
86
|
+
});
|
|
89
87
|
}
|
|
90
88
|
}, {
|
|
91
89
|
key: "render",
|
|
@@ -97,7 +95,6 @@ export var EditBankModal = (_dec = withStyleOverrides(generateStyle, generateCom
|
|
|
97
95
|
label: t('Item Bank'),
|
|
98
96
|
"data-automation": "sdk-edit-bank-modal"
|
|
99
97
|
}, jsx(ModalHeader, null, jsx(Heading, {
|
|
100
|
-
level: "reset",
|
|
101
98
|
as: "h2"
|
|
102
99
|
}, t('Edit Item Bank')), jsx(CloseButton, {
|
|
103
100
|
onClick: this.closeAction,
|
|
@@ -109,7 +106,11 @@ export var EditBankModal = (_dec = withStyleOverrides(generateStyle, generateCom
|
|
|
109
106
|
}]);
|
|
110
107
|
EditBankModal.displayName = "EditBankModal";
|
|
111
108
|
return EditBankModal;
|
|
112
|
-
}(Component)
|
|
109
|
+
}(Component);
|
|
110
|
+
_EditBankModal = EditBankModal;
|
|
111
|
+
EditBankModal.displayName = 'EditBankModal';
|
|
112
|
+
EditBankModal.componentId = "Quizzes".concat(_EditBankModal.displayName);
|
|
113
|
+
EditBankModal.propTypes = {
|
|
113
114
|
modalOpen: PropTypes.bool.isRequired,
|
|
114
115
|
modalTrigger: PropTypes.instanceOf(Component),
|
|
115
116
|
workingBank: PropTypes.instanceOf(Bank).isRequired,
|
|
@@ -122,8 +123,9 @@ export var EditBankModal = (_dec = withStyleOverrides(generateStyle, generateCom
|
|
|
122
123
|
hideError: PropTypes.func.isRequired,
|
|
123
124
|
closeModal: PropTypes.func.isRequired,
|
|
124
125
|
styles: PropTypes.object
|
|
125
|
-
}
|
|
126
|
+
};
|
|
127
|
+
EditBankModal.defaultProps = {
|
|
126
128
|
displayError: false,
|
|
127
129
|
modalTrigger: null
|
|
128
|
-
}
|
|
130
|
+
};
|
|
129
131
|
export default EditBankModal;
|
|
@@ -4,14 +4,12 @@ import { connect } from "../../../common/react-redux.js";
|
|
|
4
4
|
import { shareBank, getSharedBanks, updateSharedBankPermission, getBank, updateBank } from "../../api/banks.js";
|
|
5
5
|
import { removeSharedBank } from "../../../common/actions/sharedBanks.js";
|
|
6
6
|
import { withConfirm } from "../../../common/actions/modal.js";
|
|
7
|
-
import { featureOn } from "../../../common/util/featureCheck.js";
|
|
8
7
|
import SharingModal from "./presenter.js";
|
|
9
8
|
function mapStateToProps(state, ownProps) {
|
|
10
9
|
var sharedBanks = state.get('sharedBanks', Map()).filter(function (sharedBank) {
|
|
11
10
|
return sharedBank.get('bankId') === ownProps.bank.id;
|
|
12
11
|
}).toList();
|
|
13
12
|
return {
|
|
14
|
-
subAccountBankSharingEnabled: featureOn('sub_account_bank_sharing'),
|
|
15
13
|
sharedBanks: sharedBanks
|
|
16
14
|
};
|
|
17
15
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
1
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
3
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
5
5
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
6
6
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
@@ -22,7 +22,6 @@ import { Grid } from '@instructure/ui-grid';
|
|
|
22
22
|
import { Tabs } from '@instructure/ui-tabs';
|
|
23
23
|
import { Text } from '@instructure/ui-text';
|
|
24
24
|
import { jsx } from '@instructure/emotion';
|
|
25
|
-
import elementsForSelectors from "../../../common/util/ElementsForSelectors.js";
|
|
26
25
|
import CustomPropTypes from "../../../common/util/CustomPropTypes.js";
|
|
27
26
|
import ShareList from "./ShareList/index.js";
|
|
28
27
|
import AsyncSearch from "../AsyncSearch/index.js";
|
|
@@ -54,9 +53,6 @@ export var SharingModalPresenter = (_dec = withStyleOverrides(generateStyle, gen
|
|
|
54
53
|
};
|
|
55
54
|
_this.shareListRef = null;
|
|
56
55
|
_this.shareButtonRef = null;
|
|
57
|
-
_this.applicationElement = function () {
|
|
58
|
-
return elementsForSelectors(_this.props.appContainer);
|
|
59
|
-
};
|
|
60
56
|
// =============
|
|
61
57
|
// LIFECYCLE
|
|
62
58
|
// =============
|
|
@@ -176,27 +172,7 @@ export var SharingModalPresenter = (_dec = withStyleOverrides(generateStyle, gen
|
|
|
176
172
|
return originalEntity.get('permission', CAN_EDIT);
|
|
177
173
|
};
|
|
178
174
|
_this.handleEntityRemove = function (entity, undoRemove) {
|
|
179
|
-
|
|
180
|
-
_this.confirmPermissionChange(entity, REMOVED_ACCESS);
|
|
181
|
-
} else {
|
|
182
|
-
var permission = undoRemove ? _this.originalPermissionForEntity(entity) : REMOVED_ACCESS;
|
|
183
|
-
_this.setState(function (prevState) {
|
|
184
|
-
var sharesIndex = prevState.shares.findIndex(function (e) {
|
|
185
|
-
return e.get('id') == entity.get('id');
|
|
186
|
-
});
|
|
187
|
-
var newEntitiesIndex = prevState.newEntities.findIndex(function (e) {
|
|
188
|
-
return e.get('id') == entity.get('id');
|
|
189
|
-
});
|
|
190
|
-
var removedNewEntity = newEntitiesIndex > -1;
|
|
191
|
-
var newShares = removedNewEntity ? prevState.shares.delete(sharesIndex) : prevState.shares.setIn([sharesIndex, 'permission'], permission);
|
|
192
|
-
var newEntities = removedNewEntity ? prevState.newEntities.delete(newEntitiesIndex) : prevState.newEntities;
|
|
193
|
-
return {
|
|
194
|
-
shares: newShares,
|
|
195
|
-
newEntities: newEntities,
|
|
196
|
-
entitiesWithChangedPermission: Object.assign({}, prevState.entitiesWithChangedPermission, _defineProperty({}, entity.get('id'), permission))
|
|
197
|
-
};
|
|
198
|
-
}, _this.updateEntitiesCount);
|
|
199
|
-
}
|
|
175
|
+
_this.confirmPermissionChange(entity, REMOVED_ACCESS);
|
|
200
176
|
};
|
|
201
177
|
_this.handleSearchPermissionChange = function (e, _ref4) {
|
|
202
178
|
var value = _ref4.value;
|
|
@@ -223,21 +199,13 @@ export var SharingModalPresenter = (_dec = withStyleOverrides(generateStyle, gen
|
|
|
223
199
|
permission: _this.state.searchPermission
|
|
224
200
|
});
|
|
225
201
|
}));
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
});
|
|
234
|
-
} else {
|
|
235
|
-
_this.setState({
|
|
236
|
-
searchSelection: [],
|
|
237
|
-
shares: newEntities.concat(_this.state.shares),
|
|
238
|
-
newEntities: newEntities.concat(_this.state.newEntities)
|
|
239
|
-
}, _this.updateEntitiesCount);
|
|
240
|
-
}
|
|
202
|
+
newEntities.forEach(function (entity) {
|
|
203
|
+
_this.props.onShare(entity.toJS());
|
|
204
|
+
_this.props.shareBank(_this.sharedBankForEntity(entity), _this.props.getUserInfo);
|
|
205
|
+
});
|
|
206
|
+
_this.setState({
|
|
207
|
+
searchSelection: []
|
|
208
|
+
});
|
|
241
209
|
};
|
|
242
210
|
_this.updatePermission = /*#__PURE__*/function () {
|
|
243
211
|
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(entity, permission) {
|
|
@@ -282,19 +250,7 @@ export var SharingModalPresenter = (_dec = withStyleOverrides(generateStyle, gen
|
|
|
282
250
|
});
|
|
283
251
|
};
|
|
284
252
|
_this.handleEntityPermissionChange = function (entity, permission) {
|
|
285
|
-
|
|
286
|
-
_this.confirmPermissionChange(entity, permission);
|
|
287
|
-
} else {
|
|
288
|
-
_this.setState(function (prevState) {
|
|
289
|
-
var index = prevState.shares.findIndex(function (share) {
|
|
290
|
-
return share.get('id') === entity.get('id');
|
|
291
|
-
});
|
|
292
|
-
return {
|
|
293
|
-
shares: prevState.shares.setIn([index, 'permission'], permission),
|
|
294
|
-
entitiesWithChangedPermission: Object.assign({}, prevState.entitiesWithChangedPermission, _defineProperty({}, entity.get('id'), permission))
|
|
295
|
-
};
|
|
296
|
-
});
|
|
297
|
-
}
|
|
253
|
+
_this.confirmPermissionChange(entity, permission);
|
|
298
254
|
};
|
|
299
255
|
_this.toggleAccountShare = function (event) {
|
|
300
256
|
_this.setState(function (prevState) {
|
|
@@ -383,7 +339,7 @@ export var SharingModalPresenter = (_dec = withStyleOverrides(generateStyle, gen
|
|
|
383
339
|
}, {
|
|
384
340
|
key: "componentDidUpdate",
|
|
385
341
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
386
|
-
if (this.
|
|
342
|
+
if (this.state.accountPermission !== prevState.accountPermission && this.state.accountPermission !== this.props.bank.accountPermission) {
|
|
387
343
|
var updatedBank = this.props.bank.set('accountPermission', this.state.accountPermission);
|
|
388
344
|
this.props.updateBank(updatedBank, false);
|
|
389
345
|
}
|
|
@@ -502,37 +458,20 @@ export var SharingModalPresenter = (_dec = withStyleOverrides(generateStyle, gen
|
|
|
502
458
|
var existingAccounts = existingShares.filter(function (s) {
|
|
503
459
|
return s.get('entityType') === SHARED_WITH_ACCOUNT;
|
|
504
460
|
});
|
|
505
|
-
|
|
506
|
-
return this.renderSubaccountSharingEnabledEntities(existingPeople, existingCourses, existingAccounts);
|
|
507
|
-
}
|
|
508
|
-
return this.renderOriginalDesignEntities(existingPeople, existingCourses);
|
|
461
|
+
return this.renderSubaccountSharingEnabledEntities(existingPeople, existingCourses, existingAccounts);
|
|
509
462
|
}
|
|
510
463
|
}, {
|
|
511
464
|
key: "renderFooter",
|
|
512
465
|
value: function renderFooter() {
|
|
513
|
-
|
|
514
|
-
return jsx(Button, {
|
|
515
|
-
color: "primary",
|
|
516
|
-
margin: "0 x-small 0 0",
|
|
517
|
-
onClick: this.handleDismiss
|
|
518
|
-
}, t('Close'));
|
|
519
|
-
}
|
|
520
|
-
return jsx(React.Fragment, null, jsx(Button, {
|
|
521
|
-
"data-automation": "sdk-shared-bank-cancel-button",
|
|
522
|
-
color: "primary-inverse",
|
|
523
|
-
onClick: this.handleDismiss,
|
|
524
|
-
margin: "0 x-small 0 0"
|
|
525
|
-
}, t('Cancel')), jsx(Button, {
|
|
526
|
-
"data-automation": "sdk-shared-bank-done-button",
|
|
466
|
+
return jsx(Button, {
|
|
527
467
|
color: "primary",
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
}, t('
|
|
468
|
+
margin: "0 x-small 0 0",
|
|
469
|
+
onClick: this.handleDismiss
|
|
470
|
+
}, t('Close'));
|
|
531
471
|
}
|
|
532
472
|
}, {
|
|
533
473
|
key: "render",
|
|
534
474
|
value: function render() {
|
|
535
|
-
var subAccountBankSharingEnabled = this.props.subAccountBankSharingEnabled;
|
|
536
475
|
return jsx(Modal, {
|
|
537
476
|
open: this.props.isOpen,
|
|
538
477
|
onDismiss: this.handleDismiss,
|
|
@@ -545,7 +484,7 @@ export var SharingModalPresenter = (_dec = withStyleOverrides(generateStyle, gen
|
|
|
545
484
|
placement: "end",
|
|
546
485
|
offset: "medium",
|
|
547
486
|
screenReaderLabel: t('Close')
|
|
548
|
-
})), jsx(ModalBody, null,
|
|
487
|
+
})), jsx(ModalBody, null, this.state.shares.size >= 0 ? this.renderEntitiesSection() : _ref7), jsx(ModalFooter, null, this.renderFooter()));
|
|
549
488
|
}
|
|
550
489
|
}]);
|
|
551
490
|
SharingModalPresenter.displayName = "SharingModalPresenter";
|
|
@@ -580,7 +519,6 @@ export var SharingModalPresenter = (_dec = withStyleOverrides(generateStyle, gen
|
|
|
580
519
|
removeSharedBank: PropTypes.func.isRequired,
|
|
581
520
|
shareBank: PropTypes.func.isRequired,
|
|
582
521
|
sharedBanks: ImmutablePropTypes.list,
|
|
583
|
-
subAccountBankSharingEnabled: PropTypes.bool,
|
|
584
522
|
updateBank: PropTypes.func.isRequired,
|
|
585
523
|
updateSharedBankPermission: PropTypes.func.isRequired,
|
|
586
524
|
updateSharedCount: PropTypes.func,
|
|
@@ -595,7 +533,6 @@ export var SharingModalPresenter = (_dec = withStyleOverrides(generateStyle, gen
|
|
|
595
533
|
onDismiss: noop,
|
|
596
534
|
onShare: function onShare() {},
|
|
597
535
|
sharedBanks: List(),
|
|
598
|
-
subAccountBankSharingEnabled: false,
|
|
599
536
|
updateSharedCount: Function.prototype
|
|
600
537
|
}, _SharingModalPresenter)) || _class);
|
|
601
538
|
export default SharingModalPresenter;
|
|
@@ -21,7 +21,8 @@ export function createStimulus(stimulus, parentId, parentType) {
|
|
|
21
21
|
parent_stimulus_id: parentStimulusId,
|
|
22
22
|
source_url: stimulus.sourceUrl,
|
|
23
23
|
stimulus_type: stimulus.stimulusType,
|
|
24
|
-
title: stimulus.title
|
|
24
|
+
title: stimulus.title,
|
|
25
|
+
passage: stimulus.passage
|
|
25
26
|
};
|
|
26
27
|
var requestBody = JSON.stringify({
|
|
27
28
|
stimulus: stimulusParams
|
|
@@ -114,6 +114,12 @@ export var DeleteStimulusModal = (_dec = withStyleOverrides(generateStyle, gener
|
|
|
114
114
|
cancelText: t('Cancel')
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
|
+
}, {
|
|
118
|
+
key: "isPassage",
|
|
119
|
+
value: function isPassage() {
|
|
120
|
+
var _this$props$stimulusE;
|
|
121
|
+
return (_this$props$stimulusE = this.props.stimulusEntry) === null || _this$props$stimulusE === void 0 ? void 0 : _this$props$stimulusE.getEntry().passage;
|
|
122
|
+
}
|
|
117
123
|
}, {
|
|
118
124
|
key: "anyImmutableKeepers",
|
|
119
125
|
value: function anyImmutableKeepers() {
|
|
@@ -142,8 +148,8 @@ export var DeleteStimulusModal = (_dec = withStyleOverrides(generateStyle, gener
|
|
|
142
148
|
return jsx(Button, {
|
|
143
149
|
onClick: this.closeAction,
|
|
144
150
|
margin: XSMALL_SIDE_MARGIN,
|
|
145
|
-
"data-automation": "sdk-keep-stimulus-button"
|
|
146
|
-
}, t('Keep Stimulus'));
|
|
151
|
+
"data-automation": "sdk-keep-".concat(this.isPassage() ? 'passage' : 'stimulus', "-button")
|
|
152
|
+
}, this.isPassage() ? t('Keep Passage') : t('Keep Stimulus'));
|
|
147
153
|
}
|
|
148
154
|
}, {
|
|
149
155
|
key: "doneButton",
|
|
@@ -157,8 +163,8 @@ export var DeleteStimulusModal = (_dec = withStyleOverrides(generateStyle, gener
|
|
|
157
163
|
color: "primary",
|
|
158
164
|
onClick: this.handleSubmit,
|
|
159
165
|
margin: XSMALL_SIDE_MARGIN,
|
|
160
|
-
"data-automation": "sdk-remove-stimulus-button"
|
|
161
|
-
}, t('Remove Stimulus'));
|
|
166
|
+
"data-automation": "sdk-remove-".concat(this.isPassage() ? 'passage' : 'stimulus', "-button")
|
|
167
|
+
}, this.isPassage() ? t('Remove Passage') : t('Remove Stimulus'));
|
|
162
168
|
}
|
|
163
169
|
}, {
|
|
164
170
|
key: "renderChooseWhich",
|
|
@@ -199,7 +205,8 @@ export var DeleteStimulusModal = (_dec = withStyleOverrides(generateStyle, gener
|
|
|
199
205
|
}, {
|
|
200
206
|
key: "renderContent",
|
|
201
207
|
value: function renderContent() {
|
|
202
|
-
var
|
|
208
|
+
var message = this.isPassage() ? t('Are you sure you want to remove this passage?') : t('Are you sure you want to remove this stimulus?');
|
|
209
|
+
var content = this.props.childEntries.size === 0 ? jsx("span", null, message) : this.renderMainMenu();
|
|
203
210
|
var stimulusTitle = this.props.stimulusEntry && this.props.stimulusEntry.getEntry().title;
|
|
204
211
|
return jsx("div", {
|
|
205
212
|
className: "deleteStimulusModal",
|
|
@@ -215,11 +222,11 @@ export var DeleteStimulusModal = (_dec = withStyleOverrides(generateStyle, gener
|
|
|
215
222
|
open: this.props.modalOpen,
|
|
216
223
|
onDismiss: this.closeAction,
|
|
217
224
|
size: "small",
|
|
218
|
-
label: t('Confirm Stimulus Removal')
|
|
225
|
+
label: this.isPassage() ? t('Confirm Passage Removal') : t('Confirm Stimulus Removal')
|
|
219
226
|
}, jsx(ModalHeader, null, jsx(Heading, {
|
|
220
227
|
level: "reset",
|
|
221
228
|
as: "h2"
|
|
222
|
-
}, t('Confirm Stimulus Removal')), jsx(CloseButton, {
|
|
229
|
+
}, this.isPassage() ? t('Confirm Passage Removal') : t('Confirm Stimulus Removal')), jsx(CloseButton, {
|
|
223
230
|
onClick: this.closeAction,
|
|
224
231
|
placement: "end",
|
|
225
232
|
offset: "medium",
|
|
@@ -38,10 +38,10 @@ export var QuizEntry = (_dec = withStyleOverrides(generateStyle, generateCompone
|
|
|
38
38
|
function QuizEntry() {
|
|
39
39
|
var _this;
|
|
40
40
|
_classCallCheck(this, QuizEntry);
|
|
41
|
-
for (var _len = arguments.length,
|
|
42
|
-
|
|
41
|
+
for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
42
|
+
_args[_key] = arguments[_key];
|
|
43
43
|
}
|
|
44
|
-
_this = _super.call.apply(_super, [this].concat(
|
|
44
|
+
_this = _super.call.apply(_super, [this].concat(_args));
|
|
45
45
|
_this.itemOverrideTypes = function () {
|
|
46
46
|
return ['choice'].concat(_toConsumableArray(_this.props.partialScoringEnabled ? ['multi-answer'] : []), _toConsumableArray(_this.props.partialDeepScoringEnabled ? ['matching'] : []));
|
|
47
47
|
};
|
|
@@ -96,7 +96,14 @@ export var QuizEntry = (_dec = withStyleOverrides(generateStyle, generateCompone
|
|
|
96
96
|
};
|
|
97
97
|
_this.bankEntryWarningWrapperProps = function () {
|
|
98
98
|
if (_this.props.quizEntry.entryEditable) {
|
|
99
|
-
var
|
|
99
|
+
var _this$props$entry;
|
|
100
|
+
var isPassage = (_this$props$entry = _this.props.entry) === null || _this$props$entry === void 0 ? void 0 : _this$props$entry.passage;
|
|
101
|
+
var propsFunc = _this.props.quizEntry.hasStimulus ? function () {
|
|
102
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
103
|
+
args[_key2] = arguments[_key2];
|
|
104
|
+
}
|
|
105
|
+
return propsForStimulusBankEntryEditPrompt.apply(void 0, [isPassage].concat(args));
|
|
106
|
+
} : propsForItemBankEntryEditPrompt;
|
|
100
107
|
return propsFunc(_this.isEditing(), _this.props.switchOffEditing, function () {
|
|
101
108
|
var bankEntry = _this.props.quizEntry.getEntry();
|
|
102
109
|
_this.props.setUi(BUILD_TRAY_OPEN, true);
|
|
@@ -9,7 +9,6 @@ import { Component } from 'react';
|
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
11
11
|
import { View } from '@instructure/ui-view';
|
|
12
|
-
import { Flex } from '@instructure/ui-flex';
|
|
13
12
|
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
14
13
|
import { Text } from '@instructure/ui-text';
|
|
15
14
|
import NumberInput from '@instructure/quiz-number-input';
|
|
@@ -19,7 +18,7 @@ import { IconDiscussionLine, IconDiscussionSolid } from '@instructure/ui-icons';
|
|
|
19
18
|
import { interactionPoints } from '@instructure/quiz-interactions';
|
|
20
19
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
21
20
|
import EntrySave from "../../../../../../common/components/resources/entry/EntrySave/index.js";
|
|
22
|
-
import { ITEM_FEEDBACK_MODAL, ITEM_FEEDBACK_MODAL_ITEM, ITEM_FEEDBACK_MODAL_FEEDBACK, withStyleOverrides } from '@instructure/quiz-common';
|
|
21
|
+
import { Flex, ITEM_FEEDBACK_MODAL, ITEM_FEEDBACK_MODAL_ITEM, ITEM_FEEDBACK_MODAL_FEEDBACK, withStyleOverrides } from '@instructure/quiz-common';
|
|
23
22
|
import generateStyle from "./styles.js";
|
|
24
23
|
import generateComponentTheme from "./theme.js";
|
|
25
24
|
function pointsAsFloat(pointsString) {
|