@instructure/quiz-core 17.49.1-rc.3 → 17.49.1-rc.4

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.
@@ -0,0 +1,13 @@
1
+ import { GRADE_BY_QUESTION_ENABLED, GBQ_SET_ACTIVE_ITEM } from '@instructure/quiz-common';
2
+ export function setGradeByQuestionEnabled(enabled) {
3
+ return {
4
+ type: GRADE_BY_QUESTION_ENABLED,
5
+ payload: enabled
6
+ };
7
+ }
8
+ export function setActiveItem(itemId) {
9
+ return {
10
+ type: GBQ_SET_ACTIVE_ITEM,
11
+ payload: itemId
12
+ };
13
+ }
@@ -21,6 +21,7 @@ import { set } from "../../actions/ui.js";
21
21
  import { setAPIEndpoint, setCanvasOrigin, setUserToken } from "../../actions/config.js";
22
22
  import { setContextUuid, setOutcomesEndpoint, setOutcomesToken } from "../../actions/outcomes.js";
23
23
  import { addFeatures, removeFeatures } from "../../actions/features.js";
24
+ import { setGradeByQuestionEnabled } from "../../actions/grading.js";
24
25
  import renderAlerts from "../../util/renderAlerts.js";
25
26
  var styles = {
26
27
  componentId: 'fzweS',
@@ -85,6 +86,10 @@ export var SDKApp = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
85
86
  if (this.props.itemBankSharingEnabled) {
86
87
  this.store.dispatch(addFeatures('item_bank_sharing'));
87
88
  }
89
+
90
+ if (this.props.gradeByQuestionEnabled !== null) {
91
+ this.store.dispatch(setGradeByQuestionEnabled(this.props.gradeByQuestionEnabled));
92
+ }
88
93
  }
89
94
  }, {
90
95
  key: "componentDidMount",
@@ -130,6 +135,10 @@ export var SDKApp = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
130
135
  var toggleFeature = newProps.itemBankSharingEnabled ? addFeatures : removeFeatures;
131
136
  this.store.dispatch(toggleFeature('item_bank_sharing'));
132
137
  }
138
+
139
+ if (newProps.gradeByQuestionEnabled !== this.props.gradeByQuestionEnabled && this.props.gradeByQuestionEnabled !== null) {
140
+ this.store.dispatch(setGradeByQuestionEnabled(newProps.gradeByQuestionEnabled));
141
+ }
133
142
  }
