Class: Qti::V1::Models::BankEntryItem
- Inherits:
-
Base
- Object
- Models::Base
- Base
- Qti::V1::Models::BankEntryItem
- Defined in:
- lib/qti/v1/models/bank_entry_item.rb
Instance Attribute Summary collapse
-
#doc ⇒ Object
readonly
Returns the value of attribute doc.
Attributes inherited from Models::Base
#manifest, #package_root, #path, #resource
Instance Method Summary collapse
- #entry_type ⇒ Object
-
#initialize(item, package_root = nil) ⇒ BankEntryItem
constructor
A new instance of BankEntryItem.
- #item_ref ⇒ Object
- #parent_stimulus_item_ident ⇒ Object
- #points_possible ⇒ Object
- #sourcebank_ref ⇒ Object
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!, #parse_html, #parse_xml, #preprocess_xml_doc, #raise_unsupported, #remap_href_path, #sanitize_content!, #xpath_with_single_check
Constructor Details
#initialize(item, package_root = nil) ⇒ BankEntryItem
Returns a new instance of BankEntryItem.
7 8 9 10 11 |
# File 'lib/qti/v1/models/bank_entry_item.rb', line 7 def initialize(item, package_root = nil) @doc = item @path = item.document.url self.package_root = package_root end |
Instance Attribute Details
#doc ⇒ Object (readonly)
Returns the value of attribute doc.
5 6 7 |
# File 'lib/qti/v1/models/bank_entry_item.rb', line 5 def doc @doc end |
Instance Method Details
#entry_type ⇒ Object
29 30 31 |
# File 'lib/qti/v1/models/bank_entry_item.rb', line 29 def entry_type @entry_type ||= @doc.attribute('entry_type')&.value end |
#item_ref ⇒ Object
17 18 19 |
# File 'lib/qti/v1/models/bank_entry_item.rb', line 17 def item_ref @item_ref ||= @doc.attribute('item_ref').value end |
#parent_stimulus_item_ident ⇒ Object
21 22 23 |
# File 'lib/qti/v1/models/bank_entry_item.rb', line 21 def parent_stimulus_item_ident @parent_stimulus_item_ident ||= @doc.attribute('parent_stimulus_item_ident')&.value end |
#points_possible ⇒ Object
25 26 27 |
# File 'lib/qti/v1/models/bank_entry_item.rb', line 25 def points_possible @points_possible ||= @doc.attribute('points_possible')&.value || 1 end |
#sourcebank_ref ⇒ Object
13 14 15 |
# File 'lib/qti/v1/models/bank_entry_item.rb', line 13 def sourcebank_ref @sourcebank_ref ||= @doc.attribute('sourcebank_ref').value end |