<commit_before><%
   @guide = @exercise.guide
   @stats = @guide.stats_for(current_user)
%>


<div class="bs-callout bs-callout-<%= class_for_status assignment.status %>">
  <h4>
    <strong><%= fa_icon icon_type_for_status(assignment.status) %> <%= t(assignment.status) %></strong>
  </h4>

  <% if assignment.results_visible? %>
    <div>
      <% if assignment.expectation_results_visible? %>
        <div class="results-item">
          <strong><%= t :unmeet_expectations %>:</strong>
          <ul class="results-list">
            <% assignment.visible_expectation_results.each do |it| %>
              <li><%= status_icon(it[:result]) %> <%= t_expectation_result it[:binding], it[:inspection] %></li>
            <% end %>
          </ul>
        </div>
      <% end %>
      <% if render_feedback?(assignment) %>
        <div class="results-item">
          <strong><%= t :feedback %>:</strong>

          <div>
            <%= assignment.feedback_html %>
          </div>
          <a data-toggle="collapse" href="#results-section" class="text-danger">
            <%= fa_icon 'question-circle' %> <%= t :details %>
          </a>
        </div>
      <% end %>
      <div id="results-section" class="<%= 'collapse' if render_feedback?(assignment) %> results-item">
        <strong><%= t :test_results %>:</strong>

        <%= render_test_results assignment %>
      </div>
    </div>
  <% elsif assignment.passed? %>
    <div>
      <h4><%= t(:exercise_done) %></h4>
    </div>
  <% else %>
    <div></div>
  <% end %>

  <%= corollary_box @exercise unless assignment.should_retry? %>

</div>

<% @comments.each do |comment| %>
  <div class="bs-callout bs-callout-<%= comment.type %>">
    <h6> <%= comment.author %></h6>
    <div>
      <%= comment.content_html %>
    </div>
  </div>
<% end %>

<div class="row">
  <div class="col-md-12">
    <%= mail_to contact_email,
                fa_icon(:bug, text: t(:notify_problem_with_exercise)),
                subject: t(:problem_with_exercise, title: assignment.exercise.name),
                body: assignment_help_email_body(assignment),
                class: 'text-info warning pull-left' %>
  </div>
</div>

<div class="row">
  <div class="col-md-12">
    <div class="actions">
      <%= next_button(@exercise) || next_button(@guide) %>
    </div>
  </div>
</div>

<script>
  $('.progress-list-item.active').attr('class', "<%= class_for_progress_list_item(@exercise, true) %>");

  <% if guide_finished_by_solution %>
  $('#guide-done').modal();<commit_msg>Fixing next button bug at the end of guide<commit_after><%
   @guide = @exercise.guide
   @stats = @guide.stats_for(current_user)
%>


<div class="bs-callout bs-callout-<%= class_for_status assignment.status %>">
  <h4>
    <strong><%= fa_icon icon_type_for_status(assignment.status) %> <%= t(assignment.status) %></strong>
  </h4>

  <% if assignment.results_visible? %>
    <div>
      <% if assignment.expectation_results_visible? %>
        <div class="results-item">
          <strong><%= t :unmeet_expectations %>:</strong>
          <ul class="results-list">
            <% assignment.visible_expectation_results.each do |it| %>
              <li><%= status_icon(it[:result]) %> <%= t_expectation_result it[:binding], it[:inspection] %></li>
            <% end %>
          </ul>
        </div>
      <% end %>
      <% if render_feedback?(assignment) %>
        <div class="results-item">
          <strong><%= t :feedback %>:</strong>

          <div>
            <%= assignment.feedback_html %>
          </div>
          <a data-toggle="collapse" href="#results-section" class="text-danger">
            <%= fa_icon 'question-circle' %> <%= t :details %>
          </a>
        </div>
      <% end %>
      <div id="results-section" class="<%= 'collapse' if render_feedback?(assignment) %> results-item">
        <strong><%= t :test_results %>:</strong>

        <%= render_test_results assignment %>
      </div>
    </div>
  <% elsif assignment.passed? %>
    <div>
      <h4><%= t(:exercise_done) %></h4>
    </div>
  <% else %>
    <div></div>
  <% end %>

  <%= corollary_box @exercise unless assignment.should_retry? %>

</div>

<% @comments.each do |comment| %>
  <div class="bs-callout bs-callout-<%= comment.type %>">
    <h6> <%= comment.author %></h6>
    <div>
      <%= comment.content_html %>
    </div>
  </div>
<% end %>

<div class="row">
  <div class="col-md-12">
    <%= mail_to contact_email,
                fa_icon(:bug, text: t(:notify_problem_with_exercise)),
                subject: t(:problem_with_exercise, title: assignment.exercise.name),
                body: assignment_help_email_body(assignment),
                class: 'text-info warning pull-left' %>
  </div>
</div>

<div class="row">
  <div class="col-md-12">
    <div class="actions">
      <%= next_button(@exercise) || next_button(@guide.usage_in_organization) %>
    </div>
  </div>
</div>

<script>
  $('.progress-list-item.active').attr('class', "<%= class_for_progress_list_item(@exercise, true) %>");

  <% if guide_finished_by_solution %>
  $('#guide-done').modal();
{'fraction_non_alphanumeric': 0.19442809495781832, 'fraction_numerical': 0.003923876790268786, 'mean_word_length': 2.7157434402332363, 'pattern_counts': {'":': 0, '<': 175, '<?xml version=': 0, '>': 175, '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': '244947', 'n_tokens_mistral': 1851, 'n_tokens_neox': 1647, 'n_words': 305}