<commit_before><!--Move to controller-->
<% if @summary[:type] == 'training' %>
    <% ast_edit_path = lambda {|a| edit_course_assessment_training_path(@course, a)} %>
    <% ast_path = lambda {|a| course_assessment_training_path(@course, a) } %>
<% else %>
    <% ast_edit_path = lambda {|a| edit_course_assessment_mission_path(@course, a)} %>
    <% ast_path = lambda {|a| course_assessment_mission_path(@course, a) } %>
<% end %>

<%- display_name = @course.customized_title(@summary[:type]).singularize -%>
<div class="page-header">
  <h1> <%= @summary[:specific].title %></h1>
</div>

<% if can? :manage, Assessment %>
    <div style="float: right">
      <%= link_to ast_edit_path.call(@summary[:specific]), class: "btn btn-large-icon" do %>
          <i class="icon-edit"></i>
      <% end %>
      <%= link_to ast_path.call(@summary[:specific]),
                  class: "btn btn-danger btn-large-icon",
                  method: "DELETE",
                  data: { confirm: t('.confirm',
                                     default: t("helpers.links.confirm",
                                                default: "Are you sure to delete #{@summary[:type]} '#{@summary[:specific].title}'?")) } do %>
          <i class="icon-trash"></i>
      <% end %>
    </div>
<% end %>

<h2 class="assignments-description-title"><%= display_name %> Description</h2>

<table class="table-top-align">
  <tr>
    <td>
      <div class="pull-left">
        <p><%= style_format(@summary[:specific].description) %></p>
        <%= render partial: "assessment/#{@summary[:type].pluralize}/details", locals: {ast: @summary[:specific] } %>
      </div>
    </td>

    <% if can? :manage, Assessment::Submission %>
        <td>
          <%= render partial: "assessment/#{@summary[:type].pluralize}/action", locals: {ast: @assessment} %>
        </td>
    <% end %>

  </tr>
</table>

<% if @summary[:specific].required_for.count > 0 %>
    <h3>Finish to unlock:</h3>
    <ul>
      <% @summary[:specific].dependent_by.each do |ast| %>
          <h4><li><%= ast.title %></li></h4>
      <% end %>
    </ul>
<% end %>

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


<% unless @summary[:specific].respond_to? :single_question? and @summary[:specific].single_question? %>
    <hr/>
    <% if can? :manage, @assessment %>
        <% if @summary[:allowed_questions].include? Assessment::McqQuestion %>
            <%= link_to t('.new', :default => t("helpers.links.new_mcq")),
                        new_course_assessment_assessment_mcq_question_path(@course, @assessment),
                        :class => 'btn btn-primary' %>
        <% end %>

        <% if @summary[:allowed_questions].include? Assessment::GeneralQuestion %>
            <%= link_to t('.new', :default => t("helpers.links.new_qn")),
                        new_course_assessment_assessment_general_question_path(@course, @assessment),
                        :class => 'btn btn-primary' %>
        <% end %>

        <% if @summary[:allowed_questions].include? Assessment::CodingQuestion %>
            <%= link_to t('.new', :default => t("helpers.links.new_cq")),
                        new_course_assessment_assessment_coding_question_path(@course, @assessment),
                        :class => 'btn btn-primary' %>
        <% end %>
    <% end %>
<% end %>

<% if can? :view_detail, @assessment %>
    <h2 class="asm-qns-title"><%= display_name %> Questions</h2>
    <table class="table asm-qns-table sort">
      <tbody class="asm-qns sortable-table" url="<%= reorder_course_assessment_path(@course, @assessment) %>">
      <% @summary[:questions].each_with_index do |qn, index| %>
          <% q = qn.as_question %>
          <tr class="asm-qn" id="sortable-item_<%= qn.id %>" >
            <td>
              <div>
                <div class="asm-qn-handler">
                  <i class="icon-move handler-icon"></i>
                  <h3 class="handler-text">Question <span class="asm-qn-index"><%= index + 1 %></span>
                    <%= ": #{q.title}" if !q.title.nil? and !q.title.empty? %>
                  </h3>
                </div><commit_msg>fix assessment show page<commit_after><!--Move to controller-->
