@instructure/quiz-core 20.37.1 → 20.38.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.
Files changed (91) hide show
  1. package/es/banks/components/BankSearch/presenter.js +1 -2
  2. package/es/building/api/stimuli.js +2 -1
  3. package/es/building/components/resources/DeleteStimulusModal/presenter.js +14 -7
  4. package/es/building/components/resources/quizEntry/QuizEntry/presenter.js +11 -4
  5. package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +1 -2
  6. package/es/common/actions/modifications.js +3 -2
  7. package/es/common/components/layout/Page/styles.js +13 -1
  8. package/es/common/components/layout/Page/theme.js +1 -2
  9. package/es/common/components/layout/sidebar/Sidebar/index.js +26 -4
  10. package/es/common/components/layout/sidebar/SidebarItem/presenter.js +13 -7
  11. package/es/common/components/layout/sidebar/Stimulus/presenter.js +14 -7
  12. package/es/common/components/resources/quiz/AddContent/Body/presenter.js +2 -2
  13. package/es/common/components/resources/quiz/instructions/styles.js +5 -2
  14. package/es/common/components/resources/stimulus/Stimulus/presenter.js +3 -2
  15. package/es/common/components/resources/stimulus/StimulusEdit/presenter.js +14 -4
  16. package/es/common/components/resources/stimulus/StimulusEdit/styles.js +1 -5
  17. package/es/common/components/resources/stimulus/StimulusEdit/theme.js +0 -2
  18. package/es/common/components/resources/stimulus/StimulusEditInfo/presenter.js +46 -29
  19. package/es/common/components/resources/stimulus/StimulusShow/index.js +10 -4
  20. package/es/common/components/resources/stimulus/StimulusShow/styles.js +0 -7
  21. package/es/common/components/resources/stimulus/StimulusShow/theme.js +0 -3
  22. package/es/common/components/shared/InteractionTypes/index.js +4 -1
  23. package/es/common/components/shared/InteractionTypes/presenter.js +38 -15
  24. package/es/common/components/shared/TimeUnitsInput/index.js +9 -8
  25. package/es/common/components/shared/drag_and_drop/dragAndDropUtils.js +3 -0
  26. package/es/common/records/QuizEntry.js +5 -0
  27. package/es/common/reducers/modifications.js +6 -3
  28. package/es/common/util/warningHelpers.js +15 -5
  29. package/es/moderating/components/resources/ModerateTable/presenter.js +1 -2
  30. package/es/moderating/components/sidebar/ModerateTray/presenter.js +1 -2
  31. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +1 -2
  32. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/presenter.js +1 -1
  33. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/presenter.js +1 -2
  34. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/ChoiceGroupTypeTable/presenter.js +1 -2
  35. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsTableWrapper/presenter.js +1 -2
  36. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +1 -2
  37. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/presenter.js +1 -2
  38. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/presenter.js +1 -2
  39. package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js +1 -2
  40. package/es/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/presenter.js +1 -2
  41. package/es/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +1 -2
  42. package/es/reporting/components/resources/ReportCard/index.js +1 -2
  43. package/es/reporting/components/resources/StudentAnalysis/ReportCard/presenter.js +1 -2
  44. package/es/reporting/components/resources/common/AnalysisUpdateDate/index.js +1 -1
  45. package/es/taking/api/taking.js +4 -0
  46. package/lib/banks/components/BankSearch/presenter.js +3 -4
  47. package/lib/building/api/stimuli.js +2 -1
  48. package/lib/building/components/resources/DeleteStimulusModal/presenter.js +14 -7
  49. package/lib/building/components/resources/quizEntry/QuizEntry/presenter.js +11 -4
  50. package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +3 -4
  51. package/lib/common/actions/modifications.js +3 -2
  52. package/lib/common/components/layout/Page/styles.js +13 -1
  53. package/lib/common/components/layout/Page/theme.js +1 -2
  54. package/lib/common/components/layout/sidebar/Sidebar/index.js +25 -3
  55. package/lib/common/components/layout/sidebar/SidebarItem/presenter.js +15 -9
  56. package/lib/common/components/layout/sidebar/Stimulus/presenter.js +16 -9
  57. package/lib/common/components/resources/quiz/AddContent/Body/presenter.js +2 -2
  58. package/lib/common/components/resources/quiz/instructions/styles.js +5 -2
  59. package/lib/common/components/resources/stimulus/Stimulus/presenter.js +3 -2
  60. package/lib/common/components/resources/stimulus/StimulusEdit/presenter.js +14 -4
  61. package/lib/common/components/resources/stimulus/StimulusEdit/styles.js +1 -5
  62. package/lib/common/components/resources/stimulus/StimulusEdit/theme.js +0 -2
  63. package/lib/common/components/resources/stimulus/StimulusEditInfo/presenter.js +46 -29
  64. package/lib/common/components/resources/stimulus/StimulusShow/index.js +9 -3
  65. package/lib/common/components/resources/stimulus/StimulusShow/styles.js +0 -7
  66. package/lib/common/components/resources/stimulus/StimulusShow/theme.js +0 -3
  67. package/lib/common/components/shared/InteractionTypes/index.js +4 -1
  68. package/lib/common/components/shared/InteractionTypes/presenter.js +38 -15
  69. package/lib/common/components/shared/TimeUnitsInput/index.js +10 -9
  70. package/lib/common/components/shared/drag_and_drop/dragAndDropUtils.js +3 -0
  71. package/lib/common/records/QuizEntry.js +5 -0
  72. package/lib/common/reducers/modifications.js +6 -3
  73. package/lib/common/util/warningHelpers.js +15 -5
  74. package/lib/moderating/components/resources/ModerateTable/presenter.js +3 -4
  75. package/lib/moderating/components/sidebar/ModerateTray/presenter.js +5 -6
  76. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +6 -7
  77. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/presenter.js +9 -9
  78. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/presenter.js +2 -3
  79. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/ChoiceGroupTypeTable/presenter.js +5 -6
  80. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsTableWrapper/presenter.js +4 -5
  81. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +3 -4
  82. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/presenter.js +3 -4
  83. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/presenter.js +8 -9
  84. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js +20 -21
  85. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/presenter.js +9 -10
  86. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +20 -21
  87. package/lib/reporting/components/resources/ReportCard/index.js +1 -2
  88. package/lib/reporting/components/resources/StudentAnalysis/ReportCard/presenter.js +9 -10
  89. package/lib/reporting/components/resources/common/AnalysisUpdateDate/index.js +2 -2
  90. package/lib/taking/api/taking.js +4 -0
  91. package/package.json +8 -12
