diff --git a/lib/TestTemplate.js b/lib/TestTemplate.js index c628fbf..c8588c1 100644 --- a/lib/TestTemplate.js +++ b/lib/TestTemplate.js @@ -94,6 +94,26 @@ class TestTemplate { return new (require('./Account'))(this.#conn, this.accountId); } + async getTests() { + const sql = ` + select + testId as id + from + test + where + testTemplateId = ?; + `; + + return await Promise.all( + (await this.#conn.runQuery(sql, [ this.id ])) + .map(record => { + return new (require('./Test'))( + this.#conn, + record.id); + }) + ); + } + async assignClass(classId, date) { const c = await new Class(this.#conn, classId); const id = crypto.randomUUID();