assignment_rubric_dialog.mustache 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. <div id="rubrics" class="rubric_dialog" style="display: none; margin-bottom: 10px;">
  19. <% if @assignment.rubric_association && @assignment.rubric_association.rubric %>
  20. <%= render :partial => "shared/rubric", :object => @assignment.rubric_association.rubric,
  21. :locals => {:association => @assignment,
  22. :rubric_association => @assignment.rubric_association,
  23. :editable => can_do(@assignment, @current_user, :update),
  24. :has_assessments => !@assignment.rubric_association.rubric_assessments.empty?, :edit_view => true} %>
  25. <% end %>
  26. <div style="display: none;" id="rubric_parameters">
  27. <input type="hidden" name="rubric_association[association_type]" value="Assignment"/>
  28. <input type="hidden" name="rubric_association[association_id]" value="<%= @assignment.id %>"/>
  29. <input type="hidden" name="rubric_association[purpose]" value="grading"/>
  30. </div>
  31. <div class="assignment_points_possible" style="display: none;"><%= round_if_whole(@assignment.points_possible) %></div>
  32. <% if can_do(@assignment, @current_user, :update) %>
  33. {{> views/shared/rubric_dialog}}
  34. <% end %>
  35. {{> views/shared/rubric_criterion_dialog}}
  36. {{> views/shared/find_outcome}}
  37. {{> views/shared/rubric}}
  38. <% if can_do(@assignment, @current_user, :update) %>
  39. <div style="text-align: center; font-size: 1.2em; margin-top: 10px; display: none;">
  40. <a href="<%= context_url(@context, :context_rubrics_url) %>" class="add_rubric_link rubric" style="<%= hidden if @assignment.rubric_association %>"><%= t 'links.assign_rubric', "Assign Rubric" %></a>
  41. </div>
  42. {{> views/shared/rubric_forms}}
  43. <% end %>
  44. <a href="#" class="btn add_rubric_link" style="margin-top: 20px; <%= hidden if @assignment && @assignment.rubric_association %>"><%= image_tag "rubric.png", :alt => '' %> <%= t 'links.add_rubric', "Add Rubric" %></a>
  45. </div>
  46. <script>
  47. window.ENV = window.ENV || {};
  48. window.ENV.ROOT_OUTCOME_GROUP = <%= raw @root_outcome_group %>;
  49. var event = document.createEvent('Event');
  50. event.initEvent('rubricEditDataReady', true, true);
  51. document.dispatchEvent(event)
  52. </script>