module Bearcat class Client < Footrest::Client module Submissions def course_submissions(course, params={}) get("/api/v1/courses/#{course.to_s}/students/submissions", params) end def section_submissions(section, params={}) get("/api/v1/sections/#{section.to_s}/students/submissions", params) end def get_course_submissions(course, assignment, params={}) get("/api/v1/courses/#{course.to_s}/assignments/#{assignment}/submissions", params) end def user_course_assignment_submission(course, assignment, user, params={}) get("/api/v1/courses/#{course.to_s}/assignments/#{assignment.to_s}/submissions/#{user.to_s}", params) end def course_submission(course, assignment, params) post("/api/v1/courses/#{course}/assignments/#{assignment}/submissions", params) end def section_submission(section, assignment, params) post("/api/v1/sections/#{section}/assignments/#{assignment}/submissions", params) end def grade_course_submission(course, assignment, user, params) put("/api/v1/courses/#{course}/assignments/#{assignment}/submissions/#{user}", params) end def grade_section_submission(section, assignment, user, params) put("/api/v1/sections/#{section}/assignments/#{assignment}/submissions/#{user}", params) end def course_file_upload_submission(course, assignment, user, file_path, params={}) response = upload_file("/api/v1/courses/#{course}/assignments/#{assignment}/submissions/#{user}/files", file_path, params) params['submission'] = { 'submission_type' => 'online_upload', 'file_ids'=> [response['id']] } course_submission(course, assignment, params) end def section_file_upload_submission(section, assignment, user, file_path, params={}) response = upload_file("/api/v1/sections/#{section}/assignments/#{assignment}/submissions/#{user}/files", file_path, params) params['submission'] = { 'submission_type' => 'online_upload', 'file_ids'=> [response['id']] } section_submission(section, assignment, params) end end end end