Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 6 additions & 3 deletions app/controllers/graders_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion config/locales/views/graders/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions docs/docs/instructors/assignments/assigning-graders.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
24 changes: 21 additions & 3 deletions spec/controllers/graders_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down