<% # Copyright (C) 2011 - present Instructure, Inc. # # This file is part of Canvas. # # Canvas is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as published by the Free # Software Foundation, version 3 of the License. # # Canvas is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU Affero General Public License for more # details. # # You should have received a copy of the GNU Affero General Public License along # with this program. If not, see . %> <% sidebar_weighting ||= nil %> <% groups = sidebar_weighting || @context.assignment_groups.active %>
<% if @context.group_weighting_scheme == "percent" %>

<%= before_label 'assignments_weighting', 'Assignments are weighted by group' %>

<% if groups.empty? %> <% else %> <% tally = 0 %> <% groups.each do |group| %> <% tally += group.group_weight || 0 %> <% end %> <% end %>
<%= t('headings.group', %{Group}) %> <%= t('headings.weight', %{Weight}) %>
<%= t('no_groups', %{No Groups Set Up}) %>
<%= group.name || t('default_name', "Group") %> <%= group.group_weight ? n(group.group_weight, percentage: true) : t('none') %>
<%= t('headings.total', %{Total}) %> <%= n(tally, percentage: true) %>
<% else %>

<%= t('not_weighted', 'Course assignments are not weighted.') %>

<% end %>