Filter out Modules that offer Evening Classes
Feature Request
So some of us go for semester long Industrial Attachments as part of our curriculum. And during those semesters, we have extra MCs that we can take and would like to fill them up with some classes. But the thing is, there is no way to search for evening modules. It's only that your own home Faculty emails you the list. But sometimes you want to clear modules from other faculties/departments too. And finding their list is a hassle as they have different websites.
Describe the solution you'd like
Since NUSMODS has all the information of modules, we could add an extra filter that will show modules that offer classes after 18:00, as that's what the University considers as an evening class. And this would apply to all faculties, and we can browse at our whim.
Describe alternatives you've considered
Right now, trying to compile a pdf list that contains the module timings released from various faculties. But this is a slow process as we have to reach out on platforms such as Reddit and wait for students to send in the files. "Ctrl-F" is a nice feature on Pdfs, but I think we can do better.
Additional context
Not any. Just want a filter button to filter the evening modules, that's all! Thanks y'all! =)
Hey @thebirdgr, thanks for the feature request!
Just so that we can refine what we should constitute as a "evening class", do you mind sharing or directing me to information about "classes after 18:00, as that's what the University considers as an evening class"?
Specifically, we need to know what NUS constitutes as an evening class for us to write the filtering logic. e.g. Do all lectures/tutorials/sectional teaching sessions have to be after 1800 to be considered an "evening class"? What if a module has a 2 lecture options, one after 1800, one at 1200. Will that mod be counted as a "evening class", etc. etc.
Hello @chrisgzf,
I cannot find any NUS website that has information on what constitutes as an evening module. Because it's mainly based on the emails that they've sent to students.
So based on the email, here are the assumptions:
- A module should have one evening lecture option "and" one evening tutorial option(if applicable ) to be considered as evening module
- This module may offer morning classes simultaneously
- Evening classes start after 1800Hrs, as that's when most offices end work. (Source). (P.S 9 hours of work starting at 9am.) However, NUS also allows a student to enrol in a module if it doesn't interfere with working hours, meaning if one's work ends at 7pm, they can't enrol in a module that has a lecture that begins at 6pm.
- If a module has no classes after 1800Hrs, both a lecture and a tutorial, then it is considered a morning class and the student will be dropped from the module if found enrolled.
- The workload and prerequisites of the module do not play a role.
I hope this information is enough to implement this feature. Right now we're running a python script to call the API and register for classes, all based on the above assumptions. Thanks!
@thebirdgr nice! That's very useful. Do you mind sharing the python script?
@chrisgzf Sorry for the late reply!
This script was written by : @yanquantan
EDIT: The code doesn't fit in the code block for some reason, but it's everything below this line.
` import requests import pprint import pickle5 as pickle
AY = "2021-2022" sem = 2 cutoffTime = 1800
x = requests.get("https://api.nusmods.com/v2/" + AY + "/moduleList.json") moduleList = x.json()
wantedMods = {} count = 0
for mod in moduleList: modCode = mod["moduleCode"]
modNum = "".join(char for char in modCode if char.isdigit())
if int(modNum) < 5000:
x = requests.get("https://api.nusmods.com/v2/" + AY + "/modules/" + modCode + ".json")
modInfo = x.json()
for modInfoBySem in modInfo["semesterData"]:
if modInfoBySem["semester"] == sem:
for lesson in modInfoBySem["timetable"]:
if int(lesson["startTime"]) > cutoffTime - 1:
wantedMods[modCode] = modInfoBySem
count += 1
print(count)
print(wantedMods.keys()) try: geeky_file = open("geekyfile", "wb") pickle.dump(wantedMods.keys(), geeky_file) geeky_file.close()
except: print("Something went wrong") `