@instructure/quiz-core 21.0.1-rc.15 → 21.0.1-rc.18

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.
@@ -5,7 +5,7 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
5
5
  return {
6
6
  quizSavingColor: colors.lightGray,
7
7
  quizSavingMargin: spacing.large,
8
- buttonsHolderMargin: spacing.mediumSmall,
8
+ buttonsHolderMargin: spacing.xLarge,
9
9
  menuIconMargin: spacing.xSmall,
10
10
  menuIconFontSize: typography.fontSizeLarge
11
11
  };
@@ -160,6 +160,16 @@ var QuizEntryHeader = (_dec = withStyleOverrides(generateStyle, generateComponen
160
160
  cancelText: t('Keep Question')
161
161
  };
162
162
  }
163
+ }, {
164
+ key: "isActiveBank",
165
+ get: function get() {
166
+ return this.props.quizEntry.isBank && this.props.newActiveBank;
167
+ }
168
+ }, {
169
+ key: "isBankEntry",
170
+ get: function get() {
171
+ return this.props.quizEntry.isBank || this.props.quizEntry.isBankEntry;
172
+ }
163
173
  }, {
164
174
  key: "getVOText",
165
175
  value: function getVOText(verb, displayPosition) {
@@ -174,27 +184,19 @@ var QuizEntryHeader = (_dec = withStyleOverrides(generateStyle, generateComponen
174
184
  });
175
185
  }
176
186
  }, {
177
- key: "renderBankedContent",
178
- value: function renderBankedContent() {
179
- if (this.props.quizEntry.isBank || this.props.quizEntry.isBankEntry) {
180
- return jsx(IconBankLine, null);
181
- }
187
+ key: "renderItemName",
188
+ value: function renderItemName() {
189
+ return jsx(Text, {
190
+ size: "small",
191
+ weight: "normal",
192
+ "data-automation": "sdk-quiz-entry-interaction-type"
193
+ }, this.props.name);
182
194
  }
183
195
  }, {
184
- key: "renderName",
185
- value: function renderName() {
186
- var isBank = this.props.quizEntry.isBank && this.props.newActiveBank;
187
- var dataAutomation = 'sdk-quiz-entry-interaction-type';
188
- if (!isBank) {
189
- return jsx(Text, {
190
- size: "small",
191
- weight: "normal",
192
- "data-automation": dataAutomation
193
- }, this.props.name);
194
- }
196
+ key: "renderBankNameButton",
197
+ value: function renderBankNameButton() {
195
198
  return jsx(CondensedButton, {
196
199
  size: "small",
197
- margin: "0 0 0 x-small",
198
200
  onClick: this.handleBankClick,
199
201
  "data-automation": "sdk-quiz-entry-interaction-type"
200
202
  }, this.props.name);
@@ -220,14 +222,14 @@ var QuizEntryHeader = (_dec = withStyleOverrides(generateStyle, generateComponen
220
222
  renderLabel: jsx(Flex, {
221
223
  direction: "column",
222
224
  gap: "small"
223
- }, jsx(Flex.Item, {
225
+ }, !this.isBankEntry && jsx(Flex.Item, {
224
226
  "aria-hidden": true
225
- }, this.renderName()), jsx(Flex.Item, {
227
+ }, this.renderItemName()), jsx(Flex.Item, {
226
228
  "aria-hidden": true
227
229
  }, t('Question Title')), jsx(ScreenReaderContent, null, titleLabelText)),
228
230
  type: "text",
229
231
  onChange: this.handleTitleChange,
230
- value: workingEntry.title || '',
232
+ defaultValue: workingEntry.title || '',
231
233
  interaction: disabled ? 'disabled' : 'enabled',
232
234
  "data-automation": "sdk-question-title-textinput"
233
235
  });
@@ -242,15 +244,27 @@ var QuizEntryHeader = (_dec = withStyleOverrides(generateStyle, generateComponen
242
244
  return jsx(Flex, {
243
245
  className: "leftHeader",
244
246
  direction: "row",
245
- justifyItems: "center",
247
+ alignItems: "center",
246
248
  "data-automation": "sdk-quiz-entry-left-header"
247
249
  }, jsx(PositionBox, {
248
250
  position: position,
249
251
  headingText: positionText,
250
252
  "data-automation": "sdk-quiz-entry-positionbox"
251
- }), this.renderBankedContent(), jsx("div", {
252
- css: this.props.styles.dividingLine
253
- }), this.renderTitleHolder());
253
+ }), jsx(Flex.Item, {
254
+ shouldShrink: this.isActiveBank,
255
+ shouldGrow: !this.isActiveBank
256
+ }, jsx(Flex, {
257
+ direction: "row",
258
+ gap: this.isActiveBank ? 'x-small' : 'medium',
259
+ themeOverride: {
260
+ gapMedium: '1.25rem'
261
+ },
262
+ alignItems: "center"
263
+ }, this.isBankEntry && jsx(Flex.Item, null, jsx(IconBankLine, null)), this.isActiveBank ? jsx(Flex.Item, {
264
+ shouldShrink: true
265
+ }, this.renderBankNameButton()) : jsx(Flex.Item, {
266
+ shouldGrow: true
267
+ }, this.renderTitleHolder()))));
254
268
  }
255
269
  }, {
256
270
  key: "render",
@@ -278,11 +292,15 @@ var QuizEntryHeader = (_dec = withStyleOverrides(generateStyle, generateComponen
278
292
  }), jsx(Flex, {
279
293
  className: "header",
280
294
  direction: "row",
281
- gap: "small"
295
+ alignItems: this.isActiveBank ? 'center' : 'end',
296
+ gap: "small",
297
+ justifyItems: "space-between"
282
298
  }, jsx(Flex.Item, {
283
- shouldShrink: false,
299
+ shouldShrink: this.isActiveBank,
284
300
  shouldGrow: true
285
- }, this.renderLeftHeader()), jsx(Flex.Item, null, jsx(ActionButtons, actionButtonProps))));
301
+ }, this.renderLeftHeader()), jsx(Flex.Item, {
302
+ padding: this.isActiveBank ? '0' : '0 0 xx-small'
303
+ }, jsx(ActionButtons, actionButtonProps))));
286
304
  }
