-
Notifications
You must be signed in to change notification settings - Fork 226
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
Fix order of annotations on feedback view and file view to be consistent #1590
Conversation
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.
Tested on nightly and works as expected. LGTM.
Left a comment on one line of the code.
Archive.get_nth_filename(@files, annotation.position) | ||
else | ||
@submission.filename | ||
end |
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.
I'm curious as to why do we need a duplication of this code in this controller as well?
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.
LGTM!
Looks like this PR caused this, will make a hotfix, thanks for finding the bug. @michellexliu for visibility since you're requesting computing services to merge this PR into deployment. |
Description
Previously, the annotations on the "viewFeedback" page were sorted by creation date of the annotation, while the annotations on the file view were sorted by line number, which meant order wasn't maintained among the two views.
Previous feedback and file view:
![Screen Shot 2022-09-17 at 15 39 09](https://user-images.githubusercontent.com/25730111/190873922-a79019fb-3fa4-4e29-bfb9-470019013e23.png)
![Screen Shot 2022-09-17 at 15 38 45](https://user-images.githubusercontent.com/25730111/190873928-2419ae24-2583-4425-82f8-48e4e8360938.png)
I added sorting to both
viewFeedback.html.erb
and_annotation_pane.html.erb
to first sort by the filename the annotation was added to, and then to sort by the line number. The lambda functionget_correct_filename
was added toassessments_controller.rb
since in multiple instances, we need to get the proper filename / change the filename if it's the autograded output or it's an archived file, inviewFeedback.html.erb
.submissions_controller.rb
also received similar code to append the proper filename toproblemSummaries
.Revised annotation ordering for feedback and file view:
![Screen Shot 2022-09-17 at 15 38 18](https://user-images.githubusercontent.com/25730111/190874214-f509d6e1-ffae-4f4f-800a-d93cbf467ae3.png)
![Screen Shot 2022-09-17 at 15 38 30](https://user-images.githubusercontent.com/25730111/190874215-aabf1107-62f5-4fdd-a3e6-a61827b8fc46.png)
Motivation and Context
This issue was brought up by the 122 team, as they saw that "the order of annotations in the student feedback when they click on the score is not the same as the order when you look at the file page." There was also a TODO in
viewFeedback.html.erb
to make order of annotations consistent with the order of the file list.How Has This Been Tested?
Types of changes
Checklist:
overcommit --install && overcommit --sign
to use pre-commit hook for linting