@instructure/quiz-core 17.49.1-rc.3 → 17.49.1-rc.5
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.
- package/es/common/actions/grading.js +13 -0
- package/es/common/components/RceConfigProvider/presenter.js +7 -1
- package/es/common/components/RceConfigProvider/rceConfigMapper.js +11 -3
- package/es/common/components/RceConfigProvider/rceConfigUtils.js +3 -0
- package/es/common/components/SDKApp/index.js +11 -0
- package/es/common/reducers/grading.js +17 -0
- package/es/configureStore.js +2 -0
- package/es/index.js +1 -0
- package/lib/common/actions/grading.js +23 -0
- package/lib/common/components/RceConfigProvider/presenter.js +7 -1
- package/lib/common/components/RceConfigProvider/rceConfigMapper.js +10 -2
- package/lib/common/components/RceConfigProvider/rceConfigUtils.js +7 -1
- package/lib/common/components/SDKApp/index.js +12 -0
- package/lib/common/reducers/grading.js +28 -0
- package/lib/configureStore.js +3 -0
- package/lib/index.js +9 -0
- package/package.json +9 -9
|
@@ -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
|
+
}
|
|
@@ -67,6 +67,7 @@ var RceConfigProviderComponent = function RceConfigProviderComponent(_ref2) {
|
|
|
67
67
|
contextId = _ref2.contextId,
|
|
68
68
|
contextType = _ref2.contextType,
|
|
69
69
|
canvasUserId = _ref2.canvasUserId,
|
|
70
|
+
canvasToolId = _ref2.canvasToolId,
|
|
70
71
|
rcsHost = _ref2.rcsHost,
|
|
71
72
|
rcsJwt = _ref2.rcsJwt,
|
|
72
73
|
rcsJwtRefreshFn = _ref2.rcsJwtRefreshFn,
|
|
@@ -101,6 +102,9 @@ var RceConfigProviderComponent = function RceConfigProviderComponent(_ref2) {
|
|
|
101
102
|
isNewRCERendererEnabled: isNewRCERendererEnabled,
|
|
102
103
|
isNewRCEAppsEnabled: isNewRCEAppsEnabled
|
|
103
104
|
};
|
|
105
|
+
var ltiAppParams = {
|
|
106
|
+
canvasToolId: canvasToolId
|
|
107
|
+
};
|
|
104
108
|
var rendererParams = {
|
|
105
109
|
canvasOrigin: canvasOrigin
|
|
106
110
|
};
|
|
@@ -169,7 +173,7 @@ var RceConfigProviderComponent = function RceConfigProviderComponent(_ref2) {
|
|
|
169
173
|
}
|
|
170
174
|
|
|
171
175
|
return /*#__PURE__*/React.createElement(RceConfigContext.Provider, {
|
|
172
|
-
value: mapParamsToRceConfigContext(flags, rcsParams, rendererParams, canvasConfig)
|
|
176
|
+
value: mapParamsToRceConfigContext(flags, rcsParams, rendererParams, canvasConfig, ltiAppParams)
|
|
173
177
|
}, children);
|
|
174
178
|
};
|
|
175
179
|
|
|
@@ -181,6 +185,7 @@ RceConfigProviderComponent.propTypes = {
|
|
|
181
185
|
contextId: PropTypes.string,
|
|
182
186
|
contextType: PropTypes.string,
|
|
183
187
|
canvasUserId: PropTypes.string,
|
|
188
|
+
canvasToolId: PropTypes.string,
|
|
184
189
|
rcsHost: PropTypes.string,
|
|
185
190
|
rcsJwt: PropTypes.string,
|
|
186
191
|
rcsJwtRefreshFn: PropTypes.func,
|
|
@@ -190,6 +195,7 @@ RceConfigProviderComponent.defaultProps = {
|
|
|
190
195
|
contextId: null,
|
|
191
196
|
contextType: null,
|
|
192
197
|
canvasUserId: null,
|
|
198
|
+
canvasToolId: null,
|
|
193
199
|
rcsHost: null,
|
|
194
200
|
rcsJwt: null,
|
|
195
201
|
rcsJwtRefreshFn: null,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import { RceConfigKeys } from '@instructure/quiz-common';
|
|
3
|
-
import { hasAllPropsForRcs } from "./rceConfigUtils.js";
|
|
3
|
+
import { hasAllPropsForRcs, areLtiAppsConfigured } from "./rceConfigUtils.js";
|
|
4
4
|
|
|
5
5
|
var mapFeatureFlags = function mapFeatureFlags(flags) {
|
|
6
6
|
var _ref;
|
|
@@ -18,14 +18,22 @@ var mapRcs = function mapRcs(rcsParams, canvasConfig) {
|
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
+
var mapLtiApps = function mapLtiApps(flags, canvasConfig, ltiAppParams) {
|
|
22
|
+
var _ref3;
|
|
23
|
+
|
|
24
|
+
if (!areLtiAppsConfigured(flags, canvasConfig, ltiAppParams)) return null;
|
|
25
|
+
return _ref3 = {}, _defineProperty(_ref3, RceConfigKeys.canvasToolId, ltiAppParams.canvasToolId), _defineProperty(_ref3, RceConfigKeys.editorButtons, canvasConfig.editorButtons), _ref3;
|
|
26
|
+
};
|
|
27
|
+
|
|
21
28
|
var rendererEnhancement = function rendererEnhancement(rendererParams) {
|
|
22
29
|
return _defineProperty({}, RceConfigKeys.canvasOrigin, (rendererParams === null || rendererParams === void 0 ? void 0 : rendererParams.canvasOrigin) || null);
|
|
23
30
|
};
|
|
24
31
|
|
|
25
|
-
export var mapParamsToRceConfigContext = function mapParamsToRceConfigContext(flags, rcsParams, rendererParams, canvasConfig) {
|
|
32
|
+
export var mapParamsToRceConfigContext = function mapParamsToRceConfigContext(flags, rcsParams, rendererParams, canvasConfig, ltiAppParams) {
|
|
26
33
|
return {
|
|
27
34
|
featureFlags: mapFeatureFlags(flags),
|
|
28
35
|
rcs: mapRcs(rcsParams, canvasConfig),
|
|
29
|
-
rendererEnhancement: rendererEnhancement(rendererParams)
|
|
36
|
+
rendererEnhancement: rendererEnhancement(rendererParams),
|
|
37
|
+
ltiApps: mapLtiApps(flags, canvasConfig, ltiAppParams)
|
|
30
38
|
};
|
|
31
39
|
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export var hasAllPropsForRcs = function hasAllPropsForRcs(rcsParams) {
|
|
2
2
|
return !!((rcsParams === null || rcsParams === void 0 ? void 0 : rcsParams.contextId) && (rcsParams === null || rcsParams === void 0 ? void 0 : rcsParams.contextType) && (rcsParams === null || rcsParams === void 0 ? void 0 : rcsParams.canvasUserId) && (rcsParams === null || rcsParams === void 0 ? void 0 : rcsParams.rcsHost) && (rcsParams === null || rcsParams === void 0 ? void 0 : rcsParams.refreshToken) && (rcsParams === null || rcsParams === void 0 ? void 0 : rcsParams.jwt));
|
|
3
3
|
};
|
|
4
|
+
export var areLtiAppsConfigured = function areLtiAppsConfigured(flags, canvasConfig, ltiAppParams) {
|
|
5
|
+
return !!((flags === null || flags === void 0 ? void 0 : flags.isNewRCEAppsEnabled) && (ltiAppParams === null || ltiAppParams === void 0 ? void 0 : ltiAppParams.canvasToolId) && (canvasConfig === null || canvasConfig === void 0 ? void 0 : canvasConfig.editorButtons) && Array.isArray(canvasConfig.editorButtons) && canvasConfig.editorButtons.length > 0);
|
|
6
|
+
};
|
|
4
7
|
export var isRce5Disabled = function isRce5Disabled(flags) {
|
|
5
8
|
return !(flags === null || flags === void 0 ? void 0 : flags.isNewRCEEnabled) && !(flags === null || flags === void 0 ? void 0 : flags.isNewRCERendererEnabled);
|
|
6
9
|
};
|
|
@@ -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
|
+
});
|
package/es/configureStore.js
CHANGED
|
@@ -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
|
+
}
|
|
@@ -90,6 +90,7 @@ var RceConfigProviderComponent = function RceConfigProviderComponent(_ref2) {
|
|
|
90
90
|
contextId = _ref2.contextId,
|
|
91
91
|
contextType = _ref2.contextType,
|
|
92
92
|
canvasUserId = _ref2.canvasUserId,
|
|
93
|
+
canvasToolId = _ref2.canvasToolId,
|
|
93
94
|
rcsHost = _ref2.rcsHost,
|
|
94
95
|
rcsJwt = _ref2.rcsJwt,
|
|
95
96
|
rcsJwtRefreshFn = _ref2.rcsJwtRefreshFn,
|
|
@@ -124,6 +125,9 @@ var RceConfigProviderComponent = function RceConfigProviderComponent(_ref2) {
|
|
|
124
125
|
isNewRCERendererEnabled: isNewRCERendererEnabled,
|
|
125
126
|
isNewRCEAppsEnabled: isNewRCEAppsEnabled
|
|
126
127
|
};
|
|
128
|
+
var ltiAppParams = {
|
|
129
|
+
canvasToolId: canvasToolId
|
|
130
|
+
};
|
|
127
131
|
var rendererParams = {
|
|
128
132
|
canvasOrigin: canvasOrigin
|
|
129
133
|
};
|
|
@@ -192,7 +196,7 @@ var RceConfigProviderComponent = function RceConfigProviderComponent(_ref2) {
|
|
|
192
196
|
}
|
|
193
197
|
|
|
194
198
|
return /*#__PURE__*/_react.default.createElement(_quizCommon.RceConfigContext.Provider, {
|
|
195
|
-
value: (0, _rceConfigMapper.mapParamsToRceConfigContext)(flags, rcsParams, rendererParams, canvasConfig)
|
|
199
|
+
value: (0, _rceConfigMapper.mapParamsToRceConfigContext)(flags, rcsParams, rendererParams, canvasConfig, ltiAppParams)
|
|
196
200
|
}, children);
|
|
197
201
|
};
|
|
198
202
|
|
|
@@ -204,6 +208,7 @@ RceConfigProviderComponent.propTypes = {
|
|
|
204
208
|
contextId: _propTypes.default.string,
|
|
205
209
|
contextType: _propTypes.default.string,
|
|
206
210
|
canvasUserId: _propTypes.default.string,
|
|
211
|
+
canvasToolId: _propTypes.default.string,
|
|
207
212
|
rcsHost: _propTypes.default.string,
|
|
208
213
|
rcsJwt: _propTypes.default.string,
|
|
209
214
|
rcsJwtRefreshFn: _propTypes.default.func,
|
|
@@ -213,6 +218,7 @@ RceConfigProviderComponent.defaultProps = {
|
|
|
213
218
|
contextId: null,
|
|
214
219
|
contextType: null,
|
|
215
220
|
canvasUserId: null,
|
|
221
|
+
canvasToolId: null,
|
|
216
222
|
rcsHost: null,
|
|
217
223
|
rcsJwt: null,
|
|
218
224
|
rcsJwtRefreshFn: null,
|
|
@@ -29,15 +29,23 @@ var mapRcs = function mapRcs(rcsParams, canvasConfig) {
|
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
+
var mapLtiApps = function mapLtiApps(flags, canvasConfig, ltiAppParams) {
|
|
33
|
+
var _ref3;
|
|
34
|
+
|
|
35
|
+
if (!(0, _rceConfigUtils.areLtiAppsConfigured)(flags, canvasConfig, ltiAppParams)) return null;
|
|
36
|
+
return _ref3 = {}, (0, _defineProperty2.default)(_ref3, _quizCommon.RceConfigKeys.canvasToolId, ltiAppParams.canvasToolId), (0, _defineProperty2.default)(_ref3, _quizCommon.RceConfigKeys.editorButtons, canvasConfig.editorButtons), _ref3;
|
|
37
|
+
};
|
|
38
|
+
|
|
32
39
|
var rendererEnhancement = function rendererEnhancement(rendererParams) {
|
|
33
40
|
return (0, _defineProperty2.default)({}, _quizCommon.RceConfigKeys.canvasOrigin, (rendererParams === null || rendererParams === void 0 ? void 0 : rendererParams.canvasOrigin) || null);
|
|
34
41
|
};
|
|
35
42
|
|
|
36
|
-
var mapParamsToRceConfigContext = function mapParamsToRceConfigContext(flags, rcsParams, rendererParams, canvasConfig) {
|
|
43
|
+
var mapParamsToRceConfigContext = function mapParamsToRceConfigContext(flags, rcsParams, rendererParams, canvasConfig, ltiAppParams) {
|
|
37
44
|
return {
|
|
38
45
|
featureFlags: mapFeatureFlags(flags),
|
|
39
46
|
rcs: mapRcs(rcsParams, canvasConfig),
|
|
40
|
-
rendererEnhancement: rendererEnhancement(rendererParams)
|
|
47
|
+
rendererEnhancement: rendererEnhancement(rendererParams),
|
|
48
|
+
ltiApps: mapLtiApps(flags, canvasConfig, ltiAppParams)
|
|
41
49
|
};
|
|
42
50
|
};
|
|
43
51
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.isRce5Disabled = exports.hasAllPropsForRcs = void 0;
|
|
6
|
+
exports.isRce5Disabled = exports.areLtiAppsConfigured = exports.hasAllPropsForRcs = void 0;
|
|
7
7
|
|
|
8
8
|
var hasAllPropsForRcs = function hasAllPropsForRcs(rcsParams) {
|
|
9
9
|
return !!((rcsParams === null || rcsParams === void 0 ? void 0 : rcsParams.contextId) && (rcsParams === null || rcsParams === void 0 ? void 0 : rcsParams.contextType) && (rcsParams === null || rcsParams === void 0 ? void 0 : rcsParams.canvasUserId) && (rcsParams === null || rcsParams === void 0 ? void 0 : rcsParams.rcsHost) && (rcsParams === null || rcsParams === void 0 ? void 0 : rcsParams.refreshToken) && (rcsParams === null || rcsParams === void 0 ? void 0 : rcsParams.jwt));
|
|
@@ -11,6 +11,12 @@ var hasAllPropsForRcs = function hasAllPropsForRcs(rcsParams) {
|
|
|
11
11
|
|
|
12
12
|
exports.hasAllPropsForRcs = hasAllPropsForRcs;
|
|
13
13
|
|
|
14
|
+
var areLtiAppsConfigured = function areLtiAppsConfigured(flags, canvasConfig, ltiAppParams) {
|
|
15
|
+
return !!((flags === null || flags === void 0 ? void 0 : flags.isNewRCEAppsEnabled) && (ltiAppParams === null || ltiAppParams === void 0 ? void 0 : ltiAppParams.canvasToolId) && (canvasConfig === null || canvasConfig === void 0 ? void 0 : canvasConfig.editorButtons) && Array.isArray(canvasConfig.editorButtons) && canvasConfig.editorButtons.length > 0);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
exports.areLtiAppsConfigured = areLtiAppsConfigured;
|
|
19
|
+
|
|
14
20
|
var isRce5Disabled = function isRce5Disabled(flags) {
|
|
15
21
|
return !(flags === null || flags === void 0 ? void 0 : flags.isNewRCEEnabled) && !(flags === null || flags === void 0 ? void 0 : flags.isNewRCERendererEnabled);
|
|
16
22
|
};
|
|
@@ -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;
|
package/lib/configureStore.js
CHANGED
|
@@ -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
|
+
"version": "17.49.1-rc.5+64019c505",
|
|
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.
|
|
45
|
-
"@instructure/quiz-i18n": "17.49.1-rc.
|
|
46
|
-
"@instructure/quiz-interactions": "17.49.1-rc.
|
|
47
|
-
"@instructure/quiz-number-input": "17.49.1-rc.
|
|
48
|
-
"@instructure/quiz-rce": "17.49.1-rc.
|
|
44
|
+
"@instructure/quiz-common": "17.49.1-rc.5+64019c505",
|
|
45
|
+
"@instructure/quiz-i18n": "17.49.1-rc.5+64019c505",
|
|
46
|
+
"@instructure/quiz-interactions": "17.49.1-rc.5+64019c505",
|
|
47
|
+
"@instructure/quiz-number-input": "17.49.1-rc.5+64019c505",
|
|
48
|
+
"@instructure/quiz-rce": "17.49.1-rc.5+64019c505",
|
|
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.
|
|
109
|
+
"instructure-validations": "17.49.1-rc.5+64019c505",
|
|
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.
|
|
159
|
+
"quiz-presets": "17.49.1-rc.5+64019c505",
|
|
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": "
|
|
175
|
+
"gitHead": "64019c505076e70430601ccbed94f7a94898ca21"
|
|
176
176
|
}
|