Closed 20wildmanj closed 4 months ago
This set of changes introduces improved error handling and sorting logic in the scoreboards_controller.rb
, alongside UI adjustments in scoreboards/show.html.erb
to enhance user experience when encountering errors. The modifications aim to address specific bugs and enhance the robustness of the application by preventing crashes and displaying more informative error messages.
File Path | Change Summary |
---|---|
app/controllers/scoreboards_controller.rb |
Error handling in show , sorting logic adjustment, enhanced error messages and logging. |
app/views/scoreboards/_form.html.erb |
Modified form_for declaration and updated styling for error messages. |
app/views/scoreboards/show.html.erb |
Added error handling section and updated logic to prevent index out of bounds errors. |
config/routes.rb |
Removed get "help", on: :member route declaration within the scoreboard resource configuration. |
Objective | Addressed | Explanation |
---|---|---|
ArgumentError in scoreboards#show due to Hash comparison [#2086] |
✅ | |
Improve error handling and logging in scoreboard processing [#2086] | ✅ | |
Ensure UI gracefully handles errors and prevents index out of bounds [#2086] | ✅ |
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
When updating the assessment rb file, if you go straight to the scoreboard (i.e. don't load the assessment index page), there is an error about an undefined method.
However, after loading the assessment index page at least once, the error message is now as expected
Suspect it is because reload_config_file
is not called by assessments_controller.rb#update
When updating the assessment rb file, if you go straight to the scoreboard (i.e. don't load the assessment index page), there is an error about an undefined method.
However, after loading the assessment index page at least once, the error message is now as expected
Suspect it is because
reload_config_file
is not called byassessments_controller.rb#update
I noticed this while testing, not sure why going to index would resolve this though because doesn't seem that index doesn't do any calls to reload the config file? Not sure if it's worth looking into a fix for a hook that very few classes use (and the ones that do should understand how to reload the config file)
Description
scoreboardOrderSubmissions
, in the case that an exception is raised, and tells the instructor via an error message#show
so that if a bad sort / comparison occurs, the error can be caught#show
, revert to an empty array#show
view code, check that the current entry length is greater than the index in order to show a score, else show an error icon (which handles the empty array case)Motivation and Context
Closes #2086
How Has This Been Tested?
Import the provided assessment: randomlab5_20240217.tar.zip
Upload at least two submissions as students
View scoreboard, see that it renders fine (if it is not rendering fine, upload
autograder.tar
as the autograder)Upload the assessment config file
randomlab5-bad-scoreboard-order.rb
(in Edit Assessment you can upload)See that you get an error as follows:
Try to view scoreboard as a student and see that you get redirected back to assessment index with an error flash
Upload the initial assessment config file back, and then upload
autograde-bad.tar
as the new autograderRegrade all submissions
view scoreboard as instructor, see that following error appears:
View scoreboard as student, see that scoreboard is visible but error icons appear:
Upload the old autograder.tar back, and regrade all
Then add this code after line 296 in
scoreboards_controller.rb
:( you may need to also reload the config file)
view the scoreboard as an instructor, see the following error
As a student, see something like this (all the bad scoreboard entries are at the bottom)
Types of changes