Class: Qti::V1::Models::Interactions::LogicalIdentifierInteraction

Inherits:
Base
  • Object
show all
Defined in:
lib/qti/v1/models/interactions/logical_identifier_interaction.rb

Constant Summary

Constants inherited from Models::Base

Models::Base::ELEMENTS_REMAP

Instance Method Summary collapse

Methods inherited from Base

#qti_version

Methods inherited from Models::Base

#css_with_single_check, from_path!, #parse_xml, #remap_href_path, #remap_unknown_tags_transformer, #sanitize_config, #sanitize_content!, #xpath_with_single_check

Constructor Details

#initialize(node) ⇒ LogicalIdentifierInteraction

Returns a new instance of LogicalIdentifierInteraction.



9
10
11
# File 'lib/qti/v1/models/interactions/logical_identifier_interaction.rb', line 9

def initialize(node)
  @node = node
end

Instance Method Details

#answersObject



17
18
19
20
21
# File 'lib/qti/v1/models/interactions/logical_identifier_interaction.rb', line 17

def answers
  @answers ||= answer_nodes.map do |node|
    V1::Models::Choices::LogicalIdentifierChoice.new(node)
  end
end

#shuffled?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/qti/v1/models/interactions/logical_identifier_interaction.rb', line 13

def shuffled?
  @node.at_xpath('.//render_choice/@shuffle')&.value == 'Yes'
end