@instructure/quiz-core 17.37.1-rc.0 → 17.37.1-rc.1

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.
@@ -100,7 +100,7 @@ export var BuildingSidebar = (_dec = themeable(theme, styles), _dec(_class = (_t
100
100
  switch (quizEntry.entryType) {
101
101
  case 'Item':
102
102
  case 'BankEntry':
103
- return extractTextFromHtml(quizEntry.getItem().itemBody || '');
103
+ return extractTextFromHtml(quizEntry.getItem().getItemBody() || '');
104
104
 
105
105
  case 'Bank':
106
106
  return quizEntry.getEntry().title;
@@ -6,7 +6,7 @@ import { fromJS, Map, is } from 'immutable';
6
6
  import { InteractionType as InteractionTypeRecord } from '@instructure/quiz-interactions';
7
7
  import t from '@instructure/quiz-i18n/es/format-message';
8
8
  import { rule } from 'instructure-validations';
9
- import { TEMPORARY_ITEM_ID, BUILD_CHAR_LIMIT } from '@instructure/quiz-common';
9
+ import { TEMPORARY_ITEM_ID, BUILD_CHAR_LIMIT, RICH_FILL_BLANK_SLUG } from '@instructure/quiz-common';
10
10
  import ReduxRecord from "./reduxRecord.js";
11
11
  import { getInteractionType as _getInteractionType } from "../selectors/interactionTypes.js";
12
12
  export var Item = /*#__PURE__*/function (_ReduxRecord) {
@@ -45,6 +45,15 @@ export var Item = /*#__PURE__*/function (_ReduxRecord) {
45
45
  var interactionTypeId = typeof this.interactionType === 'object' ? this.interactionType.id : this.interactionType;
46
46
  return _getInteractionType(this.getState(), interactionTypeId) || new InteractionTypeRecord();
47
47
  }
48
+ }, {
49
+ key: "getItemBody",
50
+ value: function getItemBody() {
51
+ if (this.getInteractionType().slug === RICH_FILL_BLANK_SLUG && this.itemBody) {
52
+ return this.itemBody.split(/(?=<span id="blank_)/g).join('_____');
53
+ }
54
+
55
+ return this.itemBody;
56
+ }
48
57
  }, {
49
58
  key: "hasModifications",
50
59
  value: function hasModifications() {
@@ -127,7 +127,7 @@ var BuildingSidebar = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
127
127
  switch (quizEntry.entryType) {
128
128
  case 'Item':
129
129
  case 'BankEntry':
130
- return (0, _quizInteractions.extractTextFromHtml)(quizEntry.getItem().itemBody || '');
130
+ return (0, _quizInteractions.extractTextFromHtml)(quizEntry.getItem().getItemBody() || '');
131
131
 
132
132
  case 'Bank':
133
133
  return quizEntry.getEntry().title;
@@ -64,6 +64,15 @@ var Item = /*#__PURE__*/function (_ReduxRecord) {
64
64
  var interactionTypeId = typeof this.interactionType === 'object' ? this.interactionType.id : this.interactionType;
65
65
  return (0, _interactionTypes.getInteractionType)(this.getState(), interactionTypeId) || new _quizInteractions.InteractionType();
66
66
  }
67
+ }, {
68
+ key: "getItemBody",
69
+ value: function getItemBody() {
70
+ if (this.getInteractionType().slug === _quizCommon.RICH_FILL_BLANK_SLUG && this.itemBody) {
71
+ return this.itemBody.split(/(?=<span id="blank_)/g).join('_____');
72
+ }
73
+
74
+ return this.itemBody;
75
+ }
67
76
  }, {
68
77
  key: "hasModifications",
69
78
  value: function hasModifications() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/quiz-core",
3
- "version": "17.37.1-rc.0+1acb80e7a",
3
+ "version": "17.37.1-rc.1+77a6c093c",
4
4
  "license": "MIT",
5
5
  "description": "The Quiz React SDK by Instructure Inc.",
6
6
  "author": "Instructure, Inc. Engineering and Product Design",
@@ -41,11 +41,11 @@
41
41
  ],
42
42
  "dependencies": {
43
43
  "@instructure/outcomes-ui": "^2.1.2",
44
- "@instructure/quiz-common": "17.37.1-rc.0+1acb80e7a",
45
- "@instructure/quiz-i18n": "17.37.1-rc.0+1acb80e7a",
46
- "@instructure/quiz-interactions": "17.37.1-rc.0+1acb80e7a",
47
- "@instructure/quiz-number-input": "17.37.1-rc.0+1acb80e7a",
48
- "@instructure/quiz-rce": "17.37.1-rc.0+1acb80e7a",
44
+ "@instructure/quiz-common": "17.37.1-rc.1+77a6c093c",
45
+ "@instructure/quiz-i18n": "17.37.1-rc.1+77a6c093c",
46
+ "@instructure/quiz-interactions": "17.37.1-rc.1+77a6c093c",
47
+ "@instructure/quiz-number-input": "17.37.1-rc.1+77a6c093c",
48
+ "@instructure/quiz-rce": "17.37.1-rc.1+77a6c093c",
49
49
  "@instructure/ui-a11y-content": "^7.20.0",
50
50
  "@instructure/ui-alerts": "^7.20.0",
51
51
  "@instructure/ui-avatar": "^7.20.0",
@@ -106,7 +106,7 @@
106
106
  "eventemitter3": "^3.1.0",
107
107
  "humps": "^2.0.0",
108
108
  "immutable": "^3.8.1",
109
- "instructure-validations": "17.37.1-rc.0+1acb80e7a",
109
+ "instructure-validations": "17.37.1-rc.1+77a6c093c",
110
110
  "ipaddr.js": "^1.5.4",
111
111
  "isomorphic-fetch": "^2.2.0",
112
112
  "isuuid": "^0.1.0",
@@ -137,7 +137,7 @@
137
137
  "uuid": "^3.2.1"
138
138
  },
139
139
  "devDependencies": {
140
- "@instructure/quiz-scripts": "17.37.1-rc.0+1acb80e7a",
140
+ "@instructure/quiz-scripts": "17.37.1-rc.1+77a6c093c",
141
141
  "@instructure/ui-axe-check": "^7.20.0",
142
142
  "@instructure/ui-babel-preset": "^7.20.0",
143
143
  "@instructure/ui-karma-config": "^7.20.0",
@@ -156,7 +156,7 @@
156
156
  "intl": "^1.2.4",
157
157
  "jquery": "^2.2.3",
158
158
  "most-subject": "^5.3.0",
159
- "quiz-presets": "17.37.1-rc.0+1acb80e7a",
159
+ "quiz-presets": "17.37.1-rc.1+77a6c093c",
160
160
  "react": "^16.8.6",
161
161
  "react-addons-test-utils": "^15.6.2",
162
162
  "react-dom": "^16.8.6",
@@ -172,5 +172,5 @@
172
172
  "publishConfig": {
173
173
  "access": "public"
174
174
  },
175
- "gitHead": "1acb80e7a7f89abfc763f33d4684c5f0fa6f7238"
175
+ "gitHead": "77a6c093c0360d2b3bc7657cc372f5deb62afd3f"
176
176
  }