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
Overview
This is the Interaction for Essay question type
Instance Attribute Summary
Attributes inherited from BaseInteraction
Attributes inherited from Models::Base
#doc, #manifest, #package_root, #path, #resource
Class Method Summary collapse
-
.matches(node, parent) ⇒ Object
This will know if a class matches.
Instance Method Summary collapse
- #rce ⇒ Object
- #scoring_data_structs ⇒ Object
- #spell_check ⇒ Object
- #word_count ⇒ Object
- #word_limit_enabled ⇒ Object
- #word_limit_max ⇒ Object
- #word_limit_min ⇒ Object
Methods inherited from BaseInteraction
#answer_feedback, canvas_custom_fitb?, #canvas_item_feedback, canvas_multiple_fib?, #initialize, #locked_choices, maybe_question_type, new_quizzes_fib?, question_type, #shuffled?
Methods inherited from Base
#qti_version, #return_inner_content!, #sanitize_attributes, #sanitize_attributes_by_node
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::V1::Models::Interactions::BaseInteraction
Class Method Details
.matches(node, parent) ⇒ Object
This will know if a class matches
8 9 10 11 12 |
# File 'lib/qti/v1/models/interactions/string_interaction.rb', line 8 def self.matches(node, parent) matches = node.xpath('.//xmlns:render_fib') return false if matches.empty? new(node, parent) end |
Instance Method Details
#rce ⇒ Object
14 15 16 |
# File 'lib/qti/v1/models/interactions/string_interaction.rb', line 14 def rce @rce ||= (rce_raw.nil? || rce_raw.downcase == 'yes') end |
#scoring_data_structs ⇒ Object
39 40 41 |
# File 'lib/qti/v1/models/interactions/string_interaction.rb', line 39 def scoring_data_structs { value: grading_notes } end |
#spell_check ⇒ Object
22 23 24 |
# File 'lib/qti/v1/models/interactions/string_interaction.rb', line 22 def spell_check @spell_check ||= @node.at_xpath('.//xmlns:response_str/@spell_check')&.value&.downcase == 'yes' end |
#word_count ⇒ Object
18 19 20 |
# File 'lib/qti/v1/models/interactions/string_interaction.rb', line 18 def word_count @word_count ||= @node.at_xpath('.//xmlns:response_str/@word_count')&.value&.downcase == 'yes' end |
#word_limit_enabled ⇒ Object
26 27 28 29 |
# File 'lib/qti/v1/models/interactions/string_interaction.rb', line 26 def word_limit_enabled @word_limit_enabled ||= @node.at_xpath('.//xmlns:response_str/@word_limit_enabled')&.value&.downcase == 'yes' end |
#word_limit_max ⇒ Object
31 32 33 |
# File 'lib/qti/v1/models/interactions/string_interaction.rb', line 31 def word_limit_max @word_limit_max ||= @node.at_xpath('.//xmlns:response_str/@word_limit_max')&.value end |
#word_limit_min ⇒ Object
35 36 37 |
# File 'lib/qti/v1/models/interactions/string_interaction.rb', line 35 def word_limit_min @word_limit_min ||= @node.at_xpath('.//xmlns:response_str/@word_limit_min')&.value end |