@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
|
@@ -11,7 +11,7 @@ import PropTypes from 'prop-types';
|
|
|
11
11
|
import { List } from 'immutable';
|
|
12
12
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
13
13
|
import { IconMoveStartLine, IconMoveEndLine, IconPinSolid, IconQuizInstructionsLine, IconQuizTitleLine } from '@instructure/ui-icons';
|
|
14
|
-
import { AccessibleContent,
|
|
14
|
+
import { AccessibleContent, PresentationContent, ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
15
15
|
import { IconButton } from '@instructure/ui-buttons';
|
|
16
16
|
import { Link } from '@instructure/ui-link';
|
|
17
17
|
import { Text } from '@instructure/ui-text';
|
|
@@ -19,6 +19,7 @@ import { View } from '@instructure/ui-view';
|
|
|
19
19
|
import { jsx, Global } from '@instructure/emotion';
|
|
20
20
|
import { Heading } from '@instructure/ui-heading';
|
|
21
21
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
22
|
+
import { Tooltip } from '@instructure/ui-tooltip';
|
|
22
23
|
import { INSTRUCTIONS_SCROLL_KEY, RESULTS_SCROLL_KEY, SIDEBAR_NAV_ID, TITLE_SCROLL_KEY, END_EDITING_TRIGGER_CLASSNAME, withStyleOverrides } from '@instructure/quiz-common';
|
|
23
24
|
import { onPhone } from "../../../../util/windowChecks.js";
|
|
24
25
|
import CustomPropTypes from "../../../../util/CustomPropTypes.js";
|
|
@@ -101,12 +102,19 @@ export var Sidebar = (_dec = withStyleOverrides(generateStyle, generateComponent
|
|
|
101
102
|
}, {
|
|
102
103
|
key: "renderTitle",
|
|
103
104
|
value: function renderTitle() {
|
|
105
|
+
var navigationText = t('Navigate to title');
|
|
104
106
|
if (this.props.grading) {
|
|
105
107
|
return;
|
|
106
108
|
}
|
|
107
109
|
return jsx("div", {
|
|
108
110
|
css: this.props.styles.sidebar.actionableInfo,
|
|
109
111
|
className: END_EDITING_TRIGGER_CLASSNAME
|
|
112
|
+
}, jsx(Tooltip, {
|
|
113
|
+
renderTip: this.props.sidebarOpen ? '' : jsx("span", {
|
|
114
|
+
"aria-hidden": "true"
|
|
115
|
+
}, navigationText),
|
|
116
|
+
placement: "start",
|
|
117
|
+
on: this.props.sidebarOpen ? [] : ['focus', 'hover']
|
|
110
118
|
}, jsx(Link, {
|
|
111
119
|
href: "#",
|
|
112
120
|
margin: "small",
|
|
@@ -114,7 +122,7 @@ export var Sidebar = (_dec = withStyleOverrides(generateStyle, generateComponent
|
|
|
114
122
|
onClick: this.scrollToTitle,
|
|
115
123
|
renderIcon: _ref,
|
|
116
124
|
"data-automation": "sidebar-title-button"
|
|
117
|
-
}, jsx(ScreenReaderContent, null,
|
|
125
|
+
}, jsx(ScreenReaderContent, null, navigationText))), jsx(PresentationContent, null, jsx("span", {
|
|
118
126
|
css: this.props.styles.sidebar.description,
|
|
119
127
|
"data-automation": "sidebar-title-text",
|
|
120
128
|
onClick: this.scrollToTitle,
|
|
@@ -124,12 +132,19 @@ export var Sidebar = (_dec = withStyleOverrides(generateStyle, generateComponent
|
|
|
124
132
|
}, {
|
|
125
133
|
key: "renderInstructions",
|
|
126
134
|
value: function renderInstructions() {
|
|
135
|
+
var navigationText = t('Navigate to instructions');
|
|
127
136
|
if (this.props.grading) {
|
|
128
137
|
return;
|
|
129
138
|
}
|
|
130
139
|
return jsx("div", {
|
|
131
140
|
css: this.props.styles.sidebar.actionableInfo,
|
|
132
141
|
className: END_EDITING_TRIGGER_CLASSNAME
|
|
142
|
+
}, jsx(Tooltip, {
|
|
143
|
+
renderTip: this.props.sidebarOpen ? '' : jsx("span", {
|
|
144
|
+
"aria-hidden": "true"
|
|
145
|
+
}, navigationText),
|
|
146
|
+
placement: "start",
|
|
147
|
+
on: this.props.sidebarOpen ? [] : ['focus', 'hover']
|
|
133
148
|
}, jsx(Link, {
|
|
134
149
|
href: "#",
|
|
135
150
|
margin: "small",
|
|
@@ -137,7 +152,7 @@ export var Sidebar = (_dec = withStyleOverrides(generateStyle, generateComponent
|
|
|
137
152
|
onClick: this.scrollToInfo,
|
|
138
153
|
renderIcon: _ref2,
|
|
139
154
|
"data-automation": "sidebar-instructions-button"
|
|
140
|
-
}, jsx(ScreenReaderContent, null,
|
|
155
|
+
}, jsx(ScreenReaderContent, null, navigationText))), jsx(PresentationContent, null, jsx("span", {
|
|
141
156
|
css: this.props.styles.sidebar.description,
|
|
142
157
|
"data-automation": "sidebar-instructions-text",
|
|
143
158
|
onClick: this.scrollToInfo,
|
|
@@ -147,11 +162,18 @@ export var Sidebar = (_dec = withStyleOverrides(generateStyle, generateComponent
|
|
|
147
162
|
}, {
|
|
148
163
|
key: "renderResults",
|
|
149
164
|
value: function renderResults() {
|
|
165
|
+
var navigationText = t('Navigate to results');
|
|
150
166
|
if (!this.props.grading) {
|
|
151
167
|
return;
|
|
152
168
|
}
|
|
153
169
|
return jsx("div", {
|
|
154
170
|
css: this.props.styles.sidebar.actionableInfo
|
|
171
|
+
}, jsx(Tooltip, {
|
|
172
|
+
renderTip: this.props.sidebarOpen ? '' : jsx("span", {
|
|
173
|
+
"aria-hidden": "true"
|
|
174
|
+
}, navigationText),
|
|
175
|
+
placement: "start",
|
|
176
|
+
on: this.props.sidebarOpen ? [] : ['focus', 'hover']
|
|
155
177
|
}, jsx(Link, {
|
|
156
178
|
href: "#",
|
|
157
179
|
margin: "small",
|
|
@@ -159,7 +181,7 @@ export var Sidebar = (_dec = withStyleOverrides(generateStyle, generateComponent
|
|
|
159
181
|
onClick: this.scrollToResults,
|
|
160
182
|
renderIcon: _ref3,
|
|
161
183
|
"data-automation": "sidebar-results-button"
|
|
162
|
-
}, jsx(ScreenReaderContent, null,
|
|
184
|
+
}, jsx(ScreenReaderContent, null, navigationText))), jsx(PresentationContent, null, jsx("span", {
|
|
163
185
|
css: this.props.styles.sidebar.description,
|
|
164
186
|
"data-automation": "sidebar-results-text",
|
|
165
187
|
onClick: this.scrollToResults,
|
|
@@ -7,16 +7,16 @@ var _dec, _class, _SidebarItem;
|
|
|
7
7
|
import { Component } from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
10
|
-
import { AccessibleContent } from '@instructure/ui-a11y-content';
|
|
11
10
|
import { Link } from '@instructure/ui-link';
|
|
12
|
-
import { Flex } from '@instructure/ui-flex';
|
|
13
11
|
import { jsx } from '@instructure/emotion';
|
|
14
12
|
import PositionSummary from "../PositionSummary/index.js";
|
|
15
13
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
16
14
|
import { RichContentRenderer } from '@instructure/quiz-rce';
|
|
17
15
|
import generateStyle from "./styles.js";
|
|
18
16
|
import generateComponentTheme from "./theme.js";
|
|
19
|
-
import { END_EDITING_TRIGGER_CLASSNAME, withStyleOverrides } from '@instructure/quiz-common';
|
|
17
|
+
import { Flex, END_EDITING_TRIGGER_CLASSNAME, withStyleOverrides } from '@instructure/quiz-common';
|
|
18
|
+
import { Tooltip } from '@instructure/ui-tooltip';
|
|
19
|
+
import { AccessibleContent } from '@instructure/ui-a11y-content';
|
|
20
20
|
export var SidebarItem = (_dec = withStyleOverrides(generateStyle, generateComponentTheme), _dec(_class = (_SidebarItem = /*#__PURE__*/function (_Component) {
|
|
21
21
|
_inherits(SidebarItem, _Component);
|
|
22
22
|
var _super = _createSuper(SidebarItem);
|
|
@@ -89,12 +89,18 @@ export var SidebarItem = (_dec = withStyleOverrides(generateStyle, generateCompo
|
|
|
89
89
|
displayPosition = _this$props2.displayPosition,
|
|
90
90
|
itemId = _this$props2.itemId,
|
|
91
91
|
isAnswered = _this$props2.isAnswered;
|
|
92
|
-
var
|
|
92
|
+
var content = !isAnswered && isAnswered !== null ? t('Navigate to question at position {displayPosition}, unanswered', {
|
|
93
93
|
displayPosition: displayPosition
|
|
94
94
|
}) : t('Navigate to question at position {displayPosition}', {
|
|
95
95
|
displayPosition: displayPosition
|
|
96
96
|
});
|
|
97
|
-
return jsx(
|
|
97
|
+
return jsx(Tooltip, {
|
|
98
|
+
renderTip: this.props.sidebarOpen ? '' : jsx("span", {
|
|
99
|
+
"aria-hidden": "true"
|
|
100
|
+
}, content),
|
|
101
|
+
placement: "start",
|
|
102
|
+
on: this.props.sidebarOpen ? [] : ['hover', 'focus']
|
|
103
|
+
}, jsx(Link, {
|
|
98
104
|
href: "#",
|
|
99
105
|
size: "small",
|
|
100
106
|
margin: "0 small",
|
|
@@ -104,8 +110,8 @@ export var SidebarItem = (_dec = withStyleOverrides(generateStyle, generateCompo
|
|
|
104
110
|
"data-automation-item-id": itemId,
|
|
105
111
|
"data-automation": "sdk-sidebar-item-button"
|
|
106
112
|
}, jsx(AccessibleContent, {
|
|
107
|
-
alt:
|
|
108
|
-
}, this.renderPosition()));
|
|
113
|
+
alt: content
|
|
114
|
+
}, this.renderPosition())));
|
|
109
115
|
}
|
|
110
116
|
}, {
|
|
111
117
|
key: "renderClosed",
|
|
@@ -10,15 +10,15 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
|
10
10
|
import { IconTextLeftLine } from '@instructure/ui-icons';
|
|
11
11
|
import { jsx } from '@instructure/emotion';
|
|
12
12
|
import { Link } from '@instructure/ui-link';
|
|
13
|
-
import { Flex } from '@instructure/ui-flex';
|
|
14
|
-
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
15
13
|
import Collection from "./Collection/index.js";
|
|
16
14
|
import Title from "./Title/index.js";
|
|
17
15
|
import Summary from "./Summary/index.js";
|
|
18
16
|
import generateStyle from "./styles.js";
|
|
19
17
|
import generateComponentTheme from "./theme.js";
|
|
20
18
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
21
|
-
import { END_EDITING_TRIGGER_CLASSNAME, withStyleOverrides } from '@instructure/quiz-common';
|
|
19
|
+
import { Flex, END_EDITING_TRIGGER_CLASSNAME, withStyleOverrides } from '@instructure/quiz-common';
|
|
20
|
+
import { Tooltip } from '@instructure/ui-tooltip';
|
|
21
|
+
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
22
22
|
export var DISPLAY_AS_SUMMARY_LIMIT = 5;
|
|
23
23
|
var _ref = jsx(IconTextLeftLine, {
|
|
24
24
|
color: "primary"
|
|
@@ -78,16 +78,23 @@ export var SidebarStimulus = (_dec = withStyleOverrides(generateStyle, generateC
|
|
|
78
78
|
key: "renderButton",
|
|
79
79
|
value: function renderButton() {
|
|
80
80
|
var displayPosition = this.props.displayPosition;
|
|
81
|
-
|
|
81
|
+
var textForNavigation = t('Navigate to stimulus at position {displayPosition}', {
|
|
82
|
+
displayPosition: displayPosition
|
|
83
|
+
});
|
|
84
|
+
return jsx(Tooltip, {
|
|
85
|
+
renderTip: this.props.sidebarOpen ? '' : jsx("span", {
|
|
86
|
+
"aria-hidden": "true"
|
|
87
|
+
}, textForNavigation),
|
|
88
|
+
placement: "start",
|
|
89
|
+
on: this.props.sidebarOpen ? [] : ['hover', 'focus']
|
|
90
|
+
}, jsx(Link, {
|
|
82
91
|
href: "#",
|
|
83
92
|
margin: "small",
|
|
84
93
|
forceButtonRole: false,
|
|
85
94
|
onClick: this.scrollToItem,
|
|
86
95
|
renderIcon: _ref,
|
|
87
96
|
className: END_EDITING_TRIGGER_CLASSNAME
|
|
88
|
-
}, jsx(ScreenReaderContent, null,
|
|
89
|
-
displayPosition: displayPosition
|
|
90
|
-
})));
|
|
97
|
+
}, jsx(ScreenReaderContent, null, textForNavigation)));
|
|
91
98
|
}
|
|
92
99
|
}, {
|
|
93
100
|
key: "renderClosed",
|
|
@@ -13,7 +13,6 @@ import componentForItem from "../../../../util/componentForItem.js";
|
|
|
13
13
|
import { liveRegion, COMPONENT_EDIT, FormFieldGroup } from '@instructure/quiz-common';
|
|
14
14
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
15
15
|
import { propsForInteractionEdit } from "../../../../util/interactionTypePropsHelper.js";
|
|
16
|
-
import elementsForSelectors from "../../../../../common/util/ElementsForSelectors.js";
|
|
17
16
|
import { toErrors } from "../../../../util/instUIMessages.js";
|
|
18
17
|
export var ItemEdit = /*#__PURE__*/function (_Component) {
|
|
19
18
|
_inherits(ItemEdit, _Component);
|
|
@@ -32,9 +31,6 @@ export var ItemEdit = /*#__PURE__*/function (_Component) {
|
|
|
32
31
|
}
|
|
33
32
|
return null;
|
|
34
33
|
};
|
|
35
|
-
_this.applicationElement = function () {
|
|
36
|
-
return elementsForSelectors(_this.props.appContainer);
|
|
37
|
-
};
|
|
38
34
|
_this.onModalOpen = function () {
|
|
39
35
|
_this.props.occludeQuizEntries(true);
|
|
40
36
|
};
|
|
@@ -97,7 +93,6 @@ export var ItemEdit = /*#__PURE__*/function (_Component) {
|
|
|
97
93
|
component: /*#__PURE__*/React.createElement(OutcomeAlignments, Object.assign({
|
|
98
94
|
artifactType: "quizEntry",
|
|
99
95
|
artifactId: itemId,
|
|
100
|
-
applicationElement: this.applicationElement,
|
|
101
96
|
alignmentSetId: outcomeAlignmentSetGuid,
|
|
102
97
|
contextUuid: this.props.contextUuid
|
|
103
98
|
}, launchContexts.length > 0 && {
|
|
@@ -39,11 +39,11 @@ export var AddContentBody = (_dec = withStyleOverrides(generateStyle, generateCo
|
|
|
39
39
|
_this.props.setUi(BUILD_TRAY_POSITION, _this.props.position);
|
|
40
40
|
_this.props.setUi(BUILD_TRAY_STIMULUS_ID, _this.props.parentEntryId);
|
|
41
41
|
};
|
|
42
|
-
_this.addStimulus = function () {
|
|
42
|
+
_this.addStimulus = function (isPassage) {
|
|
43
43
|
if (_this.props.editingQuizEntry) {
|
|
44
44
|
_this.props.setNextQuizEntry(null, _this.props.quizId, _this.props.position);
|
|
45
45
|
} else {
|
|
46
|
-
_this.props.createStimulus(_this.props.quizId, _this.props.position);
|
|
46
|
+
_this.props.createStimulus(_this.props.quizId, _this.props.position, isPassage);
|
|
47
47
|
}
|
|
48
48
|
_this.props.onAddItem();
|
|
49
49
|
};
|
|
@@ -9,7 +9,6 @@ import PropTypes from 'prop-types';
|
|
|
9
9
|
import { Popover } from '@instructure/ui-popover';
|
|
10
10
|
import { jsx } from '@instructure/emotion';
|
|
11
11
|
import CustomPropTypes from "../../../../../util/CustomPropTypes.js";
|
|
12
|
-
import elementsForSelectors from "../../../../../util/ElementsForSelectors.js";
|
|
13
12
|
import { onPhone, onTablet } from "../../../../../util/windowChecks.js";
|
|
14
13
|
import AddContentButton from "../Button/index.js";
|
|
15
14
|
import AddContentBody from "../Body/index.js";
|
|
@@ -26,9 +25,6 @@ export var AddContentPopover = (_dec = withStyleOverrides(generateStyle, generat
|
|
|
26
25
|
args[_key] = arguments[_key];
|
|
27
26
|
}
|
|
28
27
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
29
|
-
_this.applicationElement = function () {
|
|
30
|
-
return elementsForSelectors(_this.props.appContainer);
|
|
31
|
-
};
|
|
32
28
|
_this.showContent = function () {
|
|
33
29
|
_this.props.switchOnEditing();
|
|
34
30
|
};
|
|
@@ -4,7 +4,7 @@ var generateStyle = function generateStyle(componentTheme) {
|
|
|
4
4
|
position: 'relative',
|
|
5
5
|
width: '100%',
|
|
6
6
|
boxSizing: 'border-box',
|
|
7
|
-
padding:
|
|
7
|
+
padding: componentTheme.wrapperPadding,
|
|
8
8
|
'&::after': {
|
|
9
9
|
clear: 'both',
|
|
10
10
|
content: '""',
|
|
@@ -15,8 +15,11 @@ var generateStyle = function generateStyle(componentTheme) {
|
|
|
15
15
|
'&:first-of-type': {
|
|
16
16
|
margin: "0 0 ".concat(componentTheme.userContentMargin)
|
|
17
17
|
},
|
|
18
|
-
'&:last-
|
|
18
|
+
'&:last-of-type': {
|
|
19
19
|
margin: "".concat(componentTheme.userContentMargin, " 0 0")
|
|
20
|
+
},
|
|
21
|
+
'&:only-child': {
|
|
22
|
+
margin: 0
|
|
20
23
|
}
|
|
21
24
|
}
|
|
22
25
|
},
|
|
@@ -108,7 +108,7 @@ export var SessionItemResult = (_dec = withStyleOverrides(generateStyle, generat
|
|
|
108
108
|
size: "small",
|
|
109
109
|
margin: "small"
|
|
110
110
|
}, jsx(Text, {
|
|
111
|
-
color: "
|
|
111
|
+
color: "alert"
|
|
112
112
|
}, t("Regrade score { possible, plural,\n one {{points, number} / # point}\n other {{points, number} / # points}\n }", {
|
|
113
113
|
points: this.props.sessionItemResult.regradeInfo.get('newScore') || 0,
|
|
114
114
|
possible: this.props.sessionItemResult.regradeInfo.get('newPointsPossible')
|
|
@@ -67,6 +67,11 @@ export var Stimulus = (_dec = withStyleOverrides(generateStyle, generateComponen
|
|
|
67
67
|
lockBlueprintContentEnabled = _this$props2.lockBlueprintContentEnabled;
|
|
68
68
|
return lockBlueprintContentEnabled && isContentLockedByBlueprint;
|
|
69
69
|
}
|
|
70
|
+
}, {
|
|
71
|
+
key: "isPassage",
|
|
72
|
+
value: function isPassage() {
|
|
73
|
+
return this.props.stimulus.passage;
|
|
74
|
+
}
|
|
70
75
|
}, {
|
|
71
76
|
key: "renderChildQuizEntries",
|
|
72
77
|
value: function renderChildQuizEntries() {
|
|
@@ -94,9 +99,10 @@ export var Stimulus = (_dec = withStyleOverrides(generateStyle, generateComponen
|
|
|
94
99
|
key: "renderStimulusPanel",
|
|
95
100
|
value: function renderStimulusPanel() {
|
|
96
101
|
var StimulusComponent = this.props.isEditing ? StimulusEdit : StimulusShow;
|
|
102
|
+
var automationPrefix = this.isPassage() ? 'passage' : 'stimulus';
|
|
97
103
|
var connectDragPreview = this.props.connectDragPreview;
|
|
98
104
|
return connectDragPreview(jsx("div", {
|
|
99
|
-
"data-automation": "sdk-
|
|
105
|
+
"data-automation": "sdk-".concat(automationPrefix, "-LeftPanelShow")
|
|
100
106
|
}, jsx(StimulusComponent, {
|
|
101
107
|
bankEntryWarningWrapperProps: this.props.bankEntryWarningWrapperProps,
|
|
102
108
|
connectDragSource: this.props.connectDragSource,
|
|
@@ -121,17 +127,18 @@ export var Stimulus = (_dec = withStyleOverrides(generateStyle, generateComponen
|
|
|
121
127
|
}, {
|
|
122
128
|
key: "renderPanels",
|
|
123
129
|
value: function renderPanels(propsForDnDZone) {
|
|
130
|
+
var automationPrefix = this.isPassage() ? 'passage' : 'stimulus';
|
|
124
131
|
return jsx("div", {
|
|
125
132
|
css: this.props.styles.stimulus,
|
|
126
133
|
ref: this.props.dndRef,
|
|
127
|
-
"data-automation": "sdk-
|
|
134
|
+
"data-automation": "sdk-".concat(automationPrefix)
|
|
128
135
|
}, jsx("div", {
|
|
129
136
|
css: this.props.styles.leftPanel
|
|
130
137
|
}, this.renderStimulusPanel()), jsx("div", {
|
|
131
138
|
css: this.props.styles.itemPanel
|
|
132
|
-
}, jsx("div", null), this.renderChildQuizEntries(), jsx(DragAndDropZone, Object.assign({}, propsForDnDZone, {
|
|
139
|
+
}, jsx("div", null), this.renderChildQuizEntries(), !this.isPassage() && jsx(DragAndDropZone, Object.assign({}, propsForDnDZone, {
|
|
133
140
|
location: "in"
|
|
134
|
-
})), this.props.childEntries.size === 0 && !this.isQuizContentLocked() && jsx(AddContentPopover, {
|
|
141
|
+
})), this.props.childEntries.size === 0 && !this.isQuizContentLocked() && !this.isPassage() && jsx(AddContentPopover, {
|
|
135
142
|
allowStimulusCreation: false,
|
|
136
143
|
stimulusId: this.props.stimulus.id,
|
|
137
144
|
parentEntryId: this.props.quizEntry.id,
|
|
@@ -15,6 +15,8 @@ import ReactDOM from 'react-dom';
|
|
|
15
15
|
import { Button } from '@instructure/ui-buttons';
|
|
16
16
|
import { ToggleDetails } from '@instructure/ui-toggle-details';
|
|
17
17
|
import { jsx } from '@instructure/emotion';
|
|
18
|
+
import { Text } from '@instructure/ui-text';
|
|
19
|
+
import { View } from '@instructure/ui-view';
|
|
18
20
|
import { FILE_UPLOAD_SUCCESS, SHOULD_CLONE_ITEM, DELETED_QUIZ_ENTRY, withStyleOverrides } from '@instructure/quiz-common';
|
|
19
21
|
import { propsForStimulusVersioningWrapper, propsForBankEntryVersioningWrapper } from "../../../../util/warningHelpers.js";
|
|
20
22
|
import AddToBankModal from "../../../../../banks/components/AddToBankModal/index.js";
|
|
@@ -56,6 +58,7 @@ export var StimulusEdit = (_dec = withStyleOverrides(generateStyle, generateComp
|
|
|
56
58
|
_this.props.setUi(SHOULD_CLONE_ITEM, false);
|
|
57
59
|
};
|
|
58
60
|
_this.handleDeleteTemporary = function () {
|
|
61
|
+
var isPassage = _this.isPassage();
|
|
59
62
|
_this.props.withConfirm(function () {
|
|
60
63
|
_this.onCancel();
|
|
61
64
|
_this.props.setUi(DELETED_QUIZ_ENTRY, {
|
|
@@ -63,10 +66,11 @@ export var StimulusEdit = (_dec = withStyleOverrides(generateStyle, generateComp
|
|
|
63
66
|
inStimulus: false
|
|
64
67
|
});
|
|
65
68
|
}, {
|
|
66
|
-
title: t('Confirm Stimulus Removal'),
|
|
67
|
-
text: t('Are you sure you want to remove this stimulus?'),
|
|
68
|
-
continueText: t('Remove Stimulus'),
|
|
69
|
-
cancelText: t('Keep Stimulus')
|
|
69
|
+
title: isPassage ? t('Confirm Passage Removal') : t('Confirm Stimulus Removal'),
|
|
70
|
+
text: isPassage ? t('Are you sure you want to remove this passage?') : t('Are you sure you want to remove this stimulus?'),
|
|
71
|
+
continueText: isPassage ? t('Remove Passage') : t('Remove Stimulus'),
|
|
72
|
+
cancelText: isPassage ? t('Keep Passage ') : t('Keep Stimulus'),
|
|
73
|
+
automationPrefix: isPassage ? 'passage' : 'stimulus'
|
|
70
74
|
});
|
|
71
75
|
};
|
|
72
76
|
_this.handleDeleteStimulus = function () {
|
|
@@ -291,6 +295,12 @@ export var StimulusEdit = (_dec = withStyleOverrides(generateStyle, generateComp
|
|
|
291
295
|
outsideApp = _checkClickedNode.outsideApp;
|
|
292
296
|
return outsideApp || !isEndEditingTrigger;
|
|
293
297
|
}
|
|
298
|
+
}, {
|
|
299
|
+
key: "isPassage",
|
|
300
|
+
value: function isPassage() {
|
|
301
|
+
var _this$props$stimulus;
|
|
302
|
+
return (_this$props$stimulus = this.props.stimulus) === null || _this$props$stimulus === void 0 ? void 0 : _this$props$stimulus.passage;
|
|
303
|
+
}
|
|
294
304
|
}, {
|
|
295
305
|
key: "afterSubmit",
|
|
296
306
|
value: function afterSubmit() {
|
|
@@ -318,7 +328,12 @@ export var StimulusEdit = (_dec = withStyleOverrides(generateStyle, generateComp
|
|
|
318
328
|
}, {
|
|
319
329
|
key: "renderAddToBankOptions",
|
|
320
330
|
value: function renderAddToBankOptions() {
|
|
321
|
-
|
|
331
|
+
var paddingTopStyle = this.isPassage() ? {
|
|
332
|
+
padding: 'small 0 0'
|
|
333
|
+
} : {};
|
|
334
|
+
return jsx(View, Object.assign({
|
|
335
|
+
as: "div"
|
|
336
|
+
}, paddingTopStyle), jsx(ToggleDetails, {
|
|
322
337
|
variant: "filled",
|
|
323
338
|
key: "itemBanking",
|
|
324
339
|
summary: t('Item Banking')
|
|
@@ -338,14 +353,17 @@ export var StimulusEdit = (_dec = withStyleOverrides(generateStyle, generateComp
|
|
|
338
353
|
}, {
|
|
339
354
|
key: "renderStimulusEdit",
|
|
340
355
|
value: function renderStimulusEdit() {
|
|
356
|
+
var stimulusLabel = this.isPassage() ? t('Passage') : t('Stimulus');
|
|
357
|
+
var automationPrefix = this.isPassage() ? 'passage' : 'stimulus';
|
|
341
358
|
return jsx("div", null, jsx("div", {
|
|
342
359
|
css: this.props.styles.stimulus,
|
|
343
360
|
ref: this.handleRef
|
|
344
361
|
}, jsx("div", {
|
|
345
362
|
css: this.props.styles.header
|
|
346
|
-
}, jsx(
|
|
347
|
-
|
|
348
|
-
|
|
363
|
+
}, jsx(Text, {
|
|
364
|
+
size: "small",
|
|
365
|
+
color: "secondary"
|
|
366
|
+
}, stimulusLabel), jsx(ActionButtons, {
|
|
349
367
|
connectDragSource: this.props.connectDragSource,
|
|
350
368
|
displayPosition: this.props.displayPosition,
|
|
351
369
|
onDelete: this.handleDeleteStimulus,
|
|
@@ -370,7 +388,7 @@ export var StimulusEdit = (_dec = withStyleOverrides(generateStyle, generateComp
|
|
|
370
388
|
}, jsx(Button, {
|
|
371
389
|
type: "button",
|
|
372
390
|
onClick: this.onCancel,
|
|
373
|
-
"data-automation": "sdk-
|
|
391
|
+
"data-automation": "sdk-".concat(automationPrefix, "-discardButton")
|
|
374
392
|
}, t('Cancel'))), jsx("div", {
|
|
375
393
|
className: "submitButtonWrapper",
|
|
376
394
|
css: this.props.styles.buttonWrapper
|
|
@@ -379,7 +397,7 @@ export var StimulusEdit = (_dec = withStyleOverrides(generateStyle, generateComp
|
|
|
379
397
|
color: "primary",
|
|
380
398
|
disabled: !this.state.canSubmit,
|
|
381
399
|
onClick: this.onSubmit,
|
|
382
|
-
"data-automation": "sdk-
|
|
400
|
+
"data-automation": "sdk-".concat(automationPrefix, "-done-button")
|
|
383
401
|
}, t('Done')))));
|
|
384
402
|
}
|
|
385
403
|
}, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var generateStyle = function generateStyle(componentTheme) {
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme, props) {
|
|
2
2
|
return {
|
|
3
3
|
stimulus: {
|
|
4
4
|
paddingTop: componentTheme.stimulusPadding,
|
|
@@ -23,10 +23,6 @@ var generateStyle = function generateStyle(componentTheme) {
|
|
|
23
23
|
height: '100%',
|
|
24
24
|
padding: componentTheme.stimulusContentPadding
|
|
25
25
|
},
|
|
26
|
-
stimulusLabel: {
|
|
27
|
-
color: componentTheme.stimulusLabelColor,
|
|
28
|
-
fontSize: componentTheme.stimulusLabelFontSize
|
|
29
|
-
},
|
|
30
26
|
stimulusButtons: {
|
|
31
27
|
flex: '0 0 auto',
|
|
32
28
|
display: 'inline-flex',
|
|
@@ -9,8 +9,6 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
9
9
|
optionPadding: spacing.small,
|
|
10
10
|
stimulusContentPadding: spacing.small,
|
|
11
11
|
stimulusContentPaddingBottom: spacing.small,
|
|
12
|
-
stimulusLabelColor: colors.ash,
|
|
13
|
-
stimulusLabelFontSize: typography.fontSizeSmall,
|
|
14
12
|
stimulusButtonsColor: colors.oxford,
|
|
15
13
|
stimulusButtonsZIndex: '3333'
|
|
16
14
|
};
|
|
@@ -58,8 +58,12 @@ export var StimulusEditInfo = (_dec = withStyleOverrides(generateStyle, generate
|
|
|
58
58
|
}
|
|
59
59
|
_createClass(StimulusEditInfo, [{
|
|
60
60
|
key: "headerText",
|
|
61
|
-
value: function headerText() {
|
|
62
|
-
|
|
61
|
+
value: function headerText(stimulus) {
|
|
62
|
+
if (stimulus.isTemporary()) {
|
|
63
|
+
return stimulus.passage ? t('Add Passage') : t('Add Stimulus');
|
|
64
|
+
} else {
|
|
65
|
+
return stimulus.passage ? t('Edit Passage') : t('Edit Stimulus');
|
|
66
|
+
}
|
|
63
67
|
}
|
|
64
68
|
}, {
|
|
65
69
|
key: "renderOptionalLabel",
|
|
@@ -92,38 +96,67 @@ export var StimulusEditInfo = (_dec = withStyleOverrides(generateStyle, generate
|
|
|
92
96
|
value: "top"
|
|
93
97
|
}, t('Questions below'))));
|
|
94
98
|
}
|
|
99
|
+
}, {
|
|
100
|
+
key: "renderInstructions",
|
|
101
|
+
value: function renderInstructions(stimulus) {
|
|
102
|
+
if (stimulus.passage) {
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
return jsx("div", {
|
|
106
|
+
css: this.props.styles.section
|
|
107
|
+
}, jsx(TextInput, {
|
|
108
|
+
renderLabel: this.renderOptionalLabel(t('Instructions')),
|
|
109
|
+
onChange: this.onTextInputChange('instructions'),
|
|
110
|
+
value: stimulus.get('instructions'),
|
|
111
|
+
"data-automation": "sdk-stimulus-instructions-input"
|
|
112
|
+
}));
|
|
113
|
+
}
|
|
114
|
+
}, {
|
|
115
|
+
key: "renderOptions",
|
|
116
|
+
value: function renderOptions(stimulus) {
|
|
117
|
+
if (stimulus.passage) {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
return jsx("div", {
|
|
121
|
+
css: this.props.styles.section
|
|
122
|
+
}, jsx(ToggleDetails, {
|
|
123
|
+
defaultExpanded: true,
|
|
124
|
+
variant: "filled",
|
|
125
|
+
key: "options",
|
|
126
|
+
summary: t('Options')
|
|
127
|
+
}, this.props.stimulusOrientationEnabled ? this.renderStimulusOrientationSelect() : null, jsx("div", {
|
|
128
|
+
css: this.props.styles.section
|
|
129
|
+
}, jsx(TextInput, {
|
|
130
|
+
renderLabel: this.renderOptionalLabel(t('Source URL'), t('(optional - not visible to students)')),
|
|
131
|
+
onChange: this.onTextInputChange('sourceUrl'),
|
|
132
|
+
value: stimulus.get('sourceUrl'),
|
|
133
|
+
"data-automation": "sdk-source-url-input"
|
|
134
|
+
}))));
|
|
135
|
+
}
|
|
95
136
|
}, {
|
|
96
137
|
key: "render",
|
|
97
138
|
value: function render() {
|
|
98
139
|
var stimulus = this.props.workingStimulus;
|
|
99
140
|
var textAreaId = "stimulusBodyEdit_".concat(stimulus.id, "_").concat(this.props.isBankedContent);
|
|
100
141
|
var stimulusBodyId = "stimulusBodyEdit_".concat(stimulus.id, "_body");
|
|
142
|
+
var automationPrefix = stimulus.passage ? 'passage' : 'stimulus';
|
|
101
143
|
return jsx(FormFieldGroup, {
|
|
102
144
|
messages: this.inputErrors('onSelf'),
|
|
103
145
|
description: jsx(ScreenReaderContent, null, t('Edit Stimulus'))
|
|
104
146
|
}, jsx(Heading, {
|
|
105
147
|
level: "h3",
|
|
106
148
|
as: "h2"
|
|
107
|
-
}, this.headerText()), jsx("div", {
|
|
149
|
+
}, this.headerText(stimulus)), jsx("div", {
|
|
108
150
|
css: this.props.styles.section
|
|
109
151
|
}, jsx(TextInput, {
|
|
110
152
|
messages: this.inputErrors('title'),
|
|
111
153
|
renderLabel: t('Title'),
|
|
112
154
|
isRequired: true,
|
|
113
|
-
type: "text",
|
|
114
155
|
ref: this.props.setTitleRef,
|
|
115
156
|
onChange: this.onTextInputChange('title'),
|
|
116
157
|
value: stimulus.get('title'),
|
|
117
|
-
"data-automation": "sdk-
|
|
118
|
-
})), jsx("div", {
|
|
119
|
-
css: this.props.styles.section
|
|
120
|
-
}, jsx(TextInput, {
|
|
121
|
-
renderLabel: this.renderOptionalLabel(t('Instructions')),
|
|
122
|
-
type: "text",
|
|
123
|
-
onChange: this.onTextInputChange('instructions'),
|
|
124
|
-
value: stimulus.get('instructions'),
|
|
125
|
-
"data-automation": "sdk-stimulus-instructions-input"
|
|
126
|
-
})), jsx("div", {
|
|
158
|
+
"data-automation": "sdk-".concat(automationPrefix, "-title-input")
|
|
159
|
+
})), this.renderInstructions(stimulus), jsx("div", {
|
|
127
160
|
css: this.props.styles.section
|
|
128
161
|
}, jsx(FormField, {
|
|
129
162
|
id: stimulusBodyId
|
|
@@ -138,22 +171,7 @@ export var StimulusEditInfo = (_dec = withStyleOverrides(generateStyle, generate
|
|
|
138
171
|
onBlur: this.onBodyChange,
|
|
139
172
|
onChange: this.onBodyChange,
|
|
140
173
|
height: RCE_SINGLE_LINE_HEIGHT
|
|
141
|
-
}))),
|
|
142
|
-
css: this.props.styles.section
|
|
143
|
-
}, jsx(ToggleDetails, {
|
|
144
|
-
defaultExpanded: true,
|
|
145
|
-
variant: "filled",
|
|
146
|
-
key: "options",
|
|
147
|
-
summary: t('Options')
|
|
148
|
-
}, this.props.stimulusOrientationEnabled ? this.renderStimulusOrientationSelect() : null, jsx("div", {
|
|
149
|
-
css: this.props.styles.section
|
|
150
|
-
}, jsx(TextInput, {
|
|
151
|
-
renderLabel: this.renderOptionalLabel(t('Source URL'), t('(optional - not visible to students)')),
|
|
152
|
-
type: "text",
|
|
153
|
-
onChange: this.onTextInputChange('sourceUrl'),
|
|
154
|
-
value: stimulus.get('sourceUrl'),
|
|
155
|
-
"data-automation": "sdk-source-url-input"
|
|
156
|
-
})))));
|
|
174
|
+
}))), this.renderOptions(stimulus));
|
|
157
175
|
}
|
|
158
176
|
}]);
|
|
159
177
|
StimulusEditInfo.displayName = "StimulusEditInfo";
|
|
@@ -10,13 +10,14 @@ import PropTypes from 'prop-types';
|
|
|
10
10
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
11
11
|
import { IconBankLine } from '@instructure/ui-icons';
|
|
12
12
|
import { jsx } from '@instructure/emotion';
|
|
13
|
+
import { Text } from '@instructure/ui-text';
|
|
13
14
|
import StimulusShowInfo from "../StimulusShowInfo/index.js";
|
|
14
15
|
import ActionButtons from "../../../../../building/components/resources/ActionButtons/index.js";
|
|
15
16
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
16
17
|
import generateStyle from "./styles.js";
|
|
17
18
|
import generateComponentTheme from "./theme.js";
|
|
18
19
|
import Overlay from "../../../shared/overlay/index.js";
|
|
19
|
-
import { withStyleOverrides } from '@instructure/quiz-common';
|
|
20
|
+
import { Flex, withStyleOverrides } from '@instructure/quiz-common';
|
|
20
21
|
var _ref = jsx(IconBankLine, null);
|
|
21
22
|
export var StimulusShow = (_dec = withStyleOverrides(generateStyle, generateComponentTheme), _dec(_class = (_StimulusShow = /*#__PURE__*/function (_Component) {
|
|
22
23
|
_inherits(StimulusShow, _Component);
|
|
@@ -43,6 +44,7 @@ export var StimulusShow = (_dec = withStyleOverrides(generateStyle, generateComp
|
|
|
43
44
|
}, {
|
|
44
45
|
key: "render",
|
|
45
46
|
value: function render() {
|
|
47
|
+
var stimulusLabel = this.props.stimulus.passage ? t('Passage') : t('Stimulus');
|
|
46
48
|
return jsx(Overlay, {
|
|
47
49
|
onClick: this.switchOnEditing,
|
|
48
50
|
wrapperStyles: this.props.styles.stimulusWrapper,
|
|
@@ -54,9 +56,13 @@ export var StimulusShow = (_dec = withStyleOverrides(generateStyle, generateComp
|
|
|
54
56
|
css: this.props.styles.header
|
|
55
57
|
}, jsx("div", {
|
|
56
58
|
css: this.props.styles.leftHeader
|
|
57
|
-
}, this.renderBankIcon(), jsx(
|
|
58
|
-
|
|
59
|
-
},
|
|
59
|
+
}, this.renderBankIcon(), jsx(Flex, {
|
|
60
|
+
margin: "0 x-small"
|
|
61
|
+
}, jsx(Text, {
|
|
62
|
+
size: "small",
|
|
63
|
+
color: "secondary",
|
|
64
|
+
margin: "0 x-small"
|
|
65
|
+
}, stimulusLabel))), jsx(ActionButtons, {
|
|
60
66
|
connectDragSource: this.props.connectDragSource,
|
|
61
67
|
displayPosition: this.props.displayPosition,
|
|
62
68
|
onDelete: this.props.openDeleteStimulusModal,
|
|
@@ -16,13 +16,6 @@ var generateStyle = function generateStyle(componentTheme) {
|
|
|
16
16
|
display: 'flex',
|
|
17
17
|
overflow: 'hidden'
|
|
18
18
|
},
|
|
19
|
-
stimulusLabel: {
|
|
20
|
-
color: componentTheme.stimulusLabelColor,
|
|
21
|
-
fontSize: componentTheme.stimulusLabelFontSize,
|
|
22
|
-
margin: "0 ".concat(componentTheme.stimulusLabelMargin),
|
|
23
|
-
overflow: 'hidden',
|
|
24
|
-
textOverflow: 'ellipsis'
|
|
25
|
-
},
|
|
26
19
|
stimulusContent: {
|
|
27
20
|
height: '10%0',
|
|
28
21
|
padding: "".concat(componentTheme.stimulusContentPaddingTop, " ").concat(componentTheme.stimulusContentPaddingLeftRight, " ").concat(componentTheme.stimulusContentPaddingBottom)
|
|
@@ -5,9 +5,6 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
5
5
|
return {
|
|
6
6
|
stimulusPadding: spacing.large,
|
|
7
7
|
headerPadding: spacing.small,
|
|
8
|
-
stimulusLabelColor: colors.ash,
|
|
9
|
-
stimulusLabelFontSize: typography.fontSizeSmall,
|
|
10
|
-
stimulusLabelMargin: spacing.xSmall,
|
|
11
8
|
stimulusContentPaddingTop: spacing.large,
|
|
12
9
|
stimulusContentPaddingBottom: spacing.small,
|
|
13
10
|
stimulusContentPaddingLeftRight: spacing.small
|