134
143
  }, {
135
144
  key: "render",
@@ -156,6 +165,7 @@ export var SDKApp = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
156
165
  appContainer: CustomPropTypes.selectors.isRequired,
157
166
  children: PropTypes.node.isRequired,
158
167
  contextUuid: PropTypes.string,
168
+ gradeByQuestionEnabled: PropTypes.bool,
159
169
  itemBankSharingEnabled: PropTypes.bool,
160
170
  // ESLint seems to this the "locale" prop is unused even though it definitely is
161
171
  locale: PropTypes.string,
@@ -182,6 +192,7 @@ export var SDKApp = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
182
192
  locale: PropTypes.string
183
193
  }, _class2.defaultProps = {
184
194
  contextUuid: '',
195
+ gradeByQuestionEnabled: null,
185
196
  itemBankSharingEnabled: false,
186
197
  locale: null,
187
198
  outcomesEndpoint: null,
@@ -0,0 +1,17 @@
1
+ import { fromJS } from 'immutable';
2
+ import { GRADE_BY_QUESTION_ENABLED, GBQ_SET_ACTIVE_ITEM } from '@instructure/quiz-common';
3
+ export default (function () {
4
+ var state = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : fromJS({});
5
+ var action = arguments.length > 1 ? arguments[1] : void 0;
6
+
7
+ switch (action.type) {
8
+ case GRADE_BY_QUESTION_ENABLED:
9
+ return state.set('gradeByQuestionEnabled', action.payload);
10
+
11
+ case GBQ_SET_ACTIVE_ITEM:
12
+ return state.set('activeItemId', action.payload);
13
+
14
+ default:
15
+ return state;
16
+ }
17
+ });
@@ -19,6 +19,7 @@ import configReducer from "./common/reducers/config.js";
19
19
  import editing from "./common/reducers/editing.js";
20
20
  import errorsShowing from "./common/reducers/errorsShowing.js";
21
21
  import features from "./common/reducers/features.js";
22
+ import grading from "./common/reducers/grading.js";
22
23
  import interactionTypes from "./common/reducers/interactionTypes.js";
23
24
  import items from "./common/reducers/items.js";
24
25
  import modal from "./common/reducers/modal.js";
@@ -87,6 +88,7 @@ export function configureStore(_ref) {
87
88
  editing: editing,
88
89
  errorsShowing: errorsShowing,
89
90
  features: features,
91
+ grading: grading,
90
92
  interactionTypes: interactionTypes,
91
93
  items: items,
92
94
  modal: modal,
package/es/index.js CHANGED
@@ -108,6 +108,7 @@ export { takingApiActions }; // Actions
108
108
 
109
109
  export { addSuccess, addInfo, addError, screenreaderNotification, removeAlert } from "./common/actions/alerts.js";
110
110
  export { openModal, closeModal } from "./common/actions/modal.js";
111
+ export { setGradeByQuestionEnabled } from "./common/actions/grading.js";
111
112
  export { setRegradingPayload, setScoreReconciliation, toggleRegradingEditMode } from "./common/actions/regrading.js";
112
113
  export { showError, hideError, clearErrorsShowing } from "./common/actions/errorsShowing.js";
113
114
  export { changeItemState, changeQuizEntryPoints, changeQuizEntryProperties, clearModifications, moveTemporaryQuizEntry, changeQuizOutcomeAlignmentSetGuid, changeFudgePoints, sessionItemResultsModification } from "./common/actions/modifications.js";
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.setGradeByQuestionEnabled = setGradeByQuestionEnabled;
7
+ exports.setActiveItem = setActiveItem;
8
+
9
+ var _quizCommon = require("@instructure/quiz-common");
10
+
11
+ function setGradeByQuestionEnabled(enabled) {
12
+ return {
13
+ type: _quizCommon.GRADE_BY_QUESTION_ENABLED,
14
+ payload: enabled
15
+ };
16
+ }
17
+
18
+ function setActiveItem(itemId) {
19
+ return {
20
+ type: _quizCommon.GBQ_SET_ACTIVE_ITEM,
21
+ payload: itemId
22
+ };
23
+ }
@@ -43,6 +43,8 @@ var _outcomes = require("../../actions/outcomes.js");
43
43
 
44
44
  var _features = require("../../actions/features.js");
45
45
 
46
+ var _grading = require("../../actions/grading.js");
47
+
46
48
  var _renderAlerts = _interopRequireDefault(require("../../util/renderAlerts.js"));
47
49
 
48
50
  var _theme = _interopRequireDefault(require("./theme.js"));
@@ -115,6 +117,10 @@ var SDKApp = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_
115
117
  if (this.props.itemBankSharingEnabled) {
116
118
  this.store.dispatch((0, _features.addFeatures)('item_bank_sharing'));
117
119
  }
120
+
121
+ if (this.props.gradeByQuestionEnabled !== null) {
122
+ this.store.dispatch((0, _grading.setGradeByQuestionEnabled)(this.props.gradeByQuestionEnabled));
123
+ }
118
124
  }
119
125
  }, {
120
126
  key: "componentDidMount",
@@ -160,6 +166,10 @@ var SDKApp = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_
160
166
  var toggleFeature = newProps.itemBankSharingEnabled ? _features.addFeatures : _features.removeFeatures;
161
167
  this.store.dispatch(toggleFeature('item_bank_sharing'));
162
168
  }
169
+
170
+ if (newProps.gradeByQuestionEnabled !== this.props.gradeByQuestionEnabled && this.props.gradeByQuestionEnabled !== null) {
171
+ this.store.dispatch((0, _grading.setGradeByQuestionEnabled)(newProps.gradeByQuestionEnabled));
172
+ }
163
173
  }
