@instructure/quiz-core 20.37.1 → 21.0.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/es/banks/components/BankSearch/presenter.js +1 -2
- package/es/banks/components/CreateBankModal/presenter.js +22 -24
- package/es/banks/components/EditBankModal/presenter.js +24 -22
- package/es/banks/components/SharingModal/presenter.js +0 -4
- 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/common/actions/modifications.js +3 -2
- package/es/common/components/ConfirmationModal/presenter.js +10 -7
- package/es/common/components/layout/Page/styles.js +13 -1
- 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 +0 -5
- 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 +5 -2
- package/es/common/components/resources/sessionItemResult/SessionItemResult/presenter.js +1 -1
- package/es/common/components/resources/stimulus/Stimulus/presenter.js +11 -4
- package/es/common/components/resources/stimulus/StimulusEdit/presenter.js +28 -10
- 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 +48 -30
- 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/resources/stimulus/StimulusShowInfo/index.js +7 -5
- 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/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/CreateBankModal/presenter.js +23 -24
- package/lib/banks/components/EditBankModal/presenter.js +25 -22
- package/lib/banks/components/SharingModal/presenter.js +0 -4
- 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/common/actions/modifications.js +3 -2
- package/lib/common/components/ConfirmationModal/presenter.js +10 -7
- package/lib/common/components/layout/Page/styles.js +13 -1
- 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 +0 -5
- 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 +5 -2
- package/lib/common/components/resources/sessionItemResult/SessionItemResult/presenter.js +1 -1
- package/lib/common/components/resources/stimulus/Stimulus/presenter.js +11 -4
- package/lib/common/components/resources/stimulus/StimulusEdit/presenter.js +28 -10
- 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 +48 -30
- 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/resources/stimulus/StimulusShowInfo/index.js +7 -5
- 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/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 +57 -62
- 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
|
@@ -23,6 +23,7 @@ var _uiView = require("@instructure/ui-view");
|
|
|
23
23
|
var _emotion = require("@instructure/emotion");
|
|
24
24
|
var _uiHeading = require("@instructure/ui-heading");
|
|
25
25
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
26
|
+
var _uiTooltip = require("@instructure/ui-tooltip");
|
|
26
27
|
var _quizCommon = require("@instructure/quiz-common");
|
|
27
28
|
var _windowChecks = require("../../../../util/windowChecks.js");
|
|
28
29
|
var _CustomPropTypes = _interopRequireDefault(require("../../../../util/CustomPropTypes.js"));
|
|
@@ -108,12 +109,19 @@ var Sidebar = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default, _them
|
|
|
108
109
|
}, {
|
|
109
110
|
key: "renderTitle",
|
|
110
111
|
value: function renderTitle() {
|
|
112
|
+
var navigationText = (0, _formatMessage.default)('Navigate to title');
|
|
111
113
|
if (this.props.grading) {
|
|
112
114
|
return;
|
|
113
115
|
}
|
|
114
116
|
return (0, _emotion.jsx)("div", {
|
|
115
117
|
css: this.props.styles.sidebar.actionableInfo,
|
|
116
118
|
className: _quizCommon.END_EDITING_TRIGGER_CLASSNAME
|
|
119
|
+
}, (0, _emotion.jsx)(_uiTooltip.Tooltip, {
|
|
120
|
+
renderTip: this.props.sidebarOpen ? '' : (0, _emotion.jsx)("span", {
|
|
121
|
+
"aria-hidden": "true"
|
|
122
|
+
}, navigationText),
|
|
123
|
+
placement: "start",
|
|
124
|
+
on: this.props.sidebarOpen ? [] : ['focus', 'hover']
|
|
117
125
|
}, (0, _emotion.jsx)(_uiLink.Link, {
|
|
118
126
|
href: "#",
|
|
119
127
|
margin: "small",
|
|
@@ -121,7 +129,7 @@ var Sidebar = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default, _them
|
|
|
121
129
|
onClick: this.scrollToTitle,
|
|
122
130
|
renderIcon: _ref,
|
|
123
131
|
"data-automation": "sidebar-title-button"
|
|
124
|
-
}, (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null,
|
|
132
|
+
}, (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, navigationText))), (0, _emotion.jsx)(_uiA11yContent.PresentationContent, null, (0, _emotion.jsx)("span", {
|
|
125
133
|
css: this.props.styles.sidebar.description,
|
|
126
134
|
"data-automation": "sidebar-title-text",
|
|
127
135
|
onClick: this.scrollToTitle,
|
|
@@ -131,12 +139,19 @@ var Sidebar = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default, _them
|
|
|
131
139
|
}, {
|
|
132
140
|
key: "renderInstructions",
|
|
133
141
|
value: function renderInstructions() {
|
|
142
|
+
var navigationText = (0, _formatMessage.default)('Navigate to instructions');
|
|
134
143
|
if (this.props.grading) {
|
|
135
144
|
return;
|
|
136
145
|
}
|
|
137
146
|
return (0, _emotion.jsx)("div", {
|
|
138
147
|
css: this.props.styles.sidebar.actionableInfo,
|
|
139
148
|
className: _quizCommon.END_EDITING_TRIGGER_CLASSNAME
|
|
149
|
+
}, (0, _emotion.jsx)(_uiTooltip.Tooltip, {
|
|
150
|
+
renderTip: this.props.sidebarOpen ? '' : (0, _emotion.jsx)("span", {
|
|
151
|
+
"aria-hidden": "true"
|
|
152
|
+
}, navigationText),
|
|
153
|
+
placement: "start",
|
|
154
|
+
on: this.props.sidebarOpen ? [] : ['focus', 'hover']
|
|
140
155
|
}, (0, _emotion.jsx)(_uiLink.Link, {
|
|
141
156
|
href: "#",
|
|
142
157
|
margin: "small",
|
|
@@ -144,7 +159,7 @@ var Sidebar = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default, _them
|
|
|
144
159
|
onClick: this.scrollToInfo,
|
|
145
160
|
renderIcon: _ref2,
|
|
146
161
|
"data-automation": "sidebar-instructions-button"
|
|
147
|
-
}, (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null,
|
|
162
|
+
}, (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, navigationText))), (0, _emotion.jsx)(_uiA11yContent.PresentationContent, null, (0, _emotion.jsx)("span", {
|
|
148
163
|
css: this.props.styles.sidebar.description,
|
|
149
164
|
"data-automation": "sidebar-instructions-text",
|
|
150
165
|
onClick: this.scrollToInfo,
|
|
@@ -154,11 +169,18 @@ var Sidebar = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default, _them
|
|
|
154
169
|
}, {
|
|
155
170
|
key: "renderResults",
|
|
156
171
|
value: function renderResults() {
|
|
172
|
+
var navigationText = (0, _formatMessage.default)('Navigate to results');
|
|
157
173
|
if (!this.props.grading) {
|
|
158
174
|
return;
|
|
159
175
|
}
|
|
160
176
|
return (0, _emotion.jsx)("div", {
|
|
161
177
|
css: this.props.styles.sidebar.actionableInfo
|
|
178
|
+
}, (0, _emotion.jsx)(_uiTooltip.Tooltip, {
|
|
179
|
+
renderTip: this.props.sidebarOpen ? '' : (0, _emotion.jsx)("span", {
|
|
180
|
+
"aria-hidden": "true"
|
|
181
|
+
}, navigationText),
|
|
182
|
+
placement: "start",
|
|
183
|
+
on: this.props.sidebarOpen ? [] : ['focus', 'hover']
|
|
162
184
|
}, (0, _emotion.jsx)(_uiLink.Link, {
|
|
163
185
|
href: "#",
|
|
164
186
|
margin: "small",
|
|
@@ -166,7 +188,7 @@ var Sidebar = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default, _them
|
|
|
166
188
|
onClick: this.scrollToResults,
|
|
167
189
|
renderIcon: _ref3,
|
|
168
190
|
"data-automation": "sidebar-results-button"
|
|
169
|
-
}, (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null,
|
|
191
|
+
}, (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, navigationText))), (0, _emotion.jsx)(_uiA11yContent.PresentationContent, null, (0, _emotion.jsx)("span", {
|
|
170
192
|
css: this.props.styles.sidebar.description,
|
|
171
193
|
"data-automation": "sidebar-results-text",
|
|
172
194
|
onClick: this.scrollToResults,
|
|
@@ -12,9 +12,7 @@ var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
12
12
|
var _react = require("react");
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
14
|
var _reactImmutableProptypes = _interopRequireDefault(require("react-immutable-proptypes"));
|
|
15
|
-
var _uiA11yContent = require("@instructure/ui-a11y-content");
|
|
16
15
|
var _uiLink = require("@instructure/ui-link");
|
|
17
|
-
var _uiFlex = require("@instructure/ui-flex");
|
|
18
16
|
var _emotion = require("@instructure/emotion");
|
|
19
17
|
var _index = _interopRequireDefault(require("../PositionSummary/index.js"));
|
|
20
18
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
@@ -22,6 +20,8 @@ var _quizRce = require("@instructure/quiz-rce");
|
|
|
22
20
|
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
23
21
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
24
22
|
var _quizCommon = require("@instructure/quiz-common");
|
|
23
|
+
var _uiTooltip = require("@instructure/ui-tooltip");
|
|
24
|
+
var _uiA11yContent = require("@instructure/ui-a11y-content");
|
|
25
25
|
var _dec, _class, _SidebarItem;
|
|
26
26
|
/** @jsx jsx */
|
|
27
27
|
var SidebarItem = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default, _theme.default), _dec(_class = (_SidebarItem = /*#__PURE__*/function (_Component) {
|
|
@@ -96,12 +96,18 @@ var SidebarItem = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default, _
|
|
|
96
96
|
displayPosition = _this$props2.displayPosition,
|
|
97
97
|
itemId = _this$props2.itemId,
|
|
98
98
|
isAnswered = _this$props2.isAnswered;
|
|
99
|
-
var
|
|
99
|
+
var content = !isAnswered && isAnswered !== null ? (0, _formatMessage.default)('Navigate to question at position {displayPosition}, unanswered', {
|
|
100
100
|
displayPosition: displayPosition
|
|
101
101
|
}) : (0, _formatMessage.default)('Navigate to question at position {displayPosition}', {
|
|
102
102
|
displayPosition: displayPosition
|
|
103
103
|
});
|
|
104
|
-
return (0, _emotion.jsx)(
|
|
104
|
+
return (0, _emotion.jsx)(_uiTooltip.Tooltip, {
|
|
105
|
+
renderTip: this.props.sidebarOpen ? '' : (0, _emotion.jsx)("span", {
|
|
106
|
+
"aria-hidden": "true"
|
|
107
|
+
}, content),
|
|
108
|
+
placement: "start",
|
|
109
|
+
on: this.props.sidebarOpen ? [] : ['hover', 'focus']
|
|
110
|
+
}, (0, _emotion.jsx)(_uiLink.Link, {
|
|
105
111
|
href: "#",
|
|
106
112
|
size: "small",
|
|
107
113
|
margin: "0 small",
|
|
@@ -111,8 +117,8 @@ var SidebarItem = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default, _
|
|
|
111
117
|
"data-automation-item-id": itemId,
|
|
112
118
|
"data-automation": "sdk-sidebar-item-button"
|
|
113
119
|
}, (0, _emotion.jsx)(_uiA11yContent.AccessibleContent, {
|
|
114
|
-
alt:
|
|
115
|
-
}, this.renderPosition()));
|
|
120
|
+
alt: content
|
|
121
|
+
}, this.renderPosition())));
|
|
116
122
|
}
|
|
117
123
|
}, {
|
|
118
124
|
key: "renderClosed",
|
|
@@ -134,9 +140,9 @@ var SidebarItem = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default, _
|
|
|
134
140
|
return (0, _emotion.jsx)("div", {
|
|
135
141
|
className: parentDivClass,
|
|
136
142
|
css: styles.sidebarItem
|
|
137
|
-
}, (0, _emotion.jsx)(
|
|
143
|
+
}, (0, _emotion.jsx)(_quizCommon.Flex, {
|
|
138
144
|
justifyItems: "space-between"
|
|
139
|
-
}, (0, _emotion.jsx)(
|
|
145
|
+
}, (0, _emotion.jsx)(_quizCommon.Flex.Item, null, this.renderButton()), (0, _emotion.jsx)(_quizCommon.Flex.Item, {
|
|
140
146
|
shouldGrow: true,
|
|
141
147
|
shouldShrink: true,
|
|
142
148
|
onClick: this.scrollToItem,
|
|
@@ -155,7 +161,7 @@ var SidebarItem = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default, _
|
|
|
155
161
|
css: this.props.styles.itemBody
|
|
156
162
|
}, (0, _emotion.jsx)(_quizRce.RichContentRenderer, {
|
|
157
163
|
content: this.props.itemBody
|
|
158
|
-
})))), (0, _emotion.jsx)(
|
|
164
|
+
})))), (0, _emotion.jsx)(_quizCommon.Flex.Item, null, (0, _emotion.jsx)("div", {
|
|
159
165
|
css: this.props.styles.pinWrapper
|
|
160
166
|
}, children))));
|
|
161
167
|
}
|
|
@@ -15,8 +15,6 @@ var _reactImmutableProptypes = _interopRequireDefault(require("react-immutable-p
|
|
|
15
15
|
var _uiIcons = require("@instructure/ui-icons");
|
|
16
16
|
var _emotion = require("@instructure/emotion");
|
|
17
17
|
var _uiLink = require("@instructure/ui-link");
|
|
18
|
-
var _uiFlex = require("@instructure/ui-flex");
|
|
19
|
-
var _uiA11yContent = require("@instructure/ui-a11y-content");
|
|
20
18
|
var _index = _interopRequireDefault(require("./Collection/index.js"));
|
|
21
19
|
var _index2 = _interopRequireDefault(require("./Title/index.js"));
|
|
22
20
|
var _index3 = _interopRequireDefault(require("./Summary/index.js"));
|
|
@@ -24,6 +22,8 @@ var _styles = _interopRequireDefault(require("./styles.js"));
|
|
|
24
22
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
25
23
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
26
24
|
var _quizCommon = require("@instructure/quiz-common");
|
|
25
|
+
var _uiTooltip = require("@instructure/ui-tooltip");
|
|
26
|
+
var _uiA11yContent = require("@instructure/ui-a11y-content");
|
|
27
27
|
var _dec, _class, _SidebarStimulus;
|
|
28
28
|
/** @jsx jsx */
|
|
29
29
|
var DISPLAY_AS_SUMMARY_LIMIT = 5;
|
|
@@ -86,16 +86,23 @@ var SidebarStimulus = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.defaul
|
|
|
86
86
|
key: "renderButton",
|
|
87
87
|
value: function renderButton() {
|
|
88
88
|
var displayPosition = this.props.displayPosition;
|
|
89
|
-
|
|
89
|
+
var textForNavigation = (0, _formatMessage.default)('Navigate to stimulus at position {displayPosition}', {
|
|
90
|
+
displayPosition: displayPosition
|
|
91
|
+
});
|
|
92
|
+
return (0, _emotion.jsx)(_uiTooltip.Tooltip, {
|
|
93
|
+
renderTip: this.props.sidebarOpen ? '' : (0, _emotion.jsx)("span", {
|
|
94
|
+
"aria-hidden": "true"
|
|
95
|
+
}, textForNavigation),
|
|
96
|
+
placement: "start",
|
|
97
|
+
on: this.props.sidebarOpen ? [] : ['hover', 'focus']
|
|
98
|
+
}, (0, _emotion.jsx)(_uiLink.Link, {
|
|
90
99
|
href: "#",
|
|
91
100
|
margin: "small",
|
|
92
101
|
forceButtonRole: false,
|
|
93
102
|
onClick: this.scrollToItem,
|
|
94
103
|
renderIcon: _ref,
|
|
95
104
|
className: _quizCommon.END_EDITING_TRIGGER_CLASSNAME
|
|
96
|
-
}, (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null,
|
|
97
|
-
displayPosition: displayPosition
|
|
98
|
-
})));
|
|
105
|
+
}, (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, textForNavigation)));
|
|
99
106
|
}
|
|
100
107
|
}, {
|
|
101
108
|
key: "renderClosed",
|
|
@@ -124,16 +131,16 @@ var SidebarStimulus = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.defaul
|
|
|
124
131
|
css: this.props.styles.infoHeader
|
|
125
132
|
}, (0, _formatMessage.default)('Stimulus')), (0, _emotion.jsx)("div", {
|
|
126
133
|
css: this.props.styles.stimulusBody
|
|
127
|
-
}, (0, _emotion.jsx)(
|
|
134
|
+
}, (0, _emotion.jsx)(_quizCommon.Flex, {
|
|
128
135
|
justifyItems: "space-between"
|
|
129
|
-
}, (0, _emotion.jsx)(
|
|
136
|
+
}, (0, _emotion.jsx)(_quizCommon.Flex.Item, null, this.renderButton()), (0, _emotion.jsx)(_quizCommon.Flex.Item, {
|
|
130
137
|
shouldGrow: true,
|
|
131
138
|
shouldShrink: true,
|
|
132
139
|
onClick: this.scrollToItem,
|
|
133
140
|
tabIndex: "-1"
|
|
134
141
|
}, (0, _emotion.jsx)(_index2.default, {
|
|
135
142
|
title: stimulus.title
|
|
136
|
-
})), (0, _emotion.jsx)(
|
|
143
|
+
})), (0, _emotion.jsx)(_quizCommon.Flex.Item, null, children)), (0, _emotion.jsx)(_index3.default, {
|
|
137
144
|
startPosition: displayPosition,
|
|
138
145
|
isDragging: isDragging,
|
|
139
146
|
isShowingItems: isShowingItems,
|
|
@@ -21,7 +21,6 @@ var _componentForItem = _interopRequireDefault(require("../../../../util/compone
|
|
|
21
21
|
var _quizCommon = require("@instructure/quiz-common");
|
|
22
22
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
23
23
|
var _interactionTypePropsHelper = require("../../../../util/interactionTypePropsHelper.js");
|
|
24
|
-
var _ElementsForSelectors = _interopRequireDefault(require("../../../../../common/util/ElementsForSelectors.js"));
|
|
25
24
|
var _instUIMessages = require("../../../../util/instUIMessages.js");
|
|
26
25
|
var ItemEdit = /*#__PURE__*/function (_Component) {
|
|
27
26
|
(0, _inherits2.default)(ItemEdit, _Component);
|
|
@@ -40,9 +39,6 @@ var ItemEdit = /*#__PURE__*/function (_Component) {
|
|
|
40
39
|
}
|
|
41
40
|
return null;
|
|
42
41
|
};
|
|
43
|
-
_this.applicationElement = function () {
|
|
44
|
-
return (0, _ElementsForSelectors.default)(_this.props.appContainer);
|
|
45
|
-
};
|
|
46
42
|
_this.onModalOpen = function () {
|
|
47
43
|
_this.props.occludeQuizEntries(true);
|
|
48
44
|
};
|
|
@@ -105,7 +101,6 @@ var ItemEdit = /*#__PURE__*/function (_Component) {
|
|
|
105
101
|
component: /*#__PURE__*/_react.default.createElement(_OutcomeAlignments.default, Object.assign({
|
|
106
102
|
artifactType: "quizEntry",
|
|
107
103
|
artifactId: itemId,
|
|
108
|
-
applicationElement: this.applicationElement,
|
|
109
104
|
alignmentSetId: outcomeAlignmentSetGuid,
|
|
110
105
|
contextUuid: this.props.contextUuid
|
|
111
106
|
}, launchContexts.length > 0 && {
|
|
@@ -46,11 +46,11 @@ var AddContentBody = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default
|
|
|
46
46
|
_this.props.setUi(_quizCommon.BUILD_TRAY_POSITION, _this.props.position);
|
|
47
47
|
_this.props.setUi(_quizCommon.BUILD_TRAY_STIMULUS_ID, _this.props.parentEntryId);
|
|
48
48
|
};
|
|
49
|
-
_this.addStimulus = function () {
|
|
49
|
+
_this.addStimulus = function (isPassage) {
|
|
50
50
|
if (_this.props.editingQuizEntry) {
|
|
51
51
|
_this.props.setNextQuizEntry(null, _this.props.quizId, _this.props.position);
|
|
52
52
|
} else {
|
|
53
|
-
_this.props.createStimulus(_this.props.quizId, _this.props.position);
|
|
53
|
+
_this.props.createStimulus(_this.props.quizId, _this.props.position, isPassage);
|
|
54
54
|
}
|
|
55
55
|
_this.props.onAddItem();
|
|
56
56
|
};
|
|
@@ -14,7 +14,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
14
14
|
var _uiPopover = require("@instructure/ui-popover");
|
|
15
15
|
var _emotion = require("@instructure/emotion");
|
|
16
16
|
var _CustomPropTypes = _interopRequireDefault(require("../../../../../util/CustomPropTypes.js"));
|
|
17
|
-
var _ElementsForSelectors = _interopRequireDefault(require("../../../../../util/ElementsForSelectors.js"));
|
|
18
17
|
var _windowChecks = require("../../../../../util/windowChecks.js");
|
|
19
18
|
var _index = _interopRequireDefault(require("../Button/index.js"));
|
|
20
19
|
var _index2 = _interopRequireDefault(require("../Body/index.js"));
|
|
@@ -33,9 +32,6 @@ var AddContentPopover = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.defa
|
|
|
33
32
|
args[_key] = arguments[_key];
|
|
34
33
|
}
|
|
35
34
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
36
|
-
_this.applicationElement = function () {
|
|
37
|
-
return (0, _ElementsForSelectors.default)(_this.props.appContainer);
|
|
38
|
-
};
|
|
39
35
|
_this.showContent = function () {
|
|
40
36
|
_this.props.switchOnEditing();
|
|
41
37
|
};
|
|
@@ -10,7 +10,7 @@ var generateStyle = function generateStyle(componentTheme) {
|
|
|
10
10
|
position: 'relative',
|
|
11
11
|
width: '100%',
|
|
12
12
|
boxSizing: 'border-box',
|
|
13
|
-
padding:
|
|
13
|
+
padding: componentTheme.wrapperPadding,
|
|
14
14
|
'&::after': {
|
|
15
15
|
clear: 'both',
|
|
16
16
|
content: '""',
|
|
@@ -21,8 +21,11 @@ var generateStyle = function generateStyle(componentTheme) {
|
|
|
21
21
|
'&:first-of-type': {
|
|
22
22
|
margin: "0 0 ".concat(componentTheme.userContentMargin)
|
|
23
23
|
},
|
|
24
|
-
'&:last-
|
|
24
|
+
'&:last-of-type': {
|
|
25
25
|
margin: "".concat(componentTheme.userContentMargin, " 0 0")
|
|
26
|
+
},
|
|
27
|
+
'&:only-child': {
|
|
28
|
+
margin: 0
|
|
26
29
|
}
|
|
27
30
|
}
|
|
28
31
|
},
|
|
@@ -115,7 +115,7 @@ var SessionItemResult = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.defa
|
|
|
115
115
|
size: "small",
|
|
116
116
|
margin: "small"
|
|
117
117
|
}, (0, _emotion.jsx)(_uiText.Text, {
|
|
118
|
-
color: "
|
|
118
|
+
color: "alert"
|
|
119
119
|
}, (0, _formatMessage.default)("Regrade score { possible, plural,\n one {{points, number} / # point}\n other {{points, number} / # points}\n }", {
|
|
120
120
|
points: this.props.sessionItemResult.regradeInfo.get('newScore') || 0,
|
|
121
121
|
possible: this.props.sessionItemResult.regradeInfo.get('newPointsPossible')
|
|
@@ -74,6 +74,11 @@ var Stimulus = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default, _the
|
|
|
74
74
|
lockBlueprintContentEnabled = _this$props2.lockBlueprintContentEnabled;
|
|
75
75
|
return lockBlueprintContentEnabled && isContentLockedByBlueprint;
|
|
76
76
|
}
|
|
77
|
+
}, {
|
|
78
|
+
key: "isPassage",
|
|
79
|
+
value: function isPassage() {
|
|
80
|
+
return this.props.stimulus.passage;
|
|
81
|
+
}
|
|
77
82
|
}, {
|
|
78
83
|
key: "renderChildQuizEntries",
|
|
79
84
|
value: function renderChildQuizEntries() {
|
|
@@ -101,9 +106,10 @@ var Stimulus = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default, _the
|
|
|
101
106
|
key: "renderStimulusPanel",
|
|
102
107
|
value: function renderStimulusPanel() {
|
|
103
108
|
var StimulusComponent = this.props.isEditing ? _index2.default : _index3.default;
|
|
109
|
+
var automationPrefix = this.isPassage() ? 'passage' : 'stimulus';
|
|
104
110
|
var connectDragPreview = this.props.connectDragPreview;
|
|
105
111
|
return connectDragPreview((0, _emotion.jsx)("div", {
|
|
106
|
-
"data-automation": "sdk-
|
|
112
|
+
"data-automation": "sdk-".concat(automationPrefix, "-LeftPanelShow")
|
|
107
113
|
}, (0, _emotion.jsx)(StimulusComponent, {
|
|
108
114
|
bankEntryWarningWrapperProps: this.props.bankEntryWarningWrapperProps,
|
|
109
115
|
connectDragSource: this.props.connectDragSource,
|
|
@@ -128,17 +134,18 @@ var Stimulus = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default, _the
|
|
|
128
134
|
}, {
|
|
129
135
|
key: "renderPanels",
|
|
130
136
|
value: function renderPanels(propsForDnDZone) {
|
|
137
|
+
var automationPrefix = this.isPassage() ? 'passage' : 'stimulus';
|
|
131
138
|
return (0, _emotion.jsx)("div", {
|
|
132
139
|
css: this.props.styles.stimulus,
|
|
133
140
|
ref: this.props.dndRef,
|
|
134
|
-
"data-automation": "sdk-
|
|
141
|
+
"data-automation": "sdk-".concat(automationPrefix)
|
|
135
142
|
}, (0, _emotion.jsx)("div", {
|
|
136
143
|
css: this.props.styles.leftPanel
|
|
137
144
|
}, this.renderStimulusPanel()), (0, _emotion.jsx)("div", {
|
|
138
145
|
css: this.props.styles.itemPanel
|
|
139
|
-
}, (0, _emotion.jsx)("div", null), this.renderChildQuizEntries(), (0, _emotion.jsx)(_index4.default, Object.assign({}, propsForDnDZone, {
|
|
146
|
+
}, (0, _emotion.jsx)("div", null), this.renderChildQuizEntries(), !this.isPassage() && (0, _emotion.jsx)(_index4.default, Object.assign({}, propsForDnDZone, {
|
|
140
147
|
location: "in"
|
|
141
|
-
})), this.props.childEntries.size === 0 && !this.isQuizContentLocked() && (0, _emotion.jsx)(_index.default, {
|
|
148
|
+
})), this.props.childEntries.size === 0 && !this.isQuizContentLocked() && !this.isPassage() && (0, _emotion.jsx)(_index.default, {
|
|
142
149
|
allowStimulusCreation: false,
|
|
143
150
|
stimulusId: this.props.stimulus.id,
|
|
144
151
|
parentEntryId: this.props.quizEntry.id,
|
|
@@ -20,6 +20,8 @@ var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
|
20
20
|
var _uiButtons = require("@instructure/ui-buttons");
|
|
21
21
|
var _uiToggleDetails = require("@instructure/ui-toggle-details");
|
|
22
22
|
var _emotion = require("@instructure/emotion");
|
|
23
|
+
var _uiText = require("@instructure/ui-text");
|
|
24
|
+
var _uiView = require("@instructure/ui-view");
|
|
23
25
|
var _quizCommon = require("@instructure/quiz-common");
|
|
24
26
|
var _warningHelpers = require("../../../../util/warningHelpers.js");
|
|
25
27
|
var _index = _interopRequireDefault(require("../../../../../banks/components/AddToBankModal/index.js"));
|
|
@@ -63,6 +65,7 @@ var StimulusEdit = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default,
|
|
|
63
65
|
_this.props.setUi(_quizCommon.SHOULD_CLONE_ITEM, false);
|
|
64
66
|
};
|
|
65
67
|
_this.handleDeleteTemporary = function () {
|
|
68
|
+
var isPassage = _this.isPassage();
|
|
66
69
|
_this.props.withConfirm(function () {
|
|
67
70
|
_this.onCancel();
|
|
68
71
|
_this.props.setUi(_quizCommon.DELETED_QUIZ_ENTRY, {
|
|
@@ -70,10 +73,11 @@ var StimulusEdit = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default,
|
|
|
70
73
|
inStimulus: false
|
|
71
74
|
});
|
|
72
75
|
}, {
|
|
73
|
-
title: (0, _formatMessage.default)('Confirm Stimulus Removal'),
|
|
74
|
-
text: (0, _formatMessage.default)('Are you sure you want to remove this stimulus?'),
|
|
75
|
-
continueText: (0, _formatMessage.default)('Remove Stimulus'),
|
|
76
|
-
cancelText: (0, _formatMessage.default)('Keep Stimulus')
|
|
76
|
+
title: isPassage ? (0, _formatMessage.default)('Confirm Passage Removal') : (0, _formatMessage.default)('Confirm Stimulus Removal'),
|
|
77
|
+
text: isPassage ? (0, _formatMessage.default)('Are you sure you want to remove this passage?') : (0, _formatMessage.default)('Are you sure you want to remove this stimulus?'),
|
|
78
|
+
continueText: isPassage ? (0, _formatMessage.default)('Remove Passage') : (0, _formatMessage.default)('Remove Stimulus'),
|
|
79
|
+
cancelText: isPassage ? (0, _formatMessage.default)('Keep Passage ') : (0, _formatMessage.default)('Keep Stimulus'),
|
|
80
|
+
automationPrefix: isPassage ? 'passage' : 'stimulus'
|
|
77
81
|
});
|
|
78
82
|
};
|
|
79
83
|
_this.handleDeleteStimulus = function () {
|
|
@@ -298,6 +302,12 @@ var StimulusEdit = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default,
|
|
|
298
302
|
outsideApp = _checkClickedNode.outsideApp;
|
|
299
303
|
return outsideApp || !isEndEditingTrigger;
|
|
300
304
|
}
|
|
305
|
+
}, {
|
|
306
|
+
key: "isPassage",
|
|
307
|
+
value: function isPassage() {
|
|
308
|
+
var _this$props$stimulus;
|
|
309
|
+
return (_this$props$stimulus = this.props.stimulus) === null || _this$props$stimulus === void 0 ? void 0 : _this$props$stimulus.passage;
|
|
310
|
+
}
|
|
301
311
|
}, {
|
|
302
312
|
key: "afterSubmit",
|
|
303
313
|
value: function afterSubmit() {
|
|
@@ -325,7 +335,12 @@ var StimulusEdit = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default,
|
|
|
325
335
|
}, {
|
|
326
336
|
key: "renderAddToBankOptions",
|
|
327
337
|
value: function renderAddToBankOptions() {
|
|
328
|
-
|
|
338
|
+
var paddingTopStyle = this.isPassage() ? {
|
|
339
|
+
padding: 'small 0 0'
|
|
340
|
+
} : {};
|
|
341
|
+
return (0, _emotion.jsx)(_uiView.View, Object.assign({
|
|
342
|
+
as: "div"
|
|
343
|
+
}, paddingTopStyle), (0, _emotion.jsx)(_uiToggleDetails.ToggleDetails, {
|
|
329
344
|
variant: "filled",
|
|
330
345
|
key: "itemBanking",
|
|
331
346
|
summary: (0, _formatMessage.default)('Item Banking')
|
|
@@ -345,14 +360,17 @@ var StimulusEdit = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default,
|
|
|
345
360
|
}, {
|
|
346
361
|
key: "renderStimulusEdit",
|
|
347
362
|
value: function renderStimulusEdit() {
|
|
363
|
+
var stimulusLabel = this.isPassage() ? (0, _formatMessage.default)('Passage') : (0, _formatMessage.default)('Stimulus');
|
|
364
|
+
var automationPrefix = this.isPassage() ? 'passage' : 'stimulus';
|
|
348
365
|
return (0, _emotion.jsx)("div", null, (0, _emotion.jsx)("div", {
|
|
349
366
|
css: this.props.styles.stimulus,
|
|
350
367
|
ref: this.handleRef
|
|
351
368
|
}, (0, _emotion.jsx)("div", {
|
|
352
369
|
css: this.props.styles.header
|
|
353
|
-
}, (0, _emotion.jsx)(
|
|
354
|
-
|
|
355
|
-
|
|
370
|
+
}, (0, _emotion.jsx)(_uiText.Text, {
|
|
371
|
+
size: "small",
|
|
372
|
+
color: "secondary"
|
|
373
|
+
}, stimulusLabel), (0, _emotion.jsx)(_index6.default, {
|
|
356
374
|
connectDragSource: this.props.connectDragSource,
|
|
357
375
|
displayPosition: this.props.displayPosition,
|
|
358
376
|
onDelete: this.handleDeleteStimulus,
|
|
@@ -377,7 +395,7 @@ var StimulusEdit = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default,
|
|
|
377
395
|
}, (0, _emotion.jsx)(_uiButtons.Button, {
|
|
378
396
|
type: "button",
|
|
379
397
|
onClick: this.onCancel,
|
|
380
|
-
"data-automation": "sdk-
|
|
398
|
+
"data-automation": "sdk-".concat(automationPrefix, "-discardButton")
|
|
381
399
|
}, (0, _formatMessage.default)('Cancel'))), (0, _emotion.jsx)("div", {
|
|
382
400
|
className: "submitButtonWrapper",
|
|
383
401
|
css: this.props.styles.buttonWrapper
|
|
@@ -386,7 +404,7 @@ var StimulusEdit = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default,
|
|
|
386
404
|
color: "primary",
|
|
387
405
|
disabled: !this.state.canSubmit,
|
|
388
406
|
onClick: this.onSubmit,
|
|
389
|
-
"data-automation": "sdk-
|
|
407
|
+
"data-automation": "sdk-".concat(automationPrefix, "-done-button")
|
|
390
408
|
}, (0, _formatMessage.default)('Done')))));
|
|
391
409
|
}
|
|
392
410
|
}, {
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var generateStyle = function generateStyle(componentTheme) {
|
|
7
|
+
var generateStyle = function generateStyle(componentTheme, props) {
|
|
8
8
|
return {
|
|
9
9
|
stimulus: {
|
|
10
10
|
paddingTop: componentTheme.stimulusPadding,
|
|
@@ -29,10 +29,6 @@ var generateStyle = function generateStyle(componentTheme) {
|
|
|
29
29
|
height: '100%',
|
|
30
30
|
padding: componentTheme.stimulusContentPadding
|
|
31
31
|
},
|
|
32
|
-
stimulusLabel: {
|
|
33
|
-
color: componentTheme.stimulusLabelColor,
|
|
34
|
-
fontSize: componentTheme.stimulusLabelFontSize
|
|
35
|
-
},
|
|
36
32
|
stimulusButtons: {
|
|
37
33
|
flex: '0 0 auto',
|
|
38
34
|
display: 'inline-flex',
|
|
@@ -15,8 +15,6 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
15
15
|
optionPadding: spacing.small,
|
|
16
16
|
stimulusContentPadding: spacing.small,
|
|
17
17
|
stimulusContentPaddingBottom: spacing.small,
|
|
18
|
-
stimulusLabelColor: colors.ash,
|
|
19
|
-
stimulusLabelFontSize: typography.fontSizeSmall,
|
|
20
18
|
stimulusButtonsColor: colors.oxford,
|
|
21
19
|
stimulusButtonsZIndex: '3333'
|
|
22
20
|
};
|
|
@@ -65,8 +65,12 @@ var StimulusEditInfo = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.defau
|
|
|
65
65
|
}
|
|
66
66
|
(0, _createClass2.default)(StimulusEditInfo, [{
|
|
67
67
|
key: "headerText",
|
|
68
|
-
value: function headerText() {
|
|
69
|
-
|
|
68
|
+
value: function headerText(stimulus) {
|
|
69
|
+
if (stimulus.isTemporary()) {
|
|
70
|
+
return stimulus.passage ? (0, _formatMessage.default)('Add Passage') : (0, _formatMessage.default)('Add Stimulus');
|
|
71
|
+
} else {
|
|
72
|
+
return stimulus.passage ? (0, _formatMessage.default)('Edit Passage') : (0, _formatMessage.default)('Edit Stimulus');
|
|
73
|
+
}
|
|
70
74
|
}
|
|
71
75
|
}, {
|
|
72
76
|
key: "renderOptionalLabel",
|
|
@@ -99,38 +103,67 @@ var StimulusEditInfo = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.defau
|
|
|
99
103
|
value: "top"
|
|
100
104
|
}, (0, _formatMessage.default)('Questions below'))));
|
|
101
105
|
}
|
|
106
|
+
}, {
|
|
107
|
+
key: "renderInstructions",
|
|
108
|
+
value: function renderInstructions(stimulus) {
|
|
109
|
+
if (stimulus.passage) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
return (0, _emotion.jsx)("div", {
|
|
113
|
+
css: this.props.styles.section
|
|
114
|
+
}, (0, _emotion.jsx)(_quizCommon.TextInput, {
|
|
115
|
+
renderLabel: this.renderOptionalLabel((0, _formatMessage.default)('Instructions')),
|
|
116
|
+
onChange: this.onTextInputChange('instructions'),
|
|
117
|
+
value: stimulus.get('instructions'),
|
|
118
|
+
"data-automation": "sdk-stimulus-instructions-input"
|
|
119
|
+
}));
|
|
120
|
+
}
|
|
121
|
+
}, {
|
|
122
|
+
key: "renderOptions",
|
|
123
|
+
value: function renderOptions(stimulus) {
|
|
124
|
+
if (stimulus.passage) {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
return (0, _emotion.jsx)("div", {
|
|
128
|
+
css: this.props.styles.section
|
|
129
|
+
}, (0, _emotion.jsx)(_uiToggleDetails.ToggleDetails, {
|
|
130
|
+
defaultExpanded: true,
|
|
131
|
+
variant: "filled",
|
|
132
|
+
key: "options",
|
|
133
|
+
summary: (0, _formatMessage.default)('Options')
|
|
134
|
+
}, this.props.stimulusOrientationEnabled ? this.renderStimulusOrientationSelect() : null, (0, _emotion.jsx)("div", {
|
|
135
|
+
css: this.props.styles.section
|
|
136
|
+
}, (0, _emotion.jsx)(_quizCommon.TextInput, {
|
|
137
|
+
renderLabel: this.renderOptionalLabel((0, _formatMessage.default)('Source URL'), (0, _formatMessage.default)('(optional - not visible to students)')),
|
|
138
|
+
onChange: this.onTextInputChange('sourceUrl'),
|
|
139
|
+
value: stimulus.get('sourceUrl'),
|
|
140
|
+
"data-automation": "sdk-source-url-input"
|
|
141
|
+
}))));
|
|
142
|
+
}
|
|
102
143
|
}, {
|
|
103
144
|
key: "render",
|
|
104
145
|
value: function render() {
|
|
105
146
|
var stimulus = this.props.workingStimulus;
|
|
106
147
|
var textAreaId = "stimulusBodyEdit_".concat(stimulus.id, "_").concat(this.props.isBankedContent);
|
|
107
148
|
var stimulusBodyId = "stimulusBodyEdit_".concat(stimulus.id, "_body");
|
|
149
|
+
var automationPrefix = stimulus.passage ? 'passage' : 'stimulus';
|
|
108
150
|
return (0, _emotion.jsx)(_quizCommon.FormFieldGroup, {
|
|
109
151
|
messages: this.inputErrors('onSelf'),
|
|
110
152
|
description: (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('Edit Stimulus'))
|
|
111
153
|
}, (0, _emotion.jsx)(_uiHeading.Heading, {
|
|
112
154
|
level: "h3",
|
|
113
155
|
as: "h2"
|
|
114
|
-
}, this.headerText()), (0, _emotion.jsx)("div", {
|
|
156
|
+
}, this.headerText(stimulus)), (0, _emotion.jsx)("div", {
|
|
115
157
|
css: this.props.styles.section
|
|
116
158
|
}, (0, _emotion.jsx)(_quizCommon.TextInput, {
|
|
117
159
|
messages: this.inputErrors('title'),
|
|
118
160
|
renderLabel: (0, _formatMessage.default)('Title'),
|
|
119
161
|
isRequired: true,
|
|
120
|
-
type: "text",
|
|
121
162
|
ref: this.props.setTitleRef,
|
|
122
163
|
onChange: this.onTextInputChange('title'),
|
|
123
164
|
value: stimulus.get('title'),
|
|
124
|
-
"data-automation": "sdk-
|
|
125
|
-
})), (0, _emotion.jsx)("div", {
|
|
126
|
-
css: this.props.styles.section
|
|
127
|
-
}, (0, _emotion.jsx)(_quizCommon.TextInput, {
|
|
128
|
-
renderLabel: this.renderOptionalLabel((0, _formatMessage.default)('Instructions')),
|
|
129
|
-
type: "text",
|
|
130
|
-
onChange: this.onTextInputChange('instructions'),
|
|
131
|
-
value: stimulus.get('instructions'),
|
|
132
|
-
"data-automation": "sdk-stimulus-instructions-input"
|
|
133
|
-
})), (0, _emotion.jsx)("div", {
|
|
165
|
+
"data-automation": "sdk-".concat(automationPrefix, "-title-input")
|
|
166
|
+
})), this.renderInstructions(stimulus), (0, _emotion.jsx)("div", {
|
|
134
167
|
css: this.props.styles.section
|
|
135
168
|
}, (0, _emotion.jsx)(_quizCommon.FormField, {
|
|
136
169
|
id: stimulusBodyId
|
|
@@ -145,22 +178,7 @@ var StimulusEditInfo = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.defau
|
|
|
145
178
|
onBlur: this.onBodyChange,
|
|
146
179
|
onChange: this.onBodyChange,
|
|
147
180
|
height: _quizRce.RCE_SINGLE_LINE_HEIGHT
|
|
148
|
-
}))), (
|
|
149
|
-
css: this.props.styles.section
|
|
150
|
-
}, (0, _emotion.jsx)(_uiToggleDetails.ToggleDetails, {
|
|
151
|
-
defaultExpanded: true,
|
|
152
|
-
variant: "filled",
|
|
153
|
-
key: "options",
|
|
154
|
-
summary: (0, _formatMessage.default)('Options')
|
|
155
|
-
}, this.props.stimulusOrientationEnabled ? this.renderStimulusOrientationSelect() : null, (0, _emotion.jsx)("div", {
|
|
156
|
-
css: this.props.styles.section
|
|
157
|
-
}, (0, _emotion.jsx)(_quizCommon.TextInput, {
|
|
158
|
-
renderLabel: this.renderOptionalLabel((0, _formatMessage.default)('Source URL'), (0, _formatMessage.default)('(optional - not visible to students)')),
|
|
159
|
-
type: "text",
|
|
160
|
-
onChange: this.onTextInputChange('sourceUrl'),
|
|
161
|
-
value: stimulus.get('sourceUrl'),
|
|
162
|
-
"data-automation": "sdk-source-url-input"
|
|
163
|
-
})))));
|
|
181
|
+
}))), this.renderOptions(stimulus));
|
|
164
182
|
}
|
|
165
183
|
}]);
|
|
166
184
|
StimulusEditInfo.displayName = "StimulusEditInfo";
|
|
@@ -14,6 +14,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
14
14
|
var _reactImmutableProptypes = _interopRequireDefault(require("react-immutable-proptypes"));
|
|
15
15
|
var _uiIcons = require("@instructure/ui-icons");
|
|
16
16
|
var _emotion = require("@instructure/emotion");
|
|
17
|
+
var _uiText = require("@instructure/ui-text");
|
|
17
18
|
var _index = _interopRequireDefault(require("../StimulusShowInfo/index.js"));
|
|
18
19
|
var _index2 = _interopRequireDefault(require("../../../../../building/components/resources/ActionButtons/index.js"));
|
|
19
20
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
@@ -50,6 +51,7 @@ var StimulusShow = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default,
|
|
|
50
51
|
}, {
|
|
51
52
|
key: "render",
|
|
52
53
|
value: function render() {
|
|
54
|
+
var stimulusLabel = this.props.stimulus.passage ? (0, _formatMessage.default)('Passage') : (0, _formatMessage.default)('Stimulus');
|
|
53
55
|
return (0, _emotion.jsx)(_index3.default, {
|
|
54
56
|
onClick: this.switchOnEditing,
|
|
55
57
|
wrapperStyles: this.props.styles.stimulusWrapper,
|
|
@@ -61,9 +63,13 @@ var StimulusShow = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.default,
|
|
|
61
63
|
css: this.props.styles.header
|
|
62
64
|
}, (0, _emotion.jsx)("div", {
|
|
63
65
|
css: this.props.styles.leftHeader
|
|
64
|
-
}, this.renderBankIcon(), (0, _emotion.jsx)(
|
|
65
|
-
|
|
66
|
-
}, (0,
|
|
66
|
+
}, this.renderBankIcon(), (0, _emotion.jsx)(_quizCommon.Flex, {
|
|
67
|
+
margin: "0 x-small"
|
|
68
|
+
}, (0, _emotion.jsx)(_uiText.Text, {
|
|
69
|
+
size: "small",
|
|
70
|
+
color: "secondary",
|
|
71
|
+
margin: "0 x-small"
|
|
72
|
+
}, stimulusLabel))), (0, _emotion.jsx)(_index2.default, {
|
|
67
73
|
connectDragSource: this.props.connectDragSource,
|
|
68
74
|
displayPosition: this.props.displayPosition,
|
|
69
75
|
onDelete: this.props.openDeleteStimulusModal,
|