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

Added setters for TestTemplate

This commit is contained in:
2022-04-21 13:15:34 +00:00
parent 3b29698f35
commit cd875d986f

View File

@@ -139,6 +139,42 @@ class TestTemplate {
return new Test(this.#conn, id);
}
async setMaxMark(maxMark) {
const sql = `
update
testTemplate
set
maxMark = ?
where
testTemplateId = ?;
`;
await this.#conn.runQuery(sql, [
maxMark,
this.id
]);
this.maxMark = maxMark;
}
async setName(name) {
const sql = `
update
testTemplate
set
name = ?
where
testTemplateId = ?;
`;
await this.#conn.runQuery(sql, [
name,
this.id
]);
this.name = name;
}
hasAccess(u) {
return u != null;
}