<commit_before><%= render partial: 'summary' %>


<% @assessment.questions.includes(:answers).each_with_index do |q, i| %>
    <% unless @assessment.specific.single_question? %>
        <h3> <%= q.title || "Question  #{i + 1}" %></h3>
        <div class="row">
          <div class="span8">
            <span><%= style_format(q.description) %></span>
          </div>
        </div>

        <h3>Your answer:</h3>
    <% end %>

    <%- answer = @submission.answers.where(question_id: q.id).first %>
    <%- question = q.specific %>
    <% if question.class == Assessment::GeneralQuestion %>
        <div class="row-fluid">
          <div class="submission-question-block span10">
            <%= (answer.content || "").html_safe %>
          </div>
        </div>
    <% elsif question.class == Assessment::CodingQuestion %>
        <%=render partial: 'do_coding',
                  locals: { answer: answer,
                            question: question,
                            submission: @submission,
                            mode: "view" } %>

    <% else %>
        <%= render partial: 'scribing_canvas',
                   locals: { question: question,
                             qid: q.id,
                             answer: answer,
                             curr_user_course: curr_user_course,
                             edit_mode: true
                           } %>
    <% end %>

    <hr />

    <% if @assessment.comment_per_qn? || i == (@assessment.questions.length - 1) %>
        <% require 'digest/md5' %>
        <% ecid =  Digest::MD5.hexdigest(answer.id.to_s) %>
        <input type="hidden" id="submission_url_<%= ecid %>" value="<%= course_assessment_submission_url(@course, @assessment, @submission) %>">

        <div class="row-fluid">
          <div class="span10">
            <%= render partial: "comments/list",
                       locals: { comments:  CommentTopic.comments_to_json(answer.comment_topic, curr_user_course),
                                 target:    answer,
                                 header:    'Comments',
                                 ecid:      ecid } %>
          </div>
        </div>
    <% end %>
<% end %>

<br />

<% if @assessment.file_submission?  %><commit_msg>Disallow editing scribing answer by student after submission<commit_after><%= render partial: 'summary' %>


<% @assessment.questions.includes(:answers).each_with_index do |q, i| %>
    <% unless @assessment.specific.single_question? %>
        <h3> <%= q.title || "Question  #{i + 1}" %></h3>
        <div class="row">
          <div class="span8">
            <span><%= style_format(q.description) %></span>
          </div>
        </div>

        <h3>Your answer:</h3>
    <% end %>

    <%- answer = @submission.answers.where(question_id: q.id).first %>
    <%- question = q.specific %>
    <% if question.class == Assessment::GeneralQuestion %>
        <div class="row-fluid">
          <div class="submission-question-block span10">
            <%= (answer.content || "").html_safe %>
          </div>
        </div>
    <% elsif question.class == Assessment::CodingQuestion %>
        <%=render partial: 'do_coding',
                  locals: { answer: answer,
                            question: question,
                            submission: @submission,
                            mode: "view" } %>

    <% else %>
        <%= render partial: 'scribing_canvas',
                   locals: { question: question,
                             qid: q.id,
                             answer: answer,
                             curr_user_course: curr_user_course,
                             edit_mode: (answer.std_course != curr_user_course)
                           } %>
    <% end %>

    <hr />

    <% if @assessment.comment_per_qn? || i == (@assessment.questions.length - 1) %>
        <% require 'digest/md5' %>
        <% ecid =  Digest::MD5.hexdigest(answer.id.to_s) %>
        <input type="hidden" id="submission_url_<%= ecid %>" value="<%= course_assessment_submission_url(@course, @assessment, @submission) %>">

        <div class="row-fluid">
          <div class="span10">
            <%= render partial: "comments/list",
                       locals: { comments:  CommentTopic.comments_to_json(answer.comment_topic, curr_user_course),
                                 target:    answer,
                                 header:    'Comments',
                                 ecid:      ecid } %>
          </div>
        </div>
    <% end %>
<% end %>

<br />

<% if @assessment.file_submission?  %>
{'fraction_non_alphanumeric': 0.15067597034452682, 'fraction_numerical': 0.0056694286960314, 'mean_word_length': 1.595925297113752, 'pattern_counts': {'":': 0, '<': 93, '<?xml version=': 0, '>': 93, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5996246', 'n_tokens_mistral': 1414, 'n_tokens_neox': 1285, 'n_words': 244}