@insignia-education/api-sdk-js 0.19.2 → 0.21.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/package.json +1 -1
- package/src/api/v1/Admin.js +13 -0
- package/src/api/v1/AiGradingSettings.js +13 -0
- package/src/api/v1/index.js +2 -0
package/package.json
CHANGED
package/src/api/v1/Admin.js
CHANGED
|
@@ -10,6 +10,19 @@ export default class Admin {
|
|
|
10
10
|
return this.#client.get('/admin/courses/current-dates', { page, per_page: perPage });
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Platform-wide "needs teacher correction" queue — every quiz attempt still
|
|
15
|
+
* awaiting a teacher's grade, across every course/teacher (unlike
|
|
16
|
+
* TeacherDashboard's ungraded-quiz endpoints, which are scoped to one
|
|
17
|
+
* teacher's own courses). Optional `courseId` narrows to one course,
|
|
18
|
+
* `search` matches the student's name or email.
|
|
19
|
+
*/
|
|
20
|
+
quizzesUngraded({ courseId, search, page, perPage } = {}) {
|
|
21
|
+
return this.#client.get('/admin/quizzes/ungraded', {
|
|
22
|
+
course_id: courseId, search, page, per_page: perPage,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
13
26
|
/** Date-range sales report: totals by status (pending/approved/rejected), and the same split by course, payment method and currency. */
|
|
14
27
|
statisticsSales({ fromDate, toDate } = {}) {
|
|
15
28
|
return this.#client.get('/admin/statistics/sales', { from_date: fromDate, to_date: toDate });
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default class AiGradingSettings {
|
|
2
|
+
#client;
|
|
3
|
+
|
|
4
|
+
constructor(client) {
|
|
5
|
+
this.#client = client;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/** Admin-only: which AI provider/model quizzes:auto-grade-ai uses for open-text and audio grading. */
|
|
9
|
+
get() { return this.#client.get('/ai-grading-settings'); }
|
|
10
|
+
|
|
11
|
+
/** Admin-only: update the provider/model choices. */
|
|
12
|
+
edit(data) { return this.#client.patch('/ai-grading-settings', data); }
|
|
13
|
+
}
|
package/src/api/v1/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import InsigniaApi from '../index.js';
|
|
2
|
+
import AiGradingSettings from './AiGradingSettings.js';
|
|
2
3
|
import Admin from './Admin.js';
|
|
3
4
|
import Auth from './Auth.js';
|
|
4
5
|
import Accounts from './Accounts.js';
|
|
@@ -57,6 +58,7 @@ export default class InsigniaApiV1 extends InsigniaApi {
|
|
|
57
58
|
let url = InsigniaApiV1._resolve(baseUrl);
|
|
58
59
|
super(url);
|
|
59
60
|
|
|
61
|
+
this.aiGradingSettings = new AiGradingSettings(this);
|
|
60
62
|
this.admin = new Admin(this);
|
|
61
63
|
this.auth = new Auth(this);
|
|
62
64
|
this.accounts = new Accounts(this);
|