<commit_before><% @page_title = "Checker Grader" %>
<% cur_reg = current_user.registration_for(@course)
   cur_reg_staff = cur_reg&.staff? %>

<p>
  <%= link_to "< Back to submission", course_assignment_submission_path(@course, @assignment, @submission) %>
</p>

<h1>Submission</h1>

<%= render 'submissions/sub_info' %>


<h1>Scoring Details: Checker grader</h1>

<h3>
  <%= @grading_header %>
  <% if cur_reg_staff && @grading_output.kind_of?(TapParser) %>
  <%= link_to Upload.upload_path_for(@grade.grading_output), class: "btn btn-default" do %>
    <i class="glyphicon glyphicon-download-alt"></i> Download raw output
  <% end %>

  <span class="pull-right">Total score:
    <%= to_fixed(@grading_output.points_earned) %>&nbsp;/&nbsp;
    <%= to_fixed(@grading_output.points_available)%>
  </span>
  <% end %>
</h3>
<% if @grading_output.kind_of?(String) %>
<pre><%= @grading_output %></pre>
<% else %>
<div id="tests">
  <% if @grading_header == "Selected test results" && @tests.empty? %>
  <h4>There is at least one failed test, but this assignment is not
    going to show you any hints.</h4>
  <% end %>
  <% @tests.each do |t| %>
    <% if t[:passed] %>
      <div class="alert alert-success">
        <p>
          <% if cur_reg_staff %>
          <span class="pull-right">Weight: <%= t[:info]["weight"] %></span>
          <% end %>
          <b>Passed:</b> <%= t[:info]['message'] %>
          <% if t[:info]["actual"] %>
          <% unless t[:comment].strip.empty? %>
          (using <code><%= t[:comment].strip %></code><% if t[:info]["tolerance"] %>
          with tolerance <code><%= t[:info]["tolerance"] %></code><% end %>)
          <% end %>
          <% end %>
        </p>
        <% if t[:info]["timeout"] || t[:info]["stack"] %>
        <p><b>Test:</b> <%= t[:comment] %></p>
        <% end %>
      </div>
    <% else %>
      <div class="alert alert-danger">
        <p>
          <% if cur_reg_staff %>
          <span class="pull-right">Weight: <%= t[:info]["weight"] %></span>
          <% end %>
          <b>Failed:</b> <%= t[:info]['message'] %>
          <% if t[:info]["actual"] %>
          <% unless t[:comment].strip.empty? %>
          (using <code><%= t[:comment].strip %></code><% if t[:info]["tolerance"] %>
          with tolerance <code><%= t[:info]["tolerance"] %></code><% end %>)
          <% end %>
          <% end %>
        </p>
        <% if t[:info]["timeout"] || t[:info]["stack"] %>
        <p><b>Test:</b> <%= t[:comment] %></p>
        <% end %>
        <% if t[:info]["methodName"] %>
        <p>Method signature:
          <code class="text-muted"><%= t[:info]["methodName"] %>(<%= t[:info]["paramNames"].to_sentence %>)</code>
        </p>
        <p style="display: inline-block;">Given arguments:
          <dl class="dl-horizontal">
            <% t[:info]["paramNames"].zip(t[:info]["args"]).each do |param, arg| %>
            <dt><code><%= param %></code></dt>
            <dd><pre><%= arg.join("\n") %></pre></dd>
            <% end %>
          </dl>
        </p>
        <%= render "actual_expected", locals: {actual: t[:info]["actual"], expected: t[:info]["expected"] } %>
        <% elsif t[:info]["timeout"] %>
        <p style="display: inline-block;">Stack:</p>
        <pre><%= t[:info]["stack"].join("\n") %></pre>
        <% elsif t[:info]["targetClassName"] %>
        <p>Target: <code class="text-muted"><%= t[:info]["targetClassName"] %></code></p>
        <% if t[:info]["arguments"] %>
        <div>
        <p style="display: inline-block;">Arguments:</p>
        <pre><%= t[:info]["arguments"].join(",\n") %></pre>
        </div>
        <% end %>
        <p></p>
        <div class="row">
          <div class="col-sm-6">
            <p><b>Actual:</b></p>
            <p>Exception name: <code class="text-muted"><%= t[:info]["actualExnName"] %></code></p>
            <p>Exception message: <code class="text-muted"><%= t[:info]["actualExnMessage"] %></code></p>
          </div>
          <div class="col-sm-6">
            <p><b>Expected:</b></p>
            <% if t[:info]["expectedExnName"] %>
            <p>Exception name: <code class="text-muted"><%= t[:info]["expectedExnName"] %></code></p>
            <p>Exception message: <code class="text-muted"><%= t[:info]["expectedExnMessage"] %></code></p>
            <% else %>
            <p>No exception</p>
            <% end %>
          </div>
          <% if t[:info]["stack"] %>
          <div>
          <p style="display: inline-block;">Stack:</p>
          <pre><%= t[:info]["stack"].join("\n") %></pre>
          </div>
          <% end %><commit_msg>style improvements<commit_after><% @page_title = "Checker Grader" %>
<% cur_reg = current_user.registration_for(@course)
   cur_reg_staff = cur_reg&.staff? %>

