Class: Moodle2CC::CanvasCC::AssignmentWriter

Inherits:
Object
  • Object
show all
Defined in:
lib/moodle2cc/canvas_cc/assignment_writer.rb

Instance Method Summary collapse

Constructor Details

#initialize(work_dir, *assignments) ⇒ AssignmentWriter

Returns a new instance of AssignmentWriter.



4
5
6
7
# File 'lib/moodle2cc/canvas_cc/assignment_writer.rb', line 4

def initialize(work_dir, *assignments)
  @work_dir = work_dir
  @assignments = assignments
end

Instance Method Details

#writeObject



9
10
11
12
13
14
15
16
# File 'lib/moodle2cc/canvas_cc/assignment_writer.rb', line 9

def write
  @assignments.each do |assignment|
    assignment_dir = File.join(@work_dir, assignment.assignment_resource.identifier)
    Dir.mkdir(assignment_dir)
    write_html(assignment_dir, assignment)
    write_settings(assignment_dir, assignment)
  end
end