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

Return if the user is being tracked by completion in core_enrol_get_users_courses

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.7
    • 3.6.3
    • Enrolments
    • MOODLE_36_STABLE
    • MOODLE_37_STABLE
    • MDL-65211-master
    • Hide
      1. As admin set the global enablecompletion setting to enabled (in Site administration > Advanced features)
      2. Create one course C1
      3. * C1 with enablecompletion set to 1
      4. Go to the C1 main page, and via the "Cog" open the "Course completion" option and Enable the "Condition: Course grade" using a required course grade of 50
      5. Create two users U1 and U2
      6. Enrol U1 as students in C1
      7. Enrol U2 as teacher in C1
      8. Enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      9. Create a Token in the mobile app service for all the users
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      10. Open the console an execute this new curl request, replacing wstoken with the token for U1 and the site url with yours. Replace also the userid to mach U1 one

        curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=core_enrol_get_users_courses&wstoken=3af67232a7596ceb658df4db329e5ad6&userid=19' --compressed | python -m "json.tool"

      11. After executing the WS check that:
        • You receive the course you are enrolled: C1
        • C1 field completionusesrtracked is set to true
      12. Now, execute the same CURL request but using the U2 token (keeping the original userid) and check that
        • C1 field completionusesrtracked is set to false
      Show
      As admin set the global enablecompletion setting to enabled (in Site administration > Advanced features) Create one course C1 * C1 with enablecompletion set to 1 Go to the C1 main page, and via the "Cog" open the "Course completion" option and Enable the "Condition: Course grade" using a required course grade of 50 Create two users U1 and U2 Enrol U1 as students in C1 Enrol U2 as teacher in C1 Enable "Mobile services": Site administration ► Mobile app ► Mobile settings Create a Token in the mobile app service for all the users Click on Site administration ► Plugins ► Web services ► Manage tokens Open the console an execute this new curl request, replacing wstoken with the token for U1 and the site url with yours. Replace also the userid to mach U1 one curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=core_enrol_get_users_courses&wstoken=3af67232a7596ceb658df4db329e5ad6&userid=19' --compressed | python -m "json.tool" After executing the WS check that: You receive the course you are enrolled: C1 C1 field completionusesrtracked is set to true Now, execute the same CURL request but using the U2 token (keeping the original userid) and check that C1 field completionusesrtracked is set to false

      This information will be used to:

      • Hide the completion bar (as fixed in MDL-64898 vi $completion->is_tracked_user($userid))
      • Do not display the completion menu option inside a course

            jleyva Juan Leyva
            jleyva Juan Leyva
            Dani Palou Dani Palou
            David Monllaó David Monllaó
            Janelle Barcega Janelle Barcega
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 25 minutes
                25m

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