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
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