mirror of
https://github.com/matt-fidd/stratos.git
synced 2026-01-01 20:19:30 +00:00
Added Test.addResult
This commit is contained in:
16
lib/Test.js
16
lib/Test.js
@@ -1,6 +1,8 @@
|
|||||||
/* eslint-disable no-empty-function, getter-return */
|
/* eslint-disable no-empty-function, getter-return */
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const TestResult = require('./TestResult');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A class that represents the date of a test
|
* A class that represents the date of a test
|
||||||
*/
|
*/
|
||||||
@@ -135,6 +137,16 @@ class Test {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addResult(accountId, studentId, mark) {
|
||||||
|
return TestResult.create(
|
||||||
|
this.#conn,
|
||||||
|
this.id,
|
||||||
|
accountId,
|
||||||
|
studentId,
|
||||||
|
mark
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
async hasAccess(u) {
|
async hasAccess(u) {
|
||||||
const userTests = await u.getTests();
|
const userTests = await u.getTests();
|
||||||
|
|
||||||
@@ -143,10 +155,6 @@ class Test {
|
|||||||
}).length;
|
}).length;
|
||||||
}
|
}
|
||||||
|
|
||||||
get students() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
calculateAverageScore() {
|
calculateAverageScore() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user