class Qti::V1::Models::Numerics::WithinRange

Public Class Methods

new(scoring_node) click to toggle source
# File lib/qti/v1/models/numerics/within_range.rb, line 6
def initialize(scoring_node)
  super(scoring_node)
end

Public Instance Methods

scoring_data() click to toggle source
# File lib/qti/v1/models/numerics/within_range.rb, line 10
def scoring_data
  return unless valid?
  Struct.new(
    :id,
    :type,
    :start,
    :end
  ).new(
    gte_node.attributes['respident']&.value,
    'withinARange',
    gte_node.content,
    lte_node.content
  )
end

Private Instance Methods

valid?() click to toggle source
# File lib/qti/v1/models/numerics/within_range.rb, line 27
def valid?
  (gte_node && lte_node).present? && equal_node.nil?
end