@instructure/quiz-core 20.37.1 → 21.0.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 (127) hide show
  1. package/es/banks/components/BankSearch/presenter.js +1 -2
  2. package/es/banks/components/CreateBankModal/presenter.js +22 -24
  3. package/es/banks/components/EditBankModal/presenter.js +24 -22
  4. package/es/banks/components/SharingModal/presenter.js +0 -4
  5. package/es/building/api/stimuli.js +2 -1
  6. package/es/building/components/resources/DeleteStimulusModal/presenter.js +14 -7
  7. package/es/building/components/resources/quizEntry/QuizEntry/presenter.js +11 -4
  8. package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +1 -2
  9. package/es/common/actions/modifications.js +3 -2
  10. package/es/common/components/ConfirmationModal/presenter.js +10 -7
  11. package/es/common/components/layout/Page/styles.js +13 -1
  12. package/es/common/components/layout/Page/theme.js +1 -2
  13. package/es/common/components/layout/navbar/SecondaryNavBarButton/index.js +13 -32
  14. package/es/common/components/layout/navbar/index.js +0 -3
  15. package/es/common/components/layout/sidebar/Sidebar/index.js +26 -4
  16. package/es/common/components/layout/sidebar/SidebarItem/presenter.js +13 -7
  17. package/es/common/components/layout/sidebar/Stimulus/presenter.js +14 -7
  18. package/es/common/components/resources/item/ItemEdit/presenter.js +0 -5
  19. package/es/common/components/resources/quiz/AddContent/Body/presenter.js +2 -2
  20. package/es/common/components/resources/quiz/AddContent/Popover/presenter.js +0 -4
  21. package/es/common/components/resources/quiz/instructions/styles.js +5 -2
  22. package/es/common/components/resources/sessionItemResult/SessionItemResult/presenter.js +1 -1
  23. package/es/common/components/resources/stimulus/Stimulus/presenter.js +11 -4
  24. package/es/common/components/resources/stimulus/StimulusEdit/presenter.js +28 -10
  25. package/es/common/components/resources/stimulus/StimulusEdit/styles.js +1 -5
  26. package/es/common/components/resources/stimulus/StimulusEdit/theme.js +0 -2
  27. package/es/common/components/resources/stimulus/StimulusEditInfo/presenter.js +48 -30
  28. package/es/common/components/resources/stimulus/StimulusShow/index.js +10 -4
  29. package/es/common/components/resources/stimulus/StimulusShow/styles.js +0 -7
  30. package/es/common/components/resources/stimulus/StimulusShow/theme.js +0 -3
  31. package/es/common/components/resources/stimulus/StimulusShowInfo/index.js +7 -5
  32. package/es/common/components/shared/InteractionTypes/index.js +4 -1
  33. package/es/common/components/shared/InteractionTypes/presenter.js +38 -15
  34. package/es/common/components/shared/PrintTrigger/presenter.js +0 -5
  35. package/es/common/components/shared/TimeUnitsInput/index.js +9 -8
  36. package/es/common/components/shared/drag_and_drop/dragAndDropUtils.js +3 -0
  37. package/es/common/records/QuizEntry.js +5 -0
  38. package/es/common/reducers/modifications.js +6 -3
  39. package/es/common/util/warningHelpers.js +15 -5
  40. package/es/moderating/components/resources/ModerateTable/presenter.js +1 -2
  41. package/es/moderating/components/sidebar/ModerateTray/presenter.js +1 -2
  42. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +1 -2
  43. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/presenter.js +1 -1
  44. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/presenter.js +1 -2
  45. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/ChoiceGroupTypeTable/presenter.js +1 -2
  46. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsTableWrapper/presenter.js +1 -2
  47. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +1 -2
  48. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/presenter.js +1 -2
  49. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/presenter.js +1 -2
  50. package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js +1 -2
  51. package/es/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/presenter.js +1 -2
  52. package/es/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +1 -2
  53. package/es/reporting/components/resources/OutcomeAnalysis/presenter.js +1 -11
  54. package/es/reporting/components/resources/ReportCard/index.js +1 -2
  55. package/es/reporting/components/resources/StudentAnalysis/ReportCard/presenter.js +1 -2
  56. package/es/reporting/components/resources/common/AnalysisUpdateDate/index.js +1 -1
  57. package/es/taking/api/taking.js +4 -0
  58. package/lib/banks/components/BankSearch/presenter.js +3 -4
  59. package/lib/banks/components/CreateBankModal/presenter.js +23 -24
  60. package/lib/banks/components/EditBankModal/presenter.js +25 -22
  61. package/lib/banks/components/SharingModal/presenter.js +0 -4
  62. package/lib/building/api/stimuli.js +2 -1
  63. package/lib/building/components/resources/DeleteStimulusModal/presenter.js +14 -7
  64. package/lib/building/components/resources/quizEntry/QuizEntry/presenter.js +11 -4
  65. package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +3 -4
  66. package/lib/common/actions/modifications.js +3 -2
  67. package/lib/common/components/ConfirmationModal/presenter.js +10 -7
  68. package/lib/common/components/layout/Page/styles.js +13 -1
  69. package/lib/common/components/layout/Page/theme.js +1 -2
  70. package/lib/common/components/layout/navbar/SecondaryNavBarButton/index.js +13 -32
  71. package/lib/common/components/layout/navbar/index.js +0 -3
  72. package/lib/common/components/layout/sidebar/Sidebar/index.js +25 -3
  73. package/lib/common/components/layout/sidebar/SidebarItem/presenter.js +15 -9
  74. package/lib/common/components/layout/sidebar/Stimulus/presenter.js +16 -9
  75. package/lib/common/components/resources/item/ItemEdit/presenter.js +0 -5
  76. package/lib/common/components/resources/quiz/AddContent/Body/presenter.js +2 -2
  77. package/lib/common/components/resources/quiz/AddContent/Popover/presenter.js +0 -4
  78. package/lib/common/components/resources/quiz/instructions/styles.js +5 -2
  79. package/lib/common/components/resources/sessionItemResult/SessionItemResult/presenter.js +1 -1
  80. package/lib/common/components/resources/stimulus/Stimulus/presenter.js +11 -4
  81. package/lib/common/components/resources/stimulus/StimulusEdit/presenter.js +28 -10
  82. package/lib/common/components/resources/stimulus/StimulusEdit/styles.js +1 -5
  83. package/lib/common/components/resources/stimulus/StimulusEdit/theme.js +0 -2
  84. package/lib/common/components/resources/stimulus/StimulusEditInfo/presenter.js +48 -30
  85. package/lib/common/components/resources/stimulus/StimulusShow/index.js +9 -3
  86. package/lib/common/components/resources/stimulus/StimulusShow/styles.js +0 -7
  87. package/lib/common/components/resources/stimulus/StimulusShow/theme.js +0 -3
  88. package/lib/common/components/resources/stimulus/StimulusShowInfo/index.js +7 -5
  89. package/lib/common/components/shared/InteractionTypes/index.js +4 -1
  90. package/lib/common/components/shared/InteractionTypes/presenter.js +38 -15
  91. package/lib/common/components/shared/PrintTrigger/presenter.js +0 -5
  92. package/lib/common/components/shared/TimeUnitsInput/index.js +10 -9
  93. package/lib/common/components/shared/drag_and_drop/dragAndDropUtils.js +3 -0
  94. package/lib/common/records/QuizEntry.js +5 -0
  95. package/lib/common/reducers/modifications.js +6 -3
  96. package/lib/common/util/warningHelpers.js +15 -5
  97. package/lib/moderating/components/resources/ModerateTable/presenter.js +3 -4
  98. package/lib/moderating/components/sidebar/ModerateTray/presenter.js +5 -6
  99. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +6 -7
  100. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/presenter.js +9 -9
  101. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/presenter.js +2 -3
  102. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/ChoiceGroupTypeTable/presenter.js +5 -6
  103. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsTableWrapper/presenter.js +4 -5
  104. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +3 -4
  105. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/presenter.js +3 -4
  106. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/presenter.js +8 -9
  107. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js +20 -21
  108. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/presenter.js +9 -10
  109. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +20 -21
  110. package/lib/reporting/components/resources/OutcomeAnalysis/presenter.js +1 -11
  111. package/lib/reporting/components/resources/ReportCard/index.js +1 -2
  112. package/lib/reporting/components/resources/StudentAnalysis/ReportCard/presenter.js +9 -10
  113. package/lib/reporting/components/resources/common/AnalysisUpdateDate/index.js +2 -2
  114. package/lib/taking/api/taking.js +4 -0
  115. package/package.json +57 -62
  116. package/es/banks/components/CreateBankModal/styles.js +0 -15
  117. package/es/banks/components/CreateBankModal/theme.js +0 -10
  118. package/es/banks/components/EditBankModal/styles.js +0 -12
  119. package/es/banks/components/EditBankModal/theme.js +0 -9
  120. package/es/common/components/layout/navbar/SecondaryNavBarButton/styles.js +0 -9
  121. package/es/common/components/layout/navbar/SecondaryNavBarButton/theme.js +0 -10
  122. package/lib/banks/components/CreateBankModal/styles.js +0 -22
  123. package/lib/banks/components/CreateBankModal/theme.js +0 -17
  124. package/lib/banks/components/EditBankModal/styles.js +0 -19
  125. package/lib/banks/components/EditBankModal/theme.js +0 -16
  126. package/lib/common/components/layout/navbar/SecondaryNavBarButton/styles.js +0 -16
  127. package/lib/common/components/layout/navbar/SecondaryNavBarButton/theme.js +0 -17
