Sha256: 90fa3af7db292728e57f45c018a4bbc80c97d41c2d4023c06b9fa69bb1000f8a

Contents?: true

Size: 725 Bytes

Versions: 10

Compression:

Stored size: 725 Bytes

Contents

module Gaku
  module Grading
    module Single
      class  BaseMethod
        attr_reader :gradable, :gradable_type, :student, :criteria, :result

        # Pass a gradable object [exam or assignment] and students
        def initialize(gradable, student, criteria = nil)
          @gradable = gradable
          @student = student
          @criteria = criteria
          @result = {}
        end

        # Obtain graded hash of results
        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

      end
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
gaku-0.2.4 core/lib/gaku/grading/single/base_method.rb
gaku_core-0.2.4 lib/gaku/grading/single/base_method.rb
gaku-0.2.3 core/lib/gaku/grading/single/base_method.rb
gaku_core-0.2.3 lib/gaku/grading/single/base_method.rb
gaku-0.2.2 core/lib/gaku/grading/single/base_method.rb
gaku_core-0.2.2 lib/gaku/grading/single/base_method.rb
gaku-0.2.1 core/lib/gaku/grading/single/base_method.rb
gaku_core-0.2.1 lib/gaku/grading/single/base_method.rb
gaku-0.2.0 core/lib/gaku/grading/single/base_method.rb
gaku_core-0.2.0 lib/gaku/grading/single/base_method.rb