287
305
  }]);
288
306
  }(Component), _defineProperty(_QuizEntryHeader, "displayName", 'QuizEntryHeader'), _defineProperty(_QuizEntryHeader, "componentId", "Quizzes".concat(_QuizEntryHeader.displayName)), _defineProperty(_QuizEntryHeader, "propTypes", {
@@ -76,7 +76,7 @@ export var ResultStimulus = (_dec = withStyleOverrides(generateStyle, generateCo
76
76
  css: this.props.styles.stimulusGroup
77
77
  }, jsx("div", {
78
78
  css: this.props.styles.stimulusInfo
79
- }, this.renderStimulusInfo()), jsx("div", {
79
+ }, this.renderStimulusInfo()), this.props.stimulus.isPassage === false && jsx("div", {
80
80
  css: this.props.styles.items
81
81
  }, this.renderStimulusItems()))));
82
82
  }
@@ -16,7 +16,7 @@ var generateStyle = function generateStyle(componentTheme, props) {
16
16
  };
17
17
  return {
18
18
  root: {
19
- borderBottom: "".concat(componentTheme.rootBorderWidth, " solid ").concat(componentTheme.rootBorderColor),
19
+ borderTop: "".concat(componentTheme.rootBorderWidth, " solid ").concat(componentTheme.rootBorderColor),
20
20
  overflow: 'hidden'
21
21
  },
22
22
  instructions: _defineProperty({
@@ -31,9 +31,7 @@ var generateStyle = function generateStyle(componentTheme, props) {
31
31
  },
32
32
  info: _defineProperty({
33
33
  padding: "".concat(componentTheme.infoPaddingTopBottom, " ").concat(componentTheme.infoPaddingLeftRight),
34
- backgroundColor: componentTheme.infoBackgroundColor,
35
- height: '100%',
36
- overflow: 'scroll'
34
+ height: '100%'
37
35
  }, mq, {
38
36
  padding: componentTheme.phoneInfoPadding
39
37
  }),
@@ -6,7 +6,7 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
6
6
  breakpoints = _ref.breakpoints;
7
7
  return {
8
8
  rootBorderWidth: borders.widthSmall,
9
- rootBorderColor: colors.porcelain,
9
+ rootBorderColor: colors.tiara,
10
10
  instructionsPaddingTopBottom: spacing.medium,
11
11
  instructionsPaddingLeftRight: spacing.large,
12
12
  instructionsBorderWidth: borders.widthSmall,
@@ -22,6 +22,11 @@ export var Stimulus = /*#__PURE__*/function (_ReduxRecord) {
22
22
  get: function get() {
23
23
  return true;
24
24
  }
25
+ }, {
26
+ key: "isPassage",
27
+ get: function get() {
28
+ return this.passage;
29
+ }
25
30
  }, {
26
31
  key: "isLoaded",
27
32
  value: function isLoaded() {
@@ -11,7 +11,7 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
11
11
  return {
12
12
  quizSavingColor: colors.lightGray,
13
13
  quizSavingMargin: spacing.large,
14
- buttonsHolderMargin: spacing.mediumSmall,
14
+ buttonsHolderMargin: spacing.xLarge,
15
15
  menuIconMargin: spacing.xSmall,
16
16
  menuIconFontSize: typography.fontSizeLarge
17
17
  };
@@ -167,6 +167,16 @@ var QuizEntryHeader = (_dec = (0, _quizCommon.withStyleOverrides)(_styles["defau
167
167
  cancelText: (0, _formatMessage["default"])('Keep Question')
168
168
  };
169
169
  }
170
+ }, {
171
+ key: "isActiveBank",
172
+ get: function get() {
173
+ return this.props.quizEntry.isBank && this.props.newActiveBank;
174
+ }
175
+ }, {
176
+ key: "isBankEntry",
177
+ get: function get() {
178
+ return this.props.quizEntry.isBank || this.props.quizEntry.isBankEntry;
179
+ }
170
180
  }, {
171
181
  key: "getVOText",
172
182
  value: function getVOText(verb, displayPosition) {
@@ -181,27 +191,19 @@ var QuizEntryHeader = (_dec = (0, _quizCommon.withStyleOverrides)(_styles["defau
181
191
  });
182
192
  }
183
193
  }, {
184
- key: "renderBankedContent",
185
- value: function renderBankedContent() {
186
- if (this.props.quizEntry.isBank || this.props.quizEntry.isBankEntry) {
187
- return (0, _emotion.jsx)(_uiIcons.IconBankLine, null);
188
- }
194
+ key: "renderItemName",
195
+ value: function renderItemName() {
196
+ return (0, _emotion.jsx)(_uiText.Text, {
197
+ size: "small",
198
+ weight: "normal",
199
+ "data-automation": "sdk-quiz-entry-interaction-type"
200
+ }, this.props.name);
189
201
  }
190
202
  }, {
191
- key: "renderName",
192
- value: function renderName() {
193
- var isBank = this.props.quizEntry.isBank && this.props.newActiveBank;
194
- var dataAutomation = 'sdk-quiz-entry-interaction-type';
195
- if (!isBank) {
196
- return (0, _emotion.jsx)(_uiText.Text, {
197
- size: "small",
198
- weight: "normal",
199
- "data-automation": dataAutomation
200
- }, this.props.name);
201
- }
203
+ key: "renderBankNameButton",
204
+ value: function renderBankNameButton() {
202
205
  return (0, _emotion.jsx)(_uiButtons.CondensedButton, {
203
206
  size: "small",
204
- margin: "0 0 0 x-small",
205
207
  onClick: this.handleBankClick,
206
208
  "data-automation": "sdk-quiz-entry-interaction-type"
207
209
  }, this.props.name);
@@ -227,14 +229,14 @@ var QuizEntryHeader = (_dec = (0, _quizCommon.withStyleOverrides)(_styles["defau
227
229
  renderLabel: (0, _emotion.jsx)(_quizCommon.Flex, {
228
230
  direction: "column",
229
231
  gap: "small"
230
- }, (0, _emotion.jsx)(_quizCommon.Flex.Item, {
232
+ }, !this.isBankEntry && (0, _emotion.jsx)(_quizCommon.Flex.Item, {
231
233
  "aria-hidden": true
232
- }, this.renderName()), (0, _emotion.jsx)(_quizCommon.Flex.Item, {
234
+ }, this.renderItemName()), (0, _emotion.jsx)(_quizCommon.Flex.Item, {
233
235
  "aria-hidden": true
234
236
  }, (0, _formatMessage["default"])('Question Title')), (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, titleLabelText)),
235
237
  type: "text",
236
238
  onChange: this.handleTitleChange,
237
- value: workingEntry.title || '',
239
+ defaultValue: workingEntry.title || '',
238
240
  interaction: disabled ? 'disabled' : 'enabled',
239
241
  "data-automation": "sdk-question-title-textinput"
240
242
  });
@@ -249,15 +251,27 @@ var QuizEntryHeader = (_dec = (0, _quizCommon.withStyleOverrides)(_styles["defau
249
251
  return (0, _emotion.jsx)(_quizCommon.Flex, {
250
252
  className: "leftHeader",
251
253
  direction: "row",
252
- justifyItems: "center",
254
+ alignItems: "center",
253
255
  "data-automation": "sdk-quiz-entry-left-header"
254
256
  }, (0, _emotion.jsx)(_PositionBox["default"], {
255
257
  position: position,
256
258
  headingText: positionText,
257
259
  "data-automation": "sdk-quiz-entry-positionbox"
258
- }), this.renderBankedContent(), (0, _emotion.jsx)("div", {
259
- css: this.props.styles.dividingLine
260
- }), this.renderTitleHolder());
260
+ }), (0, _emotion.jsx)(_quizCommon.Flex.Item, {
261
+ shouldShrink: this.isActiveBank,
262
+ shouldGrow: !this.isActiveBank
263
+ }, (0, _emotion.jsx)(_quizCommon.Flex, {
264
+ direction: "row",
265
+ gap: this.isActiveBank ? 'x-small' : 'medium',
266
+ themeOverride: {
267
+ gapMedium: '1.25rem'
268
+ },
269
+ alignItems: "center"
270
+ }, this.isBankEntry && (0, _emotion.jsx)(_quizCommon.Flex.Item, null, (0, _emotion.jsx)(_uiIcons.IconBankLine, null)), this.isActiveBank ? (0, _emotion.jsx)(_quizCommon.Flex.Item, {
271
+ shouldShrink: true
272
+ }, this.renderBankNameButton()) : (0, _emotion.jsx)(_quizCommon.Flex.Item, {
273
+ shouldGrow: true
274
+ }, this.renderTitleHolder()))));
261
275
  }
262
276
  }, {
263
277
  key: "render",
@@ -285,11 +299,15 @@ var QuizEntryHeader = (_dec = (0, _quizCommon.withStyleOverrides)(_styles["defau
285
299
  }), (0, _emotion.jsx)(_quizCommon.Flex, {
286
300
  className: "header",
287
301
  direction: "row",
288
- gap: "small"
302
+ alignItems: this.isActiveBank ? 'center' : 'end',
303
+ gap: "small",
304
+ justifyItems: "space-between"
289
305
  }, (0, _emotion.jsx)(_quizCommon.Flex.Item, {
290
- shouldShrink: false,
306
+ shouldShrink: this.isActiveBank,
291
307
  shouldGrow: true
292
- }, this.renderLeftHeader()), (0, _emotion.jsx)(_quizCommon.Flex.Item, null, (0, _emotion.jsx)(_ActionButtons["default"], actionButtonProps))));
308
+ }, this.renderLeftHeader()), (0, _emotion.jsx)(_quizCommon.Flex.Item, {
309
+ padding: this.isActiveBank ? '0' : '0 0 xx-small'
310
+ }, (0, _emotion.jsx)(_ActionButtons["default"], actionButtonProps))));
293
311
  }
294
312
  }]);
295
313
  }(_react.Component), (0, _defineProperty2["default"])(_QuizEntryHeader, "displayName", 'QuizEntryHeader'), (0, _defineProperty2["default"])(_QuizEntryHeader, "componentId", "Quizzes".concat(_QuizEntryHeader.displayName)), (0, _defineProperty2["default"])(_QuizEntryHeader, "propTypes", {
@@ -83,7 +83,7 @@ var ResultStimulus = exports.ResultStimulus = (_dec = (0, _quizCommon.withStyleO
83
83
  css: this.props.styles.stimulusGroup
84
84
  }, (0, _emotion.jsx)("div", {
85
85
  css: this.props.styles.stimulusInfo
86
- }, this.renderStimulusInfo()), (0, _emotion.jsx)("div", {
86
+ }, this.renderStimulusInfo()), this.props.stimulus.isPassage === false && (0, _emotion.jsx)("div", {
87
87
  css: this.props.styles.items
88
88
  }, this.renderStimulusItems()))));
89
89
  }
@@ -23,7 +23,7 @@ var generateStyle = function generateStyle(componentTheme, props) {
23
23
  };
24
24
  return {
25
25
  root: {
26
- borderBottom: "".concat(componentTheme.rootBorderWidth, " solid ").concat(componentTheme.rootBorderColor),
26
+ borderTop: "".concat(componentTheme.rootBorderWidth, " solid ").concat(componentTheme.rootBorderColor),
27
27
  overflow: 'hidden'
28
28
  },
29
29
  instructions: (0, _defineProperty2["default"])({
@@ -38,9 +38,7 @@ var generateStyle = function generateStyle(componentTheme, props) {
38
38
  },
39
39
  info: (0, _defineProperty2["default"])({
40
40
  padding: "".concat(componentTheme.infoPaddingTopBottom, " ").concat(componentTheme.infoPaddingLeftRight),
41
- backgroundColor: componentTheme.infoBackgroundColor,
42
- height: '100%',
43
- overflow: 'scroll'
41
+ height: '100%'
44
42
  }, mq, {
45
43
  padding: componentTheme.phoneInfoPadding
46
44
  }),
@@ -12,7 +12,7 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
12
12
  breakpoints = _ref.breakpoints;
13
13
  return {
14
14
  rootBorderWidth: borders.widthSmall,
15
- rootBorderColor: colors.porcelain,
15
+ rootBorderColor: colors.tiara,
16
16
  instructionsPaddingTopBottom: spacing.medium,
17
17
  instructionsPaddingLeftRight: spacing.large,
18
18
  instructionsBorderWidth: borders.widthSmall,
@@ -29,6 +29,11 @@ var Stimulus = exports.Stimulus = /*#__PURE__*/function (_ReduxRecord) {
29
29
  get: function get() {
30
30
  return true;
31
31
  }
32
+ }, {
33
+ key: "isPassage",
34
+ get: function get() {
35
+ return this.passage;
36
+ }
32
37
  }, {
33
38
  key: "isLoaded",
34
39
  value: function isLoaded() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/quiz-core",
3
- "version": "21.0.1-rc.15+2eb659881",
3
+ "version": "21.0.1-rc.18+49db59146",
4
4
  "license": "MIT",
5
5
  "description": "The Quiz React SDK by Instructure Inc.",
6
6
  "author": "Instructure, Inc. Engineering and Product Design",
@@ -46,11 +46,11 @@
46
46
  "@instructure/emotion": "^9.11.1",
47
47
  "@instructure/grading-utils": "^1.0.0",
48
48
  "@instructure/outcomes-ui": "^3.2.2",
49
- "@instructure/quiz-common": "21.0.1-rc.15+2eb659881",
50
- "@instructure/quiz-i18n": "21.0.1-rc.15+2eb659881",
51
- "@instructure/quiz-interactions": "21.0.1-rc.15+2eb659881",
52
- "@instructure/quiz-number-input": "21.0.1-rc.15+2eb659881",
53
- "@instructure/quiz-rce": "21.0.1-rc.15+2eb659881",
49
+ "@instructure/quiz-common": "21.0.1-rc.18+49db59146",
50
+ "@instructure/quiz-i18n": "21.0.1-rc.18+49db59146",
51
+ "@instructure/quiz-interactions": "21.0.1-rc.18+49db59146",
52
+ "@instructure/quiz-number-input": "21.0.1-rc.18+49db59146",
53
+ "@instructure/quiz-rce": "21.0.1-rc.18+49db59146",
54
54
  "@instructure/ui-a11y-content": "^9.11.1",
55
55
  "@instructure/ui-alerts": "^9.11.1",
56
56
  "@instructure/ui-avatar": "^9.11.1",
@@ -109,7 +109,7 @@
109
109
  "file-saver": "~2.0.5",
110
110
  "humps": "^2.0.0",
111
111
  "immutable": "^3.8.1",
112
- "instructure-validations": "21.0.1-rc.15+2eb659881",
112
+ "instructure-validations": "21.0.1-rc.18+49db59146",
113
113
  "ipaddr.js": "^1.5.4",
114
114
  "isomorphic-fetch": "^2.2.0",
115
115
  "isuuid": "^0.1.0",
@@ -158,7 +158,7 @@
158
158
  "jquery": "^2.2.3",
159
159
  "karma-junit-reporter": "^2.0.1",
160
160
  "most-subject": "^5.3.0",
161
- "quiz-presets": "21.0.1-rc.15+2eb659881",
161
+ "quiz-presets": "21.0.1-rc.18+49db59146",
162
162
  "react": "^16.8.6",
163
163
  "react-addons-test-utils": "^15.6.2",
164
164
  "react-dom": "^16.8.6",
@@ -174,5 +174,5 @@
174
174
  "publishConfig": {
175
175
  "access": "public"
176
176
  },
177
- "gitHead": "2eb6598816fde1560fa50fe1f5bc3a718819a36a"
177
+ "gitHead": "49db591467624e6c83907fe8e6bafcf7d1622e51"
178
178
  }