Add course schedules for ISF and ITZS programs for 2026 and 2024 sessions

- Created new snapshot files for ISF credits and daily schedules for the 26-АРХ and 26-ПГС programs.
- Added summer 2026 and winter 2024 exam schedules for the 23-ИТзс program, detailing lectures, labs, and consultations.
This commit is contained in:
2026-10-19 22:55:28 +03:00
parent 15851b26cd
commit e38c388462
24 changed files with 73775 additions and 70942 deletions

View File

@@ -1,7 +1,8 @@
import test from "node:test";
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import { groupsIn, parseDocx, parseWord } from "../server/parser.js";
import { groupsIn, parseDocx, parseWord, details, leadingDate, leadingTime } from "../server/parser.js";
import { parseWeekRanges } from "../shared/weeks.js";
import { decodeListing, fileMetadata } from "../server/source.js";
const fixture = (name) =>
readFileSync(new URL(`./fixtures/${name}.docx`, import.meta.url));
@@ -236,3 +237,39 @@ test("Расписание зачетов: дата перед днём неде
],
);
});
test("Пометки недель из нескольких частей через «;» и «,»", () => {
for (const [cell, condition, ranges] of [
["1-4н.;6-12н. Современная политэкономия (п.з.)", "1-4н.;6-12н.", [[1, 4], [6, 12]]],
["1-4;10-14н. Материаловедение и технологии (л.)", "1-4;10-14н.", [[1, 4], [10, 14]]],
["2,4н.;10-16н. Охрана труда (л.з.)", "2,4н.;10-16н.", [[2, 2], [4, 4], [10, 16]]],
["2-5 н., 10-17 н. Конструкция автомобиля (л.)", "2-5 н., 10-17 н.", [[2, 5], [10, 17]]],
]) {
const d = details(cell);
assert.equal(d.condition, condition, cell);
assert.deepEqual(parseWeekRanges(d.condition), ranges, cell);
assert.ok(!/^\d/.test(d.subject), d.subject);
}
});
test("Дата и время в начале ячейки", () => {
assert.equal(leadingDate("3.12 Микроконтроллерные устройства", 2026).date, "2026-12-03");
assert.equal(leadingDate("24.11. Алгоритмы компьютерной графики", 2026).date, "2026-11-24");
assert.equal(leadingDate("09.09.Конструкционные материалы", 2026).date, "2026-09-09");
assert.equal(leadingDate("12.09.26г. Аналитическая геометрия", 2026).date, "2026-09-12");
assert.equal(leadingDate("14.02 Химия", 2026).date, "2027-02-14");
// Not dates: a time, an ambiguous one-digit day, a list handled by DATE_LIST.
assert.equal(leadingDate("9.00 Информационный час", 2026), null);
assert.equal(leadingDate("9.10 Химия", 2026), null);
assert.equal(leadingDate("03.12, 17.12 Химия", 2026), null);
assert.deepEqual(leadingTime("11:10-11:30 – информационный час"), { starts: ["11:10"], end: "11:30", length: 11 });
assert.deepEqual(leadingTime("9.00 Информационный час").starts, ["09:00"]);
assert.deepEqual(leadingTime("18.35. Налоговое право").starts, ["18:35"]);
assert.deepEqual(leadingTime("17.00 и 18.35 Русский язык").starts, ["17:00", "18:35"]);
assert.deepEqual(leadingTime("18.35+20.10 Новополоцк").starts, ["18:35", "20:10"]);
// "20.10" is also 20 October: only taken as a time when the caller says so.
assert.equal(leadingTime("20.10 Теория государственного управления"), null);
assert.deepEqual(leadingTime("20.10 Теория государственного управления", true).starts, ["20:10"]);
assert.equal(leadingTime("3.12 Микроконтроллерные устройства", true), null);
});