show.mustache 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. <%
  19. css_bundle :learning_outcomes
  20. js_bundle :react_outcome_alignment
  21. content_for :page_title, @outcome.short_description
  22. %>
  23. <% content_for :right_side do %>
  24. <a class="btn button-sidebar-wide" href="<%= context_url(@context, :context_outcomes_url) %>">
  25. <i class="icon-arrow-left"></i>
  26. <%= t "#buttons.back_to_outcomes", "Back to Outcomes" %>
  27. </a>
  28. <% end %>
  29. <h2><%= t "#titles.aligned_items", "Aligned Items" %></h2>
  30. <div id="outcome_urls" style="display: none;">
  31. <% if @context.is_a?(Course) %>
  32. <a href="<%= context_url(@context, :context_outcome_reorder_alignments_url, @outcome.id) %>" class="reorder_alignments_url">&nbsp;</a>
  33. <a href="<%= context_url(@context, :context_outcome_align_url, @outcome.id) %>" class="align_url">&nbsp;</a>
  34. {{> views/shared/select_content_dialog}}
  35. <% end %>
  36. </div>
  37. <%= t(:no_aligned_items, "No aligned items") if @alignments.empty? %>
  38. <ul id="alignments" class="<%= 'orderable' if @context.is_a?(Course) %>">
  39. <% @alignments.each do |alignment| %>
  40. {{> views/outcome_alignment}}
  41. <% end %>
  42. </ul>
  43. <h2 style="margin-top: 20px;">{{#t}}Outcome Artifacts{{/t}}</h2>
  44. <%= t(:no_artifacts, "No artifacts") if @results.empty? %>
  45. <div id="outcome_results">
  46. <ul id="outcome_results_list">
  47. <% @results.each do |result| %>
  48. <%#
  49. There are a few old LearningOutcomeResults that have a nil artifact, and
  50. many that have a Submission as an artifact. We want to get rid of these
  51. because they come from bad data, and step 1 toward that goal is to stop
  52. creating them and hide them in the UI.
  53. The LORs with a nil artifact are very old and I believe came from a very
  54. early incarnation of outcomes. The LORs with a Submission as an artifact
  55. came from a combination of two code problems. The first was old code
  56. that allowed an assignment that was aligned with an outcome but did not
  57. have a rubric to create LORs directly based on it's submission. The
  58. second was a bug that prevented the assignment <-> outcome link from
  59. being destroyed when a rubric with an outcome was removed from an
  60. assignment.
  61. %>
  62. <% if result.artifact_type.present? && result.artifact_type != 'Submission' %>
  63. {{> views/outcome_result}}
  64. <% end %>
  65. <% end %>
  66. </ul>
  67. <%= will_paginate(@results) %>
  68. </div>
  69. <div style="display: none;">
  70. <div id="outcome_results_total_pages"><%= @results.total_pages %></div>
  71. <a href="<%= context_url(@context, :context_outcome_results_url, @outcome.id) %>" style="display: none;" class="outcome_results_url">&nbsp;</a>
  72. <ul>
  73. {{> views/outcome_result}}
  74. {{> views/outcome_alignment}}
  75. </ul>
  76. </div>