class Gaku::Grading::Single::BaseMethod

Attributes

criteria[R]
gradable[R]
gradable_scope[R]
gradable_type[R]
result[R]
student[R]

Public Class Methods

new(gradable, student, gradable_scope, criteria = nil) click to toggle source

Pass a gradable object [exam or assignment] and students

# File lib/gaku/grading/single/base_method.rb, line 8
def initialize(gradable, student, gradable_scope, criteria = nil)
  @gradable = gradable
  @student = student
  @criteria = criteria
  @gradable_scope = gradable_scope
  @result = {}
end

Public Instance Methods

grade() click to toggle source

Obtain graded hash of results

# File lib/gaku/grading/single/base_method.rb, line 17
def grade
  case @gradable
  when Gaku::Exam
    grade_exam
  when Gaku::Assignment
    #grade_assignment
  end

  Gaku::Grading::Single::Result.new(@gradable.id, @result).as_json
end