<% # 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 . %> <% provide_blank :right_side %>

<%= t(:page_title, 'Grades') %>

<% unless @presenter.student_enrollments.empty? %>

<%= t('titles.current_student_courses', "Courses I'm Taking") %>

<% @presenter.student_enrollments.each do |course, enrollment| %> <% end %>
<%= course.name %> <%= @presenter.grade(course:, user: @current_user, grades: @grades, grading_periods: @grading_periods) %> <%= image_tag "email.png", :alt => t('Send a Message to the Teacher') %> <% if @grading_periods[course.id] %> <%= render partial: "shared/grading_periods_selector", locals: {selected_period_id: @grading_periods[course.id][:selected_period_id], enrollment_id: enrollment.global_id, grading_periods: @grading_periods[course.id][:periods], all_grading_periods_option: course.display_totals_for_all_grading_periods?} %> <% end %>
<% end %> <% unless @presenter.observed_enrollments.empty? %>

<%= t('linked_student_accounts', 'Linked Student Accounts') %>

<% @presenter.observed_enrollments.each do |enrollment| %> <% end %>
<%= context_user_name(enrollment.course, enrollment.user_id) %>, <%= enrollment.course.name %> <% if enrollment.course.hide_final_grades? || (@grading_periods[enrollment.course_id] && @grading_periods[enrollment.course_id][:selected_period_id] == 0) && !enrollment.course.display_totals_for_all_grading_periods?%> -- <% elsif @grades&.dig(:observed_enrollments, enrollment.course_id, enrollment.user_id) %> <% if enrollment.course.restrict_quantitative_data?(@current_user) %> <%= enrollment.course.score_to_grade(@grades[:observed_enrollments][enrollment.course_id][enrollment.user_id], user: @current_user) %> <% else %> <%= @grades[:observed_enrollments][enrollment.course_id][enrollment.user_id] %>% <% end %> <% else %> <%= t('no_grade', 'no grade') %> <% end %> <%= image_tag "email.png", :alt => t('Send a Message to the Teacher') %> <% if @grading_periods[enrollment.course_id] %> <%= render partial: "shared/grading_periods_selector", locals: {selected_period_id: @grading_periods[enrollment.course_id][:selected_period_id], enrollment_id: enrollment.global_id, grading_periods: @grading_periods[enrollment.course_id][:periods], all_grading_periods_option: enrollment.course.display_totals_for_all_grading_periods?} %> <% end %>
<% end %> <% unless @presenter.teacher_enrollments.empty? %>

<%= t('current_teacher_courses', "Courses I'm Teaching") %>

<% @presenter.teacher_enrollments.each do |enrollment| %> <% end %>
<%= enrollment.course.name %> <% if @presenter.course_grade_summaries[enrollment.course_id][:score] %> <% if enrollment.course.restrict_quantitative_data?(@current_user)%> <%= enrollment.course.score_to_grade(@presenter.course_grade_summaries[enrollment.course_id][:score], user: @current_user)%> <%else%> <%= n(@presenter.course_grade_summaries[enrollment.course_id][:score], percentage: true, precision: 2) %> <%end%>
<%= t('average_grades', {:one => "average for 1 student", :other => "average for %{count} students"}, :count => @presenter.course_grade_summaries[enrollment.course_id][:students]) %>
<% else %> <%= t('no_grades', 'no grades') %> <% end %>
<%= image_tag "email.png", :alt => t('Send a Message to the Teacher') %> <%= link_to(t('links.teacher_activity', 'Student Interactions Report'), user_course_teacher_activity_url(@current_user, enrollment.course_id)) unless @presenter.course_grade_summaries[enrollment.course_id][:students].try(:zero?) %>
<% end %> <% unless @presenter.prior_enrollments.empty? %> <% end %>