From d88a2b8fd7f1ac32103bfdbb955a8ff55eaf05ed Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 18 Apr 2022 20:18:36 +0000 Subject: [PATCH] Added Test.addResult --- lib/Test.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/Test.js b/lib/Test.js index e81d0e1..a7c231a 100644 --- a/lib/Test.js +++ b/lib/Test.js @@ -1,6 +1,8 @@ /* eslint-disable no-empty-function, getter-return */ 'use strict'; +const TestResult = require('./TestResult'); + /** * 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) { const userTests = await u.getTests(); @@ -143,10 +155,6 @@ class Test { }).length; } - get students() { - - } - calculateAverageScore() { }