1
0
mirror of https://github.com/matt-fidd/stratos.git synced 2026-01-01 15:59:25 +00:00

Implemented Student.getTestResults

This commit is contained in:
2022-04-22 02:30:38 +00:00
parent 6a0bcc90f3
commit 0d4a1d339c

View File

@@ -8,12 +8,26 @@ class Student extends User {
super(conn, id, 'student');
}
get classes() {
async getTestResults() {
const sql = `
select
testResultId
from
testResult
where
studentId = ?
order by
time desc;
`;
}
get parents() {
const records = await this._conn.runQuery(sql, [ this.id ]);
return Promise.all(records.map(r => {
return new (require('./TestResult'))(
this._conn,
r.testResultId
);
}));
}
static async createStudent(conn, fname, oname, lname, email, password) {