@@ -12,7 +12,6 @@ import { IconPlusLine } from '@instructure/ui-icons';
12
12
  import { Button, CondensedButton } from '@instructure/ui-buttons';
13
13
  import { Checkbox } from '@instructure/ui-checkbox';
14
14
  import { View } from '@instructure/ui-view';
15
- import { Flex } from '@instructure/ui-flex';
16
15
  import { Text } from '@instructure/ui-text';
17
16
  import { AccessibleContent, ScreenReaderContent } from '@instructure/ui-a11y-content';
18
17
  import { jsx } from '@instructure/emotion';
@@ -21,7 +20,7 @@ import TagSuggestSelect from "../../../common/components/shared/TagSuggestSelect
21
20
  import { interactionTypesNameDictionary } from "../../../common/util/interactionTypeMetadata.js";
22
21
  import generateStyle from "./styles.js";
23
22
  import generateComponentTheme from "./theme.js";
24
- import { TextInput, withStyleOverrides } from '@instructure/quiz-common';
23
+ import { Flex, TextInput, withStyleOverrides } from '@instructure/quiz-common';
25
24
  var tagShape = PropTypes.shape({
26
25
  tag: PropTypes.shape({
27
26
  id: PropTypes.string,
@@ -2,9 +2,9 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/esm/createClass";
3
3
  import _inherits from "@babel/runtime/helpers/esm/inherits";
4
4
  import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
- var _dec, _class, _CreateBankModal;
5
+ var _CreateBankModal;
6
6
  /** @jsx jsx */
7
- import { Component } from 'react';
7
+ import React, { Component } from 'react';
8
8
  import PropTypes from 'prop-types';
9
9
  import { Button, CloseButton } from '@instructure/ui-buttons';
10
10
  import { Checkbox } from '@instructure/ui-checkbox';
@@ -14,19 +14,14 @@ import { jsx } from '@instructure/emotion';
14
14
  import t from '@instructure/quiz-i18n/es/format-message';
15
15
  import Bank from "../../../common/records/Bank.js";
16
16
  import { toErrors } from "../../../common/util/instUIMessages.js";
17
- import { Modal, ModalHeader, ModalBody, ModalFooter, TextInput, XSMALL_SIDE_MARGIN, withStyleOverrides } from '@instructure/quiz-common';
18
- import generateStyle from "./styles.js";
19
- import generateComponentTheme from "./theme.js";
20
- export var CreateBankModal = (_dec = withStyleOverrides(generateStyle, generateComponentTheme), _dec(_class = (_CreateBankModal = /*#__PURE__*/function (_Component) {
17
+ import { Modal, ModalHeader, ModalBody, ModalFooter, TextInput, XSMALL_SIDE_MARGIN } from '@instructure/quiz-common';
18
+ export var CreateBankModal = /*#__PURE__*/function (_Component) {
21
19
  _inherits(CreateBankModal, _Component);
22
20
  var _super = _createSuper(CreateBankModal);
23
- function CreateBankModal() {
21
+ function CreateBankModal(props) {
24
22
  var _this;
25
23
  _classCallCheck(this, CreateBankModal);
26
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
27
- args[_key] = arguments[_key];
28
- }
29
- _this = _super.call.apply(_super, [this].concat(args));
24
+ _this = _super.call(this, props);
30
25
  _this.state = {
31
26
  shareWithCourse: false
32
27
  };
@@ -38,7 +33,8 @@ export var CreateBankModal = (_dec = withStyleOverrides(generateStyle, generateC
38
33
  _this.props.onCreateBank();
39
34
  _this.closeAction();
40
35
  } else {
41
- _this.props.screenreaderNotification(t('Bank name cannot be blank.'));
36
+ var _this$bankNameInput$c;
37
+ (_this$bankNameInput$c = _this.bankNameInput.current) === null || _this$bankNameInput$c === void 0 ? void 0 : _this$bankNameInput$c.focus();
42
38
  }
43
39
  };
44
40
  _this.closeAction = function () {
@@ -68,6 +64,7 @@ export var CreateBankModal = (_dec = withStyleOverrides(generateStyle, generateC
68
64
  shareWithCourse: event.target.checked
69
65
  });
70
66
  };
67
+ _this.bankNameInput = /*#__PURE__*/React.createRef();
71
68
  return _this;
72
69
  }
73
70
  _createClass(CreateBankModal, [{
@@ -92,17 +89,14 @@ export var CreateBankModal = (_dec = withStyleOverrides(generateStyle, generateC
92
89
  }, {
93
90
  key: "renderContent",
94
91
  value: function renderContent() {
95
- return jsx("div", {
96
- css: this.props.styles.bankNameInput
97
- }, jsx(TextInput, {
92
+ return jsx("div", null, jsx(TextInput, {
98
93
  messages: this.getErrors(),
99
94
  onChange: this.onNameChange,
100
- renderLabel: jsx("div", {
101
- css: this.props.styles.bankNameLabel
102
- }, t('Bank Name')),
95
+ renderLabel: t('Bank Name'),
96
+ isRequired: true,
103
97
  type: "text",
104
- placeholder: t('Enter a name...'),
105
- "data-automation": "sdk-create-bank-name-textinput"
98
+ "data-automation": "sdk-create-bank-name-textinput",
99
+ ref: this.bankNameInput
106
100
  }), this.renderCheckbox());
107
101
  }
108
102
  }, {
@@ -134,7 +128,6 @@ export var CreateBankModal = (_dec = withStyleOverrides(generateStyle, generateC
134
128
  label: t('Item Bank'),
135
129
  "data-automation": "sdk-create-bank-modal"
136
130
  }, jsx(ModalHeader, null, jsx(Heading, {
137
- level: "reset",
138
131
  as: "h2"
139
132
  }, t('New Item Bank')), jsx(CloseButton, {
140
133
  onClick: this.closeAction,
@@ -146,7 +139,11 @@ export var CreateBankModal = (_dec = withStyleOverrides(generateStyle, generateC
146
139
  }]);
147
140
  CreateBankModal.displayName = "CreateBankModal";
148
141
  return CreateBankModal;
149
- }(Component), _CreateBankModal.displayName = 'CreateBankModal', _CreateBankModal.componentId = "Quizzes".concat(_CreateBankModal.displayName), _CreateBankModal.propTypes = {
142
+ }(Component);
143
+ _CreateBankModal = CreateBankModal;
144
+ CreateBankModal.displayName = 'CreateBankModal';
145
+ CreateBankModal.componentId = "Quizzes".concat(_CreateBankModal.displayName);
146
+ CreateBankModal.propTypes = {
150
147
  modalOpen: PropTypes.bool.isRequired,
151
148
  modalTrigger: PropTypes.instanceOf(Component),
152
149
  temporaryBank: PropTypes.instanceOf(Bank).isRequired,
@@ -169,11 +166,12 @@ export var CreateBankModal = (_dec = withStyleOverrides(generateStyle, generateC
169
166
  root_account_name: PropTypes.string
170
167
  }),
171
168
  styles: PropTypes.object
172
- }, _CreateBankModal.defaultProps = {
169
+ };
170
+ CreateBankModal.defaultProps = {
173
171
  displayError: false,
174
172
  modalTrigger: null,
175
173
  showShareBankOnCreate: false,
176
174
  itemBanksScope: {},
177
175
  onCreateBank: function onCreateBank() {}
178
- }, _CreateBankModal)) || _class);
176
+ };
179
177
  export default CreateBankModal;
@@ -2,34 +2,32 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/esm/createClass";
3
3
  import _inherits from "@babel/runtime/helpers/esm/inherits";
4
4
  import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
- var _dec, _class, _EditBankModal;
5
+ var _EditBankModal;
6
6
  /** @jsx jsx */
7
- import { Component } from 'react';
7
+ import React, { Component } from 'react';
8
8
  import PropTypes from 'prop-types';
9
9
  import { Button, CloseButton } from '@instructure/ui-buttons';
10
10
  import { Heading } from '@instructure/ui-heading';
11
11
  import { jsx } from '@instructure/emotion';
12
12
  import t from '@instructure/quiz-i18n/es/format-message';
13
13
  import { toErrors } from "../../../common/util/instUIMessages.js";
14
- import { Modal, ModalHeader, ModalBody, ModalFooter, TextInput, XSMALL_SIDE_MARGIN, withStyleOverrides } from '@instructure/quiz-common';
14
+ import { Modal, ModalHeader, ModalBody, ModalFooter, TextInput, XSMALL_SIDE_MARGIN } from '@instructure/quiz-common';
15
15
  import Bank from "../../../common/records/Bank.js";
16
- import generateStyle from "./styles.js";
17
- import generateComponentTheme from "./theme.js";
18
- export var EditBankModal = (_dec = withStyleOverrides(generateStyle, generateComponentTheme), _dec(_class = (_EditBankModal = /*#__PURE__*/function (_Component) {
16
+ export var EditBankModal = /*#__PURE__*/function (_Component) {
19
17
  _inherits(EditBankModal, _Component);
20
18
  var _super = _createSuper(EditBankModal);
21
- function EditBankModal() {
19
+ function EditBankModal(props) {
22
20
  var _this;
23
21
  _classCallCheck(this, EditBankModal);
24
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
25
- args[_key] = arguments[_key];
26
- }
27
- _this = _super.call.apply(_super, [this].concat(args));
22
+ _this = _super.call(this, props);
28
23
  _this.continueAction = function () {
29
24
  _this.props.showError(_this.props.errorKey);
30
25
  if (_this.props.workingBank.isValid()) {
31
26
  _this.props.updateBank(_this.props.workingBank);
32
27
  _this.closeAction();
28
+ } else {
29
+ var _this$bankNameInput$c;
30
+ (_this$bankNameInput$c = _this.bankNameInput.current) === null || _this$bankNameInput$c === void 0 ? void 0 : _this$bankNameInput$c.focus();
33
31
  }
34
32
  };
35
33
  _this.closeAction = function () {
@@ -51,6 +49,7 @@ export var EditBankModal = (_dec = withStyleOverrides(generateStyle, generateCom
51
49
  return toErrors(_this.props.workingBank.errorsFor('title').toJS());
52
50
  }
53
51
  };
52
+ _this.bankNameInput = /*#__PURE__*/React.createRef();
54
53
  return _this;
55
54
  }
56
55
  _createClass(EditBankModal, [{
@@ -75,17 +74,16 @@ export var EditBankModal = (_dec = withStyleOverrides(generateStyle, generateCom
75
74
  }, {
76
75
  key: "renderContent",
77
76
  value: function renderContent() {
78
- return jsx("div", {
79
- css: this.props.styles.bankNameInput
80
- }, jsx(TextInput, {
77
+ return jsx(TextInput, {
81
78
  value: this.props.workingBank.title,
82
79
  messages: this.getErrors(),
83
80
  onChange: this.onNameChange,
84
- renderLabel: jsx("div", null, t('Bank Name')),
81
+ renderLabel: t('Bank Name'),
85
82
  type: "text",
86
- placeholder: t('Enter a name...'),
87
- "data-automation": "sdk-edit-bank-name-textinput"
88
- }));
83
+ isRequired: true,
84
+ "data-automation": "sdk-edit-bank-name-textinput",
85
+ ref: this.bankNameInput
86
+ });
89
87
  }
90
88
  }, {
91
89
  key: "render",
@@ -97,7 +95,6 @@ export var EditBankModal = (_dec = withStyleOverrides(generateStyle, generateCom
97
95
  label: t('Item Bank'),
98
96
  "data-automation": "sdk-edit-bank-modal"
99
97
  }, jsx(ModalHeader, null, jsx(Heading, {
100
- level: "reset",
101
98
  as: "h2"
102
99
  }, t('Edit Item Bank')), jsx(CloseButton, {
103
100
  onClick: this.closeAction,
@@ -109,7 +106,11 @@ export var EditBankModal = (_dec = withStyleOverrides(generateStyle, generateCom
109
106
  }]);
110
107
  EditBankModal.displayName = "EditBankModal";
111
108
  return EditBankModal;
112
- }(Component), _EditBankModal.displayName = 'EditBankModal', _EditBankModal.componentId = "Quizzes".concat(_EditBankModal.displayName), _EditBankModal.propTypes = {
109
+ }(Component);
110
+ _EditBankModal = EditBankModal;
111
+ EditBankModal.displayName = 'EditBankModal';
112
+ EditBankModal.componentId = "Quizzes".concat(_EditBankModal.displayName);
113
+ EditBankModal.propTypes = {
113
114
  modalOpen: PropTypes.bool.isRequired,
114
115
  modalTrigger: PropTypes.instanceOf(Component),
115
116
  workingBank: PropTypes.instanceOf(Bank).isRequired,
@@ -122,8 +123,9 @@ export var EditBankModal = (_dec = withStyleOverrides(generateStyle, generateCom
122
123
  hideError: PropTypes.func.isRequired,
123
124
  closeModal: PropTypes.func.isRequired,
124
125
  styles: PropTypes.object
125
- }, _EditBankModal.defaultProps = {
126
+ };
127
+ EditBankModal.defaultProps = {
126
128
  displayError: false,
127
129
  modalTrigger: null
128
- }, _EditBankModal)) || _class);
130
+ };
129
131
  export default EditBankModal;
@@ -22,7 +22,6 @@ import { Grid } from '@instructure/ui-grid';
22
22
  import { Tabs } from '@instructure/ui-tabs';
23
23
  import { Text } from '@instructure/ui-text';
24
24
  import { jsx } from '@instructure/emotion';
25
- import elementsForSelectors from "../../../common/util/ElementsForSelectors.js";
26
25
  import CustomPropTypes from "../../../common/util/CustomPropTypes.js";
27
26
  import ShareList from "./ShareList/index.js";
28
27
  import AsyncSearch from "../AsyncSearch/index.js";
@@ -54,9 +53,6 @@ export var SharingModalPresenter = (_dec = withStyleOverrides(generateStyle, gen
54
53
  };
55
54
  _this.shareListRef = null;
56
55
  _this.shareButtonRef = null;
57
- _this.applicationElement = function () {
58
- return elementsForSelectors(_this.props.appContainer);
59
- };
60
56
  // =============
61
57
  // LIFECYCLE
62
58
  // =============
@@ -21,7 +21,8 @@ export function createStimulus(stimulus, parentId, parentType) {
21
21
  parent_stimulus_id: parentStimulusId,
22
22
  source_url: stimulus.sourceUrl,
23
23
  stimulus_type: stimulus.stimulusType,
24
- title: stimulus.title
24
+ title: stimulus.title,
25
+ passage: stimulus.passage
25
26
  };
26
27
  var requestBody = JSON.stringify({
27
28
  stimulus: stimulusParams
@@ -114,6 +114,12 @@ export var DeleteStimulusModal = (_dec = withStyleOverrides(generateStyle, gener
114
114
  cancelText: t('Cancel')
115
115
  };
116
116
  }
117
+ }, {
118
+ key: "isPassage",
119
+ value: function isPassage() {
120
+ var _this$props$stimulusE;
121
+ return (_this$props$stimulusE = this.props.stimulusEntry) === null || _this$props$stimulusE === void 0 ? void 0 : _this$props$stimulusE.getEntry().passage;
122
+ }
117
123
  }, {
118
124
  key: "anyImmutableKeepers",
119
125
  value: function anyImmutableKeepers() {
@@ -142,8 +148,8 @@ export var DeleteStimulusModal = (_dec = withStyleOverrides(generateStyle, gener
142
148
  return jsx(Button, {
143
149
  onClick: this.closeAction,
144
150
  margin: XSMALL_SIDE_MARGIN,
145
- "data-automation": "sdk-keep-stimulus-button"
146
- }, t('Keep Stimulus'));
151
+ "data-automation": "sdk-keep-".concat(this.isPassage() ? 'passage' : 'stimulus', "-button")
152
+ }, this.isPassage() ? t('Keep Passage') : t('Keep Stimulus'));
147
153
  }
148
154
  }, {
149
155
  key: "doneButton",
@@ -157,8 +163,8 @@ export var DeleteStimulusModal = (_dec = withStyleOverrides(generateStyle, gener
157
163
  color: "primary",
158
164
  onClick: this.handleSubmit,
159
165
  margin: XSMALL_SIDE_MARGIN,
160
- "data-automation": "sdk-remove-stimulus-button"
161
- }, t('Remove Stimulus'));
166
+ "data-automation": "sdk-remove-".concat(this.isPassage() ? 'passage' : 'stimulus', "-button")
167
+ }, this.isPassage() ? t('Remove Passage') : t('Remove Stimulus'));
162
168
  }
163
169
  }, {
164
170
  key: "renderChooseWhich",
@@ -199,7 +205,8 @@ export var DeleteStimulusModal = (_dec = withStyleOverrides(generateStyle, gener
199
205
  }, {
200
206
  key: "renderContent",
201
207
  value: function renderContent() {
202
- var content = this.props.childEntries.size === 0 ? jsx("span", null, t('Are you sure you want to remove this stimulus?')) : this.renderMainMenu();
208
+ var message = this.isPassage() ? t('Are you sure you want to remove this passage?') : t('Are you sure you want to remove this stimulus?');
209
+ var content = this.props.childEntries.size === 0 ? jsx("span", null, message) : this.renderMainMenu();
203
210
  var stimulusTitle = this.props.stimulusEntry && this.props.stimulusEntry.getEntry().title;
204
211
  return jsx("div", {
205
212
  className: "deleteStimulusModal",
@@ -215,11 +222,11 @@ export var DeleteStimulusModal = (_dec = withStyleOverrides(generateStyle, gener
215
222
  open: this.props.modalOpen,
216
223
  onDismiss: this.closeAction,
217
224
  size: "small",
218
- label: t('Confirm Stimulus Removal')
225
+ label: this.isPassage() ? t('Confirm Passage Removal') : t('Confirm Stimulus Removal')
219
226
  }, jsx(ModalHeader, null, jsx(Heading, {
220
227
  level: "reset",
221
228
  as: "h2"
222
- }, t('Confirm Stimulus Removal')), jsx(CloseButton, {
229
+ }, this.isPassage() ? t('Confirm Passage Removal') : t('Confirm Stimulus Removal')), jsx(CloseButton, {
223
230
  onClick: this.closeAction,
224
231
  placement: "end",
225
232
  offset: "medium",
@@ -38,10 +38,10 @@ export var QuizEntry = (_dec = withStyleOverrides(generateStyle, generateCompone
38
38
  function QuizEntry() {
39
39
  var _this;
40
40
  _classCallCheck(this, QuizEntry);
41
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
42
- args[_key] = arguments[_key];
41
+ for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
42
+ _args[_key] = arguments[_key];
43
43
  }
44
- _this = _super.call.apply(_super, [this].concat(args));
44
+ _this = _super.call.apply(_super, [this].concat(_args));
45
45
  _this.itemOverrideTypes = function () {
46
46
  return ['choice'].concat(_toConsumableArray(_this.props.partialScoringEnabled ? ['multi-answer'] : []), _toConsumableArray(_this.props.partialDeepScoringEnabled ? ['matching'] : []));
47
47
  };
@@ -96,7 +96,14 @@ export var QuizEntry = (_dec = withStyleOverrides(generateStyle, generateCompone
96
96
  };
97
97
  _this.bankEntryWarningWrapperProps = function () {
98
98
  if (_this.props.quizEntry.entryEditable) {
99
- var propsFunc = _this.props.quizEntry.hasStimulus ? propsForStimulusBankEntryEditPrompt : propsForItemBankEntryEditPrompt;
99
+ var _this$props$entry;
100
+ var isPassage = (_this$props$entry = _this.props.entry) === null || _this$props$entry === void 0 ? void 0 : _this$props$entry.passage;
101
+ var propsFunc = _this.props.quizEntry.hasStimulus ? function () {
102
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
103
+ args[_key2] = arguments[_key2];
104
+ }
105
+ return propsForStimulusBankEntryEditPrompt.apply(void 0, [isPassage].concat(args));
106
+ } : propsForItemBankEntryEditPrompt;
100
107
  return propsFunc(_this.isEditing(), _this.props.switchOffEditing, function () {
101
108
  var bankEntry = _this.props.quizEntry.getEntry();
102
109
  _this.props.setUi(BUILD_TRAY_OPEN, true);
@@ -9,7 +9,6 @@ import { Component } from 'react';
9
9
  import PropTypes from 'prop-types';
10
10
  import ImmutablePropTypes from 'react-immutable-proptypes';
11
11
  import { View } from '@instructure/ui-view';
12
- import { Flex } from '@instructure/ui-flex';
13
12
  import { ScreenReaderContent } from '@instructure/ui-a11y-content';
14
13
  import { Text } from '@instructure/ui-text';
15
14
  import NumberInput from '@instructure/quiz-number-input';
@@ -19,7 +18,7 @@ import { IconDiscussionLine, IconDiscussionSolid } from '@instructure/ui-icons';
19
18
  import { interactionPoints } from '@instructure/quiz-interactions';
20
19
  import t from '@instructure/quiz-i18n/es/format-message';
21
20
  import EntrySave from "../../../../../../common/components/resources/entry/EntrySave/index.js";
22
- import { ITEM_FEEDBACK_MODAL, ITEM_FEEDBACK_MODAL_ITEM, ITEM_FEEDBACK_MODAL_FEEDBACK, withStyleOverrides } from '@instructure/quiz-common';
21
+ import { Flex, ITEM_FEEDBACK_MODAL, ITEM_FEEDBACK_MODAL_ITEM, ITEM_FEEDBACK_MODAL_FEEDBACK, withStyleOverrides } from '@instructure/quiz-common';
23
22
  import generateStyle from "./styles.js";
24
23
  import generateComponentTheme from "./theme.js";
25
24
  function pointsAsFloat(pointsString) {
@@ -474,13 +474,14 @@ export function clearTemporaryBankItem(bankId) {
474
474
  // =====================
475
475
  // =====================
476
476
 
477
- export function createStimulus(quizId, position) {
477
+ export function createStimulus(quizId, position, isPassage) {
478
478
  return function (dispatch, getState) {
479
479
  dispatch({
480
480
  type: CREATE_TEMPORARY_STIMULUS,
481
481
  payload: {
482
482
  quizId: quizId,
483
- position: position
483
+ position: position,
484
+ isPassage: isPassage
484
485
  }
485
486
  });
486
487
  };
@@ -57,19 +57,20 @@ export var ConfirmationModal = /*#__PURE__*/function (_Component) {
57
57
  continueText = _this$props2.continueText,
58
58
  size = _this$props2.size,
59
59
  shouldReturnFocus = _this$props2.shouldReturnFocus,
60
- continueVariant = _this$props2.continueVariant;
60
+ continueVariant = _this$props2.continueVariant,
61
+ automationPrefix = _this$props2.automationPrefix;
61
62
  return /*#__PURE__*/React.createElement(ImportantModal, {
62
63
  open: this.props.modalOpen,
63
64
  size: size || 'small',
64
65
  label: title || t('Confirm'),
65
66
  onDismiss: this.cancelAction,
66
- "data-automation": "sdk-confirmation-modal",
67
+ "data-automation": automationPrefix ? "sdk-".concat(automationPrefix, "-confirmation-modal") : 'sdk-confirmation-modal',
67
68
  shouldReturnFocus: shouldReturnFocus,
68
69
  onClose: this.doAction
69
70
  }, /*#__PURE__*/React.createElement(ModalHeader, null, /*#__PURE__*/React.createElement(Heading, {
70
71
  level: "reset",
71
72
  as: "h2",
72
- "data-automation": "sdk-confirmation-modal-heading"
73
+ "data-automation": automationPrefix ? "sdk-".concat(automationPrefix, "-confirmation-modal-heading") : 'sdk-confirmation-modal-heading'
73
74
  }, title || t('Confirm')), /*#__PURE__*/React.createElement(CloseButton, {
74
75
  onClick: this.cancelAction,
75
76
  placement: "end",
@@ -80,12 +81,12 @@ export var ConfirmationModal = /*#__PURE__*/function (_Component) {
80
81
  }, text || t('Are you sure?'))), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
81
82
  onClick: this.cancelAction,
82
83
  margin: XSMALL_SIDE_MARGIN,
83
- "data-automation": "sdk-confirmation-modal-cancel"
84
+ "data-automation": automationPrefix ? "sdk-".concat(automationPrefix, "-confirmation-modal-cancel") : 'sdk-confirmation-modal-cancel'
84
85
  }, cancelText || t('Cancel')), /*#__PURE__*/React.createElement(Button, {
85
86
  color: continueVariant || 'primary',
86
87
  onClick: this.continueAction,
87
88
  margin: XSMALL_SIDE_MARGIN,
88
- "data-automation": "sdk-confirmation-modal-confirm"
89
+ "data-automation": automationPrefix ? "sdk-".concat(automationPrefix, "-confirmation-modal-confirm") : 'sdk-confirmation-modal-confirm'
89
90
  }, continueText || t('Confirm'))));
90
91
  }
91
92
  }]);
@@ -103,7 +104,8 @@ ConfirmationModal.propTypes = {
103
104
  size: PropTypes.string,
104
105
  shouldReturnFocus: PropTypes.bool,
105
106
  onContinue: PropTypes.func,
106
- onCancel: PropTypes.func
107
+ onCancel: PropTypes.func,
108
+ automationPrefix: PropTypes.string
107
109
  };
108
110
  ConfirmationModal.defaultProps = {
109
111
  title: null,
@@ -114,6 +116,7 @@ ConfirmationModal.defaultProps = {
114
116
  size: null,
115
117
  shouldReturnFocus: true,
116
118
  onContinue: null,
117
- onCancel: null
119
+ onCancel: null,
120
+ automationPrefix: null
118
121
  };
119
122
  export default ConfirmationModal;
@@ -17,7 +17,19 @@ var generateStyle = function generateStyle(componentTheme, props) {
17
17
  overflowY: 'auto'
18
18
  }), {}, {
19
19
  transition: componentTheme.contentTransition,
20
- width: '100%'
20
+ width: '100%',
21
+ '.user_content p': {
22
+ margin: "".concat(componentTheme.userContentMargin, " 0"),
23
+ '&:first-of-type': {
24
+ margin: "0 0 ".concat(componentTheme.userContentMargin)
25
+ },
26
+ '&:last-of-type': {
27
+ margin: "".concat(componentTheme.userContentMargin, " 0 0")
28
+ },
29
+ '&:only-child': {
30
+ margin: 0
31
+ }
32
+ }
21
33
  })
22
34
  };
23
35
  };
@@ -6,8 +6,7 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
6
6
  return {
7
7
  fontFamily: typography.fontFamily,
8
8
  contentTransition: "transform ".concat(transitions.duration),
9
- userContentMargin: spacing.mediumSmall,
10
- userContentZeroMargin: 0
9
+ userContentMargin: spacing.mediumSmall
11
10
  };
12
11
  };
13
12
  export default generateComponentTheme;
@@ -2,17 +2,14 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/esm/createClass";
3
3
  import _inherits from "@babel/runtime/helpers/esm/inherits";
4
4
  import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
- var _dec, _class, _SecondaryNavBarButton;
5
+ var _SecondaryNavBarButton;
6
6
  /** @jsx jsx */
7
7
  import { Component } from 'react';
8
8
  import PropTypes from 'prop-types';
9
9
  import { TopNavBar } from '@instructure/ui-top-nav-bar';
10
- import { InstUISettingsProvider, jsx } from '@instructure/emotion';
10
+ import { jsx } from '@instructure/emotion';
11
11
  import { omitProps } from '@instructure/ui-react-utils';
12
- import generateStyle from "./styles.js";
13
- import generateComponentTheme from "./theme.js";
14
- import { withStyleOverrides } from '@instructure/quiz-common';
15
- export var SecondaryNavBarButton = (_dec = withStyleOverrides(generateStyle, generateComponentTheme), _dec(_class = (_SecondaryNavBarButton = /*#__PURE__*/function (_Component) {
12
+ export var SecondaryNavBarButton = /*#__PURE__*/function (_Component) {
16
13
  _inherits(SecondaryNavBarButton, _Component);
17
14
  var _super = _createSuper(SecondaryNavBarButton);
18
15
  function SecondaryNavBarButton() {
@@ -20,37 +17,21 @@ export var SecondaryNavBarButton = (_dec = withStyleOverrides(generateStyle, gen
20
17
  return _super.apply(this, arguments);
21
18
  }
22
19
  _createClass(SecondaryNavBarButton, [{
23
- key: "componentDidMount",
24
- value: function componentDidMount() {
25
- this.props.makeStyles();
26
- }
27
- }, {
28
- key: "componentDidUpdate",
29
- value: function componentDidUpdate() {
30
- this.props.makeStyles();
31
- }
32
- }, {
33
20
  key: "render",
34
21
  value: function render() {
35
- return jsx(InstUISettingsProvider, {
36
- theme: {
37
- componentOverrides: {
38
- BaseButton: {
39
- primaryColor: this.props.styles.textColor,
40
- primaryBackground: this.props.styles.backgroundColor,
41
- primaryHoverBackground: this.props.styles.backgroundHoverColor,
42
- primaryBorderColor: this.props.styles.borderColor
43
- }
44
- }
45
- }
46
- }, jsx(TopNavBar.Item, omitProps(this.props, this.constructor.propTypes), this.props.children));
22
+ return jsx(TopNavBar.Item, Object.assign({
23
+ color: "secondary"
24
+ }, omitProps(this.props, this.constructor.propTypes)), this.props.children);
47
25
  }
48
26
  }]);
49
27
  SecondaryNavBarButton.displayName = "SecondaryNavBarButton";
50
28
  return SecondaryNavBarButton;
51
- }(Component), _SecondaryNavBarButton.displayName = 'TopNavBarItem', _SecondaryNavBarButton.componentId = "Quizzes".concat(_SecondaryNavBarButton.displayName), _SecondaryNavBarButton.propTypes = {
29
+ }(Component);
30
+ _SecondaryNavBarButton = SecondaryNavBarButton;
31
+ SecondaryNavBarButton.displayName = 'TopNavBarItem';
32
+ SecondaryNavBarButton.componentId = "Quizzes".concat(_SecondaryNavBarButton.displayName);
33
+ SecondaryNavBarButton.propTypes = {
52
34
  children: PropTypes.string.isRequired,
53
- styles: PropTypes.object,
54
- makeStyles: PropTypes.func
55
- }, _SecondaryNavBarButton)) || _class);
35
+ styles: PropTypes.object
36
+ };
56
37
  export default SecondaryNavBarButton;
@@ -93,9 +93,6 @@ export var NavBar = (_dec = withStyleOverrides(generateStyle, generateComponentT
93
93
  desktopBottomBorderInverse: false
94
94
  } : {}),
95
95
  navLabel: t('Quizzes navigation bar'),
96
- desktopConfig: {
97
- hideActionsUserSeparator: true
98
- },
99
96
  smallViewportConfig: {
100
97
  dropdownMenuToggleButtonLabel: t('Toggle Menu'),
101
98
  dropdownMenuLabel: t('Main Menu')