nusmodifications / nusmods

🏫 Official course planning platform for National University of Singapore.
https://nusmods.com
MIT License
557 stars 270 forks source link

Improve module search page's exam clash detection #3663

Open kokrui opened 3 months ago

kokrui commented 3 months ago

In https://github.com/nusmodifications/nusmods/pull/3560, we improved our exam clash detection algorithm. Previously, we only checked for exam start times, but it's possible that an exam's end time overlaps with another exam's start time.

However, the "No Exam Clash (Sem X)" filters in our Module Search page still use the previous detection method. We should change it to the better exam clash detection algorithm.

https://github.com/nusmodifications/nusmods/blob/d99218bad72e5bed4245669a95d42aa27e1cf14b/website/src/views/modules/ModuleFinderSidebar.tsx#L53

This will require some elasticsearch-fu. Relevant docs: https://www.elastic.co/guide/en/elasticsearch/reference/8.12/query-dsl-range-query.html