Module: GithubToCanvasQuiz::CanvasAPI::Endpoints::QuizQuestions
- Included in:
- GithubToCanvasQuiz::CanvasAPI::Endpoints
- Defined in:
- lib/github_to_canvas_quiz/canvas_api/endpoints/quiz_questions.rb
Instance Method Summary collapse
- #create_question(course_id, quiz_id, payload) ⇒ Object
- #delete_question(course_id, quiz_id, id) ⇒ Object
- #get_single_question(course_id, quiz_id, id) ⇒ Object
- #list_questions(course_id, quiz_id) ⇒ Object
- #update_question(course_id, quiz_id, id, payload) ⇒ Object
Instance Method Details
#create_question(course_id, quiz_id, payload) ⇒ Object
15 16 17 |
# File 'lib/github_to_canvas_quiz/canvas_api/endpoints/quiz_questions.rb', line 15 def create_question(course_id, quiz_id, payload) post("/courses/#{course_id}/quizzes/#{quiz_id}/questions", payload) end |
#delete_question(course_id, quiz_id, id) ⇒ Object
23 24 25 |
# File 'lib/github_to_canvas_quiz/canvas_api/endpoints/quiz_questions.rb', line 23 def delete_question(course_id, quiz_id, id) delete("/courses/#{course_id}/quizzes/#{quiz_id}/questions/#{id}") end |
#get_single_question(course_id, quiz_id, id) ⇒ Object
11 12 13 |
# File 'lib/github_to_canvas_quiz/canvas_api/endpoints/quiz_questions.rb', line 11 def get_single_question(course_id, quiz_id, id) get("/courses/#{course_id}/quizzes/#{quiz_id}/questions/#{id}") end |
#list_questions(course_id, quiz_id) ⇒ Object
7 8 9 |
# File 'lib/github_to_canvas_quiz/canvas_api/endpoints/quiz_questions.rb', line 7 def list_questions(course_id, quiz_id) get_all("/courses/#{course_id}/quizzes/#{quiz_id}/questions") end |
#update_question(course_id, quiz_id, id, payload) ⇒ Object
19 20 21 |
# File 'lib/github_to_canvas_quiz/canvas_api/endpoints/quiz_questions.rb', line 19 def update_question(course_id, quiz_id, id, payload) put("/courses/#{course_id}/quizzes/#{quiz_id}/questions/#{id}", payload) end |