-
Notifications
You must be signed in to change notification settings - Fork 340
Fix TA mode for lecture lessons #3930
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
Open
leslieyip02
wants to merge
6
commits into
nusmodifications:master
Choose a base branch
from
leslieyip02:fix-ta-mode-for-lecture-lessons
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1910c07
Fix hover icon
leslieyip02 9438551
Make lectures TA-able
leslieyip02 3af7817
Add startTime and day to TaModulesConfig
leslieyip02 bc6eb5b
Update serialization
leslieyip02 ddec499
Update export types
leslieyip02 e56d83f
Fix tests
leslieyip02 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TaModulesConfig
is starting to get quite big. I'm starting to think that it would be better to store this state differently. With this PR the state would look like:Instead, we could have
addTaLesson
actions overwrite the "lessons" keyed object like so:Note that we would have to change the type of the values for
ModuleLessonConfig
to an array.Coincidentally (or not), this change causes the state schema for "ta" and "hidden" to match -- they are both arrays of
ModuleCode
s.For readability, we can go even further and replace
["G01", "0800", "Monday"]
with:Hence, the resulting state would look like:
As for the serialized state, it changes from
CS2103T=LEC:G01&ta=CS2103T(LEC:G01:0800:Monday)
toCS2103T=LEC:G01:0800:Monday&ta=CS2103T
.State transitions should be pretty straightforward in theory. When switching from TA to non-TA mode, we should also pick the first lesson for each type and discard the rest.
Let me know what you think, and if you'd like to work on this! This would be a pretty big change since it modifies the existing schema for modules, so feel free to break it up into more easily reviewable chunks, i.e.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, I think it makes sense to update the schema. I'll start working on those PRs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thing I'm not sure how to handle is that there are some mods with lessons with identical startTime, endTime and day (e.g. HSI1000). The only thing differentiating the lessons are the weeks and venue. In this case, should we add weeks/venue to the schema as well? I feel that it would be introducing bloat for such a rare scenario though.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a problem. Can we hold off on the addition of
startTime
andendTime
and any other distinguishing identifiers for now? Let's make it possible to add lectures to TA in a separate PR, and spend some more time figuring out what we really need to make this feature possible.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that makes sense to me.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the meantime, I'll also try to look for the edge cases that aren't covered so we can try to figure out what the minimum identifying info is:
So far, it looks like we need day, start time, end time, weeks and lesson type.
I think weeks might be a problem for serialization because it can either be an array or JSON.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah... Furthermore, currently things fail silently, so I think it would make sense to notify users when any discrepancies are found. It would be a separate issue though
Yeah, that's part of the validation. currently I am handling it naively such that when it finds a non-valid lesson in normal mode it would also try to recover by finding lessons with the same classNo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@leslieyip02 For the 4th example, suppose there were 2 classes, 4 lessons
LEC:01 <- currently selected
TUT:01 <- currently selected
LEC:02
TUT:02
Do we need to make it such selecting LEC:02 will also switch the tutorial lesson type to TUT:02?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zwliew @leslieyip02 From #3930 (comment)
I think it would be better to take into account the lessons that the user currently have selected in TA mode, it's also not too difficult to implement
Recording.2025-07-09.192301.1.mp4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zwliew @leslieyip02 Since this discussion has veered from the original PR review, I have created a discussion which I think would be a more appropriate place to talk about the proposed changes and discuss the implementation
#4098