module Agilix::Buzz::Commands::Course

Public Instance Methods

copy_courses(items = []) click to toggle source

api.copy_courses [{courseid: 60982, domainid: 57025}]

# File lib/agilix/buzz/commands/course.rb, line 7
def copy_courses(items = [])
  options = items.map do |item|
    argument_cleaner(required_params: %i( courseid domainid ), optional_params: %i( action depth reference status roleid title type startdate enddate days term indexrule ), options: item )
  end
  authenticated_bulk_post cmd: "copycourses", root_node: "course", body: options
end
create_courses(items = []) click to toggle source

api.create_courses title: “Starter Course”, domainid: 57025

# File lib/agilix/buzz/commands/course.rb, line 15
def create_courses(items = [])
  options = items.map do |item|
    item[:schema] ||= 3 # should default to 3, 2 is old news
    argument_cleaner(required_params: %i( title domainid schema ), optional_params: %i(reference status roleid type startdate enddate days term indexrule data ), options: item )
  end
  authenticated_bulk_post cmd: "createcourses", root_node: "course", body: options
end
create_demo_course(options = {}) click to toggle source

ISSUE: documentation on request format is inconsistent, not sure if it is bulk post or normal post format. in one place rood node is request, in other its course api.create_demo_course courseid: 60982, domainid: 57025, title: “Demo Course”, daysoffset: 60

# File lib/agilix/buzz/commands/course.rb, line 25
def create_demo_course(options = {})
  options = argument_cleaner(required_params: %i( courseid domainid ), optional_params: %i( schema reference title daysoffset usermap ), options: options )
  authenticated_post cmd: "createdemocourse", **options
end
deactivate_course(options = {}) click to toggle source

ISSUE: get request should be delete, put, patch api.deactivate_course

# File lib/agilix/buzz/commands/course.rb, line 32
def deactivate_course(options = {})
  options = argument_cleaner(required_params: %i( courseid ), optional_params: %i( ), options: options )
  authenticated_get cmd: "deactivatecourse", **options
end
delete_courses(items = []) click to toggle source

ISSUE: Why so different than deactivate course api.delete_courses [{courseid: 60994}]

# File lib/agilix/buzz/commands/course.rb, line 39
def delete_courses(items = [])
  options = items.map do |item|
    argument_cleaner(required_params: %i( courseid ), optional_params: %i(), options: item )
  end
  authenticated_bulk_post cmd: "deletecourses", root_node: "course", body: options
end
get_course(options = {})
Alias for: get_course2
get_course2(options = {}) click to toggle source

api.get_course2 courseid: 60994

# File lib/agilix/buzz/commands/course.rb, line 47
def get_course2(options = {})
  options = argument_cleaner(required_params: %i( courseid ), optional_params: %i( select version ), options: options )
  authenticated_get cmd: "getcourse2", **options
end
Also aliased as: get_course
get_course_history(options = {}) click to toggle source

api.get_course_history courseid: 60994

# File lib/agilix/buzz/commands/course.rb, line 54
def get_course_history(options = {})
  options = argument_cleaner(required_params: %i( courseid ), optional_params: %i( ), options: options )
  authenticated_get cmd: "getcoursehistory", **options
end
list_courses(options = {}) click to toggle source

api.list_courses domainid: 5

# File lib/agilix/buzz/commands/course.rb, line 60
def list_courses(options = {})
  options[:domainid] ||= 0
  options = argument_cleaner(required_params: %i( domainid ), optional_params: %i( includedescendantdomains limit show select text query subtype subscriptionmode subscriptiondomainid ), options: options )
  authenticated_get cmd: "listcourses", **options
end
merge_courses(items = []) click to toggle source

api.merge_courses courseid: 60994

# File lib/agilix/buzz/commands/course.rb, line 67
def merge_courses(items = [])
  options = items.map do |item|
    argument_cleaner(required_params: %i( courseid  ), optional_params: %i( ), options: item )
  end
  authenticated_bulk_post cmd: "mergecourses", root_node: "course", body: options
end
restore_course(options = {}) click to toggle source

api.restore_course courseid: 60994

# File lib/agilix/buzz/commands/course.rb, line 75
def restore_course(options = {})
  options = argument_cleaner(required_params: %i( courseid ), optional_params: %i( ), options: options )
  authenticated_get cmd: "restorecourse", **options
end
update_courses(items = []) click to toggle source

api.update_courses [{courseid: 60994, title: “Updated Course”}]

# File lib/agilix/buzz/commands/course.rb, line 81
def update_courses(items = [])
  options = items.map do |item|
    argument_cleaner(required_params: %i( courseid  ), optional_params: %i( domainid title reference type baseid startdate enddate days term indexrule schema data ), options: item )
  end
  authenticated_bulk_post cmd: "updatecourses", root_node: "course", body: options
end