<commit_before><% @page_title = "Student Status Report" %>

<p>
<%= link_to "Back to Course: #{@course.name}", @course %>

<% if @logged_in_user.course_admin?(@course) %>
  | <%= link_to "Manage Registrations", course_registrations_path(@course) %>
<% end %>
</p>

<table class="pretty-list">
  <tr>
    <td>Course</td>
    <td><%= @course.name %></td>
  </tr>
  <tr>
    <td>User</td>
    <td><%= @user.name %></td>
  </tr>
  <tr>
    <td>Teacher?</td>
    <td>
      <%= @registration.teacher? ? "Yes" : "No" %>
      <% if @logged_in_user.course_admin?(@course) %>
        (<%= link_to "Edit", [:edit, @registration] %>)
      <% end %>
    </td>
  </tr>
</table>

<h1>Assignments</h1>

<table class="pretty-list">
  <tr>
    <th>Chapter</th>
    <th>Name</th>
    <th>Attempts</th>
    <th>Score</th>
    <th>Status</th>
    <th>Submission</th>
  </tr>

<% score_sum = 0; score_total = 0 %>

<% @course.chapters.order(:name).each do |chapter| %>
  <% chapter.assignments.order(:name).each do |assignment| %>
    <% sub = assignment.best_submission_for(@user) %>
    <% unless assignment.hide_grading? 
         score_sum += assignment.best_score_for(@user) 
       end %>
    <% score_total += assignment.points_available %>
    <tr>
      <td><%= chapter.name %></td>
      <td><%= assignment.name %></td>
      <td><%= assignment.submissions_for(@user).count %>
	(<%= link_to "List", user_assignment_submissions_path(@user, assignment) %>)
      </td>
      <td><%= show_score(assignment.best_score_for(@user), assignment)
	%>&nbsp;/&nbsp;<%= assignment.points_available %></td>
      <td><%= status_image(sub) %></td>
      <td><%= link_to "Best", sub %></td>
    </tr>
  <% end %>
<% end %>

<tr>
  <td><strong>Total</strong></td><commit_msg>Show grade source in student status report. (fixes #21)<commit_after><% @page_title = "Student Status Report" %>

<p>
<%= link_to "Back to Course: #{@course.name}", @course %>

<% if @logged_in_user.course_admin?(@course) %>
  | <%= link_to "Manage Registrations", course_registrations_path(@course) %>
<% end %>
</p>

<table class="pretty-list">
  <tr>
    <td>Course</td>
    <td><%= @course.name %></td>
  </tr>
  <tr>
    <td>User</td>
    <td><%= @user.name %></td>
  </tr>
  <tr>
    <td>Teacher?</td>
    <td>
      <%= @registration.teacher? ? "Yes" : "No" %>
      <% if @logged_in_user.course_admin?(@course) %>
        (<%= link_to "Edit", [:edit, @registration] %>)
      <% end %>
    </td>
  </tr>
</table>

<h1>Assignments</h1>

<table class="pretty-list">
  <tr>
    <th>Chapter</th>
    <th>Name</th>
    <th>Status</th>
    <th>Attempts</th>
    <th>Score</th>
    <th>Graded&nbsp;By</th>
    <th>Submission</th>
  </tr>

<% score_sum = 0; score_total = 0 %>

<% @course.chapters.order(:name).each do |chapter| %>
  <% chapter.assignments.order(:name).each do |assignment| %>
    <% sub = assignment.best_submission_for(@user) %>
    <% unless assignment.hide_grading? 
         score_sum += assignment.best_score_for(@user) 
       end %>
    <% score_total += assignment.points_available %>
    <tr>
      <td><%= chapter.name %></td>
      <td><%= assignment.name %></td>
      <td><%= status_image(sub) %></td>
      <td><%= assignment.submissions_for(@user).count %>
	(<%= link_to "List", user_assignment_submissions_path(@user, assignment) %>)
      </td>
      <td><%= show_score(assignment.best_score_for(@user), assignment)
	%>&nbsp;/&nbsp;<%= assignment.points_available %></td>
      <td>
	<% if sub.teacher_score? %>
	  Human
	<% else %>
	  Computer
	<% end %>
      </td>
      <td><%= link_to "Best", sub %></td>
    </tr>
  <% end %>
<% end %>

<tr>
  <td><strong>Total</strong></td>
{'fraction_non_alphanumeric': 0.22858701582105836, 'fraction_numerical': 0.002727768685215494, 'mean_word_length': 3.278879813302217, 'pattern_counts': {'":': 0, '<': 180, '<?xml version=': 0, '>': 180, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2871965', 'n_tokens_mistral': 1518, 'n_tokens_neox': 1383, 'n_words': 242}