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

Add ability to extract TestTemplate from Test

This commit is contained in:
2022-02-25 19:52:46 +00:00
parent 85d25439fd
commit 28f8b8dae8

View File

@@ -3,8 +3,6 @@
// Import user defined modules // Import user defined modules
const DatabaseConnectionPool = require('./DatabaseConnectionPool'); const DatabaseConnectionPool = require('./DatabaseConnectionPool');
const TestTemplate = require('./TestTemplate');
/** /**
* A class that represents the date of a test * A class that represents the date of a test
*/ */
@@ -93,7 +91,13 @@ class Test {
this.date = new TestDate(this.epochDate * 1000); 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; return this;
})(); })();
@@ -103,11 +107,11 @@ class Test {
return new (require('./Class'))(this.classId); return new (require('./Class'))(this.classId);
} }
get students() { async getTestTemplate() {
return new (require('./TestTemplate'))(this.templateId);
} }
get testTemplate() { get students() {
} }