@instructure/quiz-core 22.1.0 → 22.2.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 (37) hide show
  1. package/es/banks/components/AddBankEntryModal/presenter.js +4 -1
  2. package/es/banks/components/BankEntry/presenter.js +110 -12
  3. package/es/banks/components/BankEntryRow/presenter.js +52 -8
  4. package/es/building/components/resources/DeleteStimulusModal/presenter.js +13 -7
  5. package/es/common/components/layout/sidebar/Stimulus/Collection/presenter.js +2 -2
  6. package/es/common/components/layout/sidebar/Stimulus/presenter.js +9 -6
  7. package/es/common/components/resources/stimulus/Stimulus/presenter.js +2 -2
  8. package/es/common/components/resources/stimulus/StimulusEdit/presenter.js +11 -10
  9. package/es/common/components/resources/stimulus/StimulusEditInfo/presenter.js +5 -5
  10. package/es/common/components/resources/stimulus/StimulusShow/index.js +1 -1
  11. package/es/common/components/resources/stimulus/StimulusShowInfo/index.js +1 -1
  12. package/es/common/components/shared/InteractionTypes/presenter.js +3 -2
  13. package/es/common/components/shared/drag_and_drop/dragAndDropUtils.js +7 -0
  14. package/es/common/records/BankEntry.js +9 -1
  15. package/es/common/records/QuizEntry.js +1 -1
  16. package/es/common/reducers/modifications.js +21 -12
  17. package/es/common/util/warningHelpers.js +13 -3
  18. package/es/moderating/components/sidebar/ModerateTray/presenter.js +5 -5
  19. package/lib/banks/components/AddBankEntryModal/presenter.js +4 -1
  20. package/lib/banks/components/BankEntry/presenter.js +110 -12
  21. package/lib/banks/components/BankEntryRow/presenter.js +52 -8
  22. package/lib/building/components/resources/DeleteStimulusModal/presenter.js +13 -7
  23. package/lib/common/components/layout/sidebar/Stimulus/Collection/presenter.js +2 -2
  24. package/lib/common/components/layout/sidebar/Stimulus/presenter.js +9 -6
  25. package/lib/common/components/resources/stimulus/Stimulus/presenter.js +2 -2
  26. package/lib/common/components/resources/stimulus/StimulusEdit/presenter.js +11 -10
  27. package/lib/common/components/resources/stimulus/StimulusEditInfo/presenter.js +5 -5
  28. package/lib/common/components/resources/stimulus/StimulusShow/index.js +1 -1
  29. package/lib/common/components/resources/stimulus/StimulusShowInfo/index.js +1 -1
  30. package/lib/common/components/shared/InteractionTypes/presenter.js +3 -2
  31. package/lib/common/components/shared/drag_and_drop/dragAndDropUtils.js +7 -0
  32. package/lib/common/records/BankEntry.js +9 -1
  33. package/lib/common/records/QuizEntry.js +1 -1
  34. package/lib/common/reducers/modifications.js +21 -12
  35. package/lib/common/util/warningHelpers.js +13 -3
  36. package/lib/moderating/components/sidebar/ModerateTray/presenter.js +5 -5
  37. package/package.json +9 -9
@@ -220,14 +220,14 @@ export var ModerateTray = /*#__PURE__*/function (_Component) {
220
220
  as: "div",
221
221
  direction: "column",
222
222
  height: "100vh"
223
- }, this.renderTitleAndCloseButton(), this.props.atteqApplyChangesToCurrentQuizAttemptsEnabled && /*#__PURE__*/React.createElement(Flex.Item, {
223
+ }, this.renderTitleAndCloseButton(), this.props.atteqApplyChangesToCurrentQuizAttemptsEnabled && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Flex.Item, {
224
224
  padding: "medium medium 0 medium"
225
225
  }, this.renderNameWithTooltip()), /*#__PURE__*/React.createElement(Flex.Item, {
226
- padding: "medium"
227
- }, t('These settings apply to current and all future attempts.')), /*#__PURE__*/React.createElement(Flex.Item, {
226
+ padding: "medium medium 0"
227
+ }, t('These settings apply to current and all future attempts.'))), /*#__PURE__*/React.createElement(Flex.Item, {
228
228
  shouldGrow: true,
229
- padding: "0 medium"
230
- }, this.renderChildren()), this.props.atteqApplyChangesToCurrentQuizAttemptsEnabled && /*#__PURE__*/React.createElement(Flex.Item, null, this.renderFooter())));
229
+ padding: "medium medium 0"
230
+ }, this.renderChildren()), /*#__PURE__*/React.createElement(Flex.Item, null, this.renderFooter())));
231
231
  }
232
232
  }]);
233
233
  }(Component);
@@ -62,7 +62,10 @@ var AddBankEntryModal = exports.AddBankEntryModal = /*#__PURE__*/function (_Comp
62
62
  _this2.props.navigateToBankEntry('new', _this2.props.bankId);
63
63
  });
64
64
  (0, _defineProperty2["default"])(_this2, "addStimulus", function () {
65
- _this2.props.createBankItem(_this2.props.bankId, 'Stimulus');
65
+ var isPassage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
66
+ _this2.props.createBankItem(_this2.props.bankId, 'Stimulus', {
67
+ passage: isPassage
68
+ });
66
69
  _this2.closeAction();
67
70
  _this2.props.navigateToBankEntry('new', _this2.props.bankId);
68
71
  });
