class Qti::V1::Models::Interactions::UploadInteraction

Public Class Methods

matches(node, parent) click to toggle source

This will know if a class matches

# File lib/qti/v1/models/interactions/upload_interaction.rb, line 7
def self.matches(node, parent)
  meta_node = node.at_xpath(
    './/xmlns:qtimetadatafield[./xmlns:fieldlabel/text()="question_type"]'
  )
  return false unless meta_node.present?
  type_node = meta_node.at_xpath('.//xmlns:fieldentry')
  return false unless type_node&.text() == 'file_upload_question'
  new(node, parent)
end

Public Instance Methods

item_body() click to toggle source
# File lib/qti/v1/models/interactions/upload_interaction.rb, line 17
def item_body
  @item_body ||= begin
    node = @node.dup
    presentation = node.at_xpath('.//xmlns:presentation')
    mattext = presentation.at_xpath('.//xmlns:mattext')
    inner_content = return_inner_content!(mattext)
    sanitize_content!(inner_content)
  end
end
scoring_data_structs() click to toggle source
# File lib/qti/v1/models/interactions/upload_interaction.rb, line 27
def scoring_data_structs
  { value: '' }
end