cancel
Showing results for 
Search instead for 
Did you mean: 
marcelo_amorim
Community Member

How to send grade data through my own External Tool?

Jump to solution

Hi!

I've created an External Tool in Canvas and I want to use its result to pass back as a grade to a specific assignment.

I've found this official tutorial but I get stacked: Canvas LMS REST API Documentation .

I don't get how it works. I mean, in what moment will the xml be created containing the data with the 'ext_outcome_data_values_accepted'. It uses two parameters: url and text.

What I understand is: the url parameter is used as the place I have to send my text containing the grade. Am I right? In this case, the url must be somewhere Canvas will treat my data, but what is this specific url?

Somebody has made something like this already? I need some help with this because I'm tired of trying figure out how the tutorial means.

Greetings,

Marcelo

Labels (1)
1 Solution

Accepted Solutions
James
Navigator

I can see why you're frustrated. The documentation at EduApps is much better for understanding the process than the API docs you listed. Canvas also has information, some of it duplicated on EduApps, on their Canvas Dev & Friends site.

The second big piece is to find libraries for your particular programming language that will do OAUTH and LTI and not to worry about the XML code on the page you referred to. I found one for PHP, cleaned it up to remove the warnings, and stripped it down to do just the basics of returning a score to Canvas, rather than the full implementation. I removed the part about storing the OAuth to a database and just created a session instead. I then extended their basic LTI class to add specifics about our college and a function called postGrade() that populates the four parameters and makes the call from the library.

One thing that was crucial for me was dumping the data that comes from Canvas to the LTI so I could see what was available.

Once you find the right libraries, it's not nearly as complicated as the official docs make it out to be.

View solution in original post

5 Replies
James
Navigator

I can see why you're frustrated. The documentation at EduApps is much better for understanding the process than the API docs you listed. Canvas also has information, some of it duplicated on EduApps, on their Canvas Dev & Friends site.

The second big piece is to find libraries for your particular programming language that will do OAUTH and LTI and not to worry about the XML code on the page you referred to. I found one for PHP, cleaned it up to remove the warnings, and stripped it down to do just the basics of returning a score to Canvas, rather than the full implementation. I removed the part about storing the OAuth to a database and just created a session instead. I then extended their basic LTI class to add specifics about our college and a function called postGrade() that populates the four parameters and makes the call from the library.

One thing that was crucial for me was dumping the data that comes from Canvas to the LTI so I could see what was available.

Once you find the right libraries, it's not nearly as complicated as the official docs make it out to be.

View solution in original post

scottdennis
Community Team
Community Team

Thank you for replying James.

I'm going to move this thread into the Canvas Developers group where people are having similar conversations.  Hopefully more people will contribute there as well.

Great! Thank you for replying, @James Jones...

I see now that the best way is to choose a library to do the hard work. Could specify what PHP library you are using, please?

Thanks for the help!

marcelo.amorim​. The PHP library I started with was the BLTI (Basic Learning Tools Interoperabilty) library that the IMS provided. It's available on their tutorial page Tutorials: creating a simple tool provider with Sample php code

There is a link at the bottom that says Download the zip file with everything, but the rest of the page was useful as well.

I ended up using the BLTI and OAuth PHP files under the ims-blti folder and ignoring most of the rest.

Technically, that's not where I got it from, but I can't find that page and I could find this one.

Dr. Chuck has been doing a lot of LTI work with Sakai and PHP and some videos about a framework called Tsugi that looks interesting.

Thank again, a lot!

I discovered one thing:

- I was trying to add the external tool by the rich text editor, and it didn't work because it doesn't bring the pass back parameters I needed. The way is to create the assignment using the option below, where you have to specify the Submission type as 'External Tool'

I don't know how the rich text editor works with it. It wasn't clear for me in the documentation.

I'm gonna test it with the libraries you said, thanks again.