diff --git a/lib/Test.js b/lib/Test.js index fafe848..618a33c 100644 --- a/lib/Test.js +++ b/lib/Test.js @@ -114,6 +114,14 @@ class Test { return new (require('./TestTemplate'))(this.templateId); } + async hasAccess(u) { + const userTests = await u.getTests(); + + return userTests.filter(t => { + return t.id === this.id; + }).length; + } + get students() { }