From 2e964ad022f17e2833798ff927eee818c3e1d995 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Wed, 25 Mar 2015 12:25:51 +0100 Subject: Add BEP and elective/USE --- js/courses.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'js') diff --git a/js/courses.js b/js/courses.js index 7dc6867..7bcfc2b 100644 --- a/js/courses.js +++ b/js/courses.js @@ -31,6 +31,7 @@ define(['assert'], function(assert) { { "id": "2IIC0", "name": "Business Information Systems","when": "Y3Q1" }, { "id": "2IID0", "name": "Web Analytics", "when": "Y3Q2" }, { "id": "2IO90", "name": "DBL Algorithms", "when": "Y3Q2" }, + { "id": "DS004", "name": "Bachelor End Project", "when": "Y3Q3,Y3Q4" }, ]; function getQuartile(when) { @@ -58,7 +59,23 @@ define(['assert'], function(assert) { assert (!(course.id in coursesById), "Course is already known: " + course.id); coursesById[course.id] = course; - getQuartile(course.when).push(course); + course.when.split(",").forEach(function(when) { + getQuartile(when).push(course); + }); + }); + + // fill in the remaining time slots + schedule.forEach(function(year, year_i) { + year.forEach(function(quartile, quartile_i) { + while (quartile.length < 3) { + quartile.push({ + "id": "", + "name": "Elective / USE", + "type": "elective", + "when": "Y" + (year_i + 1) + "Q" + (quartile_i + 1) + }); + } + }); }); return { -- cgit v1.2.1