nusmods icon indicating copy to clipboard operation
nusmods copied to clipboard

Allow filtering for "evening courses"

Open kokrui opened this issue 1 year ago • 7 comments

This has historically been a very common request. We should allow users to filter courses by whether they are "evening" course.

I'm not sure if there is a universally-agreed definition of "evening course", but I think a reasonable implementation could be that for all types of slots (lecture/tutorial/lab/etc.), there must exist at least 1 slot that is beyond 6pm

Feel free to suggest alternative interpretations though!

kokrui avatar Mar 13 '24 06:03 kokrui

Hi @kokrui. Judging from the context, most student would want the filtering for choosing modules to take on Industrial Attachments or ATAP. NUS allows a student to enroll in a module if it doesn't interfere with working hours, meaning if one's work ends at 5pm, they can enroll in a module that has a lecture that begins at 530pm.

Hence, I think that it would be better for the filtering to allow user to choose the time they want to consider as evening (e.g. beyond 7pm/ beyond 5pm), instead of fix at 6pm.

jushg avatar Mar 13 '24 07:03 jushg

This could be a generic filter that allows people to filter by time for modules that satisfy the condition that @kokrui mentioned. So it can apply for 5pm onwards, 5.30pm onwards, etc.

woojiahao avatar Mar 13 '24 07:03 woojiahao

I think a good implementation of that generic filter would have a time slider. Either way, an implementation of this would require sending more data to Elastic servers. We will need to include SemesterData.timetable, or at least pre-process for the latest possible classes, in the payload to index ~modules~ courses by latest classes, so that the data can be exposed to the filter.

Also that we probably will have to filter courses that have both lectures and tutorials after given time...?

On a side note, I'm thinking if having a mock payload for elastic search result is worth the overhead, considering any frontend development right now related to new features relies on live data...

chew01 avatar Mar 13 '24 08:03 chew01

A time slider/picker sounds good and I'd be happy to accept PRs that implement that -- I think we can extend this to 2 time sliders for "BEFORE" and "AFTER", for people who want to end lessons early / start lessons late / a combination of both.

I can't think of a good concise wording to capture the "forall slot types, there exists 1 slot that's before/after X" right now though, hm

kokrui avatar Mar 15 '24 04:03 kokrui

This is a good reference PR for adding filterable fields! https://github.com/nusmodifications/nusmods/pull/3666

kokrui avatar Mar 20 '24 06:03 kokrui

I'll work on this!

luciusyeo avatar Aug 21 '24 07:08 luciusyeo

I'm interested to try this out!

Punpun1643 avatar Jul 23 '25 09:07 Punpun1643