class Qti::V1::Models::StimulusItem

Public Class Methods

new(ref_node) click to toggle source
# File lib/qti/v1/models/stimulus_item.rb, line 5
def initialize(ref_node)
  @node = ref_node
end

Public Instance Methods

body() click to toggle source
# File lib/qti/v1/models/stimulus_item.rb, line 17
def body
  @body ||= begin
    presentation = @node.at_xpath('.//xmlns:presentation')
    return nil if presentation.blank?
    sanitize_content!(presentation.at_xpath('.//xmlns:mattext')&.text)
  end
end
identifier() click to toggle source
# File lib/qti/v1/models/stimulus_item.rb, line 9
def identifier
  @identifier ||= @node.attributes['ident']&.value
end
stimulus_type() click to toggle source
# File lib/qti/v1/models/stimulus_item.rb, line 25
def stimulus_type
  'text'
end
title() click to toggle source
# File lib/qti/v1/models/stimulus_item.rb, line 13
def title
  @title ||= @node.attributes['title']&.value
end