<commit_before><div class="page-header">
  <h1><%= @training.title %></h1>
</div>
<p class="well"><%= @training.description.html_safe %></p>

<%= render partial: "file_uploads/download_files",
           locals: {owner: @training}%>

<div id="training-stop-pos"><br></div>

<hr/>
<div class="step-list">
  <% (1..@summary[:questions].length).each do |i| %>
      <% if i == @summary[:step] %>
          <%= link_to i, "?step=#{i}#training-stop-pos", class: "step step-current" %>
      <% elsif @summary[:finalised].include? @summary[:questions][i - 1] %>
          <%= link_to i, "?step=#{i}#training-stop-pos", class: "step step-done" %>
      <% else %>
          <% can_access = (curr_user_course.is_staff? or @training.skippable? or i == @summary[:next_undone]) %>
          <%= link_to i, "#{('?step=' + i.to_s) if can_access }#training-stop-pos", class: "step  #{can_access ? 'step-available' : 'step-disabled'}" %>
      <% end %>
  <% end %>
</div>
<hr/>

<% if !@summary[:current] %>
    <h2>Congratulations, you're done!</h2>
    <p>
      <a href="<%= course_assessment_submission_path(@course, @assessment, @submission)%>">
        Click here
      </a> to review your answers.
    </p>
<% else %>
    <form id="training-step-form">
      <input type="hidden" name="step" class="doing-step" value="<%= @summary[:step] %>">
      <input type="hidden" name="next_undone" class="next-undone" value="<%= @summary[:next_undone] %>">
      <input type="hidden" name="update_url"
             value="<%= submit_course_assessment_submission_path(@course, @assessment, @submission) %>" />
      <input type="hidden" name="qid" value="<%= @summary[:current].question.id %>" />

      <% if @summary[:current].class == Assessment::McqQuestion %>
          <%= render partial:"assessment/training_submissions/do_mcq", locals: {mcq: @summary[:current]} %>
      <% elsif @summary[:current].class == Assessment::CodingQuestion %>
          <%= render partial:"assessment/training_submissions/do_coding", locals: {question: @summary[:current], prefilled: @summary[:prefilled]} %>
      <% end %>

      <div class="form-actions">
        <% if @summary[:current].class == Assessment::McqQuestion %>
            <%= link_to "Submit", '#', :class => 'btn btn-primary', :id => 'submit-btn' %>
        <% elsif @summary[:current].class == Assessment::CodingQuestion %>
            <%= link_to "Run (ALT+R)", '#', class:'btn btn-danger', id:"pathrun" %>
            <!--<input id="pathrun" class="path_button" type="button" value="Run (ALT+R)" />-->
        <% end %>

        <%= link_to "Continue",
                    edit_course_assessment_submission_path(@course, @assessment, @submission, from_lesson_plan: @from_lesson_plan.nil? ? false : true, anchor: 'training-stop-pos', step: @summary[:step] + 1), :class => 'btn disabled',
                    :id => 'continue-btn' %>
      </div>
    </form>

    <% if curr_user_course.is_staff? %>
        <%= render partial: "comments/list",
                   locals: { comments:  CommentTopic.comments_to_json(@summary[:current].comment_topic, curr_user_course),
                             target:    @summary[:current],
                             header:    "Comments on the Question",
                             margin_left: "0px" } %>
    <% end %>
    <% if @training.assessment.allow_discussion? %>
        <div id="discussion-wrapper">
            <%= render partial: 'forums/topics/discussion', locals: { owner: @summary[:current].question, title: (@summary[:current].class.name + @summary[:current].question.get_title_for_nil ) } %>
        </div>
    <% end %>
<% end %><commit_msg>Proper conflict resolution following previous merge<commit_after><div class="page-header">
  <h1><%= @training.title %></h1>
</div>
<p class="well"><%= @training.description.html_safe %></p>

<%= render partial: "file_uploads/download_files",
           locals: {owner: @training}%>

