<% # evizitei: this template is used for submissions AND quiz_submissions, make sure methods used are available on both models %>

<% define_content :link do %>
  <%= course_assignment_submission_url(asset.assignment.context, asset.assignment, asset.user_id) %>
<% end %>

<% define_content :subject do %>
  <%= t :subject, "Assignment Graded: %{assignment}, %{context}", :assignment => asset.assignment.title, :context => asset.assignment.context.name %>
<% end %>

<% if send_student_names(asset, user) %>
<%= t "%{assignment} has been graded for %{name}.", assignment: asset.assignment.title, name: asset.user.name %>
<% else %>
<%= t :body, "Your assignment %{assignment} has been graded.", :assignment => asset.assignment.title %>
<% end %>

<%= t :graded_date, "graded: %{date}", :date => (datetime_string(force_zone(asset.graded_at)) rescue t(:no_date_set, "No Date Set")) %>
<% if user.try(:send_scores_in_emails?, asset.assignment.context) %>
  <% if asset.excused? %>
<%= t :excused, "This assignment has been excused." %>
  <% elsif asset.score %>
<%= t :score, "score:  %{score} out of %{total}", :score => asset.score, :total => (asset.assignment.points_possible || t(:not_applicable, "N/A")) %>
  <% end %>
<% end %>
<%= t(:score_pending_review, "score pending review by the teacher") if asset.pending_review? %>

<%= t(:link_message, "You can review the assignment here:") %>
<%= content :link %>
