@instructure/quiz-core 18.1.2-rc.2 → 18.1.2-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.
@@ -56,9 +56,10 @@ export function getQuizSessionResult(authoritativeResultId, quizSessionId) {
56
56
  // but the sessionItems aren't yet loaded, then remove the throttling functions in results and grading
57
57
 
58
58
  export function getResultInfo(quizSessionId) {
59
- var apiAction = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : fetchQuizSession;
60
- var autoRetry = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
61
- var fetchItems = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true;
59
+ var anonymousGrading = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
60
+ var apiAction = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : fetchQuizSession;
61
+ var autoRetry = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
62
+ var fetchItems = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true;
62
63
  return function (dispatch, getState) {
63
64
  var getSIResults = function getSIResults(quizSessionData) {
64
65
  if (quizSessionData.status !== 'graded') {
@@ -79,7 +80,7 @@ export function getResultInfo(quizSessionId) {
79
80
  var responseCb = function responseCb(quizSessionData) {
80
81
  if (autoRetry && quizSessionData.status === 'autograding') {
81
82
  setTimeout(function () {
82
- getResultInfo(quizSessionId, apiAction, autoRetry, fetchItems)(dispatch, getState);
83
+ getResultInfo(quizSessionId, anonymousGrading, apiAction, autoRetry, fetchItems)(dispatch, getState);
83
84
  }, 2000);
84
85
  }
85
86
 
@@ -93,6 +94,8 @@ export function getResultInfo(quizSessionId) {
93
94
  return Promise.all(promises);
94
95
  };
95
96
 
96
- return apiAction(quizSessionId, responseCb);
97
+ return apiAction(quizSessionId, responseCb, {
98
+ anonymousGrading: anonymousGrading
99
+ });
97
100
  };
98
101
  }
@@ -13,10 +13,11 @@ var generateUrl = function generateUrl(pathParts) {
13
13
  };
14
14
 
15
15
  var get = function get(url, responseCb) {
16
- var fetcherParams = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
17
- var markCallbacksComplete = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
16
+ var params = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
17
+ var fetcherParams = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
18
+ var markCallbacksComplete = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false;
18
19
  var fetcher = new Fetcher(fetcherParams);
19
- var getCall = fetcher.get(url).then(responseCb);
20
+ var getCall = fetcher.get(url, params).then(responseCb);
20
21
 
21
22
  if (markCallbacksComplete) {
22
23
  return getCall.then(function () {
@@ -54,7 +55,8 @@ var post = function post(url, params, responseCb) {
54
55
 
55
56
  export var fetchQuizSession = function fetchQuizSession(quizSessionId) {
56
57
  var responseCb = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : noop;
57
- return get(generateUrl([quizSessionId]), responseCb);
58
+ var params = arguments.length > 2 ? arguments[2] : void 0;
59
+ return get(generateUrl([quizSessionId]), responseCb, params);
58
60
  };
59
61
  export var fetchSessionItems = function fetchSessionItems(quizSessionId) {
60
62
  var responseCb = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : noop;
@@ -176,7 +178,7 @@ export var fetchSessionItemResults = function fetchSessionItemResults(quizSessio
176
178
  export var fetchQuizSessionResult = function fetchQuizSessionResult(quizSessionId, quizSessionResultId) {
177
179
  var responseCb = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : noop;
178
180
  var fetcherKey = QuizSessionResult.fetcherTag(quizSessionResultId);
179
- return get(generateUrl([quizSessionId, 'results', quizSessionResultId]), responseCb, {
181
+ return get(generateUrl([quizSessionId, 'results', quizSessionResultId]), responseCb, {}, {
180
182
  callType: fetcherKey
181
183
  }, true);
182
184
  };
@@ -26,7 +26,7 @@ export var postQuizSessionResults = function postQuizSessionResults(sessionId, s
26
26
  };
27
27
  var fetcher = new Fetcher();
28
28
  return fetcher.post(url, params).then(function (quizSessionResult) {
29
- var dispatchActions = [handleQuizSessionResultsResponse([quizSessionResult]), fetchQuizSessionCb(sessionId)];
29
+ var dispatchActions = [handleQuizSessionResultsResponse([quizSessionResult]), fetchQuizSessionCb(sessionId, null)];
30
30
 
31
31
  if (previousScore !== (quizSessionResult === null || quizSessionResult === void 0 ? void 0 : quizSessionResult.score)) {
32
32
  dispatchActions.unshift(postToParent({
@@ -87,9 +87,10 @@ function getQuizSessionResult(authoritativeResultId, quizSessionId) {
87
87
 
88
88
 
89
89
  function getResultInfo(quizSessionId) {
90
- var apiAction = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : _quizSessions.fetchQuizSession;
91
- var autoRetry = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
92
- var fetchItems = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true;
90
+ var anonymousGrading = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
91
+ var apiAction = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : _quizSessions.fetchQuizSession;
92
+ var autoRetry = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
93
+ var fetchItems = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true;
93
94
  return function (dispatch, getState) {
94
95
  var getSIResults = function getSIResults(quizSessionData) {
95
96
  if (quizSessionData.status !== 'graded') {
@@ -110,7 +111,7 @@ function getResultInfo(quizSessionId) {
110
111
  var responseCb = function responseCb(quizSessionData) {
111
112
  if (autoRetry && quizSessionData.status === 'autograding') {
112
113
  setTimeout(function () {
113
- getResultInfo(quizSessionId, apiAction, autoRetry, fetchItems)(dispatch, getState);
114
+ getResultInfo(quizSessionId, anonymousGrading, apiAction, autoRetry, fetchItems)(dispatch, getState);
114
115
  }, 2000);
115
116
  }
116
117
 
@@ -124,6 +125,8 @@ function getResultInfo(quizSessionId) {
124
125
  return Promise.all(promises);
125
126
  };
126
127
 
127
- return apiAction(quizSessionId, responseCb);
128
+ return apiAction(quizSessionId, responseCb, {
129
+ anonymousGrading: anonymousGrading
130
+ });
128
131
  };
129
132
  }
@@ -30,10 +30,11 @@ var generateUrl = function generateUrl(pathParts) {
30
30
  };
31
31
 
32
32
  var get = function get(url, responseCb) {
33
- var fetcherParams = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
34
- var markCallbacksComplete = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
33
+ var params = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
34
+ var fetcherParams = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
35
+ var markCallbacksComplete = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false;
35
36
  var fetcher = new _Fetcher.default(fetcherParams);
36
- var getCall = fetcher.get(url).then(responseCb);
37
+ var getCall = fetcher.get(url, params).then(responseCb);
37
38
 
38
39
  if (markCallbacksComplete) {
39
40
  return getCall.then(function () {
@@ -71,7 +72,8 @@ var post = function post(url, params, responseCb) {
71
72
 
72
73
  var fetchQuizSession = function fetchQuizSession(quizSessionId) {
73
74
  var responseCb = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : _noop.default;
74
- return get(generateUrl([quizSessionId]), responseCb);
75
+ var params = arguments.length > 2 ? arguments[2] : void 0;
76
+ return get(generateUrl([quizSessionId]), responseCb, params);
75
77
  };
76
78
 
77
79
  exports.fetchQuizSession = fetchQuizSession;
@@ -228,7 +230,7 @@ var fetchQuizSessionResult = function fetchQuizSessionResult(quizSessionId, quiz
228
230
 
229
231
  var fetcherKey = _QuizSessionResult.default.fetcherTag(quizSessionResultId);
230
232
 
231
- return get(generateUrl([quizSessionId, 'results', quizSessionResultId]), responseCb, {
233
+ return get(generateUrl([quizSessionId, 'results', quizSessionResultId]), responseCb, {}, {
232
234
  callType: fetcherKey
233
235
  }, true);
234
236
  };
@@ -40,7 +40,7 @@ var postQuizSessionResults = function postQuizSessionResults(sessionId, sessionI
40
40
  };
41
41
  var fetcher = new _Fetcher.default();
42
42
  return fetcher.post(url, params).then(function (quizSessionResult) {
43
- var dispatchActions = [(0, _callHandlers.handleQuizSessionResultsResponse)([quizSessionResult]), fetchQuizSessionCb(sessionId)];
43
+ var dispatchActions = [(0, _callHandlers.handleQuizSessionResultsResponse)([quizSessionResult]), fetchQuizSessionCb(sessionId, null)];
44
44
 
45
45
  if (previousScore !== (quizSessionResult === null || quizSessionResult === void 0 ? void 0 : quizSessionResult.score)) {
46
46
  dispatchActions.unshift((0, _postMessage.postToParent)({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/quiz-core",
3
- "version": "18.1.2-rc.2+c8e88b44d",
3
+ "version": "18.1.2-rc.4+638d1525f",
4
4
  "license": "MIT",
5
5
  "description": "The Quiz React SDK by Instructure Inc.",
6
6
  "author": "Instructure, Inc. Engineering and Product Design",
@@ -42,11 +42,11 @@
42
42
  "dependencies": {
43
43
  "@instructure/grading-utils": "^1.0.0",
44
44
  "@instructure/outcomes-ui": "^2.1.9",
45
- "@instructure/quiz-common": "18.1.2-rc.2+c8e88b44d",
46
- "@instructure/quiz-i18n": "18.1.2-rc.2+c8e88b44d",
47
- "@instructure/quiz-interactions": "18.1.2-rc.2+c8e88b44d",
48
- "@instructure/quiz-number-input": "18.1.2-rc.2+c8e88b44d",
49
- "@instructure/quiz-rce": "18.1.2-rc.2+c8e88b44d",
45
+ "@instructure/quiz-common": "18.1.2-rc.4+638d1525f",
46
+ "@instructure/quiz-i18n": "18.1.2-rc.4+638d1525f",
47
+ "@instructure/quiz-interactions": "18.1.2-rc.4+638d1525f",
48
+ "@instructure/quiz-number-input": "18.1.2-rc.4+638d1525f",
49
+ "@instructure/quiz-rce": "18.1.2-rc.4+638d1525f",
50
50
  "@instructure/ui-a11y-content": "^7.20.0",
51
51
  "@instructure/ui-alerts": "^7.20.0",
52
52
  "@instructure/ui-avatar": "^7.20.0",
@@ -107,7 +107,7 @@
107
107
  "eventemitter3": "^3.1.0",
108
108
  "humps": "^2.0.0",
109
109
  "immutable": "^3.8.1",
110
- "instructure-validations": "18.1.2-rc.2+c8e88b44d",
110
+ "instructure-validations": "18.1.2-rc.4+638d1525f",
111
111
  "ipaddr.js": "^1.5.4",
112
112
  "isomorphic-fetch": "^2.2.0",
113
113
  "isuuid": "^0.1.0",
@@ -158,7 +158,7 @@
158
158
  "intl": "^1.2.4",
159
159
  "jquery": "^2.2.3",
160
160
  "most-subject": "^5.3.0",
161
- "quiz-presets": "18.1.2-rc.2+c8e88b44d",
161
+ "quiz-presets": "18.1.2-rc.4+638d1525f",
162
162
  "react": "^16.8.6",
163
163
  "react-addons-test-utils": "^15.6.2",
164
164
  "react-dom": "^16.8.6",
@@ -174,5 +174,5 @@
174
174
  "publishConfig": {
175
175
  "access": "public"
176
176
  },
177
- "gitHead": "c8e88b44d4249e0328fa8864b1fc69060405f464"
177
+ "gitHead": "638d1525f2ad2da245bc7a34992273ee8851779d"
178
178
  }