Class: Moodle2CC::Canvas::Converter

Inherits:
Moodle2CC::CC::Converter show all
Defined in:
lib/moodle2cc/canvas/converter.rb

Constant Summary

Constants included from Moodle2CC::CC::CCHelper

Moodle2CC::CC::CCHelper::ASSESSMENT_CC_QTI, Moodle2CC::CC::CCHelper::ASSESSMENT_META, Moodle2CC::CC::CCHelper::ASSESSMENT_NON_CC_FOLDER, Moodle2CC::CC::CCHelper::ASSESSMENT_TYPE, Moodle2CC::CC::CCHelper::ASSIGNMENT_GROUPS, Moodle2CC::CC::CCHelper::ASSIGNMENT_SETTINGS, Moodle2CC::CC::CCHelper::BASIC_LTI, Moodle2CC::CC::CCHelper::BLTI_NAMESPACE, Moodle2CC::CC::CCHelper::CANVAS_NAMESPACE, Moodle2CC::CC::CCHelper::CANVAS_PLATFORM, Moodle2CC::CC::CCHelper::CC_ASSIGNMENT_FOLDER, Moodle2CC::CC::CCHelper::CC_EXTENSION, Moodle2CC::CC::CCHelper::CC_WIKI_FOLDER, Moodle2CC::CC::CCHelper::COURSE_SETTINGS, Moodle2CC::CC::CCHelper::COURSE_SETTINGS_DIR, Moodle2CC::CC::CCHelper::COURSE_TOKEN, Moodle2CC::CC::CCHelper::DISCUSSION_TOPIC, Moodle2CC::CC::CCHelper::EVENTS, Moodle2CC::CC::CCHelper::EXTERNAL_FEEDS, Moodle2CC::CC::CCHelper::EXTERNAL_TOOLS, Moodle2CC::CC::CCHelper::FILES_META, Moodle2CC::CC::CCHelper::GRADING_STANDARDS, Moodle2CC::CC::CCHelper::IMS_DATE, Moodle2CC::CC::CCHelper::IMS_DATETIME, Moodle2CC::CC::CCHelper::LEARNING_OUTCOMES, Moodle2CC::CC::CCHelper::LOR, Moodle2CC::CC::CCHelper::MANIFEST, Moodle2CC::CC::CCHelper::MEDIA_OBJECTS_FOLDER, Moodle2CC::CC::CCHelper::MODULE_META, Moodle2CC::CC::CCHelper::MOODLE_FILEBASE_TOKEN, Moodle2CC::CC::CCHelper::MOODLE_SLASH_TOKEN, Moodle2CC::CC::CCHelper::OBJECT_TOKEN, Moodle2CC::CC::CCHelper::QTI_ASSESSMENT_TYPE, Moodle2CC::CC::CCHelper::QTI_EXTENSION, Moodle2CC::CC::CCHelper::QUESTION_BANK, Moodle2CC::CC::CCHelper::RUBRICS, Moodle2CC::CC::CCHelper::SYLLABUS, Moodle2CC::CC::CCHelper::WEBCONTENT, Moodle2CC::CC::CCHelper::WEB_CONTENT_TOKEN, Moodle2CC::CC::CCHelper::WEB_LINK, Moodle2CC::CC::CCHelper::WEB_RESOURCES_FOLDER, Moodle2CC::CC::CCHelper::WIKI_FOLDER, Moodle2CC::CC::CCHelper::WIKI_TOKEN, Moodle2CC::CC::CCHelper::XSD_URI

Instance Method Summary collapse

Methods inherited from Moodle2CC::CC::Converter

#convert, #create_manifest, #create_organizations, #create_web_resources, #imscc_file_name, #imscc_path, #imscc_tmp_path

Methods included from Moodle2CC::CC::CCHelper

#convert_file_path_tokens, convert_file_path_tokens, #create_key, create_key, create_mod_key, #create_mod_key, #create_resource_key, create_resource_key, file_query_string, #file_slug, file_slug, #get_html_title_and_body, #get_html_title_and_body_and_id, #get_html_title_and_body_and_meta_fields, ims_date, #ims_date, ims_datetime, #ims_datetime, media_object_info

Constructor Details

#initialize(moodle_backup, destination_dir) ⇒ Converter

Returns a new instance of Converter.



3
4
5
6
# File 'lib/moodle2cc/canvas/converter.rb', line 3

def initialize(moodle_backup, destination_dir)
  super
  @resource_factory = Moodle2CC::ResourceFactory.new Moodle2CC::Canvas
end

Instance Method Details

#create_course_content(resources_node) ⇒ Object



24
25
26
27
28
# File 'lib/moodle2cc/canvas/converter.rb', line 24

def create_course_content(resources_node)
  course = Course.new(@moodle_backup.course)
  course.create_resource_node(resources_node)
  course.create_files(@export_dir)
end

#create_question_bank_resource(resources_node, question_category) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/moodle2cc/canvas/converter.rb', line 16

def create_question_bank_resource(resources_node, question_category)
  question_bank = QuestionBank.new(question_category)
  if question_bank.questions.length > 0
    question_bank.create_resource_node(resources_node)
    question_bank.create_files(@export_dir)
  end
end

#create_resources(resources_node) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/moodle2cc/canvas/converter.rb', line 8

def create_resources(resources_node)
  create_course_content(resources_node)
  @moodle_backup.course.question_categories.each do |question_category|
    create_question_bank_resource(resources_node, question_category)
  end
  super
end