mirror of
https://github.com/matt-fidd/stratos.git
synced 2026-01-01 15:59:25 +00:00
Add ability to extract TestTemplate from Test
This commit is contained in:
16
lib/Test.js
16
lib/Test.js
@@ -3,8 +3,6 @@
|
||||
// Import user defined modules
|
||||
const DatabaseConnectionPool = require('./DatabaseConnectionPool');
|
||||
|
||||
const TestTemplate = require('./TestTemplate');
|
||||
|
||||
/**
|
||||
* A class that represents the date of a test
|
||||
*/
|
||||
@@ -93,7 +91,13 @@ class Test {
|
||||
|
||||
this.date = new TestDate(this.epochDate * 1000);
|
||||
|
||||
this.class = await this.getClass();
|
||||
const [ template, c ] = await Promise.all([
|
||||
this.getTestTemplate(),
|
||||
this.getClass()
|
||||
]);
|
||||
|
||||
this.template = template;
|
||||
this.class = c;
|
||||
|
||||
return this;
|
||||
})();
|
||||
@@ -103,11 +107,11 @@ class Test {
|
||||
return new (require('./Class'))(this.classId);
|
||||
}
|
||||
|
||||
get students() {
|
||||
|
||||
async getTestTemplate() {
|
||||
return new (require('./TestTemplate'))(this.templateId);
|
||||
}
|
||||
|
||||
get testTemplate() {
|
||||
get students() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user