<commit_before><div class="row-fluid">
  <div class="code-submission span10">
    <% if mode == "view" %>
        <div class="btn-group" style="float: right" >
          <a class="btn" href="#" id="select-all-code-<%= answer.id  %>" title="Select entire code"><i class="icon-file"></i></a>
          <a class="btn" href="#" id="toggle-comment-<%= answer.id  %>" title="Toggle Annotations"><i class="icon-comment"></i></a>
          <a class="btn" href="#" id="fullscreen-link-<%= answer.id  %>" title="View in fullscreen"><i class="icon-fullscreen"></i></a>
        </div>
    <% end %>
    <div id="source-code-<%= answer.id  %>" class="code-wrapper cos_code"></div>
    <% if qn.is_auto_grading? and mode != "view" %>
        <% if qn.data_hash["publicTests"].length > 0 %>
            <h3>Public Tests</h3>
            <p>The following expressions will be executed.</p>
            <table class="table table-striped table-bordered" id="public-test-table-<%= answer.id %>">
              <thead>
              <tr>
                <td>Expression</td>
                <td>Expected Output</td>
              </tr>
              </thead>
              <tbody>
              <% qn.data_hash["publicTests"].each do |test| %>
                  <tr>
                    <td><%= test["expression"] %></td>
                    <td><%= test["expected"] %></td>
                  </tr>
              <% end %>
              </tbody>
            </table>
        <% end %>
        <h3>Testing</h3>
        <% unless curr_user_course.is_staff? %>
            <div style="font-size: 14px;padding-left: 10px">
              Click Run to test your answer. You can maximally run <%= qn.test_limit %> times.
            </div>
        <% end %>
        <button class="btn btn-large btn-block btn-danger"
                type="button"
                id="run-qn-test"
                <%= 'disabled' unless answer.can_run_test?(curr_user_course) %>
                onclick="codeEvaluator.testRun('<%= answer.id %>','<%= course_mission_submission_test_path(@course, @mission, @submission) %>', this);" >
          RUN
          <% unless curr_user_course.is_staff? %>
              ( <span id="run-count-down-<%= answer.id %>"><%= answer.test_left %></span> times left )
          <% end %>
        </button>
        <br>
        <div id="eval-result-<%= answer.id %>" style="font-size: 14px;padding-left: 10px">
        </div>
    <% elsif qn.is_auto_grading? and curr_user_course.is_staff? %>
        <h3>Auto Grading Summary</h3>
        <% if qn.data_hash["publicTests"].length > 0 %>
            <%= render partial: "submissions/test_result_table", locals:{title: "Public Tests",
                                                                         tests: qn.data_hash["publicTests"],
                                                                         results: answer.result_hash["publicTests"],
                                                                         actual: answer.result_hash["publicResults"] } %>
        <% end %>
        <% if qn.data_hash["privateTests"].length > 0 %>
            <%= render partial: "submissions/test_result_table", locals:{title: "Private Tests",
                                                                         tests: qn.data_hash["privateTests"],
                                                                         results: answer.result_hash["privateTests"],
                                                                         actual: answer.result_hash["privateResults"] } %>
        <% end %>
        <% if qn.data_hash["evalTests"].length > 0 %>
            <%= render partial: "submissions/test_result_table", locals:{title: "Evaluation Tests",
                                                                         tests: qn.data_hash["evalTests"],
                                                                         results: answer.result_hash["evalTests"],
                                                                         actual: answer.result_hash["evalResults"] } %>
        <% end %>

        <% if answer.result_hash["errors"] && answer.result_hash["errors"].length > 0 %>
            <h4>Error Message</h4>
            <div id="eval-error-message" style="font-size: 14px; padding-left: 10px; background-color: rgb(225, 193, 177);"><%= answer.result_hash["errors"] %></div>
        <% end %>
    <% end %>
  </div>
  <div class="span2"></div>
</div>
<input type="hidden" name="answers[<%=qn.class.to_s%>][<%= qn.id %>]" id="code_<%= answer.id  %>" >
<input type="hidden" id="annotation-path-<%= answer.id  %>" value="/courses/<%=@course.id%>/annotations">
<input type="hidden" class="code-ans" value="<%= answer.id  %>" >
<input type="hidden" id="submission-id-<%= answer.id  %>" value="<%= submission.id %>">
<input type="hidden" id="mode_<%= answer.id  %>" value="<%= mode %>">
<input type="hidden" id="code-language-<%= answer.id  %>" value="python">
<style>
    .CodeMirror-scroll {
        height: 495px !important;
    }
    pre {
        background: transparent;
        white-space: pre;
        font-family:  monospace;
    }

    pre, div {
        padding: 0;
        margin: 0;
        border: 0;
        vertical-align: baseline;
        text-align: left;
        color: inherit;
    }
    #annotate-area {
        padding: 5px;
    }
</style>
<script>
    var source_code = <%= answer ? raw(answer.code.to_json) : raw(JSON.parse(qn.data)["prefill"].to_json) %>;
    $('#code_<%= answer.id  %>').val(source_code);


    var _c = [];
    var _ca = true;
    var _cc = true;

