mirror of
https://github.com/matt-fidd/stratos.git
synced 2026-01-01 22:59:28 +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;
|
classId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The class object that it is assigned to
|
||||||
|
* @type {Class}
|
||||||
|
*/
|
||||||
|
class;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The test date in epoch seconds
|
* The test date in epoch seconds
|
||||||
* @type {number}
|
* @type {number}
|
||||||
@@ -86,14 +92,15 @@ class Test {
|
|||||||
this[k] = v;
|
this[k] = v;
|
||||||
|
|
||||||
this.date = new TestDate(this.epochDate * 1000);
|
this.date = new TestDate(this.epochDate * 1000);
|
||||||
this.template = await new TestTemplate(this.templateId);
|
|
||||||
|
this.class = await this.getClass();
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
|
|
||||||
get class() {
|
async getClass() {
|
||||||
|
return new (require('./Class'))(this.classId);
|
||||||
}
|
}
|
||||||
|
|
||||||
get students() {
|
get students() {
|
||||||
|
|||||||
Reference in New Issue
Block a user