Class: Qti::V1::Models::Numerics::ScoringData

Inherits:
Object
  • Object
show all
Defined in:
lib/qti/v1/models/numerics/scoring_data.rb

Defined Under Namespace

Classes: UnsupportedNumreicType

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ ScoringData

Returns a new instance of ScoringData.



8
9
10
# File 'lib/qti/v1/models/numerics/scoring_data.rb', line 8

def initialize(node)
  @scoring_node = ScoringNode.new(node)
end

Instance Method Details

#scoring_dataObject



12
13
14
15
16
17
18
# File 'lib/qti/v1/models/numerics/scoring_data.rb', line 12

def scoring_data
  ExactMatch.new(@scoring_node).scoring_data ||
    MarginError.new(@scoring_node).scoring_data ||
    Precision.new(@scoring_node).scoring_data ||
    WithinRange.new(@scoring_node).scoring_data ||
    unknown_type
end

#unknown_typeObject



20
21
22
# File 'lib/qti/v1/models/numerics/scoring_data.rb', line 20

def unknown_type
  raise UnsupportedNumreicType, 'Unsupported Numeric Type'
end