Module: Qti::V2::Models::Interactions
- Defined in:
- lib/qti/v2/models/interactions.rb,
lib/qti/v2/models/interactions/base_interaction.rb,
lib/qti/v2/models/interactions/match_interaction.rb,
lib/qti/v2/models/interactions/choice_interaction.rb,
lib/qti/v2/models/interactions/ordering_interaction.rb,
lib/qti/v2/models/interactions/gap_match_interaction.rb,
lib/qti/v2/models/interactions/extended_text_interaction.rb,
lib/qti/v2/models/interactions/categorization_interaction.rb,
lib/qti/v2/models/interactions/match_item_tag_processors/match_interaction_tag_processor.rb,
lib/qti/v2/models/interactions/match_item_tag_processors/associate_interaction_tag_processor.rb
Defined Under Namespace
Modules: MatchItemTagProcesssors Classes: BaseInteraction, CategorizationInteraction, ChoiceInteraction, ExtendedTextInteraction, GapMatchInteraction, MatchInteraction, OrderingInteraction
Class Method Summary collapse
-
.interaction_model(node) ⇒ Object
This one finds the correct parsing model based on the provided xml node.
- .subclasses ⇒ Object
Class Method Details
.interaction_model(node) ⇒ Object
This one finds the correct parsing model based on the provided xml node
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/qti/v2/models/interactions.rb', line 9 def self.interaction_model(node) # Check for matches matches = subclasses.each_with_object([]) do |interaction_class, result| match = interaction_class.matches(node) result << match if match end raise V2::UnsupportedSchema if matches.size > 1 matches.first end |
.subclasses ⇒ Object
21 22 23 24 25 |
# File 'lib/qti/v2/models/interactions.rb', line 21 def self.subclasses constants.map { |c| const_get(c) } .reject { |c| c.name =~ /Implementations|Base/ } .select { |c| c.name =~ /^Qti::V2.*Interaction$/ } end |