Class: Qti::V1::Models::Interactions::StringInteraction
- Inherits:
-
BaseInteraction
- Object
- Models::Base
- Base
- BaseInteraction
- Qti::V1::Models::Interactions::StringInteraction
- Defined in:
- lib/qti/v1/models/interactions/string_interaction.rb
Constant Summary
Constants inherited from Models::Base
Instance Attribute Summary
Attributes inherited from BaseInteraction
Attributes inherited from Models::Base
Class Method Summary collapse
-
.matches(node) ⇒ Object
This will know if a class matches.
Instance Method Summary collapse
-
#initialize(node) ⇒ StringInteraction
constructor
A new instance of StringInteraction.
Methods inherited from BaseInteraction
#scoring_data_structs, #shuffled?
Methods inherited from Base
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) ⇒ StringInteraction
Returns a new instance of StringInteraction.
14 15 16 |
# File 'lib/qti/v1/models/interactions/string_interaction.rb', line 14 def initialize(node) @node = node end |
Class Method Details
.matches(node) ⇒ 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) return false unless node.xpath('.//xmlns:other').present? matches = node.xpath('.//xmlns:render_fib') return false if matches.empty? new(matches.first) end |