Skip to content

Commit

Permalink
Display section of a group in the submission view only if it is a "se…
Browse files Browse the repository at this point in the history
…ction

groups only" assignment.
  • Loading branch information
NelleV authored and lakeskysea committed Feb 6, 2012
1 parent d9b90f5 commit e257ad7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
13 changes: 6 additions & 7 deletions app/models/grouping.rb
Expand Up @@ -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
Expand Down
Expand Up @@ -66,6 +66,7 @@
:sort_by => 'total_mark',
:desc => (sort_by == 'total_mark' && desc.blank?) %>
</th>
<% if assignment.section_groups_only %>
<th class="<%="ap_sorting_by" if (sort_by == 'section')%>
<%="ap_sorting_by_desc" if (sort_by == 'section' && !desc.blank?)%>">
<%= link_to I18n.t("browse_submissions.section"),
Expand All @@ -76,6 +77,7 @@
:sort_by => 'section',
:desc => (sort_by == 'section' && desc.blank?) %>
</th>
<% end %>
<th>
<%= I18n.t("browse_submissions.can_begin_grading") %>
</th>
Expand Down
Expand Up @@ -128,9 +128,14 @@
<% end %>
<% end %>
</td>

<%# We don't need to display the section of the group unless it is a section group
assignment %>
<% if assignment.section_groups_only %>
<td>
<%= h(grouping.section) %>
</td>
<% end %>
<td>
<% if Time.now >= assignment.submission_rule.calculate_grouping_collection_time(grouping) %>
<%= image_tag('icons/tick.png') %>
Expand Down

0 comments on commit e257ad7

Please sign in to comment.