rubric_summary_criterion.mustache 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. <% rubric_summary_criterion ||= nil; criterion = rubric_summary_criterion || nil; assessing ||= false; brief ||= false; assessment_rating ||= nil %>
  19. <% @empty_rating ||= [OpenObject.new(:id => "blank", :description => t(:full_marks, "Full Marks"), :points => 5), OpenObject.new(:id => "blank_2", :description => t(:no_marks, "No Marks"), :points => 0)] %>
  20. <tr id="criterion_<%= criterion ? criterion.id : "blank" %>" class="criterion <%= "blank" unless criterion %> criterion_<%= criterion ? criterion.id : "blank" %> <%= 'ignore_criterion_for_scoring' if criterion && criterion.ignore_for_scoring %> <%= 'learning_outcome_criterion' if criterion && criterion.learning_outcome_id %>">
  21. <td class="criterion_description">
  22. <i class="learning_outcome_flag icon-outcomes" aria-hidden="true"></i>
  23. <span class="description_title"><%= criterion ? CanvasTextHelper.truncate_text(criterion.description, :max_length => 50) : t('defaults.description', "Description of criterion") %></span>
  24. <span class="learning_outcome_id" style="display: none;"><%= criterion.learning_outcome_id rescue nbsp %></span>
  25. <span class="criterion_id" style="display: none;"><%= criterion && criterion.id %></span>
  26. <div class="long_description_holder editing <%= 'empty' if !criterion || !criterion.long_description || criterion.long_description.empty? %>">
  27. <a href="#" class="long_description_link"><%= t 'links.view_longer_description', "view longer description" %></a>
  28. <textarea aria-label="<%= t 'labels.long_description', "Long Description" %>" class="long_description" style="display: none;"><%= h((criterion.long_description rescue '')) %></textarea>
  29. </div>
  30. </td>
  31. <td class="points_form">
  32. <div class="ratings">
  33. <% ratings = criterion ? criterion.ratings : @empty_rating %>
  34. <% ratings.each_index do |idx| %>
  35. <% rating = ratings[idx]; rating.edge = (idx == 0 || idx == ratings.length - 1) %>
  36. <div class="rating_holder"><span id="rating_<%= rating.id %>" class="rating <%= "edge_rating" if rating.edge %>"><%= rating.description %></span></div>
  37. <% end %>
  38. </div>
  39. <div class="rating description" style="<%= hidden unless criterion %>"><%= assessment_rating ? assessment_rating.description : "" %></div>
  40. <% comments = assessment_rating.comments if assessment_rating && assessment_rating.comments_enabled %>
  41. <a
  42. href="#"
  43. class="rating_comments_dialog_link"
  44. title="<%= t 'titles.full_comments', "Click to see full comments" %>"
  45. style="margin-top: 5px;"
  46. ><span class="rating rating_custom"><%= comments || "" %></span></a>
  47. <div class="displaying">
  48. <span class="nobr x_out_of_x">
  49. <% ot(:out_of_points, "%{points}/%{total} pts", :points => capture { %>
  50. <span class="criterion_points" style="<%= hidden if brief %>"><%= assessing ? (assessment_rating ? I18n.n(assessment_rating.points) : "") : (criterion ? I18n.n(criterion.points) : I18n.n(5)) %></span><% }, :total => capture { %>
  51. <span class="criterion_points_possible"><%= criterion ? I18n.n(criterion.points) : I18n.n(5) %></span><% }) %>
  52. </span>
  53. </div>
  54. <div class="ignoring">
  55. <span class="x_out_of_x"> -- </span>
  56. </div>
  57. </td>
  58. </tr>