</script><commit_msg>fix problem for coding question  with no public test cases<commit_after><div class="row-fluid">
  <div class="code-submission span10">
    <% if mode == "view" %>
        <div class="btn-group" style="float: right" >
          <a class="btn" href="#" id="select-all-code-<%= answer.id  %>" title="Select entire code"><i class="icon-file"></i></a>
          <a class="btn" href="#" id="toggle-comment-<%= answer.id  %>" title="Toggle Annotations"><i class="icon-comment"></i></a>
          <a class="btn" href="#" id="fullscreen-link-<%= answer.id  %>" title="View in fullscreen"><i class="icon-fullscreen"></i></a>
        </div>
    <% end %>
    <div id="source-code-<%= answer.id  %>" class="code-wrapper cos_code"></div>
    <% if qn.is_auto_grading? and mode != "view" %>
        <% if  qn.data_hash["publicTests"] and qn.data_hash["publicTests"].length > 0 %>
            <h3>Public Tests</h3>
            <p>The following expressions will be executed.</p>
            <table class="table table-striped table-bordered" id="public-test-table-<%= answer.id %>">
              <thead>
              <tr>
                <td>Expression</td>
                <td>Expected Output</td>
              </tr>
              </thead>
              <tbody>
              <% qn.data_hash["publicTests"].each do |test| %>
                  <tr>
                    <td><%= test["expression"] %></td>
                    <td><%= test["expected"] %></td>
                  </tr>
              <% end %>
              </tbody>
            </table>
        <% end %>
        <h3>Testing</h3>
        <% unless curr_user_course.is_staff? %>
            <div style="font-size: 14px;padding-left: 10px">
              Click Run to test your answer. You can maximally run <%= qn.test_limit %> times.
            </div>
        <% end %>
        <button class="btn btn-large btn-block btn-danger"
                type="button"
                id="run-qn-test"
                <%= 'disabled' unless answer.can_run_test?(curr_user_course) %>
                onclick="codeEvaluator.testRun('<%= answer.id %>','<%= course_mission_submission_test_path(@course, @mission, @submission) %>', this);" >
          RUN
          <% unless curr_user_course.is_staff? %>
              ( <span id="run-count-down-<%= answer.id %>"><%= answer.test_left %></span> times left )
          <% end %>
        </button>
        <br>
        <div id="eval-result-<%= answer.id %>" style="font-size: 14px;padding-left: 10px">
        </div>
    <% elsif qn.is_auto_grading? and curr_user_course.is_staff? %>
        <h3>Auto Grading Summary</h3>
        <% if qn.data_hash["publicTests"].length > 0 %>
            <%= render partial: "submissions/test_result_table", locals:{title: "Public Tests",
                                                                         tests: qn.data_hash["publicTests"],
                                                                         results: answer.result_hash["publicTests"],
                                                                         actual: answer.result_hash["publicResults"] } %>
        <% end %>
        <% if qn.data_hash["privateTests"].length > 0 %>
            <%= render partial: "submissions/test_result_table", locals:{title: "Private Tests",
                                                                         tests: qn.data_hash["privateTests"],
                                                                         results: answer.result_hash["privateTests"],
                                                                         actual: answer.result_hash["privateResults"] } %>
        <% end %>
        <% if qn.data_hash["evalTests"].length > 0 %>
            <%= render partial: "submissions/test_result_table", locals:{title: "Evaluation Tests",
                                                                         tests: qn.data_hash["evalTests"],
                                                                         results: answer.result_hash["evalTests"],
                                                                         actual: answer.result_hash["evalResults"] } %>
        <% end %>

        <% if answer.result_hash["errors"] && answer.result_hash["errors"].length > 0 %>
            <h4>Error Message</h4>
            <div id="eval-error-message" style="font-size: 14px; padding-left: 10px; background-color: rgb(225, 193, 177);"><%= answer.result_hash["errors"] %></div>
        <% end %>
    <% end %>
  </div>
  <div class="span2"></div>
</div>
<input type="hidden" name="answers[<%=qn.class.to_s%>][<%= qn.id %>]" id="code_<%= answer.id  %>" >
<input type="hidden" id="annotation-path-<%= answer.id  %>" value="/courses/<%=@course.id%>/annotations">
<input type="hidden" class="code-ans" value="<%= answer.id  %>" >
<input type="hidden" id="submission-id-<%= answer.id  %>" value="<%= submission.id %>">
<input type="hidden" id="mode_<%= answer.id  %>" value="<%= mode %>">
<input type="hidden" id="code-language-<%= answer.id  %>" value="python">
<style>
    .CodeMirror-scroll {
        height: 495px !important;
    }
    pre {
        background: transparent;
        white-space: pre;
        font-family:  monospace;
    }

    pre, div {
        padding: 0;
        margin: 0;
        border: 0;
        vertical-align: baseline;
        text-align: left;
        color: inherit;
    }
    #annotate-area {
        padding: 5px;
    }
</style>
<script>
    var source_code = <%= answer ? raw(answer.code.to_json) : raw(JSON.parse(qn.data)["prefill"].to_json) %>;
    $('#code_<%= answer.id  %>').val(source_code);


    var _c = [];
    var _ca = true;
    var _cc = true;

</script>
{'fraction_non_alphanumeric': 0.16927037102787146, 'fraction_numerical': 0.0078111130836144155, 'mean_word_length': 1.6999760364246346, 'pattern_counts': {'":': 0, '<': 249, '<?xml version=': 0, '>': 259, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 54, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2545323', 'n_tokens_mistral': 3432, 'n_tokens_neox': 3148, 'n_words': 624}