The course.quiz.listSubmissions(options) method doesn't return any results when visitEndpoint returns multi-page results. This happens because, with multi-page result sets, visitEndpoint() returns an array of objects and not an object that contains a quiz_submissions key.
See code at line:
|
return Promise.resolve(response.quiz_submissions); |
I haven't checked other methods that check multi-page results return results properly, but suspect the listSubmissions() method is not the only one.
The root of the problem is that genVisitEndpoint() doesn't return an array if there is only one page of results. This is unfortunate as it complicates how to handle its return value by calling code.
See code starting at line:
If genVisitEndpoint() always returned an array, calling code could easily flatten single or multi-page results (e.g.: [].concat(...response.map(({ quiz_submissions }) => quiz_submissions))) or unwrap when a single result is expected (e.g.: response[0].key).
The
course.quiz.listSubmissions(options)method doesn't return any results whenvisitEndpointreturns multi-page results. This happens because, with multi-page result sets,visitEndpoint()returns an array of objects and not an object that contains aquiz_submissionskey.See code at line:
caccl-api/endpoints/API/Course/Quiz.js
Line 587 in 08b290f
I haven't checked other methods that check multi-page results return results properly, but suspect the
listSubmissions()method is not the only one.The root of the problem is that
genVisitEndpoint()doesn't return an array if there is only one page of results. This is unfortunate as it complicates how to handle its return value by calling code.See code starting at line:
caccl-api/classes/instantiateEndpoint/genVisitEndpoint.js
Line 208 in 08adfb2
If
genVisitEndpoint()always returned an array, calling code could easily flatten single or multi-page results (e.g.:[].concat(...response.map(({ quiz_submissions }) => quiz_submissions))) or unwrap when a single result is expected (e.g.:response[0].key).