diff --git a/app/models/grouping.rb b/app/models/grouping.rb index d1ad226267..a449507f4e 100644 --- a/app/models/grouping.rb +++ b/app/models/grouping.rb @@ -558,14 +558,13 @@ def all_assigned_criteria(ta_array) end return result.map{|a| a.criterion}.uniq end - - # Get the section for this group. Since all students must be in the same section to - # be in the same group, return the section name for the first student with a section. + + # Get the section for this group. If assignment restricts member of a groupe + # to a section, all students are in the same section. Therefore, return only + # the inviters section def section - self.students.each do |student| - if student.has_section? - return student.section.name - end + if !self.inviter.nil? and self.inviter.has_section? + return self.inviter.section.name end return '-' end diff --git a/app/views/submissions/_submissions_table_sorting_links.html.erb b/app/views/submissions/_submissions_table_sorting_links.html.erb index a0cb05e7d3..12381f4dae 100644 --- a/app/views/submissions/_submissions_table_sorting_links.html.erb +++ b/app/views/submissions/_submissions_table_sorting_links.html.erb @@ -66,6 +66,7 @@ :sort_by => 'total_mark', :desc => (sort_by == 'total_mark' && desc.blank?) %> + <% if assignment.section_groups_only %>