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

WebService clients cannot know if user has capability mod/h5pactivity:submit when activity tracking is disabled

XMLWordPrintable

    • MOODLE_500_STABLE

      The WebService mod_h5pactivity_get_h5pactivity_access_information checks if the current user has several capabilities, like canview, canreviewattempts, etc.

      After this WS was implemented, we detected and reported the bug MDL-68930 because the cansubmit capability returned a different value in WebService than in LMS because of the parameters used when checking the capability. That bug was fixed, but the fix changed the behaviour: now the cansubmit property also checks if the activity has tracking enabled.

      This is the code for cansubmit:

      $manager->is_tracking_enabled() && $manager->can_submit();

      This means that, if an activity has tracking disabled, WebService clients like the Moodle app cannot know if the user has the capability or not because this field will always be false. And we need to know this capability to be able to properly implement some features.

      WebService clients can know if tracking is enabled or not by checking the property 'enabletracking' returned by the WebService mod_h5pactivity_get_h5pactivities_by_courses. So IMO the get_h5pactivity_access_information WS should only check can_submit(), not tracking, and if a WS client needs to know if tracking is enabled or not then they need to use the by_courses WebService to obtain that information.

            Unassigned Unassigned
            dpalou Dani Palou
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 15 minutes
                15m

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