Sha256: 35eac35b68603cc91627cb2f3808401e397739121a31c9604d67d0ff3d6b34d5

Contents?: true

Size: 1.83 KB

Versions: 16

Compression:

Stored size: 1.83 KB

Contents

module Bearcat
  class Client < Footrest::Client
    module Courses

      def course(course, params={})
        get("/api/v1/courses/#{course}", params)
      end

      def create_course(account_id, params={})
        post("/api/v1/accounts/#{account_id}/courses", params)
      end

      def delete_course(course, params={event: :delete})
        delete("/api/v1/courses/#{course}", params)
      end

      def update_course(course, params={})
        put("/api/v1/courses/#{course}", params)
      end

      def list_course_users(course, params={})
        get("/api/v1/courses/#{course}/users", params)
      end

      def course_quiz_extensions(course, params={})
        post("/api/v1/courses/#{course}/quiz_extensions", params)
      end

      def course_outcome_results(course, params={})
        get("/api/v1/courses/#{course}/outcome_results", params)
      end

      def create_content_migration(course, file_path, params={})
        response = post("/api/v1/courses/#{course}/content_migrations", params)
        pre_attachment = response['pre_attachment']
        confirmation_url = post_file(pre_attachment['upload_url'], pre_attachment['upload_params'], file_path)
        confirm_file_upload(confirmation_url)
      end

      # Performs effectively the same operation as #create_content_migration, but without the need to specify a file to be uploaded
      def copy_course(course, params = {})
        post("/api/v1/courses/#{course}/content_migrations", params)
      end

      def list_users_courses(params)
        get("api/v1/courses", params)
      end

      def course_grading_standards(course, params={})
        get("/api/v1/courses/#{course}/grading_standards", params)
      end

      def course_gradebook_history(course, params={})
        get("api/v1/courses/#{course}/gradebook_history/feed", params)
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
bearcat-1.3.13 lib/bearcat/client/courses.rb
bearcat-1.3.12 lib/bearcat/client/courses.rb
bearcat-1.3.11 lib/bearcat/client/courses.rb
bearcat-1.3.10 lib/bearcat/client/courses.rb
bearcat-1.3.9 lib/bearcat/client/courses.rb
bearcat-1.3.8 lib/bearcat/client/courses.rb
bearcat-1.3.7 lib/bearcat/client/courses.rb
bearcat-1.3.6 lib/bearcat/client/courses.rb
bearcat-1.3.5 lib/bearcat/client/courses.rb
bearcat-1.3.4 lib/bearcat/client/courses.rb
bearcat-1.3.3 lib/bearcat/client/courses.rb
bearcat-1.3.2 lib/bearcat/client/courses.rb
bearcat-1.3.1 lib/bearcat/client/courses.rb
bearcat-1.2.18 lib/bearcat/client/courses.rb
bearcat-1.2.17 lib/bearcat/client/courses.rb
bearcat-1.2.16 lib/bearcat/client/courses.rb