aboutsummaryrefslogtreecommitdiff
path: root/js/student-common.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/student-common.js')
-rw-r--r--js/student-common.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/js/student-common.js b/js/student-common.js
index 48f7d60..f0d8ed3 100644
--- a/js/student-common.js
+++ b/js/student-common.js
@@ -1,8 +1,11 @@
import { getUserIconUrl, getCourseParticipantsUrl } from "./config.js";
+import { fetchGraduation } from "./graduation-common.js";
/**
* Class to represent Students.
*/
class Student {
+ graduation = null;
+
constructor(id, name, groups) {
this.id = id;
this.name = name;
@@ -23,6 +26,14 @@ class Student {
}
return this.groups.filter((g) => g !== this.getGroupName());
}
+
+ async getGraduation() {
+ if(!this.graduation) {
+ // fetchGraduation(this) sets this.graduation
+ await fetchGraduation(this);
+ }
+ return this.graduation;
+ }
}
async function fetchStudent(idFilter, nameFilter, groupFilter) {