class Qti::V1::Models::Choices::LogicalIdentifierChoice

Public Class Methods

new(node, parent) click to toggle source
# File lib/qti/v1/models/choices/logical_identifier_choice.rb, line 6
def initialize(node, parent)
  @node = node
  copy_paths_from_item(parent)
end

Public Instance Methods

identifier() click to toggle source
# File lib/qti/v1/models/choices/logical_identifier_choice.rb, line 11
def identifier
  @identifier ||= @node.attributes['ident'].value
end
item_body() click to toggle source
# File lib/qti/v1/models/choices/logical_identifier_choice.rb, line 15
def item_body
  @item_body ||= begin
    inner_content = return_inner_content!(content_node)
    sanitize_content!(inner_content)
  end
end

Private Instance Methods

content_node() click to toggle source

@node is answer node queried in callers by:

node.xpath('.//xmlns:response_label')

inner content should be in child node (mattext …) `texttype` is an attribute of mattext element. Possible child node types of response_label include:

mattext, matmtext, matimage, mataudio ... ...

from the code context, obviously we don't cover the full specification. We only consider mattext here. If there is no mattext, we basically go through original logic

# File lib/qti/v1/models/choices/logical_identifier_choice.rb, line 34
def content_node
  (@node.at_xpath('.//xmlns:mattext') || @node).dup
end