diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2026-07-01 16:27:12 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2026-07-01 16:28:00 +0200 |
| commit | 4a1f493d84330d6319a623e2eed126d9f74f0c9b (patch) | |
| tree | df4fe0caf51ca2e9e0fcbf7d98cefa10e8188312 /js/student-common.js | |
| parent | e189096ad58993ac00f440ccf5dacf4b760b95a7 (diff) | |
| download | bycs-sol-4a1f493d84330d6319a623e2eed126d9f74f0c9b.tar.gz bycs-sol-4a1f493d84330d6319a623e2eed126d9f74f0c9b.zip | |
remove individual student groups
Diffstat (limited to 'js/student-common.js')
| -rw-r--r-- | js/student-common.js | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/js/student-common.js b/js/student-common.js index f0d8ed3..c89b818 100644 --- a/js/student-common.js +++ b/js/student-common.js @@ -6,25 +6,18 @@ import { fetchGraduation } from "./graduation-common.js"; class Student { graduation = null; - constructor(id, name, groups) { + constructor(id, name, group) { this.id = id; this.name = name; - this.groups = groups; + this.group = group; } async getIconUrl() { return await getUserIconUrl(this.id); } - getGroupName() { - return `g${this.id}${this.name.replace(' ', '')}`; - } - - getRealGroups() { - if(typeof this.groups === "string") { - return [this.groups]; - } - return this.groups.filter((g) => g !== this.getGroupName()); + getGroup() { + return this.group; } async getGraduation() { @@ -75,14 +68,13 @@ async function fetchStudents(idFilter, nameFilter, groupFilter) { const id = match[1]; const groupCell = row.querySelector(".c5"); - const groupsText = groupCell.querySelector("a.quickeditlink").textContent; - const groups = groupsText.trim().split(", "); + const group = groupCell.querySelector("a.quickeditlink").textContent; if ((!idFilter || id === idFilter) && (!nameFilter || name.includes(nameFilter)) && - (!groupFilter || groups.filter((g) => g.includes(groupFilter)))) + (!groupFilter || group.includes(groupFilter))) { - students.push(new Student(id, name, groups)); + students.push(new Student(id, name, group)); } }); return students; |
