<% # 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_association ||= nil; editable ||= false; association_object = nil; edit_view ||= false rubric ||= nil; assessing ||= false; assessment ||= nil; has_assessments ||= false for_context ||= false context = @context context = context.context if context.is_a?(Group) show_grading = !@assignment || !%w{online_quiz not_graded}.include?(@assignment.submission_types) rubric_association = assessment.rubric_association if assessment&.active_rubric_association? anonymize_student ||= false outcome_friendly_descriptions = rubric.outcome_friendly_descriptions.to_a if rubric %> <% cache(['rubric_render4', (rubric.try(:cache_key) || 'no_rubric'), (rubric.try(:cache_key) || context.asset_string), (rubric_association.try(:cache_key) || 'no_association'), (assessment.try(:cache_key) || 'no_assessment'), editable, edit_view, assessing, show_grading, @domain_root_account.feature_enabled?(:non_scoring_rubrics), @domain_root_account.feature_enabled?(:rubric_criterion_range)].join('/')) do %>
<%= "for_grading" if rubric_association.try(:use_for_grading) %>" id="<%= rubric ? "rubric_#{rubric.id}" : "default_rubric" %>" style="<%= hidden unless rubric %>" >

<%= t 'rubric', "Rubric" %>

" style="width: 200px;" maxlength="255" aria-label="<%= t('title', "Title:") %>"/> " style="display: none;"><%= image_tag "find.png", :alt => '' %> <%= t 'links.find_rubric', "Find Rubric" %> <% if rubric_association && !rubric_association.rubric_assessments.empty? %>
<%= t 'messages.rubric_in_use', { :one => "Keep in mind that 1 student has already been assessed using this rubric. Changing it will affect their evaluation.", :other => "Keep in mind that %{count} students have already been assessed using this rubric. Changing it will affect their evaluations." }, :count => rubric_association.rubric_assessments.count %>
<% end %>
<%= rubric.try(:title) || t(:rubric_title, "Title") %>
<%= t 'messages.rubric_in_use2', "You've already rated students with this rubric. Any major changes could affect their assessment results." %>
<% if rubric && rubric.criteria %> <% learning_outcome_ids = rubric.learning_outcome_ids_from_results %> <% rubric.criteria_object.each do |criterion| %> <% rating = assessment.ratings.find{|r| r[:criterion_id] == criterion.id} rescue nil %> <% friendly_description = outcome_friendly_descriptions.detect {|x| x["learning_outcome_id"] == criterion[:learning_outcome_id]}.description rescue '' %> <%= render :partial => "shared/rubric_criterion", :object => criterion, :locals => {:assessing => assessing, :assessment_rating => rating, :rubric => rubric, :rubric_association => rubric_association, :edit_view => edit_view, :friendly_description => friendly_description, :learning_outcome_ids => learning_outcome_ids} %> <% end %> <% end %> <%= render :partial => "shared/rubric_criterion", :object => nil %>
<%= rubric.try(:title) || t(:rubric_title, "Title") %>
<%= t 'headers.criteria', "Criteria" %> <%= t 'headers.ratings', "Ratings" %> <%= t 'headers.points', "Pts" %>
<%= before_label :total_points, "Total Points" %> <% ot(:out_of, "%{points} *out of %{total}*", :points => capture { %> <%= assessment ? n(round_if_whole(assessment.score)) : n(round_if_whole((rubric.points_possible rescue 5))) %> <% }, wrapper: '\1', total: n(round_if_whole((rubric.points_possible rescue 5)))) %>
/>
<% if @domain_root_account.feature_enabled?(:non_scoring_rubrics) %>
/>
/>
<% end %> <% if show_grading %>
/>
<% end %>
/>
<% end %>