Class: Qti::V1::Models::Interactions::StringInteraction

Inherits:
BaseInteraction show all
Defined in:
lib/qti/v1/models/interactions/string_interaction.rb

Constant Summary

Constants inherited from Models::Base

Models::Base::ELEMENTS_REMAP

Instance Attribute Summary

Attributes inherited from BaseInteraction

#node

Attributes inherited from Models::Base

#doc, #manifest, #package_root, #path

Class Method Summary collapse

Methods inherited from BaseInteraction

canvas_multiple_fib?, #initialize, #scoring_data_structs, #shuffled?

Methods inherited from Base

#qti_version, #return_inner_content!

Methods inherited from Models::Base

#css_with_single_check, from_path!, #initialize, #object_tag_transformer, #parse_html, #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::V1::Models::Interactions::BaseInteraction

Class Method Details

.matches(node, parent) ⇒ Object

This will know if a class matches



7
8
9
10
11
12
# File 'lib/qti/v1/models/interactions/string_interaction.rb', line 7

def self.matches(node, parent)
  return false unless node.xpath('.//xmlns:other').present?
  matches = node.xpath('.//xmlns:render_fib')
  return false if matches.empty?
  new(matches.first, parent)
end