<commit_before>
<script>
    $(function () { $("[data-toggle='tooltip']").tooltip(); });
</script>

<h1>Summary Report for assignment: <%= @assignment.name %></h1>
<h4>Team: <%= @team.name %>(Username: <%= @participant.fullname %>)</h4>

<!-- For each of the models in the list, generate a heatgrid table. this is the outer most loop -->
<% @vmlist.each do |vm| %>

    <% if (vm.questionnaire_display_type == "Metareview" or vm.questionnaire_display_type == "Author Feedback" or vm.questionnaire_display_type == "Teammate Review") and @current_role_name.eql?'Student' %>
    <% else %>

        <% if vm.list_of_reviewers.length > 0 %>

            <!-- display the list of questions for this questionnaire -->
            <div id="hid<%= vm.questionnaire_type + vm.round.to_s %>" class="accordion-body collapse" >
              <table class="tbl_questlist" >
                <thead>
                <th>#</th>
                <th>Question</th>
                </thead>
                <% count = 0 %>
                <% vm.list_of_rows.each do |row| %>
                    <% if row.score_row.count > 0  %>
                        <tr style="background-color: #ffffff;">
                          <td><%= count += 1 %></td>
                          <td><%= row.questionText %></td>
                        </tr>
                    <% end %>
                <% end %>
              </table>
            </div>

            <!-- display the table title and tooltips -->
            <span style="width:100%;">
                <h4 style="font-weight:bold;display:inline-block;"><%= vm.questionnaire_display_type %>
                  <% if vm.questionnaire_type == "ReviewQuestionnaire" %>
                      (Round: <%= vm.round.to_s  %> of <%= vm.rounds.to_s  %>)
                  <%end %>
                </h4>
                <span class="spn_qsttog" data-toggle="collapse" class="accordion-toggle" data-target="#hid<%= vm.questionnaire_type + vm.round.to_s %>" data-toggle="tooltip" data-placement="right" title="Click to display/hide questions">toggle question list</span>
              <span class="spn_tooltip" data-toggle="tooltip" data-placement="right" title="Colors are scaled from poor to excellent in the following order: red, orange, yellow, light-green, dark-green">color legend</span>
              <span class="spn_tooltip" data-toggle="tooltip" data-placement="right" title="Click a row to see the comments for the respective question. Click 'Review Total' row to see Add'l Comments. Useful tip: decreasing your browser's zoom to 75% or 90% many improve your experience.">interaction legend</span>

            </span>

            <table class="tbl_heat">
              <!-- display the header row of the heatgrid table. this involves iterating through reviewers.-->
              <thead>
              <tr>
                <th>Question Id</th>
                <th>Max</th>

                <% i = 1 %>
                <% vm.list_of_reviews.each do |review| %>
                    <!-- instructors (or higher level users) see reviewer name, students see anonymized string -->
                    <% if ['Student'].include? @current_role_name %>
                        <th> <a target="_blank" href="../response/view?id=<%= review.id.to_s %>"  data-toggle="tooltip" data-placement="right" title="Click to see details"><%= "Rev" + i.to_s %></a>  </th>
                        <% i += 1 %>
                    <% end %>
                    <% if ['Instructor', 'Teaching Assistant', 'Administrator', 'Super-Administrator'].include? @current_role_name %>
                        <% user_name = User.find(Participant.find(ResponseMap.find(Response.find(review.id).map_id).reviewer_id).user_id).fullname.to_s %>
                        <th > <a target="_blank" href="../grades/view_reviewer?id=<%=@participant.id%>&response_id=<%= review.id.to_s %>"  data-toggle="tooltip" data-placement="right" title="Click to see details"><%= user_name.to_s %></a>  </th>
                        <% i += 1 %>
                    <% end %>
                <% end %>

                <th align="right">
                  Avg
                </th>
                <th>
                  <span  data-toggle="tooltip" data-placement="right" title="A count of comments, for the respective question, which have character count > 10. The purpose of this metric is to represent how many comments for the question are of a substantial length to provide quality feedback.">metric-1</span>
                </th>

              </tr>
              </thead>


              <% score_row_count = vm.list_of_rows.first.score_row.count %>
              <% j = 1 %>
              <!-- here, starts a series of nested loops. loops for the rows, and for the cells of the rows.-->
              <!-- additionally, there are hidden rows (expandable) which are also generated via iteration. -->
              <% vm.list_of_rows.each do |row| %>

                  <!-- notice the data-target. because we're toggling via looped code, we need to dynamically generate the identifier. -->
                  <tr data-toggle="collapse" class="accordion-toggle" data-target="#hid<%= row.question_id.to_s + vm.round.to_s %>">
                    <td class = 'cf' > <%= j.to_s %>   </td>
                    <td class = 'cf' > <%= row.question_max_score %>   </td>

                    <!-- actual cells with scores and colored background. -->
                    <% row.score_row.each do |score| %>
                        <td class="<%= score.color_code %>" align="center">
                          <%= score.score_value.to_s %>
                        </td>
                    <% end %>


                    <% if row.score_row.count == 0 %><commit_msg>Change 1577: count words instead of charactors.<commit_after>
<script>
    $(function () { $("[data-toggle='tooltip']").tooltip(); });
</script>

