@insignia-education/api-sdk-js 0.15.97 → 0.15.101
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/package.json +1 -1
- package/src/api/v1/Courses.js +5 -0
- package/src/api/v1/Quizzes.js +2 -1
- package/src/api/v1/Users.js +7 -0
package/package.json
CHANGED
package/src/api/v1/Courses.js
CHANGED
|
@@ -24,6 +24,9 @@ export default class Courses {
|
|
|
24
24
|
edit(id, data) { return this.#client.patch(`/courses/${id}`, data); }
|
|
25
25
|
delete(id) { return this.#client.del(`/courses/${id}`); }
|
|
26
26
|
|
|
27
|
+
/** Replaces the full set of accepted-equivalent prerequisites (any ONE unlocks the course, not all of them) — e.g. english-5 accepting english-4, english-4-personal or english-4-semi. Pass [] to clear. */
|
|
28
|
+
updatePrerequisites(id, prerequisiteIds) { return this.#client.patch(`/courses/${id}/prerequisites`, { prerequisite_ids: prerequisiteIds }); }
|
|
29
|
+
|
|
27
30
|
/** Users enrolled on this course as a teacher (user_courses.teacher = 1). */
|
|
28
31
|
teachers(courseId) { return this.#client.get(`/courses/${courseId}/teachers`); }
|
|
29
32
|
|
|
@@ -55,6 +58,8 @@ export default class Courses {
|
|
|
55
58
|
syncAttendances: (id) => this.#client.post(`${base}/${id}/sync-attendances`),
|
|
56
59
|
/** Sessions already generated for this date. */
|
|
57
60
|
sessions: (id) => this.#client.get(`${base}/${id}/sessions`),
|
|
61
|
+
/** Enrolled students (UserCourse rows, teacher rows excluded) assigned to this date. */
|
|
62
|
+
students: (id) => this.#client.get(`${base}/${id}/students`),
|
|
58
63
|
/** Create a Zoom meeting for one of this date's generated sessions. */
|
|
59
64
|
generateZoomMeeting: (id, sessionId) => this.#client.post(`${base}/${id}/sessions/${sessionId}/zoom-meeting`),
|
|
60
65
|
/** Create a Zoom meeting for every session in this date that doesn't have one yet. */
|
package/src/api/v1/Quizzes.js
CHANGED
|
@@ -25,7 +25,8 @@ export default class Quizzes {
|
|
|
25
25
|
const client = this.#client;
|
|
26
26
|
const base = `/quizzes/${quizId}/questions`;
|
|
27
27
|
return {
|
|
28
|
-
|
|
28
|
+
/** Pass `{ forAttempt: true }` to get the authenticated user's next-attempt question subset (capped to Quiz.max_questions) instead of the full list. */
|
|
29
|
+
get: (id = null, { forAttempt = false } = {}) => id ? client.get(`${base}/${id}`) : client.get(base, forAttempt ? { for_attempt: 1 } : undefined),
|
|
29
30
|
create: (data) => client.put(base, data),
|
|
30
31
|
edit: (id, data) => client.patch(`${base}/${id}`, data),
|
|
31
32
|
delete: (id) => client.del(`${base}/${id}`),
|
package/src/api/v1/Users.js
CHANGED
|
@@ -53,6 +53,13 @@ export default class Users {
|
|
|
53
53
|
rebuildCertificate: (courseId) => client.post(`${base}/${courseId}/certificate/rebuild`),
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
+
|
|
57
|
+
/** Sellers-and-above: the courses this user is assigned as teacher for (user_courses.teacher = 1). */
|
|
58
|
+
teachingCourses(userId) {
|
|
59
|
+
const client = this.#client;
|
|
60
|
+
return { get: () => client.get(`/users/${userId}/teaching-courses`) };
|
|
61
|
+
}
|
|
62
|
+
|
|
56
63
|
courseNotes(userId) { return this.#nested(userId, 'course-notes'); }
|
|
57
64
|
|
|
58
65
|
/** get() accepts optional { courseId, withTrashed } filters — withTrashed also returns soft-deleted attempts. */
|