Module: Qti::V1::Models::Interactions
- Defined in:
- lib/qti/v1/models/interactions.rb,
lib/qti/v1/models/interactions/base_interaction.rb,
lib/qti/v1/models/interactions/match_interaction.rb,
lib/qti/v1/models/interactions/choice_interaction.rb,
lib/qti/v1/models/interactions/string_interaction.rb,
lib/qti/v1/models/interactions/ordering_interaction.rb,
lib/qti/v1/models/interactions/fill_blank_interaction.rb
Defined Under Namespace
Classes: BaseInteraction, ChoiceInteraction, FillBlankInteraction, MatchInteraction, OrderingInteraction, StringInteraction
Class Method Summary collapse
-
.interaction_model(node) ⇒ Object
This one finds the correct parsing model based on the provided xml node.
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/v1/models/interactions.rb', line 9 def self.interaction_model(node) subclasses = constants.map { |c| const_get(c) } # Check for matches matches = subclasses.each_with_object([]) do |interaction_class, result| match = interaction_class.matches(node) result << match if match end raise UnsupportedSchema if matches.size != 1 matches.first end |