@insignia-education/api-sdk-js 0.15.76 → 0.15.79

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insignia-education/api-sdk-js",
3
- "version": "0.15.76",
3
+ "version": "0.15.79",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -0,0 +1,13 @@
1
+ export default class CompanySettings {
2
+ #client;
3
+
4
+ constructor(client) {
5
+ this.#client = client;
6
+ }
7
+
8
+ /** Admin-only: company name/address shown in email footers. */
9
+ get() { return this.#client.get('/company-settings'); }
10
+
11
+ /** Admin-only: update company name/address. */
12
+ edit(data) { return this.#client.patch('/company-settings', data); }
13
+ }
@@ -70,7 +70,14 @@ export default class Teacher {
70
70
  courseCorrectableQuizzes: (courseId) => this.#client.get(`${base}/courses/${courseId}/quizzes/correctable`),
71
71
  /** Full attempt detail (all score fields, answers, quiz.questions.answers eager-loaded) for one of this teacher's own students. */
72
72
  quizDetail: (id) => this.#client.get(`${base}/quizzes/${id}`),
73
- /** Grade (or partially grade) an attempt: any field omitted keeps its current value, so open/audio/session can be saved independently of finalizing (teacher_graded_at). */
73
+ /**
74
+ * Grade (or partially grade) an attempt: any field omitted keeps its current value, so open/audio/session
75
+ * can be saved independently of finalizing (teacher_graded_at). `data` may include:
76
+ * `open_grades` ({question_id: bool}, replaces score_open — server sums each correct question's own
77
+ * point value), `score_audio`, `score_session_percentage`, `teacher_graded_at`,
78
+ * `comments_positive`/`comments_negative`/`comments_general` (only saved if the quiz's matching
79
+ * comment_*_enabled flag is on), `course_selected` (only saved if course_as_comment_enabled).
80
+ */
74
81
  gradeQuiz: (id, data) => this.#client.patch(`${base}/quizzes/${id}/grade`, data),
75
82
  /** Mark one student's attendance (present: true/false) on one of this teacher's own sessions. */
76
83
  markAttendance: (sessionId, studentId, present) => this.#client.patch(`${base}/sessions/${sessionId}/attendance`, { student_id: studentId, present }),
@@ -68,6 +68,15 @@ export default class Users {
68
68
  delete: (id) => client.del(`${base}/${id}`),
69
69
  /** Puts a soft-deleted attempt back. */
70
70
  restore: (id) => client.post(`${base}/${id}/restore`),
71
+ /** Full attempt detail (quiz.questions.answers eager-loaded) — staff-only (any seller/employee/admin, not just this quiz's course teacher). */
72
+ detail: (id) => client.get(`${base}/${id}/detail`),
73
+ /**
74
+ * Staff counterpart of Teacher.dashboard().gradeQuiz() — same grading semantics
75
+ * (open_grades, score_audio, score_session_percentage, teacher_graded_at, the
76
+ * comments_ fields, course_selected — see that method's doc), but any seller/
77
+ * employee/admin can grade any user's attempt, not just that quiz's own course teacher.
78
+ */
79
+ grade: (id, data) => client.patch(`${base}/${id}/grade`, data),
71
80
  /**
72
81
  * Upload the file a student attaches as their answer to a
73
82
  * document_upload (PDF) or audio_answer (recording) question
@@ -3,6 +3,7 @@ import Admin from './Admin.js';
3
3
  import Auth from './Auth.js';
4
4
  import Accounts from './Accounts.js';
5
5
  import Changelogs from './Changelogs.js';
6
+ import CompanySettings from './CompanySettings.js';
6
7
  import ContactForms from './ContactForms.js';
7
8
  import ConversationalTopics from './ConversationalTopics.js';
8
9
  import Countries from './Countries.js';
@@ -56,6 +57,7 @@ export default class InsigniaApiV1 extends InsigniaApi {
56
57
  this.auth = new Auth(this);
57
58
  this.accounts = new Accounts(this);
58
59
  this.changelogs = new Changelogs(this);
60
+ this.companySettings = new CompanySettings(this);
59
61
  this.contactForms = new ContactForms(this);
60
62
  this.conversationalTopics = new ConversationalTopics(this);
61
63
  this.countries = new Countries(this);