@instructure/quiz-core 22.0.0 → 22.1.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 (27) hide show
  1. package/es/banks/components/CopyMoveBankEntryModal/presenter.js +84 -15
  2. package/es/common/components/layout/sidebar/Stimulus/Collection/presenter.js +6 -3
  3. package/es/common/components/layout/sidebar/Stimulus/presenter.js +98 -38
  4. package/es/common/components/layout/sidebar/Stimulus/styles.js +2 -26
  5. package/es/common/components/layout/sidebar/Stimulus/theme.js +1 -10
  6. package/es/common/components/resources/BankSelection/presenter.js +31 -8
  7. package/es/common/components/resources/sessionItemResult/SessionItemResult/presenter.js +20 -20
  8. package/es/common/components/resources/stimulus/StimulusEdit/presenter.js +31 -29
  9. package/es/common/components/resources/stimulus/StimulusEditInfo/presenter.js +2 -1
  10. package/es/common/components/shared/GenericAsyncSearch/GenericAsyncSearch.js +10 -3
  11. package/es/common/records/QuizEntry.js +29 -17
  12. package/es/common/records/SessionItem.js +6 -0
  13. package/es/taking/api/taking.js +1 -1
  14. package/lib/banks/components/CopyMoveBankEntryModal/presenter.js +84 -15
  15. package/lib/common/components/layout/sidebar/Stimulus/Collection/presenter.js +6 -3
  16. package/lib/common/components/layout/sidebar/Stimulus/presenter.js +98 -38
  17. package/lib/common/components/layout/sidebar/Stimulus/styles.js +2 -26
  18. package/lib/common/components/layout/sidebar/Stimulus/theme.js +1 -10
  19. package/lib/common/components/resources/BankSelection/presenter.js +31 -8
  20. package/lib/common/components/resources/sessionItemResult/SessionItemResult/presenter.js +20 -20
  21. package/lib/common/components/resources/stimulus/StimulusEdit/presenter.js +31 -29
  22. package/lib/common/components/resources/stimulus/StimulusEditInfo/presenter.js +2 -1
  23. package/lib/common/components/shared/GenericAsyncSearch/GenericAsyncSearch.js +10 -3
  24. package/lib/common/records/QuizEntry.js +29 -17
  25. package/lib/common/records/SessionItem.js +6 -0
  26. package/lib/taking/api/taking.js +1 -1
  27. package/package.json +9 -9
