@instructure/quiz-core 17.45.2-rc.3 → 17.46.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.
- package/CHANGELOG.md +16 -0
- package/es/building/api/quizzes.js +27 -24
- package/lib/building/api/quizzes.js +28 -24
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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
|
+
# [17.46.0](https://gerrit.instructure.com/quizzes-ui/compare/v17.45.1...v17.46.0) (2023-01-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **a11y:** add success message on changes to Settings page ([42ba9ae](https://gerrit.instructure.com/quizzes-ui/commits/42ba9ae12c3bfcb9b43e6f6b8c831677db16e57e))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **RCE5:** Added editorButtons into RCE5 ([a280b2f](https://gerrit.instructure.com/quizzes-ui/commits/a280b2f71a41ff7180abde7b21d83eb3c46da266))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [17.45.1](https://gerrit.instructure.com/quizzes-ui/compare/v17.45.0...v17.45.1) (2022-12-20)
|
|
7
23
|
|
|
8
24
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Map } from 'immutable';
|
|
2
|
+
import { noop } from 'lodash';
|
|
2
3
|
import { DO_NOTHING, NEW_QUIZ_ID, QUIZ_SAVE_CALL, PARENT_TYPE_BANK, PARENT_TYPE_QUIZ, PARENT_TYPE_QUIZ_SESSION } from '@instructure/quiz-common';
|
|
3
4
|
import Fetcher from "../../common/util/Fetcher.js";
|
|
4
5
|
import { getQTIInfo } from "./qtiImports.js";
|
|
@@ -134,6 +135,7 @@ export function interactionFileUpload(parentType, parentId, file, onSuccess, onE
|
|
|
134
135
|
// ====================================
|
|
135
136
|
|
|
136
137
|
function setQuizProperty(quizId, properties, action) {
|
|
138
|
+
var completeCb = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : noop;
|
|
137
139
|
var url = "/api/quizzes/".concat(quizId);
|
|
138
140
|
var body = JSON.stringify({
|
|
139
141
|
id: quizId,
|
|
@@ -153,85 +155,86 @@ function setQuizProperty(quizId, properties, action) {
|
|
|
153
155
|
|
|
154
156
|
return fetcher.patch(url, params).then(function (response) {
|
|
155
157
|
dispatch(handleQuizResponse(response));
|
|
158
|
+
completeCb();
|
|
156
159
|
});
|
|
157
160
|
};
|
|
158
161
|
}
|
|
159
162
|
|
|
160
|
-
export function setAllowClearMCSelection(quizId, value) {
|
|
163
|
+
export function setAllowClearMCSelection(quizId, value, completeCb) {
|
|
161
164
|
return setQuizProperty(quizId, {
|
|
162
165
|
allow_clear_mc_selection: Boolean(value)
|
|
163
|
-
}, changeQuizAllowClearMCSelection(quizId, value));
|
|
166
|
+
}, changeQuizAllowClearMCSelection(quizId, value), completeCb);
|
|
164
167
|
}
|
|
165
|
-
export function setQuizShuffleQuestions(quizId, value) {
|
|
168
|
+
export function setQuizShuffleQuestions(quizId, value, completeCb) {
|
|
166
169
|
return setQuizProperty(quizId, {
|
|
167
170
|
shuffle_questions: Boolean(value)
|
|
168
|
-
}, changeQuizShuffleQuestions(quizId, value));
|
|
171
|
+
}, changeQuizShuffleQuestions(quizId, value), completeCb);
|
|
169
172
|
}
|
|
170
|
-
export function setQuizShuffleAnswers(quizId, value) {
|
|
173
|
+
export function setQuizShuffleAnswers(quizId, value, completeCb) {
|
|
171
174
|
return setQuizProperty(quizId, {
|
|
172
175
|
shuffle_answers: Boolean(value)
|
|
173
|
-
}, changeQuizShuffleAnswers(quizId, value));
|
|
176
|
+
}, changeQuizShuffleAnswers(quizId, value), completeCb);
|
|
174
177
|
}
|
|
175
|
-
export function setRequireStudentAccessCode(quizId, value) {
|
|
178
|
+
export function setRequireStudentAccessCode(quizId, value, completeCb) {
|
|
176
179
|
return setQuizProperty(quizId, {
|
|
177
180
|
require_student_access_code: Boolean(value)
|
|
178
|
-
}, changeQuizRequireStudentAccessCode(quizId, value));
|
|
181
|
+
}, changeQuizRequireStudentAccessCode(quizId, value), completeCb);
|
|
179
182
|
}
|
|
180
183
|
export function setStudentAccessCodeUi(quizId, value) {
|
|
181
184
|
return function (dispatch, getState) {
|
|
182
185
|
dispatch(changeQuizStudentAccessCode(quizId, value));
|
|
183
186
|
};
|
|
184
187
|
}
|
|
185
|
-
export function setStudentAccessCodeApi(quizId, value) {
|
|
188
|
+
export function setStudentAccessCodeApi(quizId, value, completeCb) {
|
|
186
189
|
return setQuizProperty(quizId, {
|
|
187
190
|
student_access_code: value
|
|
188
|
-
}, null);
|
|
191
|
+
}, null, completeCb);
|
|
189
192
|
}
|
|
190
|
-
export function setOneAtATimeType(quizId, checked) {
|
|
193
|
+
export function setOneAtATimeType(quizId, checked, completeCb) {
|
|
191
194
|
var oneAtATimeType = checked ? 'question' : null;
|
|
192
195
|
return setQuizProperty(quizId, {
|
|
193
196
|
one_at_a_time_type: oneAtATimeType
|
|
194
|
-
}, changeQuizOneAtATimeType(quizId, oneAtATimeType));
|
|
197
|
+
}, changeQuizOneAtATimeType(quizId, oneAtATimeType), completeCb);
|
|
195
198
|
}
|
|
196
|
-
export function setBacktracking(quizId, value) {
|
|
199
|
+
export function setBacktracking(quizId, value, completeCb) {
|
|
197
200
|
return setQuizProperty(quizId, {
|
|
198
201
|
allow_backtracking: Boolean(value)
|
|
199
|
-
}, changeQuizAllowBacktracking(quizId, value));
|
|
202
|
+
}, changeQuizAllowBacktracking(quizId, value), completeCb);
|
|
200
203
|
}
|
|
201
|
-
export function setQuizHasTimeLimit(quizId, value) {
|
|
204
|
+
export function setQuizHasTimeLimit(quizId, value, completeCb) {
|
|
202
205
|
return setQuizProperty(quizId, {
|
|
203
206
|
has_time_limit: Boolean(value)
|
|
204
|
-
}, changeQuizHasTimeLimit(quizId, value));
|
|
207
|
+
}, changeQuizHasTimeLimit(quizId, value), completeCb);
|
|
205
208
|
}
|
|
206
209
|
export function setSessionTimeLimitInSecondsUi(quizId, value) {
|
|
207
210
|
return function (dispatch, getState) {
|
|
208
211
|
dispatch(changeSessionTimeLimitInSeconds(quizId, value));
|
|
209
212
|
};
|
|
210
213
|
}
|
|
211
|
-
export function setSessionTimeLimitInSecondsApi(quizId, value) {
|
|
214
|
+
export function setSessionTimeLimitInSecondsApi(quizId, value, completeCb) {
|
|
212
215
|
return setQuizProperty(quizId, {
|
|
213
216
|
session_time_limit_in_seconds: value
|
|
214
|
-
}, null);
|
|
217
|
+
}, null, completeCb);
|
|
215
218
|
}
|
|
216
|
-
export function setFilterIpAddress(quizId, value) {
|
|
219
|
+
export function setFilterIpAddress(quizId, value, completeCb) {
|
|
217
220
|
return setQuizProperty(quizId, {
|
|
218
221
|
filter_ip_address: Boolean(value)
|
|
219
|
-
}, changeQuizFilterIpAddress(quizId, value));
|
|
222
|
+
}, changeQuizFilterIpAddress(quizId, value), completeCb);
|
|
220
223
|
}
|
|
221
224
|
export function setIpFiltersUi(quizId, value) {
|
|
222
225
|
return function (dispatch, getState) {
|
|
223
226
|
dispatch(changeQuizIpFilters(quizId, value));
|
|
224
227
|
};
|
|
225
228
|
}
|
|
226
|
-
export function setIpFiltersApi(quizId, value) {
|
|
229
|
+
export function setIpFiltersApi(quizId, value, completeCb) {
|
|
227
230
|
return setQuizProperty(quizId, {
|
|
228
231
|
filters: {
|
|
229
232
|
ips: value
|
|
230
233
|
}
|
|
231
|
-
}, null);
|
|
234
|
+
}, null, completeCb);
|
|
232
235
|
}
|
|
233
|
-
export function setCalculatorType(quizId, value) {
|
|
236
|
+
export function setCalculatorType(quizId, value, completeCb) {
|
|
234
237
|
return setQuizProperty(quizId, {
|
|
235
238
|
calculator_type: value
|
|
236
|
-
}, changeQuizCalculatorType(quizId, value));
|
|
239
|
+
}, changeQuizCalculatorType(quizId, value), completeCb);
|
|
237
240
|
}
|
|
@@ -28,6 +28,8 @@ exports.setCalculatorType = setCalculatorType;
|
|
|
28
28
|
|
|
29
29
|
var _immutable = require("immutable");
|
|
30
30
|
|
|
31
|
+
var _lodash = require("lodash");
|
|
32
|
+
|
|
31
33
|
var _quizCommon = require("@instructure/quiz-common");
|
|
32
34
|
|
|
33
35
|
var _Fetcher = _interopRequireDefault(require("../../common/util/Fetcher.js"));
|
|
@@ -175,6 +177,7 @@ function interactionFileUpload(parentType, parentId, file, onSuccess, onError, u
|
|
|
175
177
|
|
|
176
178
|
|
|
177
179
|
function setQuizProperty(quizId, properties, action) {
|
|
180
|
+
var completeCb = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : _lodash.noop;
|
|
178
181
|
var url = "/api/quizzes/".concat(quizId);
|
|
179
182
|
var body = JSON.stringify({
|
|
180
183
|
id: quizId,
|
|
@@ -194,32 +197,33 @@ function setQuizProperty(quizId, properties, action) {
|
|
|
194
197
|
|
|
195
198
|
return fetcher.patch(url, params).then(function (response) {
|
|
196
199
|
dispatch((0, _callHandlers.handleQuizResponse)(response));
|
|
200
|
+
completeCb();
|
|
197
201
|
});
|
|
198
202
|
};
|
|
199
203
|
}
|
|
200
204
|
|
|
201
|
-
function setAllowClearMCSelection(quizId, value) {
|
|
205
|
+
function setAllowClearMCSelection(quizId, value, completeCb) {
|
|
202
206
|
return setQuizProperty(quizId, {
|
|
203
207
|
allow_clear_mc_selection: Boolean(value)
|
|
204
|
-
}, (0, _modifications.changeQuizAllowClearMCSelection)(quizId, value));
|
|
208
|
+
}, (0, _modifications.changeQuizAllowClearMCSelection)(quizId, value), completeCb);
|
|
205
209
|
}
|
|
206
210
|
|
|
207
|
-
function setQuizShuffleQuestions(quizId, value) {
|
|
211
|
+
function setQuizShuffleQuestions(quizId, value, completeCb) {
|
|
208
212
|
return setQuizProperty(quizId, {
|
|
209
213
|
shuffle_questions: Boolean(value)
|
|
210
|
-
}, (0, _modifications.changeQuizShuffleQuestions)(quizId, value));
|
|
214
|
+
}, (0, _modifications.changeQuizShuffleQuestions)(quizId, value), completeCb);
|
|
211
215
|
}
|
|
212
216
|
|
|
213
|
-
function setQuizShuffleAnswers(quizId, value) {
|
|
217
|
+
function setQuizShuffleAnswers(quizId, value, completeCb) {
|
|
214
218
|
return setQuizProperty(quizId, {
|
|
215
219
|
shuffle_answers: Boolean(value)
|
|
216
|
-
}, (0, _modifications.changeQuizShuffleAnswers)(quizId, value));
|
|
220
|
+
}, (0, _modifications.changeQuizShuffleAnswers)(quizId, value), completeCb);
|
|
217
221
|
}
|
|
218
222
|
|
|
219
|
-
function setRequireStudentAccessCode(quizId, value) {
|
|
223
|
+
function setRequireStudentAccessCode(quizId, value, completeCb) {
|
|
220
224
|
return setQuizProperty(quizId, {
|
|
221
225
|
require_student_access_code: Boolean(value)
|
|
222
|
-
}, (0, _modifications.changeQuizRequireStudentAccessCode)(quizId, value));
|
|
226
|
+
}, (0, _modifications.changeQuizRequireStudentAccessCode)(quizId, value), completeCb);
|
|
223
227
|
}
|
|
224
228
|
|
|
225
229
|
function setStudentAccessCodeUi(quizId, value) {
|
|
@@ -228,29 +232,29 @@ function setStudentAccessCodeUi(quizId, value) {
|
|
|
228
232
|
};
|
|
229
233
|
}
|
|
230
234
|
|
|
231
|
-
function setStudentAccessCodeApi(quizId, value) {
|
|
235
|
+
function setStudentAccessCodeApi(quizId, value, completeCb) {
|
|
232
236
|
return setQuizProperty(quizId, {
|
|
233
237
|
student_access_code: value
|
|
234
|
-
}, null);
|
|
238
|
+
}, null, completeCb);
|
|
235
239
|
}
|
|
236
240
|
|
|
237
|
-
function setOneAtATimeType(quizId, checked) {
|
|
241
|
+
function setOneAtATimeType(quizId, checked, completeCb) {
|
|
238
242
|
var oneAtATimeType = checked ? 'question' : null;
|
|
239
243
|
return setQuizProperty(quizId, {
|
|
240
244
|
one_at_a_time_type: oneAtATimeType
|
|
241
|
-
}, (0, _modifications.changeQuizOneAtATimeType)(quizId, oneAtATimeType));
|
|
245
|
+
}, (0, _modifications.changeQuizOneAtATimeType)(quizId, oneAtATimeType), completeCb);
|
|
242
246
|
}
|
|
243
247
|
|
|
244
|
-
function setBacktracking(quizId, value) {
|
|
248
|
+
function setBacktracking(quizId, value, completeCb) {
|
|
245
249
|
return setQuizProperty(quizId, {
|
|
246
250
|
allow_backtracking: Boolean(value)
|
|
247
|
-
}, (0, _modifications.changeQuizAllowBacktracking)(quizId, value));
|
|
251
|
+
}, (0, _modifications.changeQuizAllowBacktracking)(quizId, value), completeCb);
|
|
248
252
|
}
|
|
249
253
|
|
|
250
|
-
function setQuizHasTimeLimit(quizId, value) {
|
|
254
|
+
function setQuizHasTimeLimit(quizId, value, completeCb) {
|
|
251
255
|
return setQuizProperty(quizId, {
|
|
252
256
|
has_time_limit: Boolean(value)
|
|
253
|
-
}, (0, _modifications.changeQuizHasTimeLimit)(quizId, value));
|
|
257
|
+
}, (0, _modifications.changeQuizHasTimeLimit)(quizId, value), completeCb);
|
|
254
258
|
}
|
|
255
259
|
|
|
256
260
|
function setSessionTimeLimitInSecondsUi(quizId, value) {
|
|
@@ -259,16 +263,16 @@ function setSessionTimeLimitInSecondsUi(quizId, value) {
|
|
|
259
263
|
};
|
|
260
264
|
}
|
|
261
265
|
|
|
262
|
-
function setSessionTimeLimitInSecondsApi(quizId, value) {
|
|
266
|
+
function setSessionTimeLimitInSecondsApi(quizId, value, completeCb) {
|
|
263
267
|
return setQuizProperty(quizId, {
|
|
264
268
|
session_time_limit_in_seconds: value
|
|
265
|
-
}, null);
|
|
269
|
+
}, null, completeCb);
|
|
266
270
|
}
|
|
267
271
|
|
|
268
|
-
function setFilterIpAddress(quizId, value) {
|
|
272
|
+
function setFilterIpAddress(quizId, value, completeCb) {
|
|
269
273
|
return setQuizProperty(quizId, {
|
|
270
274
|
filter_ip_address: Boolean(value)
|
|
271
|
-
}, (0, _modifications.changeQuizFilterIpAddress)(quizId, value));
|
|
275
|
+
}, (0, _modifications.changeQuizFilterIpAddress)(quizId, value), completeCb);
|
|
272
276
|
}
|
|
273
277
|
|
|
274
278
|
function setIpFiltersUi(quizId, value) {
|
|
@@ -277,16 +281,16 @@ function setIpFiltersUi(quizId, value) {
|
|
|
277
281
|
};
|
|
278
282
|
}
|
|
279
283
|
|
|
280
|
-
function setIpFiltersApi(quizId, value) {
|
|
284
|
+
function setIpFiltersApi(quizId, value, completeCb) {
|
|
281
285
|
return setQuizProperty(quizId, {
|
|
282
286
|
filters: {
|
|
283
287
|
ips: value
|
|
284
288
|
}
|
|
285
|
-
}, null);
|
|
289
|
+
}, null, completeCb);
|
|
286
290
|
}
|
|
287
291
|
|
|
288
|
-
function setCalculatorType(quizId, value) {
|
|
292
|
+
function setCalculatorType(quizId, value, completeCb) {
|
|
289
293
|
return setQuizProperty(quizId, {
|
|
290
294
|
calculator_type: value
|
|
291
|
-
}, (0, _modifications.changeQuizCalculatorType)(quizId, value));
|
|
295
|
+
}, (0, _modifications.changeQuizCalculatorType)(quizId, value), completeCb);
|
|
292
296
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/quiz-core",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.46.0",
|
|
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.
|
|
45
|
-
"@instructure/quiz-i18n": "17.
|
|
46
|
-
"@instructure/quiz-interactions": "17.
|
|
47
|
-
"@instructure/quiz-number-input": "17.
|
|
48
|
-
"@instructure/quiz-rce": "17.
|
|
44
|
+
"@instructure/quiz-common": "^17.46.0",
|
|
45
|
+
"@instructure/quiz-i18n": "^17.46.0",
|
|
46
|
+
"@instructure/quiz-interactions": "^17.46.0",
|
|
47
|
+
"@instructure/quiz-number-input": "^17.46.0",
|
|
48
|
+
"@instructure/quiz-rce": "^17.46.0",
|
|
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.
|
|
109
|
+
"instructure-validations": "^17.46.0",
|
|
110
110
|
"ipaddr.js": "^1.5.4",
|
|
111
111
|
"isomorphic-fetch": "^2.2.0",
|
|
112
112
|
"isuuid": "^0.1.0",
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
"uuid": "^3.2.1"
|
|
138
138
|
},
|
|
139
139
|
"devDependencies": {
|
|
140
|
-
"@instructure/quiz-scripts": "17.
|
|
140
|
+
"@instructure/quiz-scripts": "^17.46.0",
|
|
141
141
|
"@instructure/ui-axe-check": "^7.20.0",
|
|
142
142
|
"@instructure/ui-babel-preset": "^7.20.0",
|
|
143
143
|
"@instructure/ui-karma-config": "^7.20.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.
|
|
159
|
+
"quiz-presets": "^17.46.0",
|
|
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": "8df1f2a9ae06d50e029393737e47866f7f1821ee"
|
|
176
176
|
}
|