Class: Senkyoshi::Assignment
- Defined in:
- lib/senkyoshi/models/assignment.rb
Constant Summary
Constants inherited from Content
Content::CONTENT_TYPES, Content::MODULE_TYPES
Instance Attribute Summary
Attributes inherited from Content
#body, #extendeddata, #files, #id, #title, #url
Instance Method Summary collapse
Methods inherited from Content
#create_module, from, #get_pre_data, #iterate_xml, #set_module
Methods inherited from Resource
#_search_and_replace, #cleanup, #fix_html, #matches_xid?
Instance Method Details
#canvas_conversion(course, resources) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/senkyoshi/models/assignment.rb', line 5 def canvas_conversion(course, resources) unless @title == "--TOP--" assignment = CanvasCc::CanvasCC::Models::Assignment.new assignment.identifier = @id assignment.title = @title assignment.body = fix_html(@body, resources) assignment.points_possible = @points assignment.assignment_group_identifier_ref = @group_id assignment.position = 1 assignment.workflow_state = "published" assignment.submission_types << "online_text_entry" assignment.submission_types << "online_upload" assignment.grading_type = "points" @files.each { |f| assignment.body << f.canvas_conversion } course = create_module(course) course.assignments << assignment end course end |