<% # Copyright (C) 2011 - present Instructure, Inc. # # This file is part of Canvas. # # Canvas is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as published by the Free # Software Foundation, version 3 of the License. # # Canvas is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU Affero General Public License for more # details. # # You should have received a copy of the GNU Affero General Public License along # with this program. If not, see . %> <% rubric_criterion ||= nil criterion = rubric_criterion || nil assessing ||= false rubric ||= nil rubric_association ||= nil edit_view ||= false assessment_rating ||= nil range_rating_enabled = @domain_root_account.feature_enabled?(:rubric_criterion_range) learning_outcome_criterion = criterion.try(:learning_outcome_id) range_rating_visible = range_rating_enabled && !learning_outcome_criterion long_description_text = criterion.try(:long_description) || '' long_description_text = Sanitize.clean(long_description_text) if learning_outcome_criterion description = criterion.try(:description) || t('defaults.description', "Description of criterion") %> " class="criterion <%= "blank" unless criterion %> <%= 'ignore_criterion_for_scoring' if criterion && criterion.ignore_for_scoring %> <%= 'learning_outcome_criterion' if learning_outcome_criterion %>" style="<%= hidden unless criterion %>">
<%= t("This criterion is linked to a Learning Outcome") %> <%= description %> <% if !assessing %>
<%= long_description_text.html_safe %>
<% end %>
<%= before_label :threshold, "threshold" %> <%= t :points, "%{points} pts", :points => %{#{n((criterion.mastery_points rescue 5))}}.html_safe %>
<% if rubric && !rubric.free_form_criterion_comments && assessment_rating && assessment_rating[:comments] %>
<%= t('Instructor Comments') %>
<%= format_message( assessment_rating[:comments] ).first %>
<% end %> <% if !edit_view && criterion && rubric && rubric.free_form_criterion_comments %>
" class="save_custom_rating" value="1"/>
<%= assessment_rating && (assessment_rating[:comments_html] ? assessment_rating[:comments_html].html_safe : assessment_rating[:comments]) %>
<% else %> <% ratings = (criterion.ratings rescue nil); ratings = nil if ratings && ratings.length < 2 %> <% ratings ||= [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)] %> <% ratings.each_index do |idx| %> <% rating = ratings[idx]; last_rating = idx == ratings.length - 1 rating.edge = (idx == 0 || last_rating); next_rating = ratings[idx+1]; rating_min = (next_rating&.points || 0); rating_match = assessment_rating && assessment_rating[:points] == rating.points use_range = (criterion.try(:criterion_use_range) && rating_min.try(:to_f) != rating.points.try(:to_f) && range_rating_enabled); selected = rating_match || (assessment_rating && assessment_rating[:points] && use_range ? ((assessment_rating[:points] > rating_min && assessment_rating[:points] < rating.points)) : false) %> <% end %>
<%= "infinitesimal" if rating_min.try(:to_f) == rating.points.try(:to_f) %> <%= "selected" if selected %>" >
<% if !learning_outcome_criterion %>
<% end %> <%= n(rating.points) %> <%= t('to') %> ><%= n(rating_min) %> <%= t('pts') %>
<%= rating.description %>
<%= rating.long_description %>
<% if !learning_outcome_criterion && !last_rating %> <% end %>
<%= t "This area will be used by the assessor to leave comments related to this criterion." %>
<% end %>
<% if assessing points_value = (n(assessment_rating.points) rescue "") else points_value = n((criterion.points rescue 5)) end rating_points = %{ }.html_safe %> <% if assessing && criterion && criterion.points %> <%= t "%{points} / %{total} pts", points: rating_points, total: n(criterion.points) %> <% else %> <%= t :points, "%{points} pts", :points => rating_points %> <% end %>
<%= assessment_rating ? n(round_if_whole(assessment_rating[:points])) : nbsp %> / <%= t :points, "%{points} pts", :points => %{#{ n((criterion.points rescue 5)) }}.html_safe %>
--
<% if !rubric || !rubric.free_form_criterion_comments %> "> <%= image_tag "rubric_comment.png", :alt => t('Additional Comments') %> <% end %>