Sha256: a23cc37abb59f75587c60a050e326210f83bc2a03385fc31d249dfb0cf954755

Contents?: true

Size: 1.58 KB

Versions: 12

Compression:

Stored size: 1.58 KB

Contents

module Bearcat
  class Client < Footrest::Client
    module Courses
      extend ClientModule

      post :create_course, "/api/v1/accounts/:account_id/courses"
      get :list_users_courses, "/api/v1/courses"

      prefix "/api/v1/courses/:course/" do
        get :course
        put :update_course
        delete :delete_course, defaults: { event: "delete" }
        get :list_course_users, "users"
        post :course_quiz_extensions, "quiz_extensions"
        get :course_outcome_results, "outcome_results"

        get :course_grading_standards, "grading_standards"
        get :course_grading_standard, "grading_standards/:grading_standard_id"
        get :course_gradebook_history, "gradebook_history/feed"

        # Performs effectively the same operation as #create_content_migration, but without the need to specify a file to be uploaded
        post :copy_course, "content_migrations"
      end

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

      def create_content_migration(course, file_path, params={})
        content_migration_response, file_upload_response = create_content_migration_with_both_responses(course, file_path, params)
        file_upload_response
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
bearcat-1.5.8 lib/bearcat/client/courses.rb
bearcat-1.5.7 lib/bearcat/client/courses.rb
bearcat-1.5.6 lib/bearcat/client/courses.rb
bearcat-1.5.5 lib/bearcat/client/courses.rb
bearcat-1.5.4 lib/bearcat/client/courses.rb
bearcat-1.5.3 lib/bearcat/client/courses.rb
bearcat-1.5.2 lib/bearcat/client/courses.rb
bearcat-1.5.0 lib/bearcat/client/courses.rb
bearcat-1.5.0.beta4 lib/bearcat/client/courses.rb
bearcat-1.5.0.beta3 lib/bearcat/client/courses.rb
bearcat-1.5.0.beta2 lib/bearcat/client/courses.rb
bearcat-1.5.0.beta1 lib/bearcat/client/courses.rb