<div id="training-stop-pos"><br></div>

<hr/>
<div class="step-list">
  <% (1..@summary[:questions].length).each do |i| %>
      <% if i == @summary[:step] %>
          <%= link_to i, "?step=#{i}#training-stop-pos", class: "step step-current" %>
      <% elsif @summary[:finalised].include? @summary[:questions][i - 1] %>
          <%= link_to i, "?step=#{i}#training-stop-pos", class: "step step-done" %>
      <% else %>
          <% can_access = (curr_user_course.is_staff? or @training.skippable? or i == @summary[:next_undone]) %>
          <%= link_to i, "#{('?step=' + i.to_s) if can_access }#training-stop-pos", class: "step  #{can_access ? 'step-available' : 'step-disabled'}" %>
      <% end %>
  <% end %>
</div>
<hr/>

<% if !@summary[:current] %>
    <h2>Congratulations, you're done!</h2>
    <p>
      <a href="<%= course_assessment_submission_path(@course, @assessment, @submission)%>">
        Click here
      </a> to review your answers.
    </p>
<% else %>
    <form id="training-step-form">
      <input type="hidden" name="step" class="doing-step" value="<%= @summary[:step] %>">
      <input type="hidden" name="next_undone" class="next-undone" value="<%= @summary[:next_undone] %>">
      <input type="hidden" name="update_url"
             value="<%= submit_course_assessment_submission_path(@course, @assessment, @submission) %>" />
      <input type="hidden" name="qid" value="<%= @summary[:current].question.id %>" />

      <% if @summary[:current].class == Assessment::McqQuestion %>
          <%= render partial:"assessment/training_submissions/do_mcq", locals: {mcq: @summary[:current]} %>
      <% elsif @summary[:current].class == Assessment::CodingQuestion %>
          <%= render partial:"assessment/training_submissions/do_coding", locals: {question: @summary[:current], prefilled: @summary[:prefilled]} %>
      <% end %>

      <div class="form-actions">
        <% if @summary[:current].class == Assessment::McqQuestion %>
            <%= link_to "Submit", '#', :class => 'btn btn-primary', :id => 'submit-btn' %>
        <% elsif @summary[:current].class == Assessment::CodingQuestion %>
            <%= link_to "Run (ALT+R)", '#', class:'btn btn-danger', id:"pathrun" %>
            <!--<input id="pathrun" class="path_button" type="button" value="Run (ALT+R)" />-->
        <% end %>

        <%= link_to "Continue",
                    edit_course_assessment_submission_path(@course, @assessment, @submission, from_lesson_plan: @from_lesson_plan.nil? ? false : true, anchor: 'training-stop-pos', step: @summary[:step] + 1), :class => 'btn disabled',
                    :id => 'continue-btn' %>
      </div>
    </form>

    <% if curr_user_course.is_staff? %>
        <%= render partial: "comments/list",
                   locals: { comments:  CommentTopic.comments_to_json(@summary[:current].comment_topic, curr_user_course),
                             target:    @summary[:current],
                             header:    "Comments on the Question",
                             margin_left: "0px" } %>
    <% end %>
    <% if @training.assessment.allow_discussion? %>
        <div id="discussion-wrapper">
            <%= render partial: 'forums/topics/discussion', locals: { owner: @summary[:current].question, title: (@summary[:current].class.name + '-' + @summary[:current].question.get_title_for_nil), sub: @submission.id, step: @summary[:step], from_lesson_plan: (local_assigns[:from_lesson_plan].nil? ? nil : true)} %>
        </div>
    <% end %>
<% end %>
{'fraction_non_alphanumeric': 0.19932795698924732, 'fraction_numerical': 0.002150537634408602, 'mean_word_length': 3.168627450980392, 'pattern_counts': {'":': 0, '<': 141, '<?xml version=': 0, '>': 149, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1790517', 'n_tokens_mistral': 2518, 'n_tokens_neox': 2330, 'n_words': 445}