Submitty / Submitty

Homework Submission, Automated Grading, and TA grading system.
http://submitty.org
BSD 3-Clause "New" or "Revised" License
657 stars 789 forks source link

Exception thrown when managing rotating sections by removing unregistered students when all students are removed from rotating sections #8900

Closed shailpatels closed 1 year ago

shailpatels commented 1 year ago

Describe the bug There appears to be an exception thrown if the user selects " Remove all students from rotating sections " followed by a "Remove unregistered students (registration section=NULL) from rotating sections and put newly registered students into rotating section with fewest members "

image

Expected behavior No exception should be thrown, if the user is trying to do something invalid or wrong an error message should be shown instead

To Reproduce Steps to reproduce the behavior:

  1. Go to the manage sections page in a course
  2. Scroll down to the Manage Rotating Sections part of the page
  3. Select the radio button " Remove all students from rotating sections " and hit submit
  4. Then select the radio button "Remove unregistered students (registration section=NULL) from rotating sections and put newly registered students into rotating section with fewest members " and hit submit
  5. See error

Additional context The operation does appear to do something, the sections are distributed back after the first removal so not sure if this is completely failing or what the expected behavior is

This appears to only happen when there's more than 2 rotating sections

jason490 commented 1 year ago

To be more specific, the issue is when there is no one in the rotating sections the curr_section_sizes would contain NULL elements, which would break the array_map, since its subtracting using a NULL element