2021-01-04 15:35:17 +00:00
|
|
|
|
class SubjectData {
|
2021-01-04 21:24:52 +00:00
|
|
|
|
constructor(id, name, credit, categories) {
|
2021-01-04 15:35:17 +00:00
|
|
|
|
this.id = id;
|
|
|
|
|
this.name = name;
|
|
|
|
|
this.credit = credit;
|
2021-01-04 21:24:52 +00:00
|
|
|
|
this.categories = categories;
|
2021-01-04 16:01:58 +00:00
|
|
|
|
this.grade = 0;
|
2021-01-25 17:43:05 +00:00
|
|
|
|
this.semester = 0;
|
2021-01-04 15:35:17 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class SubjectCategory {
|
2021-01-04 21:24:52 +00:00
|
|
|
|
constructor(id, name, neededCredit) {
|
2021-01-04 15:35:17 +00:00
|
|
|
|
this.id = id;
|
|
|
|
|
this.name = name;
|
|
|
|
|
this.spec = null;
|
2021-01-04 21:24:52 +00:00
|
|
|
|
this.neededCredit = neededCredit;
|
2021-01-04 15:35:17 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class Specialization {
|
|
|
|
|
constructor(id, name, matcat, infcat) {
|
|
|
|
|
this.id = id;
|
|
|
|
|
this.name = name;
|
|
|
|
|
this.matcat = matcat;
|
|
|
|
|
matcat.spec = this;
|
|
|
|
|
this.infcat = infcat;
|
|
|
|
|
infcat.spec = this;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-01-25 17:43:05 +00:00
|
|
|
|
class Semester {
|
|
|
|
|
constructor(firstYear, num) {
|
|
|
|
|
this.firstYear = firstYear;
|
|
|
|
|
this.num = num;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static parse(str) {
|
|
|
|
|
const regex = /(\d{4})\/\d{2}\/(\d)/g.exec(str);
|
|
|
|
|
return new Semester(+regex[1], +regex[2]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static current() {
|
|
|
|
|
const date = new Date();
|
|
|
|
|
const year = date.getFullYear();
|
|
|
|
|
const month = date.getMonth();
|
|
|
|
|
const s = new Semester(year, 1);
|
|
|
|
|
if (month === 0)
|
|
|
|
|
s.firstYear--;
|
|
|
|
|
else if (month < 8) {
|
|
|
|
|
s.firstYear--;
|
|
|
|
|
s.num++;
|
|
|
|
|
}
|
|
|
|
|
return s;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-01-04 21:24:52 +00:00
|
|
|
|
const kotMatCat = new SubjectCategory("MK‑ALA", "Kötelező matekos tárgyak", 46);
|
2021-01-25 16:09:10 +00:00
|
|
|
|
const kotInfCat = new SubjectCategory("MK‑SZT", "Kötelező infós tárgyak", 52);
|
2021-01-04 15:35:17 +00:00
|
|
|
|
kotSpec = new Specialization("KOT", "Kötelező tárgyak", kotMatCat, kotInfCat);
|
2021-01-04 21:24:52 +00:00
|
|
|
|
const kotvalMatCat = new SubjectCategory("MK‑DIF‑MATSZT", "Kötvál matekos tárgyak", 14);
|
|
|
|
|
const kotvalInfCat = new SubjectCategory("MK‑DIF‑INF", "Kötvál infós tárgyak", 23);
|
2021-01-04 15:35:17 +00:00
|
|
|
|
kotvalSpec = new Specialization("MK-DIF", "Specializáció nélkül", kotvalMatCat, kotvalInfCat);
|
|
|
|
|
kotvalEgyebCat = new SubjectCategory("MK‑DIFF‑EGYEB", "Kötvál egyéb tárgyak");
|
2021-01-04 21:24:52 +00:00
|
|
|
|
szakdogaCat = new SubjectCategory("MK‑SZD", "Szakdolgozat", 20);
|
|
|
|
|
szakmaiCat = new SubjectCategory("MK‑SZG", "Szakmai gyakorlat", 0);
|
|
|
|
|
szabvalCat = new SubjectCategory("MK‑SZV", "Szabadon választható tárgyak", 10);
|