From f749e8f700f839532b2885ba11894cbe65248cb2 Mon Sep 17 00:00:00 2001 From: david-yz-liu Date: Sat, 21 Nov 2026 16:23:25 -0500 Subject: [PATCH 1/2] Assign graders to groups with uncollected submissions when skipping empty submissions When "Assign graders to collected submissions with no files submitted" was unchecked, groups whose submissions had not yet been collected were skipped along with empty ones. Now only groups whose collected submission is empty are skipped, matching the setting's tooltip. Also clarified the setting's label and documented it. Co-Authored-By: Claude Opus 5.5 --- app/controllers/graders_controller.rb | 9 ++++--- config/locales/views/graders/en.yml | 2 +- .../assignments/assigning-graders.md | 6 +++++ spec/controllers/graders_controller_spec.rb | 24 ++++++++++++++++--- 4 files changed, 34 insertions(+), 7 deletions(-) diff --git a/app/controllers/graders_controller.rb b/app/controllers/graders_controller.rb index 7a4fde1352..0fe16f3ad2 100644 --- a/app/controllers/graders_controller.rb +++ b/app/controllers/graders_controller.rb @@ -251,10 +251,13 @@ def unassign_graders(grouping_ids, grader_ids) Grouping.unassign_tas(grader_membership_ids, grouping_ids, @assignment) end - # Returns array of grouping ids with non empty submissions + # Returns the subset of +grouping_ids+ excluding groupings whose collected submission is empty. + # Groupings whose submissions have not yet been collected are kept. def filter_empty_submissions(grouping_ids) - Submission.where(grouping_id: grouping_ids, is_empty: false, submission_version_used: true) - .pluck(:grouping_id) + empty_grouping_ids = Submission.where(grouping_id: grouping_ids, is_empty: true, submission_version_used: true) + .pluck(:grouping_id) + .to_set + grouping_ids.reject { |id| empty_grouping_ids.include?(id.to_i) } end def filter_grouping_by_section(section_assignments, assignment) diff --git a/config/locales/views/graders/en.yml b/config/locales/views/graders/en.yml index 22929a8001..860b85cc72 100644 --- a/config/locales/views/graders/en.yml +++ b/config/locales/views/graders/en.yml @@ -28,7 +28,7 @@ en: random_instruction: Assign a weight for each grader for randomized assignment. With the default weights of 1, all graders will be assigned an equal number of groups. select_a_criterion: Select at least one criterion select_a_grader: Select at least one grader to assign. - skip_empty_submissions: Assign graders to groups with no files submitted + skip_empty_submissions: Assign graders to collected submissions with no files submitted skip_empty_submissions_tooltip: When unchecked, groups are skipped if their submissions have been collected and no files were submitted. upload: remove_existing_mappings: Remove existing grader assignments diff --git a/docs/docs/instructors/assignments/assigning-graders.md b/docs/docs/instructors/assignments/assigning-graders.md index 81424ed01c..07aaf2a3c4 100644 --- a/docs/docs/instructors/assignments/assigning-graders.md +++ b/docs/docs/instructors/assignments/assigning-graders.md @@ -65,6 +65,12 @@ Upon clicking the button, a modal will prompt you to assign a weighting to each ![Unassign Graders](/images/graders-unassign.png) +#### Groups with Empty Submissions + +By default, when graders are assigned to groups, any selected group whose collected submission contains no files is skipped, and a message is displayed indicating that a grader was not assigned. Groups whose submissions have not yet been collected are always assigned, so graders can be assigned before submissions are collected. + +To also assign graders to groups whose collected submission contains no files, check "Assign graders to collected submissions with no files submitted" above the groups table. + #### Assign to Criteria Graders can also be assigned to mark individual criteria from the "Criteria" tab (not available for marks spreadsheets). diff --git a/spec/controllers/graders_controller_spec.rb b/spec/controllers/graders_controller_spec.rb index 258e575dba..2251c0000a 100644 --- a/spec/controllers/graders_controller_spec.rb +++ b/spec/controllers/graders_controller_spec.rb @@ -877,8 +877,22 @@ context 'and the group has no submission' do let(:submission) { nil } - it 'should not assign graders' do - expect(@grouping1.tas).to be_empty + it 'should assign graders' do + expect(@grouping1.tas).to include(@ta1) + end + + it 'should not display a message about skipped groups' do + expect(flash[:notice]).to be_nil + end + end + + context 'and the group has an uncollected submission' do + let(:submission) do + create(:submission, grouping: @grouping1, is_empty: true, submission_version_used: false) + end + + it 'should assign graders' do + expect(@grouping1.tas).to include(@ta1) end end @@ -893,9 +907,13 @@ context 'and the group has an empty submission' do let(:submission) { create(:version_used_submission, grouping: @grouping1, is_empty: true) } - it 'should assign graders' do + it 'should not assign graders' do expect(@grouping1.tas).to be_empty end + + it 'should display a message about skipped groups' do + expect(flash[:notice]).to have_message(I18n.t('graders.group_submission_no_files')) + end end end From 721df2d4a960f41e60d2bac5b6001fa26939380a Mon Sep 17 00:00:00 2001 From: david-yz-liu Date: Sat, 21 Nov 2026 16:24:31 -0500 Subject: [PATCH 2/2] Updated Changelog Co-Authored-By: Claude Opus 5.5 --- Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Changelog.md b/Changelog.md index beb5010996..9e56f1b8fa 100644 --- a/Changelog.md +++ b/Changelog.md @@ -41,6 +41,7 @@ - Added additional details to the account settings and renamed the Settings dropdown to Account (#8207) ### 🐛 Bug fixes +- Fixed graders not being assigned to groups whose submissions have not been collected when skipping groups with empty submissions (#8315) - Fixed an error when changing an annotation's deduction on a result with no mark yet for the annotation category's criterion (#8313) - Fixed active marking criteria re-expanding immediately after being collapsed (#8309) - Fixed validations not matching schema length limit by adding a schema limit for exam template names and tag names (#8272)