<h1>Summary Report for assignment: <%= @assignment.name %></h1>
<h4>Team: <%= @team.name %>(Username: <%= @participant.fullname %>)</h4>

<!-- For each of the models in the list, generate a heatgrid table. this is the outer most loop -->
<% @vmlist.each do |vm| %>

    <% if (vm.questionnaire_display_type == "Metareview" or vm.questionnaire_display_type == "Author Feedback" or vm.questionnaire_display_type == "Teammate Review") and @current_role_name.eql?'Student' %>
    <% else %>

        <% if vm.list_of_reviewers.length > 0 %>

            <!-- display the list of questions for this questionnaire -->
            <div id="hid<%= vm.questionnaire_type + vm.round.to_s %>" class="accordion-body collapse" >
              <table class="tbl_questlist" >
                <thead>
                <th>#</th>
                <th>Question</th>
                </thead>
                <% count = 0 %>
                <% vm.list_of_rows.each do |row| %>
                    <% if row.score_row.count > 0  %>
                        <tr style="background-color: #ffffff;">
                          <td><%= count += 1 %></td>
                          <td><%= row.questionText %></td>
                        </tr>
                    <% end %>
                <% end %>
              </table>
            </div>

            <!-- display the table title and tooltips -->
            <span style="width:100%;">
                <h4 style="font-weight:bold;display:inline-block;"><%= vm.questionnaire_display_type %>
                  <% if vm.questionnaire_type == "ReviewQuestionnaire" %>
                      (Round: <%= vm.round.to_s  %> of <%= vm.rounds.to_s  %>)
                  <%end %>
                </h4>
                <span class="spn_qsttog" data-toggle="collapse" class="accordion-toggle" data-target="#hid<%= vm.questionnaire_type + vm.round.to_s %>" data-toggle="tooltip" data-placement="right" title="Click to display/hide questions">toggle question list</span>
              <span class="spn_tooltip" data-toggle="tooltip" data-placement="right" title="Colors are scaled from poor to excellent in the following order: red, orange, yellow, light-green, dark-green">color legend</span>
              <span class="spn_tooltip" data-toggle="tooltip" data-placement="right" title="Click a row to see the comments for the respective question. Click 'Review Total' row to see Add'l Comments. Useful tip: decreasing your browser's zoom to 75% or 90% many improve your experience.">interaction legend</span>

            </span>

            <table class="tbl_heat">
              <!-- display the header row of the heatgrid table. this involves iterating through reviewers.-->
              <thead>
              <tr>
                <th>Question Id</th>
                <th>Max</th>

                <% i = 1 %>
                <% vm.list_of_reviews.each do |review| %>
                    <!-- instructors (or higher level users) see reviewer name, students see anonymized string -->
                    <% if ['Student'].include? @current_role_name %>
                        <th> <a target="_blank" href="../response/view?id=<%= review.id.to_s %>"  data-toggle="tooltip" data-placement="right" title="Click to see details"><%= "Rev" + i.to_s %></a>  </th>
                        <% i += 1 %>
                    <% end %>
                    <% if ['Instructor', 'Teaching Assistant', 'Administrator', 'Super-Administrator'].include? @current_role_name %>
                        <% user_name = User.find(Participant.find(ResponseMap.find(Response.find(review.id).map_id).reviewer_id).user_id).fullname.to_s %>
                        <th > <a target="_blank" href="../grades/view_reviewer?id=<%=@participant.id%>&response_id=<%= review.id.to_s %>"  data-toggle="tooltip" data-placement="right" title="Click to see details"><%= user_name.to_s %></a>  </th>
                        <% i += 1 %>
                    <% end %>
                <% end %>

                <th align="right">
                  Avg
                </th>
                <th>
                  <span  data-toggle="tooltip" data-placement="right" title="A count of comments, for the respective question, which have word count > 10. The purpose of this metric is to represent how many comments for the question are of a substantial length to provide quality feedback.">metric-1</span>
                </th>

              </tr>
              </thead>


              <% score_row_count = vm.list_of_rows.first.score_row.count %>
              <% j = 1 %>
              <!-- here, starts a series of nested loops. loops for the rows, and for the cells of the rows.-->
              <!-- additionally, there are hidden rows (expandable) which are also generated via iteration. -->
              <% vm.list_of_rows.each do |row| %>

                  <!-- notice the data-target. because we're toggling via looped code, we need to dynamically generate the identifier. -->
                  <tr data-toggle="collapse" class="accordion-toggle" data-target="#hid<%= row.question_id.to_s + vm.round.to_s %>">
                    <td class = 'cf' > <%= j.to_s %>   </td>
                    <td class = 'cf' > <%= row.question_max_score %>   </td>

                    <!-- actual cells with scores and colored background. -->
                    <% row.score_row.each do |score| %>
                        <td class="<%= score.color_code %>" align="center">
                          <%= score.score_value.to_s %>
                        </td>
                    <% end %>


                    <% if row.score_row.count == 0 %>
{'fraction_non_alphanumeric': 0.14587866655061363, 'fraction_numerical': 0.004700147967621203, 'mean_word_length': 1.8203240058910162, 'pattern_counts': {'":': 0, '<': 239, '<?xml version=': 0, '>': 245, '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': '7301646', 'n_tokens_mistral': 3413, 'n_tokens_neox': 3031, 'n_words': 832}