<% # 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 . %> <% css_bundle :reports %> <% js_bundle :teacher_activity_report %> <% add_crumb(t('crumbs.interaction_report', "Student Interactions Report")) %> <% provide :page_title, t('title', 'Teacher Activity Report') %>

<%= t('headings.teacher_activity', "Teacher Activity Report for %{teacher}", :teacher => @teacher.name) %>

<% @courses.each do |course, students| %>

<%= course.name %>

<% if students.blank? %> <%= t 'no_students', 'There are no students to report on.' %> <% else %> <% if course.user_has_been_instructor?(@current_user) %> <% end %> <% students.each_with_index do |student, idx| %> <% if course.user_has_been_instructor?(@current_user) %> <% end %> <% end %>
<%= t 'headings.student_name', %{Student} %> <%= t 'headings.last_interaction', 'Last Student Interaction' %> <%= t('headings.current_score', %{Current Score}) %> <%= t('headings.final_score', %{Final Score}) %> <%= t('headings.ungraded', %{Ungraded Assignments}) %> 
<%= link_to(student[:enrollment].user.name, course_user_url(course, student[:enrollment].user_id)) %> <% if student[:last_interaction] %> <%= t 'last_time', { :zero => "less than 1 day ago", :one => "1 day ago", :other => "%{count} days ago" }, :count => (((Time.now - student[:last_interaction])/60)/1440).abs.to_i %> <% else %> <%= t 'last_time_never', 'never' %> <% end %> <%= n(student[:enrollment].computed_current_score, percentage: true, precision: 1) %> <%= n(student[:enrollment].computed_final_score, percentage: true, precision: 1) %> <% student[:ungraded].each do |submission| %> <%= link_to(submission.assignment.title, speed_grader_course_gradebook_path(course, assignment_id: submission.assignment.id, student_id: student[:enrollment].user_id)) %>
<% if submission.submitted_at %> <%= t 'submitted_time', { :zero => "submitted less than 1 day ago", :one => "submitted 1 day ago", :other => "submitted %{count} days ago" }, :count => (((Time.now - submission.submitted_at)/60)/1440).abs.to_i %> <% end %>
<% end %>
<% end %> <% if params[:student_id] %>
<%= link_to(t('links.view_full_course', 'View the full Student Interaction Report for %{course}', :course => course.name), user_course_teacher_activity_url(@teacher, course), :class => 'view_full_link') %>
<% end %>
<% end %>