Class: Qti::V1::Models::BankEntryItem

Inherits:
Base show all
Defined in:
lib/qti/v1/models/bank_entry_item.rb

Instance Attribute Summary collapse

Attributes inherited from Models::Base

#manifest, #package_root, #path, #resource

Instance Method Summary collapse

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

#docObject (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_typeObject



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_refObject



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_identObject



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_possibleObject



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_refObject



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