-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update exam clash detection in the Module search page #3678
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@uyencfi is attempting to deploy a commit to a Personal Account owned by @nusmodifications on Vercel. @nusmodifications first needs to authorize it. |
Thanks for the PR! We'll test out scraper changes over the next few days and get back to you |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3678 +/- ##
==========================================
- Coverage 53.57% 53.50% -0.08%
==========================================
Files 273 273
Lines 5984 5992 +8
Branches 1430 1431 +1
==========================================
Hits 3206 3206
- Misses 2778 2786 +8 ☔ View full report in Codecov by Sentry. |
Quick live test case:
|
Hey, it looks like the exam for CM2112 got changed to be 2.30pm instead of 1pm, which makes it match HSI2001, so it's no longer that good of a candidate for a test case. A valid test case still exists: Sem 1, SH5110 vs FE5222 That said, let me take a look and test some things with your query and get back to you -- it looks pretty good right now, but for one, I think the query is inverted! (i.e. "No Exam Clash" gives us courses which do have an exam clash) |
Context
Fix #3663Implementation
Given
timetable = [m1, m2, m3]
which is the list of modules currently added in the timetable.To detect whether a module
X
clashes withtimetable
:X.start == m.start
(exact match) for each m in timetable(X.start < m.end) && (X.end > m.start)
for each m in timetable. This is the condition for 2 intervals to overlap, see https://stackoverflow.com/questions/325933/determine-whether-two-date-ranges-overlap❗ However, the module struct only stores examStartTime (ISO timestamp, assuming UTC(?)) and examDuration (in minutes). Thus to get the endTime:
m.end
can be easily obtained sincem
is a known value from the timetable.X.end
is more difficult since we need to compute it on-the-fly inside the Elasticsearch query.The new Elasticsearch query I have looks like
TBD
examStartTime
really stored in Elasticsearch in UTC or UTC+08?