Sha256: 5b53cc80c5884daf6d1f722ed6191296292c9cfa39bddf8402015d12f91023e6

Contents?: true

Size: 1.62 KB

Versions: 14

Compression:

Stored size: 1.62 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"

        get :course_settings, 'settings'
      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

14 entries across 14 versions & 1 rubygems

Version Path
bearcat-1.5.26 lib/bearcat/client/courses.rb
bearcat-1.5.24 lib/bearcat/client/courses.rb
bearcat-1.5.23 lib/bearcat/client/courses.rb
bearcat-1.5.20 lib/bearcat/client/courses.rb
bearcat-1.5.19 lib/bearcat/client/courses.rb
bearcat-1.5.17 lib/bearcat/client/courses.rb
bearcat-1.5.16 lib/bearcat/client/courses.rb
bearcat-1.5.15 lib/bearcat/client/courses.rb
bearcat-1.5.14 lib/bearcat/client/courses.rb
bearcat-1.5.13 lib/bearcat/client/courses.rb
bearcat-1.5.12 lib/bearcat/client/courses.rb
bearcat-1.5.11 lib/bearcat/client/courses.rb
bearcat-1.5.10 lib/bearcat/client/courses.rb
bearcat-1.5.9 lib/bearcat/client/courses.rb