diff --git a/spec.js b/spec.js
index 19b3287..f727230 100644
--- a/spec.js
+++ b/spec.js
@@ -18,13 +18,19 @@ parseExcel = async function (file) {
const rows = XLSX.utils.sheet_to_row_object_array(workbook.Sheets[sheetName]);
for (const row of rows) {
let id = row["Tárgykód"];
+ const name = row["Tárgy címe, előadó neve"].replace(/,.*/, "");
if (!id.startsWith("IB0"))
- id = id.replaceAll(/[‑-]\d{5}/g, "").replaceAll(/‑/g, "-");
- id = row["Tárgy címe, előadó neve"].indexOf("tehetséggondozó") !== -1 ? id + "-TG" : id;
- const subject = subjects[id];
+ id = id.replaceAll(/[‑-]\d{5}/g, "");
+ id = id.replaceAll(/‑/g, "-");
+ id = name.indexOf("tehetséggondozó") !== -1 ? id + "-TG" : id;
+ let subject = subjects[id];
if (!subject) {
- console.warn("Subject not found: " + id + " " + row["Tárgy címe, előadó neve"]);
- continue;
+ if (id.startsWith("X"))
+ subject = new SubjectData(id, name, 0, [szabvalCat]);
+ else {
+ console.warn("Subject not found: " + id + " " + name);
+ continue;
+ }
}
let grade = /\((\d)\)(?!.*\(\d\))/.exec(row["Jegyek"]);
if (grade == null)
@@ -44,10 +50,39 @@ parseExcel = async function (file) {
total[category.id] += sub.credit;
}
}
+ const print = (cat, name, total, needed) => specsSpan.innerHTML += name + ": " + total + "/" + (needed ?? cat.neededCredit) + "
";
specsSpan.innerHTML = "";
- for (const tk of Object.keys(total)) {
- const cat = tryGetCat(tk);
- specsSpan.innerHTML += cat.name + ": " + total[tk] + "/" + cat.neededCredit + "
";
+ let kotvalTotal = 0;
+ for (const spec of specs) {
+ specsSpan.innerHTML += "