remove unused actions in rubric_assessments_controller
the index and show actions are unused. the index view was
removed awhile ago in 91ce600f
.
Change-Id: Ib84fc2e9e524aec3143a4395d15f9c1320798648
Reviewed-on: https://gerrit.instructure.com/29983
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
QA-Review: Jon Willesen <jonw@instructure.com>
This commit is contained in:
parent
2f9c6f82e1
commit
39a7266315
|
@ -19,44 +19,6 @@
|
|||
class RubricAssessmentsController < ApplicationController
|
||||
before_filter :require_context
|
||||
|
||||
def index
|
||||
@association = @context.rubric_associations.find(params[:rubric_association_id]) #Rubric.find(params[:rubric_id])
|
||||
@assessments = @association.rubric_assessments
|
||||
if authorized_action(@context, @current_user, :read)
|
||||
@headers = false
|
||||
render :action => "index"
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
@association = @context.rubric_associations.find(params[:rubric_association_id]) #Rubric.find(params[:rubric_id])
|
||||
@assessment = @association.rubric_assessments.find(params[:id]) rescue nil
|
||||
@assessment_request = @association.assessment_requests.find_by_uuid(params[:id])
|
||||
if @assessment_request && @association.purpose == "grading" && @association.association_type == 'Assignment'
|
||||
redirect_to named_context_url(@context, :context_assignment_submission_url, @association.association_id, @assessment_request.user_id)
|
||||
return
|
||||
end
|
||||
if @assessment_request || authorized_action(@context, @current_user, :read)
|
||||
unless @assessment
|
||||
raise "Assessment Request required" unless @assessment_request
|
||||
@assessment = @assessment_request.rubric_assessment
|
||||
@user = @assessment_request.asset.user rescue nil
|
||||
@assessment ||= @association.assess(:assessor => (@current_user || @assessment_request.user), :user => @user, :artifact => @assessment_request.asset, :assessment => {:assessment_type => 'invited_assessment'})
|
||||
session[:rubric_assessment_ids] = ((session[:rubric_assessment_ids] || []) + [@assessment.id]).uniq
|
||||
@assessment_request.attributes = {:rubric_assessment => @assessment, :user => @assessment.assessor}
|
||||
@assessment_request.complete
|
||||
@assessing = true
|
||||
end
|
||||
@assessments = [@assessment]
|
||||
if @assessment.artifact && @assessment.artifact.is_a?(Submission)
|
||||
redirect_to named_context_url(@assessment.artifact.context, :context_assignment_submission_url, @assessment.artifact.assignment_id, @assessment.artifact.user_id)
|
||||
else
|
||||
@headers = false
|
||||
render :action => "index"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def create
|
||||
update
|
||||
end
|
||||
|
|
|
@ -19,36 +19,6 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
||||
|
||||
describe RubricAssessmentsController do
|
||||
describe "GET 'index'" do
|
||||
it "should require authorization" do
|
||||
course_with_teacher(:active_all => true)
|
||||
rubric_assessment_model(:user => @user, :context => @course)
|
||||
get 'index', :course_id => @course.id, :rubric_association_id => @rubric_association.id
|
||||
assert_unauthorized
|
||||
end
|
||||
it "should assign variables" do
|
||||
course_with_teacher_logged_in(:active_all => true)
|
||||
rubric_assessment_model(:user => @user, :context => @course)
|
||||
get 'index', :course_id => @course.id, :rubric_association_id => @rubric_association.id
|
||||
response.should be_success
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET 'show'" do
|
||||
it "should require authorization" do
|
||||
course_with_teacher(:active_all => true)
|
||||
rubric_assessment_model(:user => @user, :context => @course)
|
||||
get 'show', :course_id => @course.id, :rubric_association_id => @rubric_association.id, :id => @rubric_assessment.id
|
||||
assert_unauthorized
|
||||
end
|
||||
it "should assign variables" do
|
||||
course_with_teacher_logged_in(:active_all => true)
|
||||
rubric_assessment_model(:user => @user, :context => @course)
|
||||
get 'show', :course_id => @course.id, :rubric_association_id => @rubric_association.id, :id => @rubric_assessment.id
|
||||
response.should be_success
|
||||
end
|
||||
end
|
||||
|
||||
describe "POST 'create'" do
|
||||
it "should require authorization" do
|
||||
course_with_teacher(:active_all => true)
|
||||
|
|
Loading…
Reference in New Issue