<p>
  <%= link_to "< Back to submission", course_assignment_submission_path(@course, @assignment, @submission) %>
</p>

<h1>Submission</h1>

<%= render 'submissions/sub_info' %>


<h1>Scoring Details: Checker grader</h1>

<h3>
  <%= @grading_header %>
  <% if cur_reg_staff && @grading_output.kind_of?(TapParser) %>
  <%= link_to Upload.upload_path_for(@grade.grading_output), class: "btn btn-default" do %>
    <i class="glyphicon glyphicon-download-alt"></i> Download raw output
  <% end %>

  <span class="pull-right">Total score:
    <%= to_fixed(@grading_output.points_earned) %>&nbsp;/&nbsp;
    <%= to_fixed(@grading_output.points_available)%>
  </span>
  <% end %>
</h3>
<% if @grading_output.kind_of?(String) %>
<pre><%= @grading_output %></pre>
<% else %>
<div id="tests">
  <% if @grading_header == "Selected test results" && @tests.empty? %>
  <h4>There is at least one failed test, but this assignment is not
    going to show you any hints.</h4>
  <% end %>
  <% @tests.each do |t| %>
    <% if t[:passed] %>
      <div class="alert alert-success">
        <p>
          <% if cur_reg_staff %>
          <span class="pull-right">Weight: <%= t[:info]["weight"] %></span>
          <% end %>
          <b>Passed:</b> <%= t[:info]['message'] %>
          <% if t[:info]["actual"] %>
          <% unless t[:comment].strip.empty? %>
          (using <code><%= t[:comment].strip %></code><% if t[:info]["tolerance"] %>
          with tolerance <code><%= t[:info]["tolerance"] %></code><% end %>)
          <% end %>
          <% end %>
        </p>
        <% if t[:info]["timeout"] || t[:info]["stack"] %>
        <p><b>Test:</b> <%= t[:comment] %></p>
        <% end %>
      </div>
    <% else %>
      <div class="alert alert-danger">
        <p>
          <% if cur_reg_staff %>
          <span class="pull-right">Weight: <%= t[:info]["weight"] %></span>
          <% end %>
          <b>Failed:</b> <%= t[:info]['message'] %>
          <% if t[:info]["actual"] %>
          <% unless t[:comment].strip.empty? %>
          (using <code><%= t[:comment].strip %></code><% if t[:info]["tolerance"] %>
          with tolerance <code><%= t[:info]["tolerance"] %></code><% end %>)
          <% end %>
          <% end %>
        </p>
        <% if t[:info]["timeout"] || t[:info]["stack"] %>
        <p><b>Test:</b> <%= t[:comment] %></p>
        <% end %>
        <% if t[:info]["methodName"] %>
        <p>Method signature:
          <code class="text-muted"><%= t[:info]["methodName"] %>(<%= t[:info]["paramNames"].to_sentence %>)</code>
        </p>
        <p style="display: inline-block;">Given arguments:
          <dl class="dl-horizontal">
            <% t[:info]["paramNames"].zip(t[:info]["args"]).each do |param, arg| %>
            <dt><code><%= param %></code></dt>
            <dd><pre><%= arg.join("\n") %></pre></dd>
            <% end %>
          </dl>
        </p>
        <%= render "actual_expected", locals: {actual: t[:info]["actual"], expected: t[:info]["expected"] } %>
        <% elsif t[:info]["timeout"] %>
        <p style="display: inline-block;">Stack:</p>
        <pre><%= t[:info]["stack"].join("\n") %></pre>
        <% elsif t[:info]["targetClassName"] %>
        <p>Target: <code class="text-muted"><%= t[:info]["targetClassName"] %></code></p>
        <% if t[:info]["arguments"] %>
        <div class="col-sm-12">
        <p style="display: inline-block;">Arguments:</p>
        <pre><%= t[:info]["arguments"].join(",\n") %></pre>
        </div>
        <% end %>
        <p></p>
        <div class="row">
          <div class="col-sm-6">
            <p><b>Actual:</b></p>
            <p>Exception name: <code class="text-muted"><%= t[:info]["actualExnName"] %></code></p>
            <p>Exception message: <code class="text-muted"><%= t[:info]["actualExnMessage"] %></code></p>
          </div>
          <div class="col-sm-6">
            <p><b>Expected:</b></p>
            <% if t[:info]["expectedExnName"] %>
            <p>Exception name: <code class="text-muted"><%= t[:info]["expectedExnName"] %></code></p>
            <p>Exception message: <code class="text-muted"><%= t[:info]["expectedExnMessage"] %></code></p>
            <% else %>
            <p>No exception</p>
            <% end %>
          </div>
          <% if t[:info]["stack"] %>
          <div class="col-sm-12">
          <p style="display: inline-block;">Stack:</p>
          <pre><%= t[:info]["stack"].join("\n") %></pre>
          </div>
          <% end %>
{'fraction_non_alphanumeric': 0.24591759489564183, 'fraction_numerical': 0.0025954363577376446, 'mean_word_length': 2.513677811550152, 'pattern_counts': {'":': 0, '<': 387, '<?xml version=': 0, '>': 385, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '242849', 'n_tokens_mistral': 3367, 'n_tokens_neox': 3089, 'n_words': 569}