record grader when grading via API

test plan:
 * go to gradebook2 and change a grade
 * go to /gradebook/history for the course, and view the grade change
   you just made. it should say it was you that did it

Change-Id: Ie3f91b7ceadbe99b3cccff33a957595e5d8c2cf6
Reviewed-on: https://gerrit.instructure.com/13653
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
This commit is contained in:
Cody Cutrer 2012-09-11 21:07:12 -06:00
parent 3f9d2fb6b1
commit 2618f0d889
2 changed files with 2 additions and 1 deletions

View File

@ -259,7 +259,7 @@ class SubmissionsApiController < ApplicationController
end
if authorized
submission = {}
submission = { :grader => @current_user }
if params[:submission].is_a?(Hash)
submission[:grade] = params[:submission].delete(:posted_grade)
end

View File

@ -136,6 +136,7 @@ describe 'Submissions API', :type => :integration do
Submission.count.should == 2
@submission = Submission.last(:order => :id)
@submission.grader.should == @teacher
json['score'].should == 7.5
json['grade'].should == '75%'