@@ -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,
@@ -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 content = this.props.childEntries.size === 0 ? jsx("span", null, t('Are you sure you want to remove this stimulus?')) : this.renderMainMenu();
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, args = new Array(_len), _key = 0; _key < _len; _key++) {
42
- args[_key] = arguments[_key];
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(args));
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 propsFunc = _this.props.quizEntry.hasStimulus ? propsForStimulusBankEntryEditPrompt : propsForItemBankEntryEditPrompt;
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) {
@@ -474,13 +474,14 @@ export function clearTemporaryBankItem(bankId) {
474
474
  // =====================
475
475
  // =====================
476
476
 
477
- export function createStimulus(quizId, position) {
477
+ export function createStimulus(quizId, position, isPassage) {
478
478
  return function (dispatch, getState) {
479
479
  dispatch({
480
480
  type: CREATE_TEMPORARY_STIMULUS,
481
481
  payload: {
482
482
  quizId: quizId,
483
- position: position
483
+ position: position,
484
+ isPassage: isPassage
484
485
  }
485
486
  });
486
487
  };
@@ -17,7 +17,19 @@ var generateStyle = function generateStyle(componentTheme, props) {
17
17
  overflowY: 'auto'
18
18
  }), {}, {
19
19
  transition: componentTheme.contentTransition,
20
- width: '100%'
20
+ width: '100%',
21
+ '.user_content p': {
22
+ margin: "".concat(componentTheme.userContentMargin, " 0"),
23
+ '&:first-of-type': {
24
+ margin: "0 0 ".concat(componentTheme.userContentMargin)
25
+ },
26
+ '&:last-of-type': {
27
+ margin: "".concat(componentTheme.userContentMargin, " 0 0")
28
+ },
29
+ '&:only-child': {
30
+ margin: 0
31
+ }
32
+ }
21
33
  })
22
34
  };
23
35
  };
@@ -6,8 +6,7 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
6
6
  return {
7
7
  fontFamily: typography.fontFamily,
8
8
  contentTransition: "transform ".concat(transitions.duration),
9
- userContentMargin: spacing.mediumSmall,
10
- userContentZeroMargin: 0
9
+ userContentMargin: spacing.mediumSmall
11
10
  };
12
11
  };
13
12
  export default generateComponentTheme;
