Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- AA Sports Studies' HK Elective slots take only the eight PEd courses the CAS catalog marks as electives.
- The GWA card says when the latest sem's grades below 3.00 mean a warning, probation or worse under UPLB's rules on scholastic standing.
- A 4.00's removal picker says it turns into 5.00 after a year if it isn't removed.
- BS Agriculture students can pick Agronomy, Animal Science, Horticulture, Agricultural Systems, Landscape Agroforestry, Soil Science or Agricultural Extension as their major, and its major courses and seminar fill the major slots. Animal Science and the four ASI majors also fill their specialized course slots from their institute lists.
- BA Philosophy's Readings in Speculative Thought slot takes only SPEC, the AMIS code for that course.
- BA Sociology's social science electives take only Anthropology, History, Political Science or Psychology, as the CAS catalog footnote says.

Expand Down
6 changes: 3 additions & 3 deletions extension/curriculum-data.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const { UPLB_CATALOG } = require('./src/catalog.js');
// (GE, HK, NSTP, FE) or the data uses (MAJ for major elective slots), and
// real departments with no class in the listings we have.
const DEPTS = new Set(Object.keys(UPLB_CATALOG).map(c => c.split(' ')[0]));
['GE', 'HK', 'NSTP', 'FE', 'MAJ', 'HIST', 'PED', 'POSC', 'SOIL', 'MST', 'WLDL', 'AMPE', 'WIKA'].forEach(d => DEPTS.add(d));
['GE', 'HK', 'NSTP', 'FE', 'MAJ', 'HIST', 'PED', 'POSC', 'SOIL', 'MST', 'WLDL', 'AMPE', 'WIKA', 'AF'].forEach(d => DEPTS.add(d));
const CODE_RE = /^([A-Z]{2,6}|PEd) \d{1,3}(\.\d{1,2})?[A-Z]?( \(\d\))?$/;

function codeProblem(code) {
Expand Down Expand Up @@ -96,13 +96,13 @@ Object.values(UPLB_PROGRAMS).filter(p => p.tracks).forEach(p => {
// A specialization's `courses` rows are checked the same way; a row with a
// `slot` replaces that MAJ slot, any other row adds its units to the total.
// These are in the catalog PDFs but had no AMIS class in the terms we have.
const NOT_IN_AMIS = new Set(['FRM 110', 'BIO 151', 'BIO 130A', 'BIO 130B', 'MCB 101', 'BOT 110', 'BOT 140', 'ZOO 140', 'ZOO 113', 'CHEM 102', 'PHYS 193.1', 'WLDL 101']);
const NOT_IN_AMIS = new Set(['SFI 123', 'SFI 143', 'AF 199', 'SOIL 191', 'FRM 110', 'BIO 151', 'BIO 130A', 'BIO 130B', 'MCB 101', 'BOT 110', 'BOT 140', 'ZOO 140', 'ZOO 113', 'CHEM 102', 'PHYS 193.1', 'WLDL 101']);
const checklistCodes = new Set(Object.values(UPLB_PROGRAMS).flatMap(p => (p.majorCourses || []).map(c => normalizeCourseCode(c.code))));
Object.values(UPLB_PROGRAMS).filter(p => p.specializations).forEach(p => {
const rows = new Map((p.majorCourses || []).map(c => [normalizeCourseCode(c.code), c]));
const baseUnits = getPlannerCourses(p, p.defaultTrack).reduce((s, c) => s + c.units, 0);
Object.entries(p.specializations).forEach(([key, spec]) => {
if (!spec.name || !/page \d+/.test(spec.source || '')) fail(p.code, `specialization ${key} needs a name and a catalog page`);
if (!spec.name || !/page \d+|https:\/\//.test(spec.source || '')) fail(p.code, `specialization ${key} needs a name and a catalog page or link`);
const courseRows = spec.courses || [];
courseRows.forEach(c => {
if (c.slot && !(rows.get(c.slot) && rows.get(c.slot).genericRequirement === 'elective')) fail(p.code, `${key} slot ${c.slot} is not a MAJ elective row`);
Expand Down
12 changes: 12 additions & 0 deletions extension/requirements.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,3 +252,15 @@ assert.deepStrictEqual(lightSems([
const fill = fillRequirementSlots(math, [{ code: 'STAT 101', title: '', units: 3, result: 'passed' }]);
assert.ok(majors.every(c => !fill.has(c.code)), 'STAT is not a MATH major elective');
}

// BS Agriculture majors take their institute's major courses.
{
const passed = codes => codes.map(code => ({ code, title: '', units: 3, result: 'passed' }));
const agro = plannerCourseList(UPLB_PROGRAMS.BSAGRI, null, UPLB_CATALOG, 'agronomy');
const fill = fillRequirementSlots(agro, passed(['AGR 141', 'ENT 101']));
assert.strictEqual(fill.get('MAJ 1')?.code, 'AGR 141');
assert.strictEqual(fill.get('MAJ 4')?.code, 'ENT 101');
const soil = plannerCourseList(UPLB_PROGRAMS.BSAGRI, null, UPLB_CATALOG, 'soil');
assert.ok(['SOIL 101', 'SOIL 199'].every(code => soil.some(c => c.code === code)));
assert.ok(soil.filter(c => c.options).every(c => c.options.includes('SOIL 142')));
}
2 changes: 1 addition & 1 deletion extension/src/catalog.js

Large diffs are not rendered by default.

Loading
Loading