Class: Moodle2CC::Moodle2::Parsers::QuestionnaireParser

Inherits:
Object
  • Object
show all
Includes:
ParserHelper
Defined in:
lib/moodle2cc/moodle2/parsers/questionnaire_parser.rb

Constant Summary collapse

QUESTIONNAIRE_XML =
'questionnaire.xml'
QUESTIONNAIRE_MODULE_NAME =
'questionnaire'

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

Constructor Details

#initialize(backup_dir) ⇒ QuestionnaireParser

Returns a new instance of QuestionnaireParser.



8
9
10
# File 'lib/moodle2cc/moodle2/parsers/questionnaire_parser.rb', line 8

def initialize(backup_dir)
  @backup_dir = backup_dir
end

Instance Method Details

#parseObject



12
13
14
15
# File 'lib/moodle2cc/moodle2/parsers/questionnaire_parser.rb', line 12

def parse
  activity_dirs = activity_directories(@backup_dir, QUESTIONNAIRE_MODULE_NAME)
  activity_dirs.map { |dir| parse_questionnaire(dir) }
end