Does anyone know if quizzes are available under the GraphQL API? They don't appear for me on GrapghiQL, so I assume not, but I thought I'd check to see they were showing up somewhere else.
Hi Scott!
Take a look under Assignments. I see Quiz available there under the GraphQL API.
Ron
@RonMcDaniel
That doesn't have any specifics about the quiz that don't belong to the assignment. That is, it's not a quizzesConnection, it's a quiz. I didn't test, but the _id would allow you to then go to the REST API and fetch information about the quiz. I use the presence of the quiz object as a Boolean to tell whether the assignment is a quiz or not.
@ScottMowry
GraphQL doesn't support Classic Quizzes and Canvas has that they are phasing Classic Quizzes out, so don't look for it to magically appear despite the "if you find something missing let us know" statement.
Canvas is pushing people towards the graphql portal for new GraphQL development. I had problems getting the list of available endpoints there until I went to the beta or test instance. Then I was able to use those in production. There was some stuff for New Quizzes there, but not a lot. I haven't looked in several months.
@James I was able to get specific information regarding the quiz, but to your point, I had to have the assignmentID.
My point wasn't that you had to have the ID to get information about the quiz through GraphQL, it was that you cannot get quiz-specific information through the GraphQL API other than what the quiz ID is and whether an assignment is a quiz. By that I mean anything beyond what a regular assignment would have available. The quiz ID is part of the assignments object.
What module something is in isn't specific to quizzes. The "Elementary Student" in your last screenshot isn't information about the quiz, it's the name of the module. Note that modules is an array in case you have an assignment in multiple modules. But to Canvas, you're not fetching the modules the quizzes are in, you're fetching the modules the assignment, which just happens to be a quiz, is in. You need the assignment ID to fetch it, not the quiz ID.
Things specific to quizzes are things like the number of questions, the actual questions, the question groups, and the quiz settings. For those, you need to use the Quiz xxx APIs from the REST API. When you look on the left side of the API documentation, you see Quiz Assignment Overrides, Quiz Extensions, Quiz IP Filters, Quiz Question Groups, ..., Quizzes. That's what I'm talking about when I say the information about quizzes isn't available through the GraphQL interface.
@James Very helpful information and clarification. I am just beginning to dig in to Instructure's GraphQL implementation and am learning what's currently available. I do hope to see more and more data becoming available through GraphQL since it is much easier than hitting multiple REST APIs. Thank you for sharing your knowledge of the two, GraphQL and REST, in Canvas! Great stuff 🙂
I am calling the canvas API to get course Information. This is the endpoint that i am using /courses/{contextId}?include[]=account This is not returning the account.
Hi everyone, I am seeking some insight into how Canvas LMS handles HTTP errors and how they are reflected in the logs versus the user interface. We are currently observing the following behavior in our environment: Log-only errors: We are seeing 500 (Internal Server Error) and 503 (Service Unavailable) errors recorded in…
Hi everyone, If you write integrations against Canvas by Instructure at an institution — K-12, higher ed, corporate training, government, or anywhere in between — we'd love your feedback. We're running a short survey on the Canvas developer experience: APIs, data access, tooling, and documentation. Results will feed into…
I'm currently integrating an LTI tool and attempting to use the Activity.id.history https://canvas.instructure.com/doc/api/file.tools_variable_substitutions.html#activity-id-history variable, but I'm experiencing issues getting it to work properly. What I've Done: Added the Activity.id.history variable to my Developer…
I looked through the LTI Variable Substitutions documentation and while there are variable substitutions available for Canvas.term.name and Canvas.term.id (which is the Canvas incremented ID like "104"), I was surprised to see there was no option for Canvas.term.sisSourceId I tried testing other possible variants that may…