@instructure/quiz-core 20.18.1-rc.1 → 20.19.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
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [20.19.0](https://gerrit.instructure.com/quizzes-ui/compare/v20.18.0...v20.19.0) (2024-10-01)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* check 'add_time_to_existing_quiz_sessions' only on SET_WS_TOKEN action ([2937efc](https://gerrit.instructure.com/quizzes-ui/commits/2937efc1fed97381567c711156370de5fb0a7375))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **instfs_links:** fix issue where bank entries... ([70dd69c](https://gerrit.instructure.com/quizzes-ui/commits/70dd69c4d96b54c29d5adb229c7d6b7dad4f602c))
|
|
17
|
+
* **instfs_links:** Shift bank entry copy to use the all in one endpoint ([392e66e](https://gerrit.instructure.com/quizzes-ui/commits/392e66e66be84e073171f29b85edaf54330b3b8f))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
6
23
|
# [20.18.0](https://gerrit.instructure.com/quizzes-ui/compare/v20.17.2...v20.18.0) (2024-09-26)
|
|
7
24
|
|
|
8
25
|
|
|
@@ -14,8 +14,9 @@ export var handleExtraTime = function handleExtraTime(extraTimeInSeconds, endAt,
|
|
|
14
14
|
var remainingTimeInMs = new Date(endAt) - Date.now();
|
|
15
15
|
var remainingTimeInSeconds = Math.floor(remainingTimeInMs / 1000);
|
|
16
16
|
var formattedExtraTimeText = formatTime(extraTimeInSeconds);
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
var isUnlimited = endAt === null && extraTimeInSeconds === null;
|
|
18
|
+
updateTimeAction(remainingTimeInSeconds, !isUnlimited);
|
|
19
|
+
notifyTimeAdded(!isUnlimited, !isUnlimited ? formattedExtraTimeText : null);
|
|
19
20
|
};
|
|
20
21
|
export var parseJwt = function parseJwt(token) {
|
|
21
22
|
try {
|
|
@@ -43,14 +44,13 @@ export var handleWebSocketMessage = function handleWebSocketMessage(webSocketMes
|
|
|
43
44
|
return;
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
var
|
|
47
|
-
var end_at = webSocketMessageData.end_at;
|
|
47
|
+
var type = webSocketMessageData.type;
|
|
48
48
|
|
|
49
|
-
if (
|
|
49
|
+
if (type !== 'accommodation_changed') {
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
handleExtraTimeFn(extra_time_in_seconds, end_at, boundTakingApiActions.updateTime, boundTakingApiActions.notifyTimeAdded);
|
|
53
|
+
handleExtraTimeFn(webSocketMessageData.extra_time_in_seconds, webSocketMessageData.end_at, boundTakingApiActions.updateTime, boundTakingApiActions.notifyTimeAdded);
|
|
54
54
|
};
|
|
55
55
|
export var createQuizTimerWebSocketMiddleware = function createQuizTimerWebSocketMiddleware() {
|
|
56
56
|
var createWebsocketFn = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : createWebsocket;
|
|
@@ -59,13 +59,7 @@ export var createQuizTimerWebSocketMiddleware = function createQuizTimerWebSocke
|
|
|
59
59
|
return function (store) {
|
|
60
60
|
return function (next) {
|
|
61
61
|
return function (action) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (!addTimeToExistingQuizSessionsEnabled) {
|
|
65
|
-
return next(action);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (action.type === SET_WS_TOKEN && socket === null) {
|
|
62
|
+
if (action.type === SET_WS_TOKEN && featureOnFn('add_time_to_existing_quiz_sessions') && socket === null) {
|
|
69
63
|
var token = action.payload.wsToken;
|
|
70
64
|
socket = initializeWebSocket(token, createWebsocketFn);
|
|
71
65
|
|
package/es/taking/api/taking.js
CHANGED
|
@@ -244,19 +244,20 @@ export function submitQuiz(quizSessionId) {
|
|
|
244
244
|
}
|
|
245
245
|
};
|
|
246
246
|
}
|
|
247
|
-
export function notifyTimeAdded(extraTime) {
|
|
247
|
+
export function notifyTimeAdded(isUnlimited, extraTime) {
|
|
248
248
|
return function (dispatch) {
|
|
249
|
-
|
|
249
|
+
var message = isUnlimited ? t('Your original time limit has been extended by { extraTime }', {
|
|
250
250
|
extraTime: extraTime
|
|
251
|
-
}))
|
|
251
|
+
}) : t('Unlimited time accommodation has been added to your quiz');
|
|
252
|
+
return dispatch(addInfo(message));
|
|
252
253
|
};
|
|
253
254
|
}
|
|
254
|
-
export function updateTime(timeInSeconds) {
|
|
255
|
+
export function updateTime(timeInSeconds, timerRunning) {
|
|
255
256
|
return function (dispatch) {
|
|
256
257
|
return dispatch(updateTimerInfo({
|
|
257
258
|
timeLeftInSeconds: timeInSeconds,
|
|
258
|
-
timerRunning:
|
|
259
|
-
timeRecording:
|
|
259
|
+
timerRunning: timerRunning,
|
|
260
|
+
timeRecording: false
|
|
260
261
|
}));
|
|
261
262
|
};
|
|
262
263
|
}
|
|
@@ -30,8 +30,9 @@ var handleExtraTime = function handleExtraTime(extraTimeInSeconds, endAt, update
|
|
|
30
30
|
var remainingTimeInMs = new Date(endAt) - Date.now();
|
|
31
31
|
var remainingTimeInSeconds = Math.floor(remainingTimeInMs / 1000);
|
|
32
32
|
var formattedExtraTimeText = (0, _formatTimespan.formatTime)(extraTimeInSeconds);
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
var isUnlimited = endAt === null && extraTimeInSeconds === null;
|
|
34
|
+
updateTimeAction(remainingTimeInSeconds, !isUnlimited);
|
|
35
|
+
notifyTimeAdded(!isUnlimited, !isUnlimited ? formattedExtraTimeText : null);
|
|
35
36
|
};
|
|
36
37
|
|
|
37
38
|
exports.handleExtraTime = handleExtraTime;
|
|
@@ -68,14 +69,13 @@ var handleWebSocketMessage = function handleWebSocketMessage(webSocketMessage, b
|
|
|
68
69
|
return;
|
|
69
70
|
}
|
|
70
71
|
|
|
71
|
-
var
|
|
72
|
-
var end_at = webSocketMessageData.end_at;
|
|
72
|
+
var type = webSocketMessageData.type;
|
|
73
73
|
|
|
74
|
-
if (
|
|
74
|
+
if (type !== 'accommodation_changed') {
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
handleExtraTimeFn(extra_time_in_seconds, end_at, boundTakingApiActions.updateTime, boundTakingApiActions.notifyTimeAdded);
|
|
78
|
+
handleExtraTimeFn(webSocketMessageData.extra_time_in_seconds, webSocketMessageData.end_at, boundTakingApiActions.updateTime, boundTakingApiActions.notifyTimeAdded);
|
|
79
79
|
};
|
|
80
80
|
|
|
81
81
|
exports.handleWebSocketMessage = handleWebSocketMessage;
|
|
@@ -87,13 +87,7 @@ var createQuizTimerWebSocketMiddleware = function createQuizTimerWebSocketMiddle
|
|
|
87
87
|
return function (store) {
|
|
88
88
|
return function (next) {
|
|
89
89
|
return function (action) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
if (!addTimeToExistingQuizSessionsEnabled) {
|
|
93
|
-
return next(action);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
if (action.type === _quizCommon.SET_WS_TOKEN && socket === null) {
|
|
90
|
+
if (action.type === _quizCommon.SET_WS_TOKEN && featureOnFn('add_time_to_existing_quiz_sessions') && socket === null) {
|
|
97
91
|
var token = action.payload.wsToken;
|
|
98
92
|
socket = initializeWebSocket(token, createWebsocketFn);
|
|
99
93
|
|
package/lib/taking/api/taking.js
CHANGED
|
@@ -301,20 +301,21 @@ function submitQuiz(quizSessionId) {
|
|
|
301
301
|
};
|
|
302
302
|
}
|
|
303
303
|
|
|
304
|
-
function notifyTimeAdded(extraTime) {
|
|
304
|
+
function notifyTimeAdded(isUnlimited, extraTime) {
|
|
305
305
|
return function (dispatch) {
|
|
306
|
-
|
|
306
|
+
var message = isUnlimited ? (0, _formatMessage.default)('Your original time limit has been extended by { extraTime }', {
|
|
307
307
|
extraTime: extraTime
|
|
308
|
-
})));
|
|
308
|
+
}) : (0, _formatMessage.default)('Unlimited time accommodation has been added to your quiz');
|
|
309
|
+
return dispatch((0, _alerts.addInfo)(message));
|
|
309
310
|
};
|
|
310
311
|
}
|
|
311
312
|
|
|
312
|
-
function updateTime(timeInSeconds) {
|
|
313
|
+
function updateTime(timeInSeconds, timerRunning) {
|
|
313
314
|
return function (dispatch) {
|
|
314
315
|
return dispatch((0, _taking.updateTimerInfo)({
|
|
315
316
|
timeLeftInSeconds: timeInSeconds,
|
|
316
|
-
timerRunning:
|
|
317
|
-
timeRecording:
|
|
317
|
+
timerRunning: timerRunning,
|
|
318
|
+
timeRecording: false
|
|
318
319
|
}));
|
|
319
320
|
};
|
|
320
321
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/quiz-core",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.19.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The Quiz React SDK by Instructure Inc.",
|
|
6
6
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"@instructure/emotion": "^8.51.0",
|
|
45
45
|
"@instructure/grading-utils": "^1.0.0",
|
|
46
46
|
"@instructure/outcomes-ui": "^3.2.2",
|
|
47
|
-
"@instructure/quiz-common": "20.
|
|
48
|
-
"@instructure/quiz-i18n": "20.
|
|
49
|
-
"@instructure/quiz-interactions": "20.
|
|
50
|
-
"@instructure/quiz-number-input": "20.
|
|
51
|
-
"@instructure/quiz-rce": "20.
|
|
47
|
+
"@instructure/quiz-common": "^20.19.0",
|
|
48
|
+
"@instructure/quiz-i18n": "^20.19.0",
|
|
49
|
+
"@instructure/quiz-interactions": "^20.19.0",
|
|
50
|
+
"@instructure/quiz-number-input": "^20.19.0",
|
|
51
|
+
"@instructure/quiz-rce": "^20.19.0",
|
|
52
52
|
"@instructure/ui-a11y-content": "^8.51.0",
|
|
53
53
|
"@instructure/ui-alerts": "^8.51.0",
|
|
54
54
|
"@instructure/ui-avatar": "^8.51.0",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"file-saver": "~2.0.5",
|
|
112
112
|
"humps": "^2.0.0",
|
|
113
113
|
"immutable": "^3.8.1",
|
|
114
|
-
"instructure-validations": "20.
|
|
114
|
+
"instructure-validations": "^20.19.0",
|
|
115
115
|
"ipaddr.js": "^1.5.4",
|
|
116
116
|
"isomorphic-fetch": "^2.2.0",
|
|
117
117
|
"isuuid": "^0.1.0",
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
"uuid": "^3.2.1"
|
|
143
143
|
},
|
|
144
144
|
"devDependencies": {
|
|
145
|
-
"@instructure/quiz-scripts": "20.
|
|
145
|
+
"@instructure/quiz-scripts": "^20.19.0",
|
|
146
146
|
"@instructure/ui-axe-check": "^8.51.0",
|
|
147
147
|
"@instructure/ui-babel-preset": "^7.22.1",
|
|
148
148
|
"@instructure/ui-scripts": "^7.22.1",
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
"jquery": "^2.2.3",
|
|
162
162
|
"karma-junit-reporter": "^2.0.1",
|
|
163
163
|
"most-subject": "^5.3.0",
|
|
164
|
-
"quiz-presets": "20.
|
|
164
|
+
"quiz-presets": "^20.19.0",
|
|
165
165
|
"react": "^16.8.6",
|
|
166
166
|
"react-addons-test-utils": "^15.6.2",
|
|
167
167
|
"react-dom": "^16.8.6",
|
|
@@ -177,5 +177,5 @@
|
|
|
177
177
|
"publishConfig": {
|
|
178
178
|
"access": "public"
|
|
179
179
|
},
|
|
180
|
-
"gitHead": "
|
|
180
|
+
"gitHead": "5fe0bb8f61f23f7fa51f93e9f6f6da85e29837e0"
|
|
181
181
|
}
|