1
0
mirror of https://github.com/matt-fidd/stratos.git synced 2026-01-01 20:39:28 +00:00

Add ability to extract Class from Test

This commit is contained in:
2022-02-25 19:52:45 +00:00
parent 7f6b1cfb97
commit 85d25439fd

View File

@@ -45,6 +45,12 @@ class Test {
*/
classId;
/**
* The class object that it is assigned to
* @type {Class}
*/
class;
/**
* The test date in epoch seconds
* @type {number}
@@ -86,14 +92,15 @@ class Test {
this[k] = v;
this.date = new TestDate(this.epochDate * 1000);
this.template = await new TestTemplate(this.templateId);
this.class = await this.getClass();
return this;
})();
}
get class() {
async getClass() {
return new (require('./Class'))(this.classId);
}
get students() {