@instructure/quiz-core 20.20.1-snapshot.3 → 20.20.1-snapshot.34

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 (36) hide show
  1. package/CHANGELOG.md +115 -0
  2. package/es/banks/components/AddToBankModal/presenter.js +10 -11
  3. package/es/building/components/resources/ActionButtons/presenter.js +3 -2
  4. package/es/building/components/resources/quiz/instructions/Edit/presenter.js +5 -5
  5. package/es/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +5 -7
  6. package/es/common/components/layout/sidebar/Sidebar/index.js +5 -3
  7. package/es/common/components/layout/sidebar/SidebarItem/presenter.js +5 -2
  8. package/es/common/components/layout/sidebar/Stimulus/presenter.js +3 -1
  9. package/es/common/components/resources/quiz/AddContent/Button/index.js +2 -0
  10. package/es/common/components/resources/stimulus/StimulusEdit/presenter.js +5 -7
  11. package/es/common/components/shared/overlay/index.js +3 -1
  12. package/es/common/kinesis/StreamQueue.js +8 -2
  13. package/es/common/util/clickHandlers.js +19 -0
  14. package/es/moderating/components/resources/AccommodationsModal/ReduceAnswerChoicesSettings/index.js +78 -0
  15. package/es/moderating/components/resources/ModerateTableRow/presenter.js +0 -3
  16. package/es/moderating/components/sidebar/ModerateTray/presenter.js +2 -1
  17. package/es/moderating/components/sidebar/ResetQuiz/index.js +15 -8
  18. package/es/moderating/components/sidebar/ResetQuiz/presenter.js +20 -4
  19. package/lib/banks/components/AddToBankModal/presenter.js +9 -10
  20. package/lib/building/components/resources/ActionButtons/presenter.js +2 -1
  21. package/lib/building/components/resources/quiz/instructions/Edit/presenter.js +5 -5
  22. package/lib/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +5 -7
  23. package/lib/common/components/layout/sidebar/Sidebar/index.js +4 -2
  24. package/lib/common/components/layout/sidebar/SidebarItem/presenter.js +5 -2
  25. package/lib/common/components/layout/sidebar/Stimulus/presenter.js +3 -1
  26. package/lib/common/components/resources/quiz/AddContent/Button/index.js +2 -0
  27. package/lib/common/components/resources/stimulus/StimulusEdit/presenter.js +5 -7
  28. package/lib/common/components/shared/overlay/index.js +3 -1
  29. package/lib/common/kinesis/StreamQueue.js +8 -2
  30. package/lib/common/util/clickHandlers.js +26 -0
  31. package/lib/moderating/components/resources/AccommodationsModal/ReduceAnswerChoicesSettings/index.js +88 -0
  32. package/lib/moderating/components/resources/ModerateTableRow/presenter.js +0 -3
  33. package/lib/moderating/components/sidebar/ModerateTray/presenter.js +2 -1
  34. package/lib/moderating/components/sidebar/ResetQuiz/index.js +15 -8
  35. package/lib/moderating/components/sidebar/ResetQuiz/presenter.js +20 -4
  36. package/package.json +10 -10
