define(['assert'], function(assert) { 'use strict'; // types: bc (bachelor college), major (default), bep // (assumption: every course is 5 ECTS and one must do 15 ECTS in a // quartile, filling it up with Electives) // for new courses without code, use "DS..." var courses = [ // Bachelor college core courses { "id": "2WAB0", "name": "Calculus", "type": "bc", "when": "Y1Q1" }, { "id": "3NAB0", "name": "Physics", "type": "bc", "when": "Y1Q2" }, { "id": "0LEB0", "name": "Modelling", "type": "bc", "when": "Y1Q3" }, { "id": "0SAB0", "name": "USE Basics", "type": "bc", "when": "Y1Q4" }, { "id": "7NXB0", "name": "Design", "type": "bc", "when": "Y2Q1" }, // Data Science basic courses { "id": "2IP90", "name": "Programming", "when": "Y1Q1" }, { "id": "DS001", "name": "Introduction to Data Science", "when": "Y1Q1" }, { "id": "2IT60", "name": "Logic and Set Theory", "when": "Y1Q2" }, { "id": "2IO80", "name": "DBL Hypermedia", "when": "Y1Q3" }, { "id": "2IC60", "name": "Computer networks and security", "when": "Y1Q4" }, { "id": "2ID40", "name": "Human Technology Interaction", "when": "Y1Q4" }, { "id": "2WF20", "name": "Linear Algebra", "when": "Y2Q1" }, { "id": "2IV60", "name": "Computer Graphics", "when": "Y2Q3" }, // Advanced courses { "id": "2ID50", "name": "Datamodelling and Databases", "when": "Y2Q2" }, { "id": "2ID60", "name": "Web Technology", "when": "Y2Q2" }, { "id": "DS002", "name": "Workflow", "when": "Y2Q3" }, { "id": "2IL50", "name": "Data Structures", "when": "Y2Q3" }, { "id": "2IOC0", "name": "DBL Information Systems", "when": "Y2Q4" }, { "id": "2DI90", "name": "Probability and Statistics", "when": "Y2Q4" }, { "id": "DS003", "name": "Data Visualization", "when": "Y3Q1" }, { "id": "2IIC0", "name": "Business Information Systems","when": "Y3Q1" }, { "id": "2IID0", "name": "Web Analytics", "when": "Y3Q2" }, { "id": "2IO90", "name": "DBL Algorithms", "when": "Y3Q2" }, ]; function getQuartile(when) { var y_q = /^Y([1-3])Q([1-4])$/.exec(when); assert(y_q, "Invalid when: " + when); var y_i = y_q[1] - 1, q_i = y_q[2] - 1; return schedule[y_i][q_i]; } var coursesById = {}; // 2d array from years to quartiles to courses var schedule = []; // make an empty schedule var years = 3, quartiles = 4; for (var i = 0; i < years; i++) { schedule[i] = []; for (var j = 0; j < quartiles; j++) { schedule[i][j] = []; } } // find all courses by ID and fill the schedule courses.forEach(function(course) { assert (!(course.id in coursesById), "Course is already known: " + course.id); coursesById[course.id] = course; getQuartile(course.when).push(course); }); return { "courses": courses, "schedule": schedule }; }); /* Packages: Programming - Linear Algebra - Computer Graphics - Data Visualisation Programming - Human Technology Interaction - Web Technology - Web Analytics Programming - Data Structures - DBL Algorithms Electives and USE: Year 1 - 2x Elective Year 2 - 3x Elective/USE Year 3 - 6x Elective/USE */