canvas-api
canvas-api copied to clipboard
GETing term does not have more? defined
I have more than 10 terms and looking at the raw returns in a rest client the 'next' and 'last' links are being returned. I can manually use them but not on the results of:
raw_terms = canvas.get("/api/v1/accounts/1/terms",{'workflow_state'=>'active'}) raw_terms.more? NoMethodError: undefined method 'more?' for #<Hash:0x007fc553935100>
Any thoughts? It seems like it should be returning ResultSet < Array and not a Hash
Nor can you call more? on the array inside the hash.
raw_terms['enrollment_terms'].more?
This is on the current version of the gem. I am though using 1.0 due to the issue I mentioned in #7 .
[4] pry(Term)> raw_terms['enrollment_terms'].more?
NoMethodError: undefined method more?' for #<Array:0x007fecf30d32b0> from (pry):4:in
import_xml'
@darrencauthon I have the same issues when trying to get quiz results and unable to use any of your Array extensions for more, next etc due to this line here resulting in a hash and not an array.
I'm querying something like /api/v1/courses/873225/quizzes/792241/submissions
. The resulting JSON if queried outside of this gem is
{
quiz_submissions: [
{...},
{...}
]
}
And just to add, a simple json = json["quiz_submissions"].to_a
just before this line makes it all work fine, obviously not a solution, maybe Canvas changed their API since you created this gem.
I'll take a look...
... and I took a look.
That wasn't my code, my only contribution so far was an update to a test file. :smile:
Ooops, Im sorry, I meant @whitmer