class Moodle2CC::Moodle2::Parsers::QuestionParsers::NumericalParser
Public Instance Methods
parse_question(node)
click to toggle source
Calls superclass method
Moodle2CC::Moodle2::Parsers::QuestionParsers::QuestionParser#parse_question
# File lib/moodle2cc/moodle2/parsers/question_parsers/numerical_parser.rb, line 6 def parse_question(node) question = super q_node = node.at_xpath("plugin_qtype_#{question.qtype}_question") answer_parser = Parsers::AnswerParser.new question.answers += q_node.search('answers/answer').map { |n| answer_parser.parse(n) } q_node.search('numerical_records/numerical_record').each do |nr_node| answer_id = parse_text(nr_node, 'answer') tolerance = parse_text(nr_node, 'tolerance') question.tolerances[answer_id] = tolerance end question end