instructure / pandarus

A Ruby library for the Canvas API (and code generator for other languages, eventually)
34 stars 25 forks source link

Quiz.new(response) raises error #18

Closed rolyatwilson closed 7 years ago

rolyatwilson commented 7 years ago

The v1_api.rb method create_quiz raises a NoMethodError: Expected [{"due_at"=>"2016-09-14T17:39:48Z", "unlock_at"=>nil, "lock_at"=>nil, "base"=>true}] to respond to #to_hash

rolyatwilson commented 7 years ago

Looks like Pandarus expects the response["all_dates"] to match the QuizAssignmentOverride model but the Canvas API returns an array containing the model.

"all_dates": [ { "due_at": null, "unlock_at": null, "lock_at": null, "base": true } ],

rolyatwilson commented 7 years ago

Fixed with: https://github.com/instructure/pandarus/commit/620c861567ba74dca2003d8e90ef73753ef2b462