-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
5.0
-
MOODLE_500_STABLE
-
MDL-85331-main-5
-
-
-
5
-
Team Alpha - Sprint 1 I2-2025, Team Alpha - Sprint 2 I2-2025
MDL-84827 ensured that links are created at the point of module instance saving, but using the resource_link persistent directly in client code leaves something to be desired.
Ideally, I think we want to allow clients to create tools links via their placement type by calling into a core_ltix API that can:
- Check the placement type. This should validate it, and make sure it's enabled for the given tool.
- Perhaps abstract away some of the internals of the resource link storage (i.e. the itemtype). We know we're going to use the placement type as the itemtype, so using that in naming instead of directly asking for itemtype will be less confusing.
My feeling is that the bulk of this code probably shouldn't reside in the placements_manager itself, as that class already has a nice neat scope: dealing with creation of placement types, placements and placement config. Of course, that doesn't stop the manager class being being an entry point, but it would probably act as a factory for other objects in that case (similar to the way we currently can ask it for the component's deep linking placement implementation). This just documents some thoughts Mihail and I had when talking about this. We probably want to ask the manager for some sort of placement object (name tbd) and then using that, we manage the links.
This should also update the mod_lti calling code to use the new API instead of directly using the resource_link persistent as it does currently.
- has to be done after
-
MDL-84825 Only present those tools configured with 'mod_lti:activityplacement' in the activity chooser
-
- Closed
-