@@ -240,18 +240,69 @@ var BankEntry = exports.BankEntry = (_dec = (0, _quizCommon.withStyleOverrides)(
240
240
  value: function isTemporary() {
241
241
  return this.props.entry && this.props.entry.isTemporary();
242
242
  }
243
+ }, {
244
+ key: "getBankEntryTypeSlug",
245
+ value: function getBankEntryTypeSlug() {
246
+ return this.props.bankEntry.entryType;
247
+ }
248
+ }, {
249
+ key: "getEntry",
250
+ value: function getEntry() {
251
+ return this.props.entry;
252
+ }
243
253
  }, {
244
254
  key: "isItemEntry",
245
255
  value: function isItemEntry() {
246
256
  return this.props.bankEntry.entryType === 'Item';
247
257
  }
258
+ }, {
259
+ key: "isStimulusEntry",
260
+ value: function isStimulusEntry() {
261
+ var entry = this.getEntry();
262
+ if (!entry) return false;
263
+ return entry.isStimulus && !entry.isPassage;
264
+ }
265
+ }, {
266
+ key: "isPassageEntry",
267
+ value: function isPassageEntry() {
268
+ var entry = this.getEntry();
269
+ if (!entry) return false;
270
+ return entry.isStimulus && entry.isPassage;
271
+ }
272
+ }, {
273
+ key: "getEditWarning",
274
+ value: function getEditWarning() {
275
+ if (this.isStimulusEntry()) {
276
+ return (0, _formatMessage["default"])('Edits made here will appear on any assessment using this stimulus.');
277
+ }
278
+ if (this.isPassageEntry()) {
279
+ return (0, _formatMessage["default"])('Edits made here will appear on any assessment using this text block.');
280
+ }
281
+ return (0, _formatMessage["default"])('Edits made here will appear on any assessment using this question.');
282
+ }
248
283
  }, {
249
284
  key: "entryLinkName",
250
285
  value: function entryLinkName() {
251
- if (this.isTemporary()) {
252
- return this.isItemEntry() ? (0, _formatMessage["default"])('New Question') : (0, _formatMessage["default"])('New Stimulus');
253
- } else {
254
- return this.isItemEntry() ? (0, _formatMessage["default"])('Edit Question') : (0, _formatMessage["default"])('Edit Stimulus');
286
+ var translations = {
287
+ "new": {
288
+ question: (0, _formatMessage["default"])('New Question'),
289
+ stimulus: (0, _formatMessage["default"])('New Stimulus'),
290
+ passage: (0, _formatMessage["default"])('New Text Block')
291
+ },
292
+ edit: {
293
+ question: (0, _formatMessage["default"])('Edit Question'),
294
+ stimulus: (0, _formatMessage["default"])('Edit Stimulus'),
295
+ passage: (0, _formatMessage["default"])('Edit Text Block')
296
+ }
297
+ };
298
+ var operation = this.isTemporary() ? 'new' : 'edit';
299
+ switch (true) {
300
+ case this.isItemEntry():
301
+ return translations[operation]['question'];
302
+ case this.isStimulusEntry():
303
+ return translations[operation]['stimulus'];
304
+ case this.isPassageEntry():
305
+ return translations[operation]['passage'];
255
306
  }
256
307
  }
257
308
  }, {
@@ -304,19 +355,66 @@ var BankEntry = exports.BankEntry = (_dec = (0, _quizCommon.withStyleOverrides)(
304
355
  });
305
356
  }
306
357
  }
358
+ }, {
359
+ key: "getIdentifier",
360
+ value: function getIdentifier(entry) {
361
+ if (!entry) return;
362
+ switch (true) {
363
+ case this.isItemEntry():
364
+ return (0, _formatMessage["default"])('Question { id }', {
365
+ id: entry.id
366
+ });
367
+ case this.isStimulusEntry():
368
+ return (0, _formatMessage["default"])('Stimulus { id }', {
369
+ id: entry.id
370
+ });
371
+ case this.isPassageEntry():
372
+ return (0, _formatMessage["default"])('Text Block { id }', {
373
+ id: entry.id
374
+ });
375
+ default:
376
+ return;
377
+ }
378
+ }
379
+ }, {
380
+ key: "getTemporaryIdentifier",
381
+ value: function getTemporaryIdentifier() {
382
+ switch (true) {
383
+ case this.isItemEntry():
384
+ return (0, _formatMessage["default"])('New Question');
385
+ case this.isStimulusEntry():
386
+ return (0, _formatMessage["default"])('New Stimulus');
387
+ case this.isPassageEntry():
388
+ return (0, _formatMessage["default"])('New Text Block');
389
+ default:
390
+ return;
391
+ }
392
+ }
393
+ }, {
394
+ key: "getEntryName",
395
+ value: function getEntryName(entry) {
396
+ var _entry$getInteraction;
397
+ if (!entry) return;
398
+ switch (true) {
399
+ case this.isItemEntry():
400
+ return (_entry$getInteraction = entry.getInteractionType()) === null || _entry$getInteraction === void 0 ? void 0 : _entry$getInteraction.name;
401
+ case this.isStimulusEntry():
402
+ return (0, _formatMessage["default"])('Stimulus');
403
+ case this.isPassageEntry():
404
+ return (0, _formatMessage["default"])('Text Block');
405
+ default:
406
+ return;
407
+ }
408
+ }
307
409
  }, {
308
410
  key: "renderHeader",
309
411
  value: function renderHeader(entry) {
310
412
  if (!entry) return;
311
413
  var props = this.editProps(entry);
312
- var identifier = this.isItemEntry() ? (0, _formatMessage["default"])('Question { id }', {
313
- id: entry.id
314
- }) : (0, _formatMessage["default"])('Stimulus { id }', {
315
- id: entry.id
316
- });
317
- var tempIdentifier = this.isItemEntry() ? (0, _formatMessage["default"])('New Question') : (0, _formatMessage["default"])('New Stimulus');
414
+ var identifier = this.getIdentifier(entry);
415
+ var tempIdentifier = this.getTemporaryIdentifier();
318
416
  var itemIdentifier = this.isTemporary() ? tempIdentifier : identifier;
319
- var entryName = this.isItemEntry() ? entry.getInteractionType().name : (0, _formatMessage["default"])('Stimulus');
417
+ var entryName = this.getEntryName(entry);
320
418
  var separator = ' | ';
321
419
  return (0, _emotion.jsx)("div", {
322
420
  css: this.props.styles.header
@@ -550,7 +648,7 @@ var BankEntry = exports.BankEntry = (_dec = (0, _quizCommon.withStyleOverrides)(
550
648
  tags: _this3.visibleTags()
551
649
  });
552
650
  };
553
- var editWarning = this.isItemEntry() ? (0, _formatMessage["default"])('Edits made here will appear on any assessment using this question.') : (0, _formatMessage["default"])('Edits made here will appear on any assessment using this stimulus.');
651
+ var editWarning = this.getEditWarning();
554
652
  return (0, _emotion.jsx)("div", null, (0, _emotion.jsx)("div", {
555
653
  css: this.props.styles.entryEdit
556
654
  }, (0, _emotion.jsx)(_WarningWrapper["default"], versioningProps, canEdit && (0, _emotion.jsx)(_uiAlerts.Alert, {
@@ -67,7 +67,6 @@ var BankEntryRow = exports.BankEntryRow = (_dec = (0, _quizCommon.withStyleOverr
67
67
  _this2.props.setUi(_quizCommon.BUILD_TRAY_POSITION, _this2.props.position + 1);
68
68
  });
69
69
  (0, _defineProperty2["default"])(_this2, "deleteBankEntry", function () {
70
- var deletePreface = _this2.isItemEntry() ? (0, _formatMessage["default"])('Deleting this question:') : (0, _formatMessage["default"])('Deleting this stimulus:');
71
70
  var confirmBody = (0, _emotion.jsx)(_uiAlerts.Alert, {
72
71
  variant: "error",
73
72
  padding: "0"
@@ -75,7 +74,7 @@ var BankEntryRow = exports.BankEntryRow = (_dec = (0, _quizCommon.withStyleOverr
75
74
  css: _this2.props.styles.deleteAlert
76
75
  }, (0, _emotion.jsx)("div", {
77
76
  css: _this2.props.styles.deletePreface
78
- }, deletePreface), (0, _emotion.jsx)(_uiList.List, null, (0, _emotion.jsx)(_uiList.List.Item, null, _formatMessage["default"].rich('will <0>NOT</0> remove it from any assessments', [function (_ref) {
77
+ }, _this2.getDeletePreface()), (0, _emotion.jsx)(_uiList.List, null, (0, _emotion.jsx)(_uiList.List.Item, null, _formatMessage["default"].rich('will <0>NOT</0> remove it from any assessments', [function (_ref) {
79
78
  var children = _ref.children;
80
79
  return (0, _emotion.jsx)(_uiText.Text, {
81
80
  weight: "bold",
@@ -161,20 +160,60 @@ var BankEntryRow = exports.BankEntryRow = (_dec = (0, _quizCommon.withStyleOverr
161
160
  value: function isItemEntry() {
162
161
  return this.props.bankEntry.entryType === 'Item';
163
162
  }
163
+ }, {
164
+ key: "isStimulusEntry",
165
+ value: function isStimulusEntry() {
166
+ var entry = this.getEntry();
167
+ if (!entry) return false;
168
+ return entry.isStimulus && !entry.isPassage;
169
+ }
170
+ }, {
171
+ key: "isPassageEntry",
172
+ value: function isPassageEntry() {
173
+ var entry = this.getEntry();
174
+ if (!entry) return false;
175
+ return entry.isStimulus && entry.isPassage;
176
+ }
164
177
  }, {
165
178
  key: "type",
166
179
  value: function type() {
167
- return this.isItemEntry() ? (0, _formatMessage["default"])('Question') : (0, _formatMessage["default"])('Stimulus');
180
+ if (this.isStimulusEntry()) {
181
+ return (0, _formatMessage["default"])('Stimulus');
182
+ }
183
+ if (this.isPassageEntry()) {
184
+ return (0, _formatMessage["default"])('Text Block');
185
+ }
186
+ return (0, _formatMessage["default"])('Question');
168
187
  }
169
188
  }, {
170
189
  key: "entryIdentifier",
171
190
  value: function entryIdentifier() {
172
- return this.isItemEntry() ? (0, _formatMessage["default"])('Question { itemBody }', {
173
- itemBody: (0, _quizInteractions.extractTextFromHtml)(this.getEntry().title)
174
- }) : (0, _formatMessage["default"])('Stimulus { title }', {
175
- title: this.getEntry().title
191
+ var title = this.getEntry().title;
192
+ if (this.isStimulusEntry()) {
193
+ return (0, _formatMessage["default"])('Stimulus { title }', {
194
+ title: title
195
+ });
196
+ }
197
+ if (this.isPassageEntry()) {
198
+ return (0, _formatMessage["default"])('Text Block { title }', {
199
+ title: title
200
+ });
201
+ }
202
+ return (0, _formatMessage["default"])('Question { itemBody }', {
203
+ itemBody: (0, _quizInteractions.extractTextFromHtml)(title)
176
204
  });
177
205
  }
206
+ }, {
207
+ key: "getDeletePreface",
208
+ value: function getDeletePreface() {
209
+ if (this.isStimulusEntry()) {
210
+ return (0, _formatMessage["default"])('Deleting this stimulus:');
211
+ }
212
+ if (this.isPassageEntry()) {
213
+ return (0, _formatMessage["default"])('Deleting this text block:');
214
+ }
215
+ return (0, _formatMessage["default"])('Deleting this question:');
216
+ }
178
217
  }, {
179
218
  key: "moveModalTitle",
180
219
  value: function moveModalTitle() {
@@ -243,7 +282,12 @@ var BankEntryRow = exports.BankEntryRow = (_dec = (0, _quizCommon.withStyleOverr
243
282
  }, {
244
283
  key: "entryHeader",
245
284
  value: function entryHeader() {
246
- return this.isItemEntry() ? this.getEntry().getInteractionType().name : (0, _formatMessage["default"])('Stimulus');
285
+ var entry = this.getEntry();
286
+ if (this.isItemEntry()) {
287
+ return entry.getInteractionType().name;
288
+ } else {
289
+ return entry.isPassage ? (0, _formatMessage["default"])('Text Block') : (0, _formatMessage["default"])('Stimulus');
290
+ }
247
291
  }
248
292
  }, {
249
293
  key: "renderHeader",
@@ -165,8 +165,14 @@ var DeleteStimulusModal = exports.DeleteStimulusModal = (_dec = (0, _quizCommon.
165
165
  }, {
166
166
  key: "isPassage",
167
167
  value: function isPassage() {
168
- var _this$props$stimulusE;
169
- return (_this$props$stimulusE = this.props.stimulusEntry) === null || _this$props$stimulusE === void 0 ? void 0 : _this$props$stimulusE.getEntry().passage;
168
+ var _this$props$stimulusE, _this$props$stimulusE3;
169
+ if (((_this$props$stimulusE = this.props.stimulusEntry) === null || _this$props$stimulusE === void 0 ? void 0 : _this$props$stimulusE.entryType) === 'BankEntry') {
170
+ var _this$props$stimulusE2;
171
+ var bankEntry = (_this$props$stimulusE2 = this.props.stimulusEntry) === null || _this$props$stimulusE2 === void 0 ? void 0 : _this$props$stimulusE2.getEntry();
172
+ var stimulusEntry = bankEntry === null || bankEntry === void 0 ? void 0 : bankEntry.getEntry();
173
+ return stimulusEntry === null || stimulusEntry === void 0 ? void 0 : stimulusEntry.isPassage;
174
+ }
175
+ return (_this$props$stimulusE3 = this.props.stimulusEntry) === null || _this$props$stimulusE3 === void 0 ? void 0 : _this$props$stimulusE3.getEntry().passage;
170
176
  }
171
177
  }, {
172
178
  key: "anyImmutableKeepers",
@@ -197,7 +203,7 @@ var DeleteStimulusModal = exports.DeleteStimulusModal = (_dec = (0, _quizCommon.
197
203
  onClick: this.closeAction,
198
204
  margin: _quizCommon.XSMALL_SIDE_MARGIN,
199
205
  "data-automation": "sdk-keep-".concat(this.isPassage() ? 'passage' : 'stimulus', "-button")
200
- }, this.isPassage() ? (0, _formatMessage["default"])('Keep Passage') : (0, _formatMessage["default"])('Keep Stimulus'));
206
+ }, this.isPassage() ? (0, _formatMessage["default"])('Keep Text Block') : (0, _formatMessage["default"])('Keep Stimulus'));
201
207
  }
202
208
  }, {
203
209
  key: "doneButton",
@@ -207,7 +213,7 @@ var DeleteStimulusModal = exports.DeleteStimulusModal = (_dec = (0, _quizCommon.
207
213
  onClick: this.handleSubmit,
208
214
  margin: _quizCommon.XSMALL_SIDE_MARGIN,
209
215
  "data-automation": "sdk-remove-".concat(this.isPassage() ? 'passage' : 'stimulus', "-button")
210
- }, this.isPassage() ? (0, _formatMessage["default"])('Remove Passage') : (0, _formatMessage["default"])('Remove Stimulus'));
216
+ }, this.isPassage() ? (0, _formatMessage["default"])('Remove Text Block') : (0, _formatMessage["default"])('Remove Stimulus'));
211
217
  }
212
218
  }, {
213
219
  key: "renderChooseWhich",
@@ -250,7 +256,7 @@ var DeleteStimulusModal = exports.DeleteStimulusModal = (_dec = (0, _quizCommon.
250
256
  }, {
251
257
  key: "renderContent",
252
258
  value: function renderContent() {
253
- var message = this.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?');
259
+ var message = this.isPassage() ? (0, _formatMessage["default"])('Are you sure you want to remove this text block?') : (0, _formatMessage["default"])('Are you sure you want to remove this stimulus?');
254
260
  var content = this.props.childEntries.size === 0 ? (0, _emotion.jsx)("span", null, message) : this.renderMainMenu();
255
261
  var stimulusTitle = this.props.stimulusEntry && this.props.stimulusEntry.getEntry().title;
256
262
  return (0, _emotion.jsx)("div", {
@@ -267,11 +273,11 @@ var DeleteStimulusModal = exports.DeleteStimulusModal = (_dec = (0, _quizCommon.
267
273
  open: this.props.modalOpen,
268
274
  onDismiss: this.closeAction,
269
275
  size: "small",
270
- label: this.isPassage() ? (0, _formatMessage["default"])('Confirm Passage Removal') : (0, _formatMessage["default"])('Confirm Stimulus Removal')
276
+ label: this.isPassage() ? (0, _formatMessage["default"])('Confirm Text Block Removal') : (0, _formatMessage["default"])('Confirm Stimulus Removal')
271
277
  }, (0, _emotion.jsx)(_quizCommon.ModalHeader, null, (0, _emotion.jsx)(_uiHeading.Heading, {
272
278
  level: "reset",
273
279
  as: "h2"
274
- }, this.isPassage() ? (0, _formatMessage["default"])('Confirm Passage Removal') : (0, _formatMessage["default"])('Confirm Stimulus Removal')), (0, _emotion.jsx)(_uiButtons.CloseButton, {
280
+ }, this.isPassage() ? (0, _formatMessage["default"])('Confirm Text Block Removal') : (0, _formatMessage["default"])('Confirm Stimulus Removal')), (0, _emotion.jsx)(_uiButtons.CloseButton, {
275
281
  onClick: this.closeAction,
276
282
  placement: "end",
277
283
  offset: "medium",
@@ -96,7 +96,7 @@ var Collection = exports.Collection = (_dec = (0, _quizCommon.withStyleOverrides
96
96
  }, _this3.props.renderSidebarItem(item, displayPosition, sidebarOpen));
97
97
  });
98
98
  var transitionType = isShowingItems ? 'slide-down' : 'slide-up';
99
- var screenReaderText = this.props.isPassage ? (0, _formatMessage["default"])('Collapse passage questions') : (0, _formatMessage["default"])('Collapse stimulus questions');
99
+ var screenReaderText = this.props.isPassage ? (0, _formatMessage["default"])('Collapse text block questions') : (0, _formatMessage["default"])('Collapse stimulus questions');
100
100
  return (0, _emotion.jsx)(_uiMotion.Transition, {
101
101
  "in": isShowingItems || this.shouldDisplayAllItems(),
102
102
  type: transitionType
@@ -119,7 +119,7 @@ var Collection = exports.Collection = (_dec = (0, _quizCommon.withStyleOverrides
119
119
  itemCollection = _this$props2.itemCollection,
120
120
  isShowingItems = _this$props2.isShowingItems;
121
121
  var transitionType = !isShowingItems ? 'slide-up' : 'slide-down';
122
- var screenReaderText = this.props.isPassage ? (0, _formatMessage["default"])('Expand passage questions') : (0, _formatMessage["default"])('Expand stimulus questions');
122
+ var screenReaderText = this.props.isPassage ? (0, _formatMessage["default"])('Expand text block questions') : (0, _formatMessage["default"])('Expand stimulus questions');
123
123
  return (0, _emotion.jsx)(_uiMotion.Transition, {
124
124
  "in": !isShowingItems,
125
125
  type: transitionType
@@ -110,11 +110,14 @@ var SidebarStimulus = exports.SidebarStimulus = (_dec = (0, _quizCommon.withStyl
110
110
  var _this$props2 = this.props,
111
111
  displayPosition = _this$props2.displayPosition,
112
112
  sidebarOpen = _this$props2.sidebarOpen;
113
- var itemName = this.stimulusIsPassage() ? 'passage' : 'stimulus';
114
- var textForNavigation = (0, _formatMessage["default"])('Navigate to {itemName} at position {displayPosition}', {
115
- itemName: itemName,
116
- displayPosition: displayPosition
117
- });
113
+ var textForNavigation;
114
+ if (this.stimulusIsPassage()) {
115
+ textForNavigation = (0, _formatMessage["default"])('Navigate to text block');
116
+ } else {
117
+ textForNavigation = (0, _formatMessage["default"])('Navigate to stimulus at position {displayPosition}', {
118
+ displayPosition: displayPosition
119
+ });
120
+ }
118
121
  var content = sidebarOpen ? '' : textForNavigation;
119
122
  var tip = (0, _emotion.jsx)(_uiText.Text, {
120
123
  "aria-hidden": !sidebarOpen,
@@ -138,7 +141,7 @@ var SidebarStimulus = exports.SidebarStimulus = (_dec = (0, _quizCommon.withStyl
138
141
  }, {
139
142
  key: "infoHeaderLabel",
140
143
  value: function infoHeaderLabel() {
141
- return this.stimulusIsPassage() ? (0, _formatMessage["default"])('Passage') : (0, _formatMessage["default"])('Stimulus');
144
+ return this.stimulusIsPassage() ? (0, _formatMessage["default"])('Text Block') : (0, _formatMessage["default"])('Stimulus');
142
145
  }
143
146
  }, {
144
147
  key: "renderSummary",
@@ -121,7 +121,7 @@ var Stimulus = exports.Stimulus = (_dec = (0, _quizCommon.withStyleOverrides)(_s
121
121
  key: "renderStimulusPanel",
122
122
  value: function renderStimulusPanel() {
123
123
  var StimulusComponent = this.props.isEditing ? _StimulusEdit["default"] : _StimulusShow["default"];
124
- var automationPrefix = this.isPassage() ? 'passage' : 'stimulus';
124
+ var automationPrefix = this.isPassage() ? 'text-block' : 'stimulus';
125
125
  var connectDragPreview = this.props.connectDragPreview;
126
126
  return connectDragPreview((0, _emotion.jsx)("div", {
127
127
  "data-automation": "sdk-".concat(automationPrefix, "-LeftPanelShow")
@@ -149,7 +149,7 @@ var Stimulus = exports.Stimulus = (_dec = (0, _quizCommon.withStyleOverrides)(_s
149
149
  }, {
150
150
  key: "renderPanels",
151
151
  value: function renderPanels(propsForDnDZone) {
152
- var automationPrefix = this.isPassage() ? 'passage' : 'stimulus';
152
+ var automationPrefix = this.isPassage() ? 'text-block' : 'stimulus';
153
153
  return (0, _emotion.jsx)("div", {
154
154
  css: this.props.styles.stimulus,
155
155
  ref: this.props.dndRef,
@@ -87,11 +87,11 @@ var StimulusEdit = exports.StimulusEdit = (_dec = (0, _quizCommon.withStyleOverr
87
87
  inStimulus: false
88
88
  });
89
89
  }, {
90
- title: isPassage ? (0, _formatMessage["default"])('Confirm Passage Removal') : (0, _formatMessage["default"])('Confirm Stimulus Removal'),
91
- 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?'),
92
- continueText: isPassage ? (0, _formatMessage["default"])('Remove Passage') : (0, _formatMessage["default"])('Remove Stimulus'),
93
- cancelText: isPassage ? (0, _formatMessage["default"])('Keep Passage ') : (0, _formatMessage["default"])('Keep Stimulus'),
94
- automationPrefix: isPassage ? 'passage' : 'stimulus'
90
+ title: isPassage ? (0, _formatMessage["default"])('Confirm Text Block Removal') : (0, _formatMessage["default"])('Confirm Stimulus Removal'),
91
+ text: isPassage ? (0, _formatMessage["default"])('Are you sure you want to remove this text block?') : (0, _formatMessage["default"])('Are you sure you want to remove this stimulus?'),
92
+ continueText: isPassage ? (0, _formatMessage["default"])('Remove Text Block') : (0, _formatMessage["default"])('Remove Stimulus'),
93
+ cancelText: isPassage ? (0, _formatMessage["default"])('Keep Text Block ') : (0, _formatMessage["default"])('Keep Stimulus'),
94
+ automationPrefix: isPassage ? 'text-block' : 'stimulus'
95
95
  });
96
96
  });
97
97
  (0, _defineProperty2["default"])(_this2, "handleDeleteStimulus", function () {
@@ -161,7 +161,7 @@ var StimulusEdit = exports.StimulusEdit = (_dec = (0, _quizCommon.withStyleOverr
161
161
  _context2.next = 9;
162
162
  break;
163
163
  }
164
- message = _this2.isPassage() ? (0, _formatMessage["default"])('Passage not saved due to validation errors with the data.') : (0, _formatMessage["default"])('Stimulus not saved due to validation errors with the data.');
164
+ message = _this2.isPassage() ? (0, _formatMessage["default"])('Text Block not saved due to validation errors with the data.') : (0, _formatMessage["default"])('Stimulus not saved due to validation errors with the data.');
165
165
  _context2.next = 5;
166
166
  return _this2.props.showError(_this2.props.guid);
167
167
  case 5:
@@ -323,7 +323,7 @@ var StimulusEdit = exports.StimulusEdit = (_dec = (0, _quizCommon.withStyleOverr
323
323
  }, {
324
324
  key: "afterSubmit",
325
325
  value: function afterSubmit() {
326
- var message = this.isPassage() ? (0, _formatMessage["default"])('Changes to passage saved.') : (0, _formatMessage["default"])('Changes to stimulus saved.');
326
+ var message = this.isPassage() ? (0, _formatMessage["default"])('Changes to text block saved.') : (0, _formatMessage["default"])('Changes to stimulus saved.');
327
327
  this.props.switchOffEditing();
328
328
  this.clearModifications();
329
329
  this.props.setUi(_quizCommon.SHOULD_CLONE_ITEM, false);
@@ -373,8 +373,8 @@ var StimulusEdit = exports.StimulusEdit = (_dec = (0, _quizCommon.withStyleOverr
373
373
  }, {
374
374
  key: "renderStimulusEdit",
375
375
  value: function renderStimulusEdit() {
376
- var stimulusLabel = this.isPassage() ? (0, _formatMessage["default"])('Passage') : (0, _formatMessage["default"])('Stimulus');
377
- var automationPrefix = this.isPassage() ? 'passage' : 'stimulus';
376
+ var stimulusLabel = this.isPassage() ? (0, _formatMessage["default"])('Text Block') : (0, _formatMessage["default"])('Stimulus');
377
+ var automationPrefix = this.isPassage() ? 'text-block' : 'stimulus';
378
378
  return (0, _emotion.jsx)("div", null, (0, _emotion.jsx)("div", {
379
379
  css: this.props.styles.stimulus,
380
380
  ref: this.handleRef
@@ -430,9 +430,10 @@ var StimulusEdit = exports.StimulusEdit = (_dec = (0, _quizCommon.withStyleOverr
430
430
  var _this$props = this.props,
431
431
  stimulus = _this$props.stimulus,
432
432
  quizEntry = _this$props.quizEntry;
433
+ var isPassage = stimulus.isPassage;
433
434
  var needsWarning = stimulus.isImmutable() || quizEntry.isArchivedBankEntry;
434
435
  var propForWrapperFunc = quizEntry.isArchivedBankEntry ? _warningHelpers.propsForBankEntryVersioningWrapper : _warningHelpers.propsForStimulusVersioningWrapper;
435
- var propsForStimulusVersioning = propForWrapperFunc(needsWarning, this.props.shouldClone, (0, _partial["default"])(this.props.setUi, _quizCommon.SHOULD_CLONE_ITEM), this.props.switchOffEditing, true, quizEntry.isArchivedBankEntry ? 'info' : 'warning');
436
+ var propsForStimulusVersioning = propForWrapperFunc(needsWarning, this.props.shouldClone, (0, _partial["default"])(this.props.setUi, _quizCommon.SHOULD_CLONE_ITEM), this.props.switchOffEditing, true, quizEntry.isArchivedBankEntry ? 'info' : 'warning', isPassage);
436
437
  var hasWarningWrapper = needsWarning && !this.props.shouldClone;
437
438
  return (0, _emotion.jsx)(_WarningWrapper["default"], propsForStimulusVersioning, hasWarningWrapper ? (0, _emotion.jsx)(_StimulusShowInfo["default"], this.props) : this.renderStimulusEdit());
438
439
  }
@@ -79,9 +79,9 @@ var StimulusEditInfo = exports.StimulusEditInfo = (_dec = (0, _quizCommon.withSt
79
79
  key: "headerText",
80
80
  value: function headerText(stimulus) {
81
81
  if (stimulus.isTemporary()) {
82
- return stimulus.passage ? (0, _formatMessage["default"])('Add Passage') : (0, _formatMessage["default"])('Add Stimulus');
82
+ return stimulus.passage ? (0, _formatMessage["default"])('Add Text Block') : (0, _formatMessage["default"])('Add Stimulus');
83
83
  } else {
84
- return stimulus.passage ? (0, _formatMessage["default"])('Edit Passage') : (0, _formatMessage["default"])('Edit Stimulus');
84
+ return stimulus.passage ? (0, _formatMessage["default"])('Edit Text Block') : (0, _formatMessage["default"])('Edit Stimulus');
85
85
  }
86
86
  }
87
87
  }, {
@@ -125,7 +125,7 @@ var StimulusEditInfo = exports.StimulusEditInfo = (_dec = (0, _quizCommon.withSt
125
125
  }
126
126
  return (0, _emotion.jsx)(_uiAlerts.Alert, {
127
127
  variant: "warning"
128
- }, (0, _formatMessage["default"])('The passage sections may not appear in their original order due to the shuffle setting.'));
128
+ }, (0, _formatMessage["default"])('The text block sections may not appear in their original order due to the shuffle setting.'));
129
129
  }
130
130
  }, {
131
131
  key: "renderInstructions",
@@ -170,8 +170,8 @@ var StimulusEditInfo = exports.StimulusEditInfo = (_dec = (0, _quizCommon.withSt
170
170
  var stimulus = this.props.workingStimulus;
171
171
  var textAreaId = "stimulusBodyEdit_".concat(stimulus.id, "_").concat(this.props.isBankedContent);
172
172
  var stimulusBodyId = "stimulusBodyEdit_".concat(stimulus.id, "_body");
173
- var automationPrefix = stimulus.passage ? 'passage' : 'stimulus';
174
- var message = stimulus.passage ? (0, _formatMessage["default"])('Edit Passage') : (0, _formatMessage["default"])('Edit Stimulus');
173
+ var automationPrefix = stimulus.passage ? 'text-block' : 'stimulus';
174
+ var message = stimulus.passage ? (0, _formatMessage["default"])('Edit Text Block') : (0, _formatMessage["default"])('Edit Stimulus');
175
175
  return (0, _emotion.jsx)(_quizCommon.FormFieldGroup, {
176
176
  messages: this.inputErrors('onSelf'),
177
177
  description: (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, message)
@@ -65,7 +65,7 @@ var StimulusShow = exports.StimulusShow = (_dec = (0, _quizCommon.withStyleOverr
65
65
  }, {
66
66
  key: "render",
67
67
  value: function render() {
68
- var stimulusLabel = this.props.stimulus.passage ? (0, _formatMessage["default"])('Passage') : (0, _formatMessage["default"])('Stimulus');
68
+ var stimulusLabel = this.props.stimulus.passage ? (0, _formatMessage["default"])('Text Block') : (0, _formatMessage["default"])('Stimulus');
69
69
  return (0, _emotion.jsx)(_overlay["default"], {
70
70
  onClick: this.switchOnEditing,
71
71
  wrapperStyles: this.props.styles.stimulusWrapper,
@@ -44,7 +44,7 @@ var StimulusShowInfo = /*#__PURE__*/function (_Component) {
44
44
  key: "render",
45
45
  value: function render() {
46
46
  var stimulus = this.props.stimulus;
47
- var automationPrefix = stimulus.passage ? 'passage' : 'stimulus';
47
+ var automationPrefix = stimulus.passage ? 'text-block' : 'stimulus';
48
48
  var instructions = stimulus.instructions && /*#__PURE__*/_react["default"].createElement(_uiView.View, {
49
49
  as: "div",
50
50
  padding: "small",
@@ -68,8 +68,8 @@ var InteractionTypes = exports.InteractionTypes = (_dec = (0, _quizCommon.withSt
68
68
  return _this2.props.addStimulus(true);
69
69
  };
70
70
  Icon = _uiIcons.IconPlusLine;
71
- name = (0, _formatMessage["default"])('Passage');
72
- title = (0, _formatMessage["default"])('Add Passage');
71
+ name = (0, _formatMessage["default"])('Text Block');
72
+ title = (0, _formatMessage["default"])('Add Text Block');
73
73
  automation = 'sdk-interaction-button-passage';
74
74
  break;
75
75
  default:
@@ -186,6 +186,7 @@ var InteractionTypes = exports.InteractionTypes = (_dec = (0, _quizCommon.withSt
186
186
  styles: _propTypes["default"].object
187
187
  }), (0, _defineProperty2["default"])(_InteractionTypes, "defaultProps", {
188
188
  allowStimulusCreation: true,
189
+ allowPassageCreation: false,
189
190
  types: (0, _immutable.List)()
190
191
  }), _InteractionTypes)) || _class);
191
192
  var _default = exports["default"] = InteractionTypes;
@@ -49,6 +49,13 @@ var posObjFromQuizEntry = exports.posObjFromQuizEntry = (0, _cachePreviousArgs["
49
49
  // handle dragging items over stimulus
50
50
  if (!quizEntryDragging.hasStimulus && quizEntryHovered.hasStimulus && (onRightHalf || inSidebar)) {
51
51
  if (deepInsideEntry && quizEntryHovered.getNestedEntries().size === 0) {
52
+ if (quizEntryHovered.entryType === 'BankEntry') {
53
+ var bankEntry = quizEntryHovered.getEntry();
54
+ var bankEntryItem = bankEntry === null || bankEntry === void 0 ? void 0 : bankEntry.getEntry();
55
+ if (bankEntryItem !== null && bankEntryItem !== void 0 && bankEntryItem.isPassage) {
56
+ return null;
57
+ }
58
+ }
52
59
  if (quizEntryHovered.isPassage) {
53
60
  return null;
54
61
  }
@@ -74,7 +74,15 @@ var BankEntry = exports.BankEntry = /*#__PURE__*/function (_ReduxRecord) {
74
74
  }, {
75
75
  key: "isStimulus",
76
76
  get: function get() {
77
- return this.entryType === 'Stimulus';
77
+ var _this$getEntry;
78
+ return this.entryType === 'Stimulus' && !((_this$getEntry = this.getEntry()) !== null && _this$getEntry !== void 0 && _this$getEntry.isPassage);
79
+ }
80
+ }, {
81
+ key: "isPassage",
82
+ get: function get() {
83
+ var _this$getEntry2;
84
+ if (!this.isStimulus) return false;
85
+ return (_this$getEntry2 = this.getEntry()) === null || _this$getEntry2 === void 0 ? void 0 : _this$getEntry2.isPassage;
78
86
  }
79
87
  }]);
80
88
  }((0, _reduxRecord["default"])({
@@ -376,7 +376,7 @@ var QuizEntry = exports.QuizEntry = (_dec = (0, _withStateCache["default"])(func
376
376
  var type;
377
377
  if (this.hasStimulus || this.isBank) {
378
378
  if (this.isPassage) {
379
- type = (0, _formatMessage["default"])('Passage');
379
+ type = (0, _formatMessage["default"])('Text Block');
380
380
  var opts = {
381
381
  type: type,
382
382
  start: displayPosition - 1
@@ -144,19 +144,28 @@ var _default = exports["default"] = function _default() {
144
144
  entryType: action.payload.bankEntryType
145
145
  };
146
146
  var stateWithBankEntryMods = updateObjectOfType(stateWithBankMods, _quizCommon.TEMPORARY_BANK_ENTRY_ID, bankEntryMods, 'bankEntries');
147
- var bankItemMods = action.payload.bankEntryType === 'Item' ? {
148
- interactionData: action.payload.interactionTypeData.interactionData,
149
- interactionType: action.payload.interactionTypeData.id,
150
- itemBody: action.payload.interactionTypeData.itemBody,
151
- properties: action.payload.interactionTypeData.properties,
152
- scoringData: action.payload.interactionTypeData.scoringData,
153
- title: null
154
- } : {
155
- title: ''
156
- };
147
+ var bankItemMods;
148
+ if (action.payload.bankEntryType === 'Item') {
149
+ bankItemMods = {
150
+ interactionData: action.payload.interactionTypeData.interactionData,
151
+ interactionType: action.payload.interactionTypeData.id,
152
+ itemBody: action.payload.interactionTypeData.itemBody,
153
+ properties: action.payload.interactionTypeData.properties,
154
+ scoringData: action.payload.interactionTypeData.scoringData,
155
+ title: null
156
+ };
157
+ } else {
158
+ var isPassage = action.payload.interactionTypeData.passage;
159
+ bankItemMods = isPassage ? {
160
+ title: '',
161
+ passage: true,
162
+ orientation: 'top'
163
+ } : {
164
+ title: ''
165
+ };
166
+ }
157
167
  var collection = action.payload.bankEntryType === 'Item' ? 'items' : 'stimuli';
158
- var stateWithMods = updateObjectOfType(stateWithBankEntryMods, tempId, bankItemMods, collection);
159
- return stateWithMods;
168
+ return updateObjectOfType(stateWithBankEntryMods, tempId, bankItemMods, collection);
160
169
  }();
161
170
  case _quizCommon.CLEAR_NEXT_QUIZ_ENTRY:
162
171
  return state["delete"]('nextQuizEntry');