Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-84825

Only present those tools configured with 'mod_lti:activityplacement' in the activity chooser

XMLWordPrintable

    • 3
    • Team Alpha - Planning I2-2025, Team Alpha - Sprint 1 I2-2025, Team Alpha - Sprint 2 I2-2025

      MDL-84415 adds the placements foundation + data structures and, via upgrade, updates existing tools with a placement + placement_config + placement_status.

      NOTE: Currently, upgrade is the only way to see a placement for a tool (see MDL-84821 which deals with adding placement creation to the existing tool management workflow). Keep that in mind.

      This issue is scoped with making changes to the logic that dictates whether a tool is shown in the activitychooser or not. This is controlled in a callback 'lti_get_course_content_items' in mod/lti/lib.php, as well as in 'mod_lti_get_all_content_items' (a method used to show all activity chooser items in a site admin recommendations feature, elsewhere). These two methods will currently be using lti_get_configured_types() which in turn calls other helpers. We need to change the implementation of lti_get_configured_types() - which may involve creating a new helper method and deprecating the old one), so that it returns tools based on their placement status, NOT based on coursevisible (which isn't responsible for placement statuses any more).

      Placement status is resolved in much the same way as coursevisible was (where we support context level overrides of the status - the "Show in activity chooser" toggle in the course tools page).
      However, instead of:
      lti_types.coursevisible (the tool value of coursevisible)
      we now have:
      placement_config, where the name = 'default_usage' and value either 'enabled' or 'disabled'.

      and instead of:
      lti_coursevisible (the course level override of coursevisible)
      we now have:
      lti_placement_status (a context-specific override of the placement config's default usage).

      Note: While the hierarchy is now resolved using those 2 new values. We still want to ensure that lti_types.coursevisible is not on DONOTSHOW.

      I think what's needed is roughly:

      1. Create a new core_ltix\helper method 'get_tools_with_enabled_placement_in_context' (or similar, which can resolve the status hierarchy for a given placement type string and will return the relevant tools.
      2. Removing core_ltix\helper::get_lti_types_by_course(), since it's now a defunct method.
      3. Resolving/removing mod_lti code which is calling the removed method in the point above. There are 3 code paths all going through one mod_lti helper method, types_helper::get_lti_types_by_course().
      4. Sanity check any other references to 'coursevisible' in mod_lti code.
      5. Update unit tests (see core_ltix generator which has methods to create tools, create placements, create placement status overrides, etc).

            andrew.gosali@moodle.com Andrew Gosali
            jaked Jake Dallimore
            Jake Dallimore Jake Dallimore
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 week, 5 hours, 59 minutes
                1w 5h 59m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.