mirror of
https://github.com/matt-fidd/stratos.git
synced 2026-01-01 17:59:25 +00:00
Add ability to extract Class from Test
This commit is contained in:
13
lib/Test.js
13
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() {
|
||||
|
||||
Reference in New Issue
Block a user