class Senkyoshi::OpinionScale

Public Instance Methods

iterate_xml(data) click to toggle source
Calls superclass method Senkyoshi::Question#iterate_xml
# File lib/senkyoshi/models/questions/opinion_scale.rb, line 20
def iterate_xml(data)
  super
  if response_block = data.at("flow[@class=RESPONSE_BLOCK]")
    set_answers(data.at("resprocessing"))
    response_block.at("render_choice").children.each do |choice|
      id = choice.at("response_label").attributes["ident"].value
      @answer_text = choice.at("mat_formattedtext").text
      answer = Answer.new(@answer_text, id)
      answer.fraction = get_fraction(id)
      @answers.push(answer)
    end
  end
  self
end