class Senkyoshi::FillInBlankPlus

Public Instance Methods

iterate_xml(data) click to toggle source
Calls superclass method Senkyoshi::Question#iterate_xml
# File lib/senkyoshi/models/questions/fill_in_blank_plus.rb, line 20
def iterate_xml(data)
  super
  if data.at("resprocessing")
    conditionvar = data.at("resprocessing").at("conditionvar")
  end
  # not all fill in the blank questions have answers(ie: surveys)
  if conditionvar
    conditionvar.at("and").children.each do |or_child|
      or_child.children.each do |varequal|
        answer = Answer.new(varequal.text)
        answer.resp_ident = varequal.attributes["respident"].value
        answer.fraction = @max_score
        @answers.push(answer)
      end
    end
  end
  self
end