<commit_before><% if @jsonFeedback.nil? %>

<h2>Feedback for
<%= "#{@assessment.display_name} - #{@score.problem.name}" %>
(<%=@score.submission.course_user_datum.user.email %>)
</h2>
<pre>
<%= @score.feedback %>
Score for this problem: <%= @score.score.to_f().round(1) %>

Graded by: <%= if @score.grader && @score.grader.user then @score.grader.user.email end %>
</pre>

<% else %>
<%= render "semantic" %>

<% end %>
<!--
Yes, feedback is per problem but we show all annotations for this submission anyway. While this is not semantically correct, it offers a better UX than we had before. If we just show annotations attached to this problem, then where would we show annotations not attached to a problem at all?
-->

<% if @submission.annotations.count > 0 and @problemReleased %>
  <h2 style="margin-top: 1em">Remarks</h2>

  <ul>
  <!-- use custom sort b/c using ordering doesn't work with autograder output, archived files -->
  <% @subs = @submission.annotations.sort do |a,b|
     aFilename = @get_correct_filename.call(a)
     bFilename = @get_correct_filename.call(b)
     case
       when aFilename < bFilename
         -1
       when aFilename > bFilename
          1
       else
          a.line <=> b.line
       end
     end
     @subs.each do |annotation| %>
    <li>
      <%= link_to annotation.as_text, [:view, @course, @assessment, @submission, header_position: annotation.position] %>
      <% filename = @get_correct_filename.call(annotation) %>
      (<%= filename %>: <%= annotation.line %>)
    </li>
  <% end %>
  </ul>
<% end %><commit_msg>Allow linebreaks in remarks and other improvements to remarks section (#1610)<commit_after><% if @jsonFeedback.nil? %>

<h2>Feedback for
<%= "#{@assessment.display_name} - #{@score.problem.name}" %>
(<%=@score.submission.course_user_datum.user.email %>)
</h2>
<pre>
<%= @score.feedback %>
Score for this problem: <%= @score.score.to_f().round(1) %>

Graded by: <%= if @score.grader && @score.grader.user then @score.grader.user.email end %>
</pre>

<% else %>
<%= render "semantic" %>

<% end %>
<!--
Yes, feedback is per problem but we show all annotations for this submission anyway. While this is not semantically correct, it offers a better UX than we had before. If we just show annotations attached to this problem, then where would we show annotations not attached to a problem at all?
-->

<% if @submission.annotations.count > 0 and @problemReleased %>
  <h2 style="margin-top: 1em">Remarks</h2>

  <% subs_by_problem = @submission.annotations.group_by(&:problem)
      subs_by_problem.each do |problem, annotations| %>
      <b> <%= problem.name %> </b>
      <ul class="collection">
      <!-- use custom sort b/c using ordering doesn't work with autograder output, archived files -->
      <%
        s_annotations = annotations.sort do |a,b|
        aFilename = @get_correct_filename.call(a)
        bFilename = @get_correct_filename.call(b)
        case
          when aFilename < bFilename
            -1
          when aFilename > bFilename
              1
          else
              a.line <=> b.line
          end
        end
        s_annotations.each do |annotation| %>
        <li class="collection-item">
              <div style='white-space: pre-wrap;'><%= annotation.comment%> </div>
              <% filename = @get_correct_filename.call(annotation)%>
              <span> 
                <b><%= annotation.value? ? sprintf("(%+.1f)", annotation.value) : "" %></b> 
                <%= link_to filename.to_s + ":"+ annotation.line.to_s , [:view, @course, @assessment, @submission, header_position: annotation.position] %> 
              </span>
        </li>
        <% end %>
      </ul>
    <% end %>

<% end %>
{'fraction_non_alphanumeric': 0.1509027216383724, 'fraction_numerical': 0.006197790353004581, 'mean_word_length': 2.886910994764398, 'pattern_counts': {'":': 1, '<': 76, '<?xml version=': 0, '>': 78, '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': '516907', 'n_tokens_mistral': 1255, 'n_tokens_neox': 1137, 'n_words': 321}