-
Bug
-
Resolution: Fixed
-
Minor
-
4.1.4, 4.2.1, 4.3
Kindly reported by Onno here: https://moodle.org/mod/forum/discuss.php?d=448092
The code:
ON {c.id} = e.courseid
|
should be:
ON c.id = e.courseid
|
Note: This SQL will be in the sync_tool_grades task in 4.2 and newer. In 4.1, it'll be in the main sync_grades task.
This only impacts the case where we're creating the grade item for a published course having a decoupled grade item. I.e. the launch has included an AGS claim, but hasn't included a 'lineitem' endpoint, meaning the tool is free to manage its own line items in the gradebook. This won't impact shared activities, nor any shared items with coupled line items (those which include a 'lineitem' property in the AGS claim).
Replication instructions:
- Setup two sites using LTI Advantage; one platform, one tool
- In the tool site, create a course with an assignment in it.
- Publish the entire course as an LTI tool (course context is important)
- In the platform site, create the external tool instance such that you're able to launch into the published course (use deep linking)
- Edit the settings of that activity and set:
- Privacy > Accept grades from the tool = Yes
- Grade type: None
(This results in the ags claim ONLY sending 2 items: the 'scope' property and the 'lineitems' property (importantly, NOT the 'lineitem' property for the specific grade item, since the grade is set to None)
- Launch
- Log in to the platform as a student user s1
- Launch into the tool (we don't need a submission here, just a launch)
- Log out
- Log in to the platform as the admin
- Go to the course
- Launch the tool and go to the assignment
- Click "View all submissions"
- Click the "Quick grading" checkbox
- Set a grade for the student s1, say '55'
- Now, in the root of the tool site, run:
php admin/cli/scheduled_task.php --execute="enrol_lti\local\ltiadvantage\task\sync_grades" |
On 4.2+, this will schedule the adhocs that sync grades
- Then run:
php admin/cli/adhoc_task.php --execute
|
This will process the adhoc tasks for grade syncing
- Inspect the terminal output
Expected: You see "The grade 'xx' was sent" (xx will be whatever the expected course grade was)
Actual: You see (ignore the letter placeholders here, yours will be different):
Failed - The grade 'xx' for the user 'yy', for the resource 'zz' and the course 'a' failed to send. |
Error reading from database (ERROR: syntax error at or near "{" |
LINE 6: ON {c.id} = e.courseid |
|
SELECT c.fullname
|
FROM mdl_enrol_lti_tools t
|
JOIN mdl_enrol e
|
ON (e.id = t.enrolid)
|
JOIN mdl_course c
|
ON {c.id} = e.courseid
|
WHERE t.id = $1 |
[array (
|
0 => '14', |
)])
|