package/CHANGELOG.md CHANGED
@@ -3,6 +3,121 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [20.26.0](https://gerrit.instructure.com/quizzes-ui/compare/v20.20.0...v20.26.0) (2024-10-28)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **banks:** remove Good to Go text from Add Item to Item Bank ([fed08bb](https://gerrit.instructure.com/quizzes-ui/commits/fed08bb740c3d055aa759da8d28a20bca3e60204))
12
+ * **MultipleAttemps:** Disable reopen OAaT submissions with Backtracking disabled ([cfc3e31](https://gerrit.instructure.com/quizzes-ui/commits/cfc3e31748c1a604d8982fd8295de08709d63e97))
13
+ * **StreamQueue:** fix region config for awsClient ([051654c](https://gerrit.instructure.com/quizzes-ui/commits/051654cb11f83985f1b262106af0531e9f540022))
14
+ * **StreamQueue:** stop attempting to kinesis after 3 failures ([672a8ea](https://gerrit.instructure.com/quizzes-ui/commits/672a8ea4dda4dc43b8508cb82600d561e852a31a))
15
+ * put QUIZ-14227 behind 'add_time_to_existing_quiz_sessions' ff ([d36798a](https://gerrit.instructure.com/quizzes-ui/commits/d36798a335a652d42224893c17feffdb598f7d76))
16
+
17
+
18
+ ### Features
19
+
20
+ * **logs:** fallback to api gateway as kinesis proxy ([3124588](https://gerrit.instructure.com/quizzes-ui/commits/31245886a8ec22bb6c6824024d760fe44afdd266))
21
+ * **Moderate:** add reduce answer choices accommodation ([e7a7e8d](https://gerrit.instructure.com/quizzes-ui/commits/e7a7e8dd0de5990d9e2fd1be04aa8816ca10f246))
22
+ * **quizzes-ui:** add data_automation tag for the “Questions” section. ([b6241e0](https://gerrit.instructure.com/quizzes-ui/commits/b6241e0c4fd7c4129804a1db7f56c1a1f819bb37))
23
+
24
+
25
+
26
+
27
+
28
+ # [20.25.0](https://gerrit.instructure.com/quizzes-ui/compare/v20.20.0...v20.25.0) (2024-10-18)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * **MultipleAttemps:** Disable reopen OAaT submissions with Backtracking disabled ([cfc3e31](https://gerrit.instructure.com/quizzes-ui/commits/cfc3e31748c1a604d8982fd8295de08709d63e97))
34
+ * **StreamQueue:** fix region config for awsClient ([051654c](https://gerrit.instructure.com/quizzes-ui/commits/051654cb11f83985f1b262106af0531e9f540022))
35
+ * **StreamQueue:** stop attempting to kinesis after 3 failures ([672a8ea](https://gerrit.instructure.com/quizzes-ui/commits/672a8ea4dda4dc43b8508cb82600d561e852a31a))
36
+ * put QUIZ-14227 behind 'add_time_to_existing_quiz_sessions' ff ([d36798a](https://gerrit.instructure.com/quizzes-ui/commits/d36798a335a652d42224893c17feffdb598f7d76))
37
+
38
+
39
+ ### Features
40
+
41
+ * **logs:** fallback to api gateway as kinesis proxy ([3124588](https://gerrit.instructure.com/quizzes-ui/commits/31245886a8ec22bb6c6824024d760fe44afdd266))
42
+ * **Moderate:** add reduce answer choices accommodation ([e7a7e8d](https://gerrit.instructure.com/quizzes-ui/commits/e7a7e8dd0de5990d9e2fd1be04aa8816ca10f246))
43
+ * **quizzes-ui:** add data_automation tag for the “Questions” section. ([b6241e0](https://gerrit.instructure.com/quizzes-ui/commits/b6241e0c4fd7c4129804a1db7f56c1a1f819bb37))
44
+
45
+
46
+
47
+
48
+
49
+ # [20.24.0](https://gerrit.instructure.com/quizzes-ui/compare/v20.20.0...v20.24.0) (2024-10-18)
50
+
51
+
52
+ ### Bug Fixes
53
+
54
+ * **MultipleAttemps:** Disable reopen OAaT submissions with Backtracking disabled ([cfc3e31](https://gerrit.instructure.com/quizzes-ui/commits/cfc3e31748c1a604d8982fd8295de08709d63e97))
55
+ * **StreamQueue:** fix region config for awsClient ([051654c](https://gerrit.instructure.com/quizzes-ui/commits/051654cb11f83985f1b262106af0531e9f540022))
56
+ * **StreamQueue:** stop attempting to kinesis after 3 failures ([672a8ea](https://gerrit.instructure.com/quizzes-ui/commits/672a8ea4dda4dc43b8508cb82600d561e852a31a))
57
+ * put QUIZ-14227 behind 'add_time_to_existing_quiz_sessions' ff ([d36798a](https://gerrit.instructure.com/quizzes-ui/commits/d36798a335a652d42224893c17feffdb598f7d76))
58
+
59
+
60
+ ### Features
61
+
62
+ * **logs:** fallback to api gateway as kinesis proxy ([3124588](https://gerrit.instructure.com/quizzes-ui/commits/31245886a8ec22bb6c6824024d760fe44afdd266))
63
+ * **quizzes-ui:** add data_automation tag for the “Questions” section. ([b6241e0](https://gerrit.instructure.com/quizzes-ui/commits/b6241e0c4fd7c4129804a1db7f56c1a1f819bb37))
64
+
65
+
66
+
67
+
68
+
69
+ # [20.23.0](https://gerrit.instructure.com/quizzes-ui/compare/v20.20.0...v20.23.0) (2024-10-11)
70
+
71
+
72
+ ### Bug Fixes
73
+
74
+ * **StreamQueue:** fix region config for awsClient ([051654c](https://gerrit.instructure.com/quizzes-ui/commits/051654cb11f83985f1b262106af0531e9f540022))
75
+ * put QUIZ-14227 behind 'add_time_to_existing_quiz_sessions' ff ([d36798a](https://gerrit.instructure.com/quizzes-ui/commits/d36798a335a652d42224893c17feffdb598f7d76))
76
+
77
+
78
+ ### Features
79
+
80
+ * **logs:** fallback to api gateway as kinesis proxy ([3124588](https://gerrit.instructure.com/quizzes-ui/commits/31245886a8ec22bb6c6824024d760fe44afdd266))
81
+ * **quizzes-ui:** add data_automation tag for the “Questions” section. ([b6241e0](https://gerrit.instructure.com/quizzes-ui/commits/b6241e0c4fd7c4129804a1db7f56c1a1f819bb37))
82
+
83
+
84
+
85
+
86
+
87
+ # [20.22.0](https://gerrit.instructure.com/quizzes-ui/compare/v20.20.0...v20.22.0) (2024-10-09)
88
+
89
+
90
+ ### Bug Fixes
91
+
92
+ * put QUIZ-14227 behind 'add_time_to_existing_quiz_sessions' ff ([d36798a](https://gerrit.instructure.com/quizzes-ui/commits/d36798a335a652d42224893c17feffdb598f7d76))
93
+
94
+
95
+ ### Features
96
+
97
+ * **logs:** fallback to api gateway as kinesis proxy ([3124588](https://gerrit.instructure.com/quizzes-ui/commits/31245886a8ec22bb6c6824024d760fe44afdd266))
98
+ * **quizzes-ui:** add data_automation tag for the “Questions” section. ([b6241e0](https://gerrit.instructure.com/quizzes-ui/commits/b6241e0c4fd7c4129804a1db7f56c1a1f819bb37))
99
+
100
+
101
+
102
+
103
+
104
+ # [20.21.0](https://gerrit.instructure.com/quizzes-ui/compare/v20.20.0...v20.21.0) (2024-10-08)
105
+
106
+
107
+ ### Bug Fixes
108
+
109
+ * put QUIZ-14227 behind 'add_time_to_existing_quiz_sessions' ff ([d36798a](https://gerrit.instructure.com/quizzes-ui/commits/d36798a335a652d42224893c17feffdb598f7d76))
110
+
111
+
112
+ ### Features
113
+
114
+ * **logs:** fallback to api gateway as kinesis proxy ([3124588](https://gerrit.instructure.com/quizzes-ui/commits/31245886a8ec22bb6c6824024d760fe44afdd266))
115
+ * **quizzes-ui:** add data_automation tag for the “Questions” section. ([b6241e0](https://gerrit.instructure.com/quizzes-ui/commits/b6241e0c4fd7c4129804a1db7f56c1a1f819bb37))
116
+
117
+
118
+
119
+
120
+
6
121
  # [20.20.0](https://gerrit.instructure.com/quizzes-ui/compare/v20.19.0...v20.20.0) (2024-10-02)
7
122
 
8
123
 
@@ -16,25 +16,22 @@ import Bank from "../../../common/records/Bank.js";
16
16
  import BankSelection from "../../../common/components/resources/BankSelection/index.js";
17
17
  import { Spinner } from '@instructure/ui-spinner';
18
18
  import { Text } from '@instructure/ui-text';
19
- import { IconCheckLine, IconNoLine, IconWarningLine } from '@instructure/ui-icons';
19
+ import { IconNoLine, IconWarningLine } from '@instructure/ui-icons';
20
20
  import { View } from '@instructure/ui-view';
21
21
  import { Flex } from '@instructure/ui-flex';
22
22
  import t from '@instructure/quiz-i18n/es/format-message';
23
23
  import { Modal, ModalHeader, ModalBody, ModalFooter, ADD_TO_BANK_MODAL_BANK_SELECTION, XSMALL_SIDE_MARGIN } from '@instructure/quiz-common';
24
24
  import { featureOn } from "../../../common/util/featureCheck.js";
25
- var _ref2 = /*#__PURE__*/React.createElement(IconCheckLine, {
26
- color: "success"
27
- });
28
- var _ref3 = /*#__PURE__*/React.createElement(Flex.Item, {
25
+ var _ref2 = /*#__PURE__*/React.createElement(Flex.Item, {
29
26
  padding: "0 small 0 0"
30
27
  }, /*#__PURE__*/React.createElement(IconNoLine, {
31
28
  color: "error",
32
29
  size: "small"
33
30
  }));
34
- var _ref4 = /*#__PURE__*/React.createElement(IconWarningLine, {
31
+ var _ref3 = /*#__PURE__*/React.createElement(IconWarningLine, {
35
32
  color: "warning"
36
33
  });
37
- var _ref5 = /*#__PURE__*/React.createElement("br", null);
34
+ var _ref4 = /*#__PURE__*/React.createElement("br", null);
38
35
  export var AddToBankModal = /*#__PURE__*/function (_Component) {
39
36
  _inherits(AddToBankModal, _Component);
40
37
  var _super = _createSuper(AddToBankModal);
@@ -211,9 +208,11 @@ export var AddToBankModal = /*#__PURE__*/function (_Component) {
211
208
  renderTitle: t('Checking content shareability...')
212
209
  }), "\xA0", t('Validating content...'));
213
210
  } else if (this.state.contentShareable === 'true') {
214
- content = /*#__PURE__*/React.createElement(Text, null, _ref2, "\xA0", t('Good to go!'));
211
+ // No message needed. The API call to check shareability is very fast in most cases,
212
+ // so the user may be distracted by a message here.
213
+ content = null;
215
214
  } else if (this.state.contentShareable === 'false') {
216
- content = /*#__PURE__*/React.createElement(Flex, null, _ref3, /*#__PURE__*/React.createElement(Flex.Item, {
215
+ content = /*#__PURE__*/React.createElement(Flex, null, _ref2, /*#__PURE__*/React.createElement(Flex.Item, {
217
216
  shouldShrink: true
218
217
  }, /*#__PURE__*/React.createElement(Text, {
219
218
  color: "danger"
@@ -221,7 +220,7 @@ export var AddToBankModal = /*#__PURE__*/function (_Component) {
221
220
  } else {
222
221
  content = /*#__PURE__*/React.createElement(Text, {
223
222
  color: "warning"
224
- }, _ref4, "\xA0", t('There was an error attempting to validate shareability.'));
223
+ }, _ref3, "\xA0", t('There was an error attempting to validate shareability.'));
225
224
  }
226
225
  return /*#__PURE__*/React.createElement(View, {
227
226
  as: "div",
@@ -243,7 +242,7 @@ export var AddToBankModal = /*#__PURE__*/function (_Component) {
243
242
  }), /*#__PURE__*/React.createElement(RadioInput, {
244
243
  value: "new",
245
244
  label: t('New item bank')
246
- })), _ref5, this.renderBankTypeContent(), this.renderContentShareabilityMessage());
245
+ })), _ref4, this.renderBankTypeContent(), this.renderContentShareabilityMessage());
247
246
  }
248
247
  }, {
249
248
  key: "render",
@@ -13,7 +13,7 @@ import { withStyle, jsx, Global } from '@instructure/emotion';
13
13
  import DragHandle from "../../../../common/components/shared/drag_and_drop/DragHandle/index.js";
14
14
  import makeScrollable from "../../../../common/components/shared/functionality/makeScrollable.js";
15
15
  import noop from "../../../../common/util/noop.js";
16
- import { EDIT, REMOVE, COPY } from '@instructure/quiz-common';
16
+ import { EDIT, REMOVE, COPY, END_EDITING_TRIGGER_CLASSNAME } from '@instructure/quiz-common';
17
17
  import generateStyle from "./styles.js";
18
18
  import generateComponentTheme from "./theme.js";
19
19
  var ScrollTargetButton = makeScrollable(IconButton);
@@ -71,8 +71,9 @@ export var ActionButtons = (_dec = withStyle(generateStyle, generateComponentThe
71
71
  key: "render",
72
72
  value: function render() {
73
73
  var hideClass = !this.props.shouldRenderEdit ? 'hide' : '';
74
+ var parentDivClass = "buttons ".concat(END_EDITING_TRIGGER_CLASSNAME);
74
75
  return jsx("div", {
75
- className: "buttons",
76
+ className: parentDivClass,
76
77
  tabIndex: "-1",
77
78
  onFocus: this.onButtonFocus,
78
79
  css: this.props.styles.buttons
@@ -10,7 +10,7 @@ import { Button } from '@instructure/ui-buttons';
10
10
  import { withStyle, jsx } from '@instructure/emotion';
11
11
  import t from '@instructure/quiz-i18n/es/format-message';
12
12
  import CustomPropTypes from "../../../../../../common/util/CustomPropTypes.js";
13
- import elementsForSelectors from "../../../../../../common/util/ElementsForSelectors.js";
13
+ import { checkClickedNode } from "../../../../../../common/util/clickHandlers.js";
14
14
  import { INSTRUCTIONS_EDIT_ID } from '@instructure/quiz-common';
15
15
  import { RichContentInput } from '@instructure/quiz-rce';
16
16
  import generateStyle from "./styles.js";
@@ -36,10 +36,10 @@ var QuizInstructionsEdit = (_dec = withStyle(generateStyle, generateComponentThe
36
36
  }, {
37
37
  key: "ignoreClickOutsideIf",
38
38
  value: function ignoreClickOutsideIf(e) {
39
- var appNodes = elementsForSelectors(this.props.appContainer);
40
- return appNodes.every(function (node) {
41
- return node && !node.contains(e.target);
42
- });
39
+ var _checkClickedNode = checkClickedNode(e, this.props.appContainer),
40
+ isEndEditingTrigger = _checkClickedNode.isEndEditingTrigger,
41
+ outsideApp = _checkClickedNode.outsideApp;
42
+ return outsideApp || !isEndEditingTrigger;
43
43
  }
44
44
  }, {
45
45
  key: "render",
@@ -16,10 +16,10 @@ import first from 'lodash/first';
16
16
  import { withStyle, jsx, Global } from '@instructure/emotion';
17
17
  import t from '@instructure/quiz-i18n/es/format-message';
18
18
  import CustomPropTypes from "../../../../../common/util/CustomPropTypes.js";
19
- import elementsForSelectors from "../../../../../common/util/ElementsForSelectors.js";
20
19
  import AddToBankModal from "../../../../../banks/components/AddToBankModal/index.js";
21
20
  import DragAndDropZone from "../../../../../common/components/shared/drag_and_drop/DragAndDropZone/index.js";
22
21
  import wrapWithOutsideClickEmotion from "../../../../../common/components/shared/functionality/componentWithOutsideClickEmotion.js";
22
+ import { checkClickedNode } from "../../../../../common/util/clickHandlers.js";
23
23
  import QuizEntryEditHeader from "./Header/index.js";
24
24
  import QuizEntryEditFooter from "./Footer/index.js";
25
25
  import { SHOULD_CLONE_ITEM, TEMPORARY_ITEM_ID, DELETED_QUIZ_ENTRY, API_INPUT_VALIDATION_ERROR, CLEAR_ALL_INPUT_VALIDATION_ERRORS, PARENT_TYPE_ADDING_TO_BANK } from '@instructure/quiz-common';
@@ -294,12 +294,10 @@ var QuizEntryEdit = (_dec = withStyle(generateStyle, generateComponentTheme), _d
294
294
  }, {
295
295
  key: "ignoreClickOutsideIf",
296
296
  value: function ignoreClickOutsideIf(e) {
297
- // Need to iterate over the appNodes since Gauge and lti have a different index for the sdk node
298
- var appNodes = elementsForSelectors(this.props.appContainer);
299
- var outsideApp = appNodes.every(function (node) {
300
- return node && !node.contains(e.target);
301
- });
302
- return this.props.isOccluded || outsideApp;
297
+ var _checkClickedNode = checkClickedNode(e, this.props.appContainer),
298
+ isEndEditingTrigger = _checkClickedNode.isEndEditingTrigger,
299
+ outsideApp = _checkClickedNode.outsideApp;
300
+ return this.props.isOccluded || outsideApp || !isEndEditingTrigger;
303
301
  }
304
302
  }, {
305
303
  key: "isValid",
@@ -19,7 +19,7 @@ import { View } from '@instructure/ui-view';
19
19
  import { withStyle, 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 { INSTRUCTIONS_SCROLL_KEY, RESULTS_SCROLL_KEY, SIDEBAR_NAV_ID, TITLE_SCROLL_KEY } from '@instructure/quiz-common';
22
+ import { INSTRUCTIONS_SCROLL_KEY, RESULTS_SCROLL_KEY, SIDEBAR_NAV_ID, TITLE_SCROLL_KEY, END_EDITING_TRIGGER_CLASSNAME } from '@instructure/quiz-common';
23
23
  import { onPhone } from "../../../../util/windowChecks.js";
24
24
  import CustomPropTypes from "../../../../util/CustomPropTypes.js";
25
25
  import noop from "../../../../util/noop.js";
@@ -105,7 +105,8 @@ export var Sidebar = (_dec = withStyle(generateStyle, generateComponentTheme), _
105
105
  return;
106
106
  }
107
107
  return jsx("div", {
108
- css: this.props.styles.sidebar.actionableInfo
108
+ css: this.props.styles.sidebar.actionableInfo,
109
+ className: END_EDITING_TRIGGER_CLASSNAME
109
110
  }, jsx(Link, {
110
111
  href: "#",
111
112
  margin: "small",
@@ -127,7 +128,8 @@ export var Sidebar = (_dec = withStyle(generateStyle, generateComponentTheme), _
127
128
  return;
128
129
  }
129
130
  return jsx("div", {
130
- css: this.props.styles.sidebar.actionableInfo
131
+ css: this.props.styles.sidebar.actionableInfo,
132
+ className: END_EDITING_TRIGGER_CLASSNAME
131
133
  }, jsx(Link, {
132
134
  href: "#",
133
135
  margin: "small",
@@ -16,6 +16,7 @@ import t from '@instructure/quiz-i18n/es/format-message';
16
16
  import { RichContentRenderer } from '@instructure/quiz-rce';
17
17
  import generateStyle from "./styles.js";
18
18
  import generateComponentTheme from "./theme.js";
19
+ import { END_EDITING_TRIGGER_CLASSNAME } from '@instructure/quiz-common';
19
20
  export var SidebarItem = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_SidebarItem = /*#__PURE__*/function (_Component) {
20
21
  _inherits(SidebarItem, _Component);
21
22
  var _super = _createSuper(SidebarItem);
@@ -110,7 +111,8 @@ export var SidebarItem = (_dec = withStyle(generateStyle, generateComponentTheme
110
111
  key: "renderClosed",
111
112
  value: function renderClosed() {
112
113
  return jsx("div", {
113
- css: this.props.styles.sidebarItem
114
+ css: this.props.styles.sidebarItem,
115
+ className: END_EDITING_TRIGGER_CLASSNAME
114
116
  }, this.renderButton());
115
117
  }
116
118
  }, {
@@ -121,8 +123,9 @@ export var SidebarItem = (_dec = withStyle(generateStyle, generateComponentTheme
121
123
  itemName = _this$props3.itemName,
122
124
  pointsPossible = _this$props3.pointsPossible,
123
125
  styles = _this$props3.styles;
126
+ var parentDivClass = "sidebarIsOpen ".concat(END_EDITING_TRIGGER_CLASSNAME);
124
127
  return jsx("div", {
125
- className: "sidebarIsOpen",
128
+ className: parentDivClass,
126
129
  css: styles.sidebarItem
127
130
  }, jsx(Flex, {
128
131
  justifyItems: "space-between"
@@ -18,6 +18,7 @@ import Summary from "./Summary/index.js";
18
18
  import generateStyle from "./styles.js";
19
19
  import generateComponentTheme from "./theme.js";
20
20
  import t from '@instructure/quiz-i18n/es/format-message';
21
+ import { END_EDITING_TRIGGER_CLASSNAME } from '@instructure/quiz-common';
21
22
  export var DISPLAY_AS_SUMMARY_LIMIT = 5;
22
23
  var _ref = jsx(IconTextLeftLine, {
23
24
  color: "primary"
@@ -82,7 +83,8 @@ export var SidebarStimulus = (_dec = withStyle(generateStyle, generateComponentT
82
83
  margin: "small",
83
84
  forceButtonRole: false,
84
85
  onClick: this.scrollToItem,
85
- renderIcon: _ref
86
+ renderIcon: _ref,
87
+ className: END_EDITING_TRIGGER_CLASSNAME
86
88
  }, jsx(ScreenReaderContent, null, t('Navigate to stimulus at position { displayPosition }', {
87
89
  displayPosition: displayPosition
88
90
  })));
@@ -13,6 +13,7 @@ import { withStyle, jsx } from '@instructure/emotion';
13
13
  import t from '@instructure/quiz-i18n/es/format-message';
14
14
  import generateStyle from "./styles.js";
15
15
  import generateComponentTheme from "./theme.js";
16
+ import { END_EDITING_TRIGGER_CLASSNAME } from '@instructure/quiz-common';
16
17
  export var AddContentButton = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_AddContentButton = /*#__PURE__*/function (_Component) {
17
18
  _inherits(AddContentButton, _Component);
18
19
  var _super = _createSuper(AddContentButton);
@@ -60,6 +61,7 @@ export var AddContentButton = (_dec = withStyle(generateStyle, generateComponent
60
61
  key: "renderNonStimulus",
61
62
  value: function renderNonStimulus() {
62
63
  return jsx("div", {
64
+ className: END_EDITING_TRIGGER_CLASSNAME,
63
65
  css: this.props.styles.newItemButtonHolder
64
66
  }, jsx("button", {
65
67
  ref: this.storeButtonElemRef,
@@ -21,7 +21,7 @@ import AddToBankModal from "../../../../../banks/components/AddToBankModal/index
21
21
  import AddToBankOptions from "../../../../../building/components/resources/AddToBankOptions/index.js";
22
22
  import WarningWrapper from "../../WarningWrapper/index.js";
23
23
  import CustomPropTypes from "../../../../../common/util/CustomPropTypes.js";
24
- import elementsForSelectors from "../../../../../common/util/ElementsForSelectors.js";
24
+ import { checkClickedNode } from "../../../../../common/util/clickHandlers.js";
25
25
  import StimulusShowInfo from "../StimulusShowInfo/index.js";
26
26
  import StimulusEditInfo from "../StimulusEditInfo/index.js";
27
27
  import wrapWithOutsideClickEmotion from "../../../shared/functionality/componentWithOutsideClickEmotion.js";
@@ -286,12 +286,10 @@ export var StimulusEdit = (_dec = withStyle(generateStyle, generateComponentThem
286
286
  }, {
287
287
  key: "ignoreClickOutsideIf",
288
288
  value: function ignoreClickOutsideIf(e) {
289
- // Need to iterate over the appNodes since Gauge and lti have a different index for the sdk node
290
- var appNodes = elementsForSelectors(this.props.appContainer);
291
- var outsideApp = appNodes.every(function (node) {
292
- return node && !node.contains(e.target);
293
- });
294
- return outsideApp;
289
+ var _checkClickedNode = checkClickedNode(e, this.props.appContainer),
290
+ isEndEditingTrigger = _checkClickedNode.isEndEditingTrigger,
291
+ outsideApp = _checkClickedNode.outsideApp;
292
+ return outsideApp || !isEndEditingTrigger;
295
293
  }
296
294
  }, {
297
295
  key: "afterSubmit",
@@ -18,6 +18,7 @@ import PropTypes from 'prop-types';
18
18
  import { withStyle, jsx, Global } from '@instructure/emotion';
19
19
  import generateStyle from "./styles.js";
20
20
  import generateComponentTheme from "./theme.js";
21
+ import { END_EDITING_TRIGGER_CLASSNAME } from '@instructure/quiz-common';
21
22
  var Overlay = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_Overlay = /*#__PURE__*/function (_Component) {
22
23
  _inherits(Overlay, _Component);
23
24
  var _super = _createSuper(Overlay);
@@ -31,9 +32,10 @@ var Overlay = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_cl
31
32
  if (this.props.hideOverlay) {
32
33
  return null;
33
34
  }
35
+ var overlayClass = "overlay ".concat(END_EDITING_TRIGGER_CLASSNAME);
34
36
  return jsx("div", {
35
37
  role: "presentation",
36
- className: "overlay",
38
+ className: overlayClass,
37
39
  css: this.props.styles.overlay,
38
40
  onClick: this.props.onClick,
39
41
  "data-automation": "sdk-overlay"
@@ -5,6 +5,8 @@ var ERROR_STATE = 'error';
5
5
  var WAITING_STATE = 'waiting';
6
6
  var SENDING_STATE = 'sending';
7
7
  var SENT_STATE = 'sent';
8
+ var REACHED_MAX_FAILURES = 'reached_max_failures';
9
+ var MAX_FAILED_ATTEMPTS = 3;
8
10
  var StreamQueue = /*#__PURE__*/function () {
9
11
  function StreamQueue(_ref) {
10
12
  var config = _ref.config,
@@ -20,7 +22,7 @@ var StreamQueue = /*#__PURE__*/function () {
20
22
  accessKeyId: kinesis.config.credentials.accessKeyId,
21
23
  secretAccessKey: kinesis.config.credentials.secretAccessKey,
22
24
  sessionToken: kinesis.config.credentials.sessionToken,
23
- region: kinesis.config.client_configuration.region,
25
+ region: kinesis.config.region,
24
26
  service: 'execute-api'
25
27
  });
26
28
  this._addPage();
@@ -115,9 +117,13 @@ var StreamQueue = /*#__PURE__*/function () {
115
117
  _this.kinesis.putRecords(params, function (err, data) {
116
118
  if (err) {
117
119
  _this.pageQueue[i].status = ERROR_STATE;
120
+ _this.pageQueue[i].errorCount = (_this.pageQueue[i].errorCount || 0) + 1;
118
121
  // eslint-disable-next-line no-console
119
122
  console.error("KINESIS STREAM ".concat(_this.config.stream, " ERROR: "), err);
120
- _this._sendRecordsViaProxy(params);
123
+ if (_this.pageQueue[i].errorCount >= MAX_FAILED_ATTEMPTS) {
124
+ _this.pageQueue[i].status = REACHED_MAX_FAILURES;
125
+ _this._sendRecordsViaProxy(params);
126
+ }
121
127
  } else {
122
128
  _this.pageQueue[i].status = SENT_STATE;
123
129
  // eslint-disable-next-line no-console
@@ -0,0 +1,19 @@
1
+ import elementsForSelectors from "./ElementsForSelectors.js";
2
+ import { END_EDITING_TRIGGER_CLASSNAME } from '@instructure/quiz-common';
3
+ export function checkClickedNode(e, appContainer) {
4
+ // Need to iterate over the appNodes since Gauge and lti have a different index for the sdk node
5
+ var appNodes = elementsForSelectors(appContainer);
6
+ var outsideApp = appNodes.every(function (node) {
7
+ return node && !node.contains(e.target);
8
+ });
9
+
10
+ // checking if the click was on an element that should end editing
11
+ var endEditingNodes = elementsForSelectors(".".concat(END_EDITING_TRIGGER_CLASSNAME));
12
+ var isEndEditingTrigger = endEditingNodes.some(function (node) {
13
+ return node && node.contains(e.target);
14
+ });
15
+ return {
16
+ isEndEditingTrigger: isEndEditingTrigger,
17
+ outsideApp: outsideApp
18
+ };
19
+ }
@@ -0,0 +1,78 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
4
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
5
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
6
+ import React, { Component } from 'react';
7
+ import PropTypes from 'prop-types';
8
+ import { Checkbox } from '@instructure/ui-checkbox';
9
+ import { IconButton } from '@instructure/ui-buttons';
10
+ import { IconInfoLine as IconInfo } from '@instructure/ui-icons';
11
+ import { Tooltip } from '@instructure/ui-tooltip';
12
+ import { View } from '@instructure/ui-view';
13
+ import t from '@instructure/quiz-i18n/es/format-message';
14
+ export var ReduceAnswerChoicesSettings = /*#__PURE__*/function (_Component) {
15
+ _inherits(ReduceAnswerChoicesSettings, _Component);
16
+ var _super = _createSuper(ReduceAnswerChoicesSettings);
17
+ function ReduceAnswerChoicesSettings() {
18
+ var _this;
19
+ _classCallCheck(this, ReduceAnswerChoicesSettings);
20
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
21
+ args[_key] = arguments[_key];
22
+ }
23
+ _this = _super.call.apply(_super, [this].concat(args));
24
+ _this.onChangeReduceChoices = function () {
25
+ var update = _objectSpread(_objectSpread({}, _this.props.courseAccommodationSettings), {}, {
26
+ reduceChoicesEnabled: !_this.props.courseAccommodationSettings.reduceChoicesEnabled
27
+ });
28
+ _this.props.onChange(update);
29
+ };
30
+ _this.renderSettingLabel = function (label, tooltip) {
31
+ return /*#__PURE__*/React.createElement("span", null, label, /*#__PURE__*/React.createElement(Tooltip, {
32
+ color: "primary-inverse",
33
+ renderTip: tooltip,
34
+ placement: "bottom",
35
+ on: ['click', 'hover', 'focus']
36
+ }, /*#__PURE__*/React.createElement(IconButton, {
37
+ renderIcon: IconInfo,
38
+ color: "secondary",
39
+ size: "small",
40
+ shape: "circle",
41
+ withBackground: false,
42
+ withBorder: false,
43
+ interaction: "readonly",
44
+ screenReaderLabel: tooltip
45
+ })));
46
+ };
47
+ return _this;
48
+ }
49
+ _createClass(ReduceAnswerChoicesSettings, [{
50
+ key: "render",
51
+ value: function render() {
52
+ return /*#__PURE__*/React.createElement(View, {
53
+ display: "block",
54
+ margin: "medium none"
55
+ }, /*#__PURE__*/React.createElement(Checkbox, {
56
+ variant: "toggle",
57
+ checked: this.props.courseAccommodationSettings.reduceChoicesEnabled || false,
58
+ label: this.renderSettingLabel(t('Reduced answer choices'), t('Removes one incorrect answer from all multiple-choice questions that have 4 or more answer choices.')),
59
+ onChange: this.onChangeReduceChoices,
60
+ value: "reduce_choices_enabled"
61
+ }));
62
+ }
63
+ }]);
64
+ ReduceAnswerChoicesSettings.displayName = "ReduceAnswerChoicesSettings";
65
+ return ReduceAnswerChoicesSettings;
66
+ }(Component);
67
+ ReduceAnswerChoicesSettings.propTypes = {
68
+ courseAccommodationSettings: PropTypes.shape({
69
+ reduceChoicesEnabled: PropTypes.bool
70
+ }).isRequired,
71
+ onChange: PropTypes.func.isRequired
72
+ };
73
+ ReduceAnswerChoicesSettings.defaultProps = {
74
+ courseAccommodationSettings: {
75
+ reduceChoicesEnabled: false
76
+ }
77
+ };
78
+ export default ReduceAnswerChoicesSettings;
@@ -261,9 +261,6 @@ export var ModerateTableRow = (_dec = withStyle(generateStyle, generateComponent
261
261
  }, t('{ name }: { value }', elem)));
262
262
  }));
263
263
  }
264
-
265
- // Display the Accommodations and the button in a flex container with reverse order
266
- // so that the screen reader will read the accommodations first, and then the button
267
264
  return jsx(Table.Cell, {
268
265
  "data-automation": "sdk-moderate-accommodations-text"
269
266
  }, displayContent);
@@ -14,6 +14,7 @@ import { TruncateText } from '@instructure/ui-truncate-text';
14
14
  import { Modal } from '@instructure/ui-modal';
15
15
  import { liveRegion } from '@instructure/quiz-common';
16
16
  import { ScreenReaderContent } from '@instructure/ui-a11y-content';
17
+ import { featureOn } from "../../../../common/util/featureCheck.js";
17
18
  export var ModerateTray = /*#__PURE__*/function (_Component) {
18
19
  _inherits(ModerateTray, _Component);
19
20
  var _super = _createSuper(ModerateTray);
@@ -150,7 +151,7 @@ export var ModerateTray = /*#__PURE__*/function (_Component) {
150
151
  }, this.renderTitleAndCloseButton()), /*#__PURE__*/React.createElement(Flex.Item, {
151
152
  shouldGrow: true,
152
153
  padding: "0 medium"
153
- }, this.renderChildren()), /*#__PURE__*/React.createElement(Flex.Item, null, this.renderFooter())));
154
+ }, this.renderChildren()), featureOn('add_time_to_existing_quiz_sessions') && /*#__PURE__*/React.createElement(Flex.Item, null, this.renderFooter())));
154
155
  }
155
156
  }]);
156
157
  ModerateTray.displayName = "ModerateTray";
@@ -7,20 +7,27 @@ import { reopenQuizSession } from "../../../api/quizSessions.js";
7
7
  import { getQuizSessionsByIds } from "../../../../common/selectors/quizSessions.js";
8
8
  export function mapStateToProps(state) {
9
9
  var quizSessionIds = state.getIn(['moderation', 'selectedSessions']);
10
- var sessions = getQuizSessionsByIds(state, quizSessionIds).filter(function (qs) {
10
+ var quizSessions = getQuizSessionsByIds(state, quizSessionIds).filter(function (qs) {
11
11
  return qs.isLoaded() && !qs.pending();
12
12
  }).sort(function (qs1, qs2) {
13
13
  return qs2.id - qs1.id;
14
14
  });
15
- var sessionId, session;
16
- if (sessions.size > 0) {
17
- session = sessions.get(0);
18
- sessionId = session.id;
15
+ var quizSessionId,
16
+ quizSession,
17
+ reopenOverride = false;
18
+ if (quizSessions.size > 0) {
19
+ quizSession = quizSessions.get(0);
20
+ var _ref = [quizSession.allowBacktracking, quizSession.isOneQuestionAtATime()],
21
+ allowBacktracking = _ref[0],
22
+ isOneQuestionAtATime = _ref[1];
23
+ quizSessionId = quizSession.id;
24
+ reopenOverride = !allowBacktracking && isOneQuestionAtATime;
19
25
  }
20
26
  return {
21
- sessionId: sessionId || null,
22
- isComplete: session ? !(session.inProgress() || session.reopeningGraded()) : false,
23
- reopenOn: featureOn('reopen_session')
27
+ sessionId: quizSessionId || null,
28
+ isComplete: quizSession ? !(quizSession.inProgress() || quizSession.reopeningGraded()) : false,
29
+ reopenOn: featureOn('reopen_session'),
30
+ reopenOverride: reopenOverride
24
31
  };
25
32
  }
26
33
  export default connect(mapStateToProps, {