@@ -375,51 +375,63 @@ var QuizEntry = exports.QuizEntry = (_dec = (0, _withStateCache["default"])(func
375
375
  // their own possible string so that translators can better translate the meaning
376
376
  var type;
377
377
  if (this.hasStimulus || this.isBank) {
378
+ if (this.isPassage) {
379
+ type = (0, _formatMessage["default"])('Passage');
380
+ var opts = {
381
+ type: type,
382
+ start: displayPosition - 1
383
+ };
384
+ return {
385
+ Remove: (0, _formatMessage["default"])('Remove {type} located after position {start, number}.', opts),
386
+ Edit: (0, _formatMessage["default"])('Edit {type} located after position {start, number}.', opts),
387
+ Move: (0, _formatMessage["default"])('Move {type} located after position {start, number}.', opts)
388
+ }[verb];
389
+ }
378
390
  type = this.hasStimulus ? (0, _formatMessage["default"])('Stimulus') : (0, _formatMessage["default"])('Bank');
379
391
  if (this.numItems > 1) {
380
- var opts = {
392
+ var _opts = {
381
393
  type: type,
382
394
  start: displayPosition,
383
395
  end: displayPosition + this.numItems - 1
384
396
  };
385
397
  return {
386
- Remove: (0, _formatMessage["default"])('Remove {type} containing questions {start, number} through {end, number}.', opts),
387
- Edit: (0, _formatMessage["default"])('Edit {type} containing questions {start, number} through {end, number}.', opts),
388
- Move: (0, _formatMessage["default"])('Move {type} containing questions {start, number} through {end, number}.', opts)
398
+ Remove: (0, _formatMessage["default"])('Remove {type} containing questions {start, number} through {end, number}.', _opts),
399
+ Edit: (0, _formatMessage["default"])('Edit {type} containing questions {start, number} through {end, number}.', _opts),
400
+ Move: (0, _formatMessage["default"])('Move {type} containing questions {start, number} through {end, number}.', _opts)
389
401
  }[verb];
390
402
  } else if (this.numItems === 1) {
391
- var _opts = {
403
+ var _opts2 = {
392
404
  type: type,
393
405
  start: displayPosition
394
406
  };
395
407
  return {
396
- Remove: (0, _formatMessage["default"])('Remove {type} containing question {start, number}.', _opts),
397
- Edit: (0, _formatMessage["default"])('Edit {type} containing question {start, number}.', _opts),
398
- Move: (0, _formatMessage["default"])('Move {type} containing question {start, number}.', _opts)
408
+ Remove: (0, _formatMessage["default"])('Remove {type} containing question {start, number}.', _opts2),
409
+ Edit: (0, _formatMessage["default"])('Edit {type} containing question {start, number}.', _opts2),
410
+ Move: (0, _formatMessage["default"])('Move {type} containing question {start, number}.', _opts2)
399
411
  }[verb];
400
412
  } else {
401
- var _opts2 = {
413
+ var _opts3 = {
402
414
  type: type,
403
415
  start: displayPosition - 1
404
416
  };
405
417
  return {
406
- Remove: (0, _formatMessage["default"])('Remove empty {type} located after position {start, number}.', _opts2),
407
- Edit: (0, _formatMessage["default"])('Edit empty {type} located after position {start, number}.', _opts2),
408
- Move: (0, _formatMessage["default"])('Move empty {type} located after position {start, number}.', _opts2)
418
+ Remove: (0, _formatMessage["default"])('Remove empty {type} located after position {start, number}.', _opts3),
419
+ Edit: (0, _formatMessage["default"])('Edit empty {type} located after position {start, number}.', _opts3),
420
+ Move: (0, _formatMessage["default"])('Move empty {type} located after position {start, number}.', _opts3)
409
421
  }[verb];
410
422
  }
411
423
  } else {
412
424
  type = (0, _formatMessage["default"])('Question');
413
- var _opts3 = {
425
+ var _opts4 = {
414
426
  verb: verb,
415
427
  type: type,
416
428
  position: displayPosition
417
429
  };
418
430
  return {
419
- Remove: (0, _formatMessage["default"])('Remove {type} at position {position, number}.', _opts3),
420
- Edit: (0, _formatMessage["default"])('Edit {type} at position {position, number}.', _opts3),
421
- Move: (0, _formatMessage["default"])('Move {type} at position {position, number}.', _opts3),
422
- Copy: (0, _formatMessage["default"])('Copy {type} at position {position, number}.', _opts3)
431
+ Remove: (0, _formatMessage["default"])('Remove {type} at position {position, number}.', _opts4),
432
+ Edit: (0, _formatMessage["default"])('Edit {type} at position {position, number}.', _opts4),
433
+ Move: (0, _formatMessage["default"])('Move {type} at position {position, number}.', _opts4),
434
+ Copy: (0, _formatMessage["default"])('Copy {type} at position {position, number}.', _opts4)
423
435
  }[verb];
424
436
  }
425
437
  }
@@ -92,6 +92,11 @@ var SessionItem = exports.SessionItem = /*#__PURE__*/function (_ReduxRecord) {
92
92
  get: function get() {
93
93
  return this.type === 'Stimulus';
94
94
  }
95
+ }, {
96
+ key: "isPassage",
97
+ get: function get() {
98
+ return this.isStimulus && this.stimulusRecord.isPassage;
99
+ }
95
100
  }, {
96
101
  key: "stimulusRecord",
97
102
  get: function get() {
@@ -130,6 +135,7 @@ var SessionItem = exports.SessionItem = /*#__PURE__*/function (_ReduxRecord) {
130
135
  item: {},
131
136
  pointsPossible: null,
132
137
  position: null,
138
+ questionNumber: null,
133
139
  quizEntryId: null,
134
140
  quizSessionId: null,
135
141
  scoringData: {},
@@ -234,7 +234,7 @@ var __remainingQuestionPositions = function __remainingQuestionPositions(session
234
234
  var itemUserResponse = __getResponseForSessionItem(si, responses);
235
235
  return item.hasResponse(itemUserResponse);
236
236
  }).map(function (si) {
237
- return si.get('position');
237
+ return si.get('questionNumber');
238
238
  }).toSet().toJS();
239
239
  };
240
240
  function showSubmitConfirmModal(quizSessionId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/quiz-core",
3
- "version": "22.0.0",
3
+ "version": "22.1.0",
4
4
  "license": "MIT",
5
5
  "description": "The Quiz React SDK by Instructure Inc.",
6
6
  "author": "Instructure, Inc. Engineering and Product Design",
@@ -111,12 +111,12 @@
111
111
  "store": "^1.3.20",
112
112
  "striptags": "^2.0.0",
113
113
  "uuid": "^3.2.1",
114
- "@instructure/quiz-common": "22.0.0",
115
- "@instructure/quiz-i18n": "22.0.0",
116
- "@instructure/quiz-number-input": "22.0.0",
117
- "@instructure/quiz-rce": "22.0.0",
118
- "@instructure/quiz-interactions": "22.0.0",
119
- "instructure-validations": "22.0.0"
114
+ "@instructure/quiz-common": "22.1.0",
115
+ "@instructure/quiz-i18n": "22.1.0",
116
+ "@instructure/quiz-interactions": "22.1.0",
117
+ "@instructure/quiz-rce": "22.1.0",
118
+ "@instructure/quiz-number-input": "22.1.0",
119
+ "instructure-validations": "22.1.0"
120
120
  },
121
121
  "devDependencies": {
122
122
  "@instructure/ui-axe-check": "10.14.0",
@@ -144,8 +144,8 @@
144
144
  "request": "^2.74.0",
145
145
  "sinon": "^6.1.3",
146
146
  "sinon-chai": "^3.3.0",
147
- "@instructure/quiz-scripts": "21.0.0",
148
- "quiz-presets": "22.0.0"
147
+ "quiz-presets": "22.1.0",
148
+ "@instructure/quiz-scripts": "21.0.0"
149
149
  },
150
150
  "peerDependencies": {
151
151
  "react": "^15 || ^16"