Class: Moodle2CC::Moodle2::Parsers::QuestionParsers::MultianswerParser
- Inherits:
-
QuestionParser
- Object
- QuestionParser
- Moodle2CC::Moodle2::Parsers::QuestionParsers::MultianswerParser
- Includes:
- ParserHelper
- Defined in:
- lib/moodle2cc/moodle2/parsers/question_parsers/multianswer_parser.rb
Constant Summary
Constants included from ParserHelper
ParserHelper::FILES_XML, ParserHelper::IMS_FILEBASE_TOKEN, ParserHelper::MODULE_XML, ParserHelper::MOODLE_FILEBASE_TOKEN, ParserHelper::SLASH_TOKEN, ParserHelper::XML_NULL_VALUE
Instance Method Summary collapse
Methods included from ParserHelper
#activity_directories, #parse_boolean, #parse_module, #parse_text
Methods inherited from QuestionParser
Instance Method Details
#parse_question(node) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/moodle2cc/moodle2/parsers/question_parsers/multianswer_parser.rb', line 6 def parse_question(node) question = super answer_parser = Parsers::AnswerParser.new question.answers += node.search('answers/answer').map { |n| answer_parser.parse(n) } if sequence = node.at_xpath('plugin_qtype_multianswer_question/multianswer/sequence') question. = sequence.text.split(',') end question end |