Adding resultData url to grade passback XML

Adding resultData url to grade passback XML

by Ryan Nutt -
Number of replies: 0

For the past couple of years I've been using Moodle as an LTI provider for quizzes embedded inside Canvas. Moodle quizzes just do so much more than Canvas quizzes that it's worth it to me to jump through a few hoops.

Is there a way to add the resultData field to the XML that's sent back to the LTI TC? I'm looking specifically to add a url to resultData for quizzes, but possibly for other assignment types in the future. The idea is that the speed grader in Canvas would be able to post to that URL to get information about the quiz so kids and teachers don't need to go back to the Moodle launch. Yes, I know there's security to think about there as well. But that's for another post. 

First thought was to filter the XML that's sent back. But it appears that there isn't a spot to do that. I found where it's created in the create_service_body function, but that only takes a grade as parameter and doesn't appear to have a way to add additional data to the XML.

Found where that method is called, but appears that the value is sent to create an OAuth launch immediately. 

My current thought is to write a task plugin that basically overrides the existing grade passback task.

And I've written plugins for Moodle and LTI tools both on the consumer and provider side. So I'm not worried about the actual coding. I'm just trying to work out a way to make this work without having to edit the core code. 


Average of ratings: -