Tuks Timetable
Tuks Timetable is a free app I created to help University of Pretoria students create timetables without clashes, and then use that timetable in their academic lives.
The application is available on the Google Play Store , and has hit 8500 users. It is also available on the Apple App Store, and has hit 2700 users. The app also reached #5 on the App Store’s South African Top Charts for productivity apps.
Technologies Used
- Ionic 3
- Angular 5
- Node.js with Puppeteer to scrape timetable data
Some primary design values were taken into account:
- I wanted the app to be useful
- I didn’t want to pay too much for a server (the app should be self-sustaining)
- I want the application to be fast
- The application should be up-to-date
The application was developed using Ionic 3 with Angular 5 and TypeScript. Node.js was used for scraping timetable information.
My end goal was to make a mobile application which could be used on a day-to-day basis and provide useful information. Due to my previous experience with web development, the app was created primarily using web technologies. This allows for the application to easily be made cross-platform, and an iOS version will be released in future.
Something from nothing
The university provides information on their website for students to use. This is either delivered through their Oracle PeopleSoft interface “UPNet” or via their Blackboard interface “ClickUP”. Both of these solutions are (in my opinion and the opinion of most students) slow and difficult to use.
A major issue I found was timetable creation. Some faculties provide students with a premade timetable that neatly fits all of their modules into the right places, and that’s the end of that. But most students have to find where their modules’ lectures, practicals and tutorials take place from a +/- 7000 row table, and fiddle around until they manage to find a combination that works without clashes.
The university has since “improved” this slightly by reducing the table to only include modules which students are registered for – except this is an anti-pattern. Students want to find out if a module will clash before they register for it. Now they can’t.
All of this leads to a slow, arduous process to start out the semester. Which is where Tuks Timetable comes in: a solution to timetable generation at the University of Pretoria.
Scraping University Information
As mentioned, University of Pretoria provides timetable, practical, tutorial, test and examination dates and times on their website. The exact location and format of this information has changed over the years. At the time of writing, the university requires logging in to view this information, where it can be downloaded as a .csv file.
I created a simple web scraper to download this .csv file from the website using my own log-in information. This was a surprisingly difficult task, as Oracle Peoplesoft seems to refuse to use routing, and instead uses cookies and POST requests for absolutely every navigation step.
The csv format is easy to manipulate, and is a very space-efficient storage format (compared to say, JSON or XML) and is even more so when gzip compression is used.
The csv files are stored on my personal website server, and are downloaded by the application when needed (when the application is first installed, and then periodically from there on). The csv files are then parsed and manipulated client-side. Manipulation such as changing venues from “Brown Lab” to “Brown Lab – Informatorium” occurs to help new students find lecture venues easier.
Timetable Generation
Generating a timetable is a more complex problem than I had anticipated. Daily university timetable information (containing lectures, tutorials and practicals) is provided in a format as follows:
University timetable information
These event types are then further divided into groups. Users can select a specific group for an event type (some lecturers force students into groups to evenly divide lecture venues), or they can choose to try any group that will work.
The crux of the generator is finding all combinations of what the user has selected. This means all combinations of each group for each type of each module.
Initially, this was implemented recursively, as it makes sense from a mathematical standpoint; however, some modules, such as COS132 above, have many groups, and some cases would result in over 2GB of memory being used. Instead, a simple iterative function was made, which disposes of resulting combinations that have too many clashes.
The resulting timetables are sorted according to the number of clashes (those with 0 clashes being presented first), and then sorted according to either early days, late days, number of breaks or longest breaks (the user can choose which sorting algorithm to use).
Timetable Changes
The university has certain days of the semester where the timetable doesn’t follow a normal week. There are public holidays, timetable changes, recess, exam periods, etc.
The application automatically swaps days for timetable changes, and hides events on days that are holidays.