Class: Qti::V1::Models::StimulusItem
- Inherits:
-
Object
- Object
- Qti::V1::Models::StimulusItem
- Defined in:
- lib/qti/v1/models/stimulus_item.rb
Instance Method Summary collapse
- #body ⇒ Object
-
#identifier ⇒ Object
Not used yet.
-
#initialize(ref_node) ⇒ StimulusItem
constructor
A new instance of StimulusItem.
- #stimulus_type ⇒ Object
- #title ⇒ Object
Constructor Details
#initialize(ref_node) ⇒ StimulusItem
Returns a new instance of StimulusItem.
5 6 7 |
# File 'lib/qti/v1/models/stimulus_item.rb', line 5 def initialize(ref_node) @node = ref_node end |
Instance Method Details
#body ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/qti/v1/models/stimulus_item.rb', line 18 def body @body ||= begin presentation = @node.at_xpath('.//xmlns:presentation') return nil if presentation.blank? mattext = presentation.at_xpath('.//xmlns:mattext') mattext&.text end end |
#identifier ⇒ Object
Not used yet
10 11 12 |
# File 'lib/qti/v1/models/stimulus_item.rb', line 10 def identifier @identifier ||= @node.attributes['ident']&.value end |
#stimulus_type ⇒ Object
27 28 29 |
# File 'lib/qti/v1/models/stimulus_item.rb', line 27 def stimulus_type 'text' end |
#title ⇒ Object
14 15 16 |
# File 'lib/qti/v1/models/stimulus_item.rb', line 14 def title @title ||= @node.attributes['title']&.value end |