Class: Qti::V1::Models::ObjectBank
- Inherits:
-
Assessment
- Object
- Models::Base
- Base
- Assessment
- Qti::V1::Models::ObjectBank
- Defined in:
- lib/qti/v1/models/object_bank.rb
Constant Summary
Constants inherited from Assessment
Instance Attribute Summary
Attributes inherited from Models::Base
#doc, #manifest, #package_root, #path, #resource
Instance Method Summary collapse
- #bank_context_uuid ⇒ Object
-
#bank_type ⇒ Object
tells us whether the bank was an account or course bank.
- #canvas_item_bank ⇒ Object
- #identifier ⇒ Object
-
#title ⇒ Object
use assessment_items / create_assessment_item from Assessment for bank items.
Methods inherited from Assessment
#assessment_items, #create_assessment_item, #create_bank_entry_item, #create_question_group, #create_stimulus, #external_assignment_id, #stimulus_ref
Methods included from Models::AssessmentMetaBase
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::Models::Base
Instance Method Details
#bank_context_uuid ⇒ Object
27 28 29 30 31 |
# File 'lib/qti/v1/models/object_bank.rb', line 27 def bank_context_uuid @bank_context_uuid ||= xpath_with_single_check( './/xmlns:qtimetadatafield/xmlns:fieldlabel[text()="bank_context_uuid"]/../xmlns:fieldentry' )&.content end |
#bank_type ⇒ Object
tells us whether the bank was an account or course bank
21 22 23 24 25 |
# File 'lib/qti/v1/models/object_bank.rb', line 21 def bank_type @bank_type ||= xpath_with_single_check( './/xmlns:qtimetadatafield/xmlns:fieldlabel[text()="bank_type"]/../xmlns:fieldentry' )&.content end |
#canvas_item_bank ⇒ Object
16 17 18 |
# File 'lib/qti/v1/models/object_bank.rb', line 16 def canvas_item_bank @canvas_item_bank ||= xpath_with_single_check('.//xmlns:objectbank/@canvas_item_bank')&.content end |
#identifier ⇒ Object
12 13 14 |
# File 'lib/qti/v1/models/object_bank.rb', line 12 def identifier @identifier ||= xpath_with_single_check('.//xmlns:objectbank/@ident')&.content end |
#title ⇒ Object
use assessment_items / create_assessment_item from Assessment for bank items
6 7 8 9 10 |
# File 'lib/qti/v1/models/object_bank.rb', line 6 def title @title ||= xpath_with_single_check( './/xmlns:qtimetadatafield/xmlns:fieldlabel[text()="bank_title"]/../xmlns:fieldentry' )&.content || File.basename(@path, '.xml') end |