Class: Qti::V2::Models::Interactions::OrderingInteraction

Inherits:
ChoiceInteraction show all
Defined in:
lib/qti/v2/models/interactions/ordering_interaction.rb

Constant Summary

Constants inherited from Base

Base::BODY_ELEMENTS_CSS, Base::CHOICE_ELEMENTS_CSS, Base::INTERACTION_ELEMENTS_CSS

Constants inherited from Models::Base

Models::Base::ELEMENTS_REMAP

Instance Attribute Summary

Attributes inherited from BaseInteraction

#node

Attributes inherited from Models::Base

#doc

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ChoiceInteraction

#answers, #max_choices_count, #min_choices_count

Methods inherited from BaseInteraction

#initialize, #scoring_data_structs, #xpath_with_single_check

Methods inherited from Base

#qti_version

Methods inherited from Models::Base

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

Constructor Details

This class inherits a constructor from Qti::V2::Models::Interactions::BaseInteraction

Class Method Details

.matches(node) ⇒ Object



8
9
10
11
12
# File 'lib/qti/v2/models/interactions/ordering_interaction.rb', line 8

def self.matches(node)
  match = node.at_xpath('.//xmlns:orderInteraction')
  return false unless match.present?
  new(node)
end

Instance Method Details

#shuffled?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/qti/v2/models/interactions/ordering_interaction.rb', line 14

def shuffled?
  node.at_xpath('.//xmlns:orderInteraction').attributes['shuffle']&.value&.downcase == 'true'
end