@insignia-education/api-sdk-js 0.15.99 → 0.15.102
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 +2 -0
- package/src/api/v1/Teacher.js +5 -3
- package/src/api/v1/Users.js +7 -0
package/package.json
CHANGED
package/src/api/v1/Courses.js
CHANGED
|
@@ -58,6 +58,8 @@ export default class Courses {
|
|
|
58
58
|
syncAttendances: (id) => this.#client.post(`${base}/${id}/sync-attendances`),
|
|
59
59
|
/** Sessions already generated for this date. */
|
|
60
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`),
|
|
61
63
|
/** Create a Zoom meeting for one of this date's generated sessions. */
|
|
62
64
|
generateZoomMeeting: (id, sessionId) => this.#client.post(`${base}/${id}/sessions/${sessionId}/zoom-meeting`),
|
|
63
65
|
/** Create a Zoom meeting for every session in this date that doesn't have one yet. */
|
package/src/api/v1/Teacher.js
CHANGED
|
@@ -60,10 +60,12 @@ export default class Teacher {
|
|
|
60
60
|
courseDateGradedQuizzes: (courseDateId, quizId = null) => this.#client.get(`${base}/course-dates/${courseDateId}/quizzes/graded`, quizId ? { quiz_id: quizId } : {}),
|
|
61
61
|
/** Distinct { id, title } quizzes needing correction under this CourseDate's course — for the graded-tab quiz filter. */
|
|
62
62
|
courseDateCorrectableQuizzes: (courseDateId) => this.#client.get(`${base}/course-dates/${courseDateId}/quizzes/correctable`),
|
|
63
|
-
/** Ungraded quiz submissions grouped by course, for every course this teacher teaches. hasCertificate (true/false) narrows to
|
|
63
|
+
/** Ungraded quiz submissions grouped by course, for every course this teacher teaches. hasCertificate (true/false) narrows to Quiz.certification; omit for every course. Slow (scans every course up front) — prefer courses() + courseUngradedQuizzes() for the tab's actual course-picker flow. */
|
|
64
64
|
ungradedQuizzes: (hasCertificate = null) => this.#client.get(`${base}/quizzes/ungraded`, hasCertificate === null ? {} : { has_certificate: hasCertificate ? 1 : 0 }),
|
|
65
|
-
/**
|
|
66
|
-
|
|
65
|
+
/** This teacher's courses ({id, title} only, no counts) — the "Quizzes por corregir" tab's course picker. */
|
|
66
|
+
courses: () => this.#client.get(`${base}/courses`),
|
|
67
|
+
/** Ungraded quiz submissions for one course (any student, not just one CourseDate's) — for courses with no cohort scheduling, e.g. placement exams. hasCertificate (true/false) narrows to Quiz.certification; omit for every quiz. */
|
|
68
|
+
courseUngradedQuizzes: (courseId, hasCertificate = null) => this.#client.get(`${base}/courses/${courseId}/quizzes/ungraded`, hasCertificate === null ? {} : { has_certificate: hasCertificate ? 1 : 0 }),
|
|
67
69
|
/** Already-graded quiz submissions for one course, optionally narrowed to one quiz. */
|
|
68
70
|
courseGradedQuizzes: (courseId, quizId = null) => this.#client.get(`${base}/courses/${courseId}/quizzes/graded`, quizId ? { quiz_id: quizId } : {}),
|
|
69
71
|
/** Distinct { id, title } quizzes needing correction under this course — for the graded-tab quiz filter. */
|
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. */
|