mirror of
https://github.com/matt-fidd/stratos.git
synced 2026-01-01 22:59:28 +00:00
Added setters for TestTemplate
This commit is contained in:
@@ -139,6 +139,42 @@ class TestTemplate {
|
|||||||
return new Test(this.#conn, id);
|
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) {
|
hasAccess(u) {
|
||||||
return u != null;
|
return u != null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user