import type { Graduation } from "./graduation-common.ts"; /** * Class to represent Students. */ export class Student { id: number; name: string; graduation: Graduation | null = null; constructor(id: number, name: string) { this.id = id; this.name = name; } /** static async fetchById(id: number) { let name = ""; const res = await fetch(`/user/view.php?id=${id}&course=${getCourseId()}`); const doc = new DOMParser().parseFromString(await res.text(), "text/html"); name = doc.querySelector("div.page-header-headings > h2")!.textContent; const cards = doc.querySelectorAll("div.card-body dl"); for (const card of cards) { if (card.querySelector("dt")!.textContent !== "Gruppe") continue; break; } return new Student(id, name); } */ }