diff --git a/lib/Test.js b/lib/Test.js index 4ee4d42..0b159b4 100644 --- a/lib/Test.js +++ b/lib/Test.js @@ -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() {