@@ -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, ScreenReaderContent, PresentationContent } from '@instructure/ui-a11y-content';
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, t('Navigate to title'))), jsx(PresentationContent, null, jsx("span", {
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, t('Navigate to instructions'))), jsx(PresentationContent, null, jsx("span", {
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, t('Navigate to results'))), jsx(PresentationContent, null, jsx("span", {
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 screenReaderContent = !isAnswered && isAnswered !== null ? t('Navigate to question at position {displayPosition}, unanswered', {
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(Link, {
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: screenReaderContent
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
- return jsx(Link, {
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, t('Navigate to stimulus at position { displayPosition }', {
89
- displayPosition: displayPosition
90
- })));
97
+ }, jsx(ScreenReaderContent, null, textForNavigation)));
91
98
  }
92
99
  }, {
93
100
  key: "renderClosed",
@@ -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
  };
@@ -4,7 +4,7 @@ var generateStyle = function generateStyle(componentTheme) {
4
4
  position: 'relative',
5
5
  width: '100%',
6
6
  boxSizing: 'border-box',
7
- padding: "0 ".concat(componentTheme.wrapperPadding, " ").concat(componentTheme.wrapperPadding),
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-child': {
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
  },
@@ -121,6 +121,7 @@ export var Stimulus = (_dec = withStyleOverrides(generateStyle, generateComponen
121
121
  }, {
122
122
  key: "renderPanels",
123
123
  value: function renderPanels(propsForDnDZone) {
124
+ var isPassage = this.props.stimulus.passage;
124
125
  return jsx("div", {
125
126
  css: this.props.styles.stimulus,
126
127
  ref: this.props.dndRef,
@@ -129,9 +130,9 @@ export var Stimulus = (_dec = withStyleOverrides(generateStyle, generateComponen
129
130
  css: this.props.styles.leftPanel
130
131
  }, this.renderStimulusPanel()), jsx("div", {
131
132
  css: this.props.styles.itemPanel
132
- }, jsx("div", null), this.renderChildQuizEntries(), jsx(DragAndDropZone, Object.assign({}, propsForDnDZone, {
133
+ }, jsx("div", null), this.renderChildQuizEntries(), !isPassage && jsx(DragAndDropZone, Object.assign({}, propsForDnDZone, {
133
134
  location: "in"
134
- })), this.props.childEntries.size === 0 && !this.isQuizContentLocked() && jsx(AddContentPopover, {
135
+ })), this.props.childEntries.size === 0 && !this.isQuizContentLocked() && !isPassage && jsx(AddContentPopover, {
135
136
  allowStimulusCreation: false,
136
137
  stimulusId: this.props.stimulus.id,
137
138
  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";
@@ -318,7 +320,13 @@ export var StimulusEdit = (_dec = withStyleOverrides(generateStyle, generateComp
318
320
  }, {
319
321
  key: "renderAddToBankOptions",
320
322
  value: function renderAddToBankOptions() {
321
- return jsx("div", null, jsx(ToggleDetails, {
323
+ var _this$props$stimulus;
324
+ var paddingTopStyle = ((_this$props$stimulus = this.props.stimulus) === null || _this$props$stimulus === void 0 ? void 0 : _this$props$stimulus.passage) ? {
325
+ padding: 'small 0 0'
326
+ } : {};
327
+ return jsx(View, Object.assign({
328
+ as: "div"
329
+ }, paddingTopStyle), jsx(ToggleDetails, {
322
330
  variant: "filled",
323
331
  key: "itemBanking",
324
332
  summary: t('Item Banking')
@@ -338,14 +346,16 @@ export var StimulusEdit = (_dec = withStyleOverrides(generateStyle, generateComp
338
346
  }, {
339
347
  key: "renderStimulusEdit",
340
348
  value: function renderStimulusEdit() {
349
+ var stimulusLabel = this.props.stimulus.passage ? t('Passage') : t('Stimulus');
341
350
  return jsx("div", null, jsx("div", {
342
351
  css: this.props.styles.stimulus,
343
352
  ref: this.handleRef
344
353
  }, jsx("div", {
345
354
  css: this.props.styles.header
346
- }, jsx("div", {
347
- css: this.props.styles.stimulusLabel
348
- }, t('Stimulus')), jsx(ActionButtons, {
355
+ }, jsx(Text, {
356
+ size: "small",
357
+ color: "secondary"
358
+ }, stimulusLabel), jsx(ActionButtons, {
349
359
  connectDragSource: this.props.connectDragSource,
350
360
  displayPosition: this.props.displayPosition,
351
361
  onDelete: this.handleDeleteStimulus,
@@ -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
- return this.props.stimulus.isTemporary() ? t('Add Stimulus') : t('Edit Stimulus');
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,6 +96,43 @@ 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() {
@@ -104,26 +145,17 @@ export var StimulusEditInfo = (_dec = withStyleOverrides(generateStyle, generate
104
145
  }, jsx(Heading, {
105
146
  level: "h3",
106
147
  as: "h2"
107
- }, this.headerText()), jsx("div", {
148
+ }, this.headerText(stimulus)), jsx("div", {
108
149
  css: this.props.styles.section
109
150
  }, jsx(TextInput, {
110
151
  messages: this.inputErrors('title'),
111
152
  renderLabel: t('Title'),
112
153
  isRequired: true,
113
- type: "text",
114
154
  ref: this.props.setTitleRef,
115
155
  onChange: this.onTextInputChange('title'),
116
156
  value: stimulus.get('title'),
117
157
  "data-automation": "sdk-stimulus-title-input"
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
+ })), this.renderInstructions(stimulus), jsx("div", {
127
159
  css: this.props.styles.section
128
160
  }, jsx(FormField, {
129
161
  id: stimulusBodyId
@@ -138,22 +170,7 @@ export var StimulusEditInfo = (_dec = withStyleOverrides(generateStyle, generate
138
170
  onBlur: this.onBodyChange,
139
171
  onChange: this.onBodyChange,
140
172
  height: RCE_SINGLE_LINE_HEIGHT
141
- }))), jsx("div", {
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
- })))));
173
+ }))), this.renderOptions(stimulus));
157
174
  }
158
175
  }]);
159
176
  StimulusEditInfo.displayName = "StimulusEditInfo";