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

Instance Attribute Summary

Attributes inherited from BaseInteraction

#node

Attributes inherited from Models::Base

#doc, #manifest, #package_root, #path, #resource

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ChoiceInteraction

#answers, #max_choices_count, #min_choices_count

Methods inherited from BaseInteraction

#canvas_item_feedback, #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_html, #parse_xml, #preprocess_xml_doc, #raise_unsupported, #remap_href_path, #sanitize_content!, #xpath_with_single_check

Constructor Details

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

Class Method Details

.matches(node, parent) ⇒ Object



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

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

Instance Method Details

#shuffled?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/qti/v2/models/interactions/ordering_interaction.rb', line 12

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