-
Bug
-
Resolution: Fixed
-
Major
-
4.1.2
The workshop activity includes both a submission grade item and an assessment grade item. If you want to publish both of those graded activities as an LTI to a platform, an error is thrown:
In enrol/lti/classes/local/ltiadvantage/repository/published_resource_repository.php, line 101, grade_item::fetch() is called.
That's in lib/grade/grade_item.php, line 366, and wraps grade_object::fetch_helper, line 159 of lib/grade/grade_object.php
This throws an exception if the count of grade items for a module instance is more than 1, however workshop is designed to have 2 grade items.
If anyone has any direction on what a good fix here may be, I'm all ears.
I'm looking into previous patches for insight into the error: "Found more than one record in fetch()"
Replication steps
- Set up two Moodle sites: a platform site (consumer) and a tool site (provider). See the published as LTI tool docs for more information
- In the tool site, create a workshop in a course.
- Publish the workshop using LTI Advantage (the enrolment instance will be created)
- In the platform site, add a new instance of the external tool you've configured in step 1.
- When on the mod edit form, click "Select content"
Expected: You can see those activities published in the tool
Actual: You see an exception, as above.
Workaround
Don't use deep linking to create the resource link + line item binding. Instead, create the resource link manually, using the id=xxxx param provided on the Published as LTI tools page in the tool course.