@insignia-education/api-sdk-js 0.15.80 → 0.15.82
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/Certificates.js +18 -0
- package/src/api/v1/Quizzes.js +10 -0
- package/src/api/v1/index.js +2 -0
package/package.json
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export default class Certificates {
|
|
2
|
+
#client;
|
|
3
|
+
|
|
4
|
+
constructor(client) {
|
|
5
|
+
this.#client = client;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Public certificate verification — no auth required, safe to call from
|
|
10
|
+
* the certificate-verify page or a shared link (e.g. LinkedIn's
|
|
11
|
+
* "Add to Profile" certUrl). Resolves { student_name, course_title,
|
|
12
|
+
* completed_at }, or rejects (err.status === 404) when there's no
|
|
13
|
+
* completed enrollment for that user/course pair.
|
|
14
|
+
*/
|
|
15
|
+
verify(userId, courseId) {
|
|
16
|
+
return this.#client.get(`/certificates/verify/${userId}/${courseId}`);
|
|
17
|
+
}
|
|
18
|
+
}
|
package/src/api/v1/Quizzes.js
CHANGED
|
@@ -38,6 +38,16 @@ export default class Quizzes {
|
|
|
38
38
|
delete: (id) => client.del(`${aBase}/${id}`),
|
|
39
39
|
};
|
|
40
40
|
},
|
|
41
|
+
/** Grading-rubric criteria for one question — shown to the teacher while grading an open/audio/document/link answer. */
|
|
42
|
+
criteria: (questionId) => {
|
|
43
|
+
const cBase = `${base}/${questionId}/criteria`;
|
|
44
|
+
return {
|
|
45
|
+
get: (id = null) => id ? client.get(`${cBase}/${id}`) : client.get(cBase),
|
|
46
|
+
create: (data) => client.put(cBase, data),
|
|
47
|
+
edit: (id, data) => client.patch(`${cBase}/${id}`, data),
|
|
48
|
+
delete: (id) => client.del(`${cBase}/${id}`),
|
|
49
|
+
};
|
|
50
|
+
},
|
|
41
51
|
};
|
|
42
52
|
}
|
|
43
53
|
}
|
package/src/api/v1/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import InsigniaApi from '../index.js';
|
|
|
2
2
|
import Admin from './Admin.js';
|
|
3
3
|
import Auth from './Auth.js';
|
|
4
4
|
import Accounts from './Accounts.js';
|
|
5
|
+
import Certificates from './Certificates.js';
|
|
5
6
|
import Changelogs from './Changelogs.js';
|
|
6
7
|
import CompanySettings from './CompanySettings.js';
|
|
7
8
|
import ContactForms from './ContactForms.js';
|
|
@@ -56,6 +57,7 @@ export default class InsigniaApiV1 extends InsigniaApi {
|
|
|
56
57
|
this.admin = new Admin(this);
|
|
57
58
|
this.auth = new Auth(this);
|
|
58
59
|
this.accounts = new Accounts(this);
|
|
60
|
+
this.certificates = new Certificates(this);
|
|
59
61
|
this.changelogs = new Changelogs(this);
|
|
60
62
|
this.companySettings = new CompanySettings(this);
|
|
61
63
|
this.contactForms = new ContactForms(this);
|