Class: Moodle2CC::Moodle2Converter::CourseConverter

Inherits:
Object
  • Object
show all
Includes:
ConverterHelper
Defined in:
lib/moodle2cc/moodle2converter/course_converter.rb

Constant Summary

Constants included from ConverterHelper

Moodle2CC::Moodle2Converter::ConverterHelper::ACTIVITY_LOOKUP, Moodle2CC::Moodle2Converter::ConverterHelper::ASSESSMENT_SUFFIX, Moodle2CC::Moodle2Converter::ConverterHelper::ASSIGNMENT_SUFFIX, Moodle2CC::Moodle2Converter::ConverterHelper::CHAPTER_SUFFIX, Moodle2CC::Moodle2Converter::ConverterHelper::CHOICE_ASSESSMENT_SUFFIX, Moodle2CC::Moodle2Converter::ConverterHelper::COURSE_SUFFIX, Moodle2CC::Moodle2Converter::ConverterHelper::DISCUSSION_SUFFIX, Moodle2CC::Moodle2Converter::ConverterHelper::EXTERNAL_URL_SUFFIX, Moodle2CC::Moodle2Converter::ConverterHelper::FEEDBACK_ASSESSMENT_SUFFIX, Moodle2CC::Moodle2Converter::ConverterHelper::FILE_SUFFIX, Moodle2CC::Moodle2Converter::ConverterHelper::FOLDER_SUFFIX, Moodle2CC::Moodle2Converter::ConverterHelper::GLOSSARY_SUFFIX, Moodle2CC::Moodle2Converter::ConverterHelper::INTRO_SUFFIX, Moodle2CC::Moodle2Converter::ConverterHelper::LTI_SUFFIX, Moodle2CC::Moodle2Converter::ConverterHelper::MAX_TITLE_LENGTH, Moodle2CC::Moodle2Converter::ConverterHelper::MODULE_SUFFIX, Moodle2CC::Moodle2Converter::ConverterHelper::PAGE_SUFFIX, Moodle2CC::Moodle2Converter::ConverterHelper::QUESTIONNAIRE_ASSESSMENT_SUFFIX, Moodle2CC::Moodle2Converter::ConverterHelper::QUESTION_BANK_SUFFIX, Moodle2CC::Moodle2Converter::ConverterHelper::SUMMARY_PAGE_SUFFIX

Instance Method Summary collapse

Methods included from ConverterHelper

#activity_content_type, #generate_unique_identifier, #generate_unique_identifier_for, #generate_unique_identifier_for_activity, #generate_unique_resource_path, #get_unique_identifier_for_activity, #truncate_text, #workflow_state

Instance Method Details

#convert(moodle_course) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/moodle2cc/moodle2converter/course_converter.rb', line 5

def convert(moodle_course)
  cc_course = Moodle2CC::CanvasCC::Models::Course.new
  cc_course.title = moodle_course.fullname
  cc_course.course_code = moodle_course.shortname
  cc_course.start_at = moodle_course.startdate
  cc_course.identifier = generate_unique_identifier_for(moodle_course.course_id, COURSE_SUFFIX)
  cc_course.allow_student_discussion_topics = false
  cc_course.allow_student_wiki_edits = false
  cc_course.default_view = 'modules'
  cc_course
end