164
174
  }, {
165
175
  key: "render",
@@ -185,6 +195,7 @@ var SDKApp = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_
185
195
  appContainer: _CustomPropTypes.default.selectors.isRequired,
186
196
  children: _propTypes.default.node.isRequired,
187
197
  contextUuid: _propTypes.default.string,
198
+ gradeByQuestionEnabled: _propTypes.default.bool,
188
199
  itemBankSharingEnabled: _propTypes.default.bool,
189
200
  // ESLint seems to this the "locale" prop is unused even though it definitely is
190
201
  locale: _propTypes.default.string,
@@ -211,6 +222,7 @@ var SDKApp = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_
211
222
  locale: _propTypes.default.string
212
223
  }, _class2.defaultProps = {
213
224
  contextUuid: '',
225
+ gradeByQuestionEnabled: null,
214
226
  itemBankSharingEnabled: false,
215
227
  locale: null,
216
228
  outcomesEndpoint: null,
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _immutable = require("immutable");
9
+
10
+ var _quizCommon = require("@instructure/quiz-common");
11
+
12
+ var _default = function _default() {
13
+ var state = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : (0, _immutable.fromJS)({});
14
+ var action = arguments.length > 1 ? arguments[1] : void 0;
15
+
16
+ switch (action.type) {
17
+ case _quizCommon.GRADE_BY_QUESTION_ENABLED:
18
+ return state.set('gradeByQuestionEnabled', action.payload);
19
+
20
+ case _quizCommon.GBQ_SET_ACTIVE_ITEM:
21
+ return state.set('activeItemId', action.payload);
22
+
23
+ default:
24
+ return state;
25
+ }
26
+ };
27
+
28
+ exports.default = _default;
@@ -46,6 +46,8 @@ var _errorsShowing = _interopRequireDefault(require("./common/reducers/errorsSho
46
46
 
47
47
  var _features = _interopRequireDefault(require("./common/reducers/features.js"));
48
48
 
49
+ var _grading = _interopRequireDefault(require("./common/reducers/grading.js"));
50
+
49
51
  var _interactionTypes = _interopRequireDefault(require("./common/reducers/interactionTypes.js"));
50
52
 
51
53
  var _items = _interopRequireDefault(require("./common/reducers/items.js"));
@@ -144,6 +146,7 @@ function configureStore(_ref) {
144
146
  editing: _editing.default,
145
147
  errorsShowing: _errorsShowing.default,
146
148
  features: _features.default,
149
+ grading: _grading.default,
147
150
  interactionTypes: _interactionTypes.default,
148
151
  items: _items.default,
149
152
  modal: _modal.default,
package/lib/index.js CHANGED
@@ -147,6 +147,7 @@ var _exportNames = {
147
147
  openModal: true,
148
148
  closeModal: true,
149
149
  modalActions: true,
150
+ setGradeByQuestionEnabled: true,
150
151
  setRegradingPayload: true,
151
152
  setScoreReconciliation: true,
152
153
  toggleRegradingEditMode: true,
@@ -1031,6 +1032,12 @@ Object.defineProperty(exports, "closeModal", {
1031
1032
  return modalActions.closeModal;
1032
1033
  }
1033
1034
  });
1035
+ Object.defineProperty(exports, "setGradeByQuestionEnabled", {
1036
+ enumerable: true,
1037
+ get: function get() {
1038
+ return _grading.setGradeByQuestionEnabled;
1039
+ }
1040
+ });
1034
1041
  Object.defineProperty(exports, "setRegradingPayload", {
1035
1042
  enumerable: true,
1036
1043
  get: function get() {
@@ -1525,6 +1532,8 @@ var modalActions = _interopRequireWildcard(require("./common/actions/modal.js"))
1525
1532
 
1526
1533
  exports.modalActions = modalActions;
1527
1534
 
1535
+ var _grading = require("./common/actions/grading.js");
1536
+
1528
1537
  var _regrading = require("./common/actions/regrading.js");
1529
1538
 
1530
1539
  var _errorsShowing = require("./common/actions/errorsShowing.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/quiz-core",
3
- "version": "17.49.1-rc.3+a4de252c9",
3
+ "version": "17.49.1-rc.4+4edda9558",
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.49.1-rc.3+a4de252c9",
45
- "@instructure/quiz-i18n": "17.49.1-rc.3+a4de252c9",
46
- "@instructure/quiz-interactions": "17.49.1-rc.3+a4de252c9",
47
- "@instructure/quiz-number-input": "17.49.1-rc.3+a4de252c9",
48
- "@instructure/quiz-rce": "17.49.1-rc.3+a4de252c9",
44
+ "@instructure/quiz-common": "17.49.1-rc.4+4edda9558",
45
+ "@instructure/quiz-i18n": "17.49.1-rc.4+4edda9558",
46
+ "@instructure/quiz-interactions": "17.49.1-rc.4+4edda9558",
47
+ "@instructure/quiz-number-input": "17.49.1-rc.4+4edda9558",
48
+ "@instructure/quiz-rce": "17.49.1-rc.4+4edda9558",
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.49.1-rc.3+a4de252c9",
109
+ "instructure-validations": "17.49.1-rc.4+4edda9558",
110
110
  "ipaddr.js": "^1.5.4",
111
111
  "isomorphic-fetch": "^2.2.0",
112
112
  "isuuid": "^0.1.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.49.1-rc.3+a4de252c9",
159
+ "quiz-presets": "17.49.1-rc.4+4edda9558",
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": "a4de252c94030c31928e3fd8d2ea5ccb01548dce"
175
+ "gitHead": "4edda9558c107916281346c7a8f5de4c29352425"
176
176
  }