peer_reviews.mustache 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <%
  2. # Copyright (C) 2011 - present Instructure, Inc.
  3. #
  4. # This file is part of Canvas.
  5. #
  6. # Canvas is free software: you can redistribute it and/or modify it under
  7. # the terms of the GNU Affero General Public License as published by the Free
  8. # Software Foundation, version 3 of the License.
  9. #
  10. # Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
  11. # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. # A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
  13. # details.
  14. #
  15. # You should have received a copy of the GNU Affero General Public License along
  16. # with this program. If not, see <http://www.gnu.org/licenses/>.
  17. %>
  18. <% content_for :page_title do %><%= join_title @context.name, @assignment.title, t(:page_title, "Peer Reviews") %><% end %>
  19. <%- css_bundle(:assignments_peer_review) %>
  20. <% content_for :right_side do %>
  21. <a href="<%= context_url(@context, :context_assignment_url, @assignment.id) %>" class='btn button-sidebar-wide'>
  22. <i class="icon-arrow-left"></i>
  23. <%= t 'links.back_to_assignment', "Back to Assignment" %>
  24. </a>
  25. <p><%= t :details, "To the left you can see the list of students for this assignment, and also
  26. which student submissions (if any) they have been assigned to review." %></p>
  27. <% unless @submissions.empty? %>
  28. <%= form_tag context_url(@context, :context_assignment_assign_peer_reviews_url, @assignment.id), {} do %>
  29. <h3 style="margin-bottom: 0;"><%= t 'titles.automatically_assign_reviews', "Automatically Assign Reviews" %></h3>
  30. <p><%= t 'descriptions.automatically_assign_reviews', "You can assign peer reviews to those users who have submitted but don't already have
  31. reviews assigned by clicking the button below." %></p>
  32. <% if @assignment.group_category %>
  33. <div>
  34. <%= check_box_tag "intra_group_peer_reviews", "1", @assignment.intra_group_peer_reviews %>
  35. <label for="intra_group_peer_reviews">{{#t}}Allow intra-group peer reviews{{/t}}</label>
  36. </div>
  37. <% end %>
  38. <%= t :reviews_per_user, "%{count} reviews per user", :count => %{<input type="text" name="peer_review_count" value="#{@assignment.peer_review_count || 1}" style="width: 25px;"/>}.html_safe %>
  39. <div class='button-container button-container-right-aligned'>
  40. <button type="submit" class="btn btn-large"><%= t 'buttons.assign_peer_reviews', "Assign Peer Reviews" %></button>
  41. </div>
  42. <% end %>
  43. <% end %>
  44. <% end %>
  45. <% js_bundle 'legacy/assignments_peer_reviews' %>
  46. <h1><%= t :title, "%{assignment} Peer Reviews", :assignment => @assignment.title %></h1>
  47. <% if @assignment.rubric_association %>
  48. <%= t :overview_with_rubric, "Student peer reviews will be considered complete when students have commented
  49. at least once on the page and filled out the rubric form for the assignment." %>
  50. <% else %>
  51. <%= t :overview, "Student peer reviews will be considered complete when students have commented
  52. at least once on the page." %>
  53. <% end %>
  54. <ul class="unstyled_list" style="margin-left: 20px;">
  55. <li style="<%= hidden unless @students.empty? %>" class="no_students_message"><%= t 'messages.no_students_found', "No Students Found" %></li>
  56. <% @students.each do |student| %>
  57. <% submission = @submissions.to_a.find{|s| s.user_id == student.id} %>
  58. <li style="font-size: 1.2em; margin-bottom: 10px;" class="student_reviews">
  59. <a <%= submission && submission.has_submission? ? "class='icon-warning person' title='#{h(t(:submitted, "submitted"))}'" : "class='person_gray' title='#{h(t(:not_yet_submitted, "not yet submitted"))}'" %> href="<%= context_url(@context, :context_assignment_submission_url, @assignment.id, student.id) %>">
  60. <span class="assessor_name"><%= student.last_name_first %></span>
  61. <span class="user_id student_review_id" style="display: none;"><%= student.id %></span>
  62. </a>
  63. <ul class="unstyled_list peer_reviews" style="padding-left: 21px; font-size: 0.8em; width: 50%;">
  64. <li class="peer_review no_requests_message" style="<%= hidden unless !submission || submission.assigned_assessments.empty? %>"><%= t :none_assigned, "None Assigned" %></li>
  65. <% if submission %>
  66. <% Canvas::ICU.collate_by(submission.assigned_assessments) {|r| r.asset.user.sortable_name }.each do |request| %>
  67. <% if (request && request.asset && request.asset.user) %>
  68. {{> views/peer_review_assignment}}
  69. <% end %>
  70. <% end %>
  71. <% end %>
  72. </ul>
  73. <div style="margin-left: 25px; font-size: 0.7em;" class="assign_box">
  74. <a href="#" class="assign_peer_review_link"><%= t 'links.assign_peer_review', "Give %{student} another submission to assess", :student => student.name %>
  75. <i class="icon-add" role="presentation"></i>
  76. </a>
  77. <div class="form_content">
  78. </div>
  79. </div>
  80. </li>
  81. <% end %>
  82. </ul>
  83. <%= form_tag ".", {:id => "assign_peer_review_form", :style => "display: none;"} do %>
  84. <select name="reviewee_id">
  85. <option value=""><%= t 'options.select_student', "[ Select Student ]" %></option>
  86. <% @students.each do |student| %>
  87. <option value="<%= student.id %>" class="student_<%= student.id %>"><%= student.last_name_first %></option>
  88. <% end %>
  89. </select>
  90. <button type="submit" class="Button Button--small"><%= t 'buttons.add', 'Add' %></button>
  91. <% end %>
  92. <a href="<%= context_url(@context, :context_assignment_assign_peer_review_url, @assignment.id, '{{ reviewer_id }}') %>" style="display: none;" class="assign_peer_review_url">&nbsp;</a>
  93. <ul style="display: none;">
  94. {{> views/peer_review_assignment}}
  95. </ul>