<commit_before><ul class='sub'>
  <li id='dropdown'>
    <div class='dropdown'>
      <%# Display an appropriate message in the dropdown menu %>
      <% if assessment.nil? %>
        <%= t('menu.choose') %>
      <% elsif assessment.new_record? && allowed_to?(:admin_allowed?, assessment, with: AssignmentPolicy) %>
        <%= t('helpers.submit.create', model: assessment.class.model_name.human) %>
      <% else %>
        <% title = assessment.short_identifier %>
        <% if assessment.is_a?(Assignment) && assessment.is_peer_review? %>
          <% title = "#{assessment.parent_assignment.short_identifier} #{PeerReview.model_name.human}" %>
        <% end %>
        <% if assessment.is_hidden %>
          <% title = t('assignments.hidden', assignment_text: title) %>
        <% end %>
        <%= title %>
      <% end %>
      <ul>
        <%= render partial: 'shared/assignments_dropdown_menu' %>
      </ul>
    </div>
  </li>

  <% if assessment.is_a?(GradeEntryForm) && !assessment.new_record? %>
    <% if allowed_to?(:manage?, assessment, with: GradeEntryFormPolicy) %>
      <li class='<%= "active" if controller.action_name == 'edit' %>'>
        <%= link_to t('menu.properties'),
                    edit_grade_entry_form_path(assessment) %>
      </li>
    <% end %>
    <li class='<%= "active" if controller.action_name == 'grades' %>'>
      <%= link_to GradeEntryForm.human_attribute_name(:grades),
                  grades_grade_entry_form_path(assessment) %>
    </li>
    <% if allowed_to?(:admin_allowed?, assessment, with: AssignmentPolicy) %>
      <li class='<%= "active" if controller.controller_name == 'marks_graders' %>'>
        <%= link_to Ta.model_name.human.pluralize,
                    grade_entry_form_marks_graders_path(assessment) %>
      </li>
    <% end %>
  <% elsif assessment.is_a?(Assignment) && !assessment.new_record? %>
    <% target_id = @result&.is_a_review? ? assessment.pr_assignment.id :
                                                     assessment.id %>
    <% if allowed_to?(:manage?, assessment, with: AssignmentPolicy) %>
      <li <% if ['criteria',
                 'annotation_categories',
                 'automated_tests',
                 'exam_templates'].include?(controller.controller_name) ||
        (controller.controller_name == 'assignments' &&
          controller.action_name != 'summary' && controller.action_name != 'batch_runs') %>
          class='active'
          <% end %>
      >
        <%= link_to t('menu.settings'),
                    edit_assignment_path(target_id) %>
      </li>
    <% end %>
    <% if allowed_to?(:admin_allowed?, assessment, with: AssignmentPolicy) %>
      <li class='<%= "active" if controller.controller_name == 'groups' %>'>
        <%= link_to Group.model_name.human.pluralize,
                    assignment_groups_path(target_id) %>
      </li>
      <li class='<%= "active" if controller.controller_name == 'graders' %>'>
        <%= link_to Ta.model_name.human.pluralize,
                    assignment_graders_path(target_id) %>
      </li>
    <% end %>
    <% if assessment.is_peer_review? || @result&.is_a_review? %>
      <% if allowed_to?(:manage_reviewers?, with: PeerReviewPolicy) %>
        <li class='<%= 'active' if controller.controller_name == 'peer_reviews' %>'>
          <%= link_to t('peer_reviews.assign'),
                      assignment_peer_reviews_path(target_id) %><commit_msg>peer reviews: Fix policy lookup in assign peer reviewers view (#4864)<commit_after><ul class='sub'>
  <li id='dropdown'>
    <div class='dropdown'>
      <%# Display an appropriate message in the dropdown menu %>
      <% if assessment.nil? %>
        <%= t('menu.choose') %>
      <% elsif assessment.new_record? && allowed_to?(:admin_allowed?, assessment, with: AssignmentPolicy) %>
        <%= t('helpers.submit.create', model: assessment.class.model_name.human) %>
      <% else %>
        <% title = assessment.short_identifier %>
        <% if assessment.is_a?(Assignment) && assessment.is_peer_review? %>
          <% title = "#{assessment.parent_assignment.short_identifier} #{PeerReview.model_name.human}" %>
        <% end %>
        <% if assessment.is_hidden %>
          <% title = t('assignments.hidden', assignment_text: title) %>
        <% end %>
        <%= title %>
      <% end %>
      <ul>
        <%= render partial: 'shared/assignments_dropdown_menu' %>
      </ul>
    </div>
  </li>

  <% if assessment.is_a?(GradeEntryForm) && !assessment.new_record? %>
    <% if allowed_to?(:manage?, assessment, with: GradeEntryFormPolicy) %>
      <li class='<%= "active" if controller.action_name == 'edit' %>'>
        <%= link_to t('menu.properties'),
                    edit_grade_entry_form_path(assessment) %>
      </li>
    <% end %>
    <li class='<%= "active" if controller.action_name == 'grades' %>'>
      <%= link_to GradeEntryForm.human_attribute_name(:grades),
                  grades_grade_entry_form_path(assessment) %>
    </li>
    <% if allowed_to?(:admin_allowed?, assessment, with: AssignmentPolicy) %>
      <li class='<%= "active" if controller.controller_name == 'marks_graders' %>'>
        <%= link_to Ta.model_name.human.pluralize,
                    grade_entry_form_marks_graders_path(assessment) %>
      </li>
    <% end %>
  <% elsif assessment.is_a?(Assignment) && !assessment.new_record? %>
    <% target_id = @result&.is_a_review? ? assessment.pr_assignment.id :
                                                     assessment.id %>
    <% if allowed_to?(:manage?, assessment, with: AssignmentPolicy) %>
      <li <% if ['criteria',
                 'annotation_categories',
                 'automated_tests',
                 'exam_templates'].include?(controller.controller_name) ||
        (controller.controller_name == 'assignments' &&
          controller.action_name != 'summary' && controller.action_name != 'batch_runs') %>
          class='active'
          <% end %>
      >
        <%= link_to t('menu.settings'),
                    edit_assignment_path(target_id) %>
      </li>
    <% end %>
    <% if allowed_to?(:admin_allowed?, assessment, with: AssignmentPolicy) %>
      <li class='<%= "active" if controller.controller_name == 'groups' %>'>
        <%= link_to Group.model_name.human.pluralize,
                    assignment_groups_path(target_id) %>
      </li>
      <li class='<%= "active" if controller.controller_name == 'graders' %>'>
        <%= link_to Ta.model_name.human.pluralize,
                    assignment_graders_path(target_id) %>
      </li>
    <% end %>
    <% if assessment.is_peer_review? || @result&.is_a_review? %>
      <% if allowed_to?(:manage_reviewers?, assessment, with: PeerReviewPolicy) %>
        <li class='<%= 'active' if controller.controller_name == 'peer_reviews' %>'>
          <%= link_to t('peer_reviews.assign'),
                      assignment_peer_reviews_path(target_id) %>
{'fraction_non_alphanumeric': 0.15920900692840648, 'fraction_numerical': 0.0005773672055427252, 'mean_word_length': 2.6126173096976015, 'pattern_counts': {'":': 0, '<': 131, '<?xml version=': 0, '>': 131, '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': '1791353', 'n_tokens_mistral': 2222, 'n_tokens_neox': 2037, 'n_words': 351}