<% if @summary[:type] == 'training' %>
    <% ast_edit_path = lambda {|a| edit_course_assessment_training_path(@course, a)} %>
    <% ast_path = lambda {|a| course_assessment_training_path(@course, a) } %>
<% else %>
    <% ast_edit_path = lambda {|a| edit_course_assessment_mission_path(@course, a)} %>
    <% ast_path = lambda {|a| course_assessment_mission_path(@course, a) } %>
<% end %>

<%- display_name = @course.customized_title(@summary[:type]).singularize -%>
<div class="page-header">
  <h1> <%= @summary[:specific].title %></h1>
</div>

<% if can? :manage, Assessment %>
    <div style="float: right">
      <%= link_to ast_edit_path.call(@summary[:specific]), class: "btn btn-large-icon" do %>
          <i class="icon-edit"></i>
      <% end %>
      <%= link_to ast_path.call(@summary[:specific]),
                  class: "btn btn-danger btn-large-icon",
                  method: "DELETE",
                  data: { confirm: t('.confirm',
                                     default: t("helpers.links.confirm",
                                                default: "Are you sure to delete #{@summary[:type]} '#{@summary[:specific].title}'?")) } do %>
          <i class="icon-trash"></i>
      <% end %>
    </div>
<% end %>

<h2 class="assignments-description-title"><%= display_name %> Description</h2>

<table class="table-top-align">
  <tr>
    <td>
      <div class="pull-left">
        <p><%= style_format(@summary[:specific].description) %></p>
        <%= render partial: "assessment/#{@summary[:type].pluralize}/details", locals: {ast: @summary[:specific] } %>
      </div>
    </td>

    <% if can? :manage, Assessment::Submission %>
        <td>
          <%= render partial: "assessment/#{@summary[:type].pluralize}/action", locals: {ast: @assessment} %>
        </td>
    <% end %>

  </tr>
</table>

<% if @assessment.required_for.count > 0 %>
    <h3>Finish to unlock:</h3>
    <ul>
      <% @assessment.required_for.each do |ast| %>
          <h4><li><%= ast.title %></li></h4>
      <% end %>
    </ul>
<% end %>

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


<hr/>
<% if can? :manage, @assessment %>
    <% if @summary[:allowed_questions].include? Assessment::McqQuestion %>
        <%= link_to t('.new', :default => t("helpers.links.new_mcq")),
                    new_course_assessment_assessment_mcq_question_path(@course, @assessment),
                    :class => 'btn btn-primary' %>
    <% end %>

    <% if @summary[:allowed_questions].include? Assessment::GeneralQuestion %>
        <%= link_to t('.new', :default => t("helpers.links.new_qn")),
                    new_course_assessment_assessment_general_question_path(@course, @assessment),
                    :class => 'btn btn-primary' %>
    <% end %>

    <% if @summary[:allowed_questions].include? Assessment::CodingQuestion %>
        <%= link_to t('.new', :default => t("helpers.links.new_cq")),
                    new_course_assessment_assessment_coding_question_path(@course, @assessment),
                    :class => 'btn btn-primary' %>
    <% end %>
<% end %>

<% if can? :view_detail, @assessment %>
    <h2 class="asm-qns-title"><%= display_name %> Questions</h2>
    <table class="table asm-qns-table sort">
      <tbody class="asm-qns sortable-table" url="<%= reorder_course_assessment_path(@course, @assessment) %>">
      <% @summary[:questions].each_with_index do |qn, index| %>
          <% q = qn.as_question %>
          <tr class="asm-qn" id="sortable-item_<%= qn.id %>" >
            <td>
              <div>
                <div class="asm-qn-handler">
                  <i class="icon-move handler-icon"></i>
                  <h3 class="handler-text">Question <span class="asm-qn-index"><%= index + 1 %></span>
                    <%= ": #{q.title}" if !q.title.nil? and !q.title.empty? %>
                  </h3>
                </div>
{'fraction_non_alphanumeric': 0.18997426155166075, 'fraction_numerical': 0.0034317931119009683, 'mean_word_length': 2.5172413793103448, 'pattern_counts': {'":': 2, '<': 195, '<?xml version=': 0, '>': 209, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5517891', 'n_tokens_mistral': 2764, 'n_tokens_neox': 2509, 'n_words': 470}