LTI 1.3 External tool - grade pass to Moodle

LTI 1.3 External tool - grade pass to Moodle

Daniil Globa -
回帖数:1

Hello.

I am trying to figure out how the grades are supposed to be passed from Tool Provider to Modole Platform. I found one wirking instruction instruction but I am not sure if this instruction is complete or even the one supposed to be used. According to it one must make a POST request to eg http://example-moodle-instant.com/mod/lti/services.php/{courseid}/lineitems/{gradeitemid}/lineitem/scores/?type_id=19} with access token in headers and some grade info in the body.

I had no problem in retrieving token (aka authentification with JWT). But I want to understand how Provider is supposed to get course id and grade item id parameters (which are more or less internal Moodle data) used in the request link.

I figured, that using standard Moodle API it is possible to get both course id and grade item id for userid and cmid, which Provider recieves among other parameters when Moodle user opens External tool. But this way seems to be too hard? as there must also be a user for api for each tool provider and in total it takes 4 requests to set a grade. 

What am I missing? Is there some more adequate way?


回复Daniil Globa

Re: LTI 1.3 External tool - grade pass to Moodle

Jake Dallimore -
Core developers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 Testers的头像
Hi Daniil,

You will get access to the necessary information from the lti-ags claim. You can see more information about that in the 1EdTech spec docs (which I recommend reading anyway if you're building a tool - login required to view). You'll find that here: https://www.imsglobal.org/spec/lti-ags/v2p0#assignment-and-grade-service-claim

Essentially, on every launch (assuming 'accept grades from the tool' is checked in the tool settings) Moodle will pass the claim to the tool. The tool can then just use the relevant URLs to make service calls. At no point do you need to figure out any of the internal Moodle data, or call any non-lti APIs; it's all included in the launch data.

Hope that helps,
Jake