Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-4323

Allow enrolment plugins to indicate whether they want to be supported in the app via the "Enrol me" button

XMLWordPrintable

    • Hide

      Test on any device of your choice:

      1. On a site, install the 3 plugins attached to this issue (paypaltest, guesttest and selftest). They're copies of PayPal, Guest and Self enrol but adding mobile support using the plugins system. When installing the Guest one, enable "Add instance to new courses" and "Allow guest access" (otherwise it didn't appear for me in courses).
      2. Go to Site administration > Plugins > Manage enrol plugins.
      3. Enable the 3 plugins you just installed.
      4. Purge caches
      5. Create 3 new courses (one for each enrol plugin).
      6. For each course, go to Participants, click in the "Enrolled users" dropdown, select "Enrolment methods" and add 1 of the new enrolment methods you just installed. Make sure to disable "Guest access test" in the courses where you add "PayPal test" or "Self enrolment test".
      7. In the app, login as a student (if the app was already open and you were already logged in, restart the app).
      8. Go to Dashboard and click the search icon at the top.
      9. Search the course with "PayPal test" enrolment. Check that you see a shower icon next to the course name.
      10. Click the course. Check that you see an "Enrol me" button that sends you to browser (before this patch you only saw a message saying you cannot enrol). There's no need to test that enrolment works in browser.
      11. Now go back to course search and search the course with Guest test enrolment. Check that you see a key icon (if you configured it with password) or an open lock icon (if you configured it without password). There's no need to test both cases because the code that handles this is in the plugin, not in the app.
      12. Click the course and click "View course". If you don't need a password, the course should open. It you need a password, the app will ask for it. Again, there's no need to test both cases because the code that handles this is in the plugin, not in the app. Please notice that, if you test with password, the password is remembered in the server for the user so if you try again with a different device it will not ask the password, the only way to force to ask the password again is to change the password for the course.
      13. Now go back to course search and search the course with Self enrolment test. Check that you see a key icon (if you configured it with password) or an arrow icon (if you configured it without password). There's no need to test both cases because the code that handles this is in the plugin, not in the app.
      14. Click the course and click "Enrol me". If you don't need a password, a confirm will be shown and then the course should open. It you need a password, the app will ask for it. Again, there's no need to test both cases because the code that handles this is in the plugin, not in the app.
      Show
      Test on any device of your choice: On a site, install the 3 plugins attached to this issue (paypaltest, guesttest and selftest). They're copies of PayPal, Guest and Self enrol but adding mobile support using the plugins system. When installing the Guest one, enable "Add instance to new courses" and "Allow guest access" (otherwise it didn't appear for me in courses). Go to Site administration > Plugins > Manage enrol plugins. Enable the 3 plugins you just installed. Purge caches Create 3 new courses (one for each enrol plugin). For each course, go to Participants, click in the "Enrolled users" dropdown, select "Enrolment methods" and add 1 of the new enrolment methods you just installed. Make sure to disable "Guest access test" in the courses where you add "PayPal test" or "Self enrolment test". In the app, login as a student (if the app was already open and you were already logged in, restart the app). Go to Dashboard and click the search icon at the top. Search the course with "PayPal test" enrolment. Check that you see a shower icon next to the course name. Click the course. Check that you see an "Enrol me" button that sends you to browser (before this patch you only saw a message saying you cannot enrol). There's no need to test that enrolment works in browser. Now go back to course search and search the course with Guest test enrolment. Check that you see a key icon (if you configured it with password) or an open lock icon (if you configured it without password). There's no need to test both cases because the code that handles this is in the plugin, not in the app. Click the course and click "View course". If you don't need a password, the course should open. It you need a password, the app will ask for it. Again, there's no need to test both cases because the code that handles this is in the plugin, not in the app. Please notice that, if you test with password, the password is remembered in the server for the user so if you try again with a different device it will not ask the password, the only way to force to ask the password again is to change the password for the course. Now go back to course search and search the course with Self enrolment test. Check that you see a key icon (if you configured it with password) or an arrow icon (if you configured it without password). There's no need to test both cases because the code that handles this is in the plugin, not in the app. Click the course and click "Enrol me". If you don't need a password, a confirm will be shown and then the course should open. It you need a password, the app will ask for it. Again, there's no need to test both cases because the code that handles this is in the plugin, not in the app.
    • MOODLE_402_STABLE
    • MOODLE_403_STABLE
    • Moodle Apps - 2023 Sprint i3.2

      Enrolment plugins are not currently supported at all in the mobile app. A quick workaround that could work for some plugins is just to allow them to indicate whether they want to be supported via the "Enrol me" button in the app.

      We did a proof of concept with the enrol_apply plugin (see video). As you can see, in this case, an external browser will be launched to allow the user to complete the process.

      As we did for Blocks, we can just support a new option in db/mobile.php for a new course enrolments delegate to indicate this.

      Please, notice also that we should be able to also detect auto-enrolment plugins to avoid displaying the padlock (see linked issue).

      The issue is divided in two parts:

      1. Create the enrolment delegate and migrate the current self, guest, fee and paypal handlers.
      2. Create the siteplugin structure so 3rd party plugins can decide:
        1. The action to take when enrolling: self (self), view (guest), browser (paypal, fee...).
        2. Invalidation of WS calls (if needed)
        3. Self enrolment function (for self)
        4.  Can access and Validate access function (for view).

        1. Grabación de pantalla 2023-04-27 a las 14.52.02.mov
          1.09 MB
        2. guesttest.zip
          32 kB
        3. image-2023-09-12-16-36-02-265.png
          image-2023-09-12-16-36-02-265.png
          200 kB
        4. image-2023-09-12-16-36-27-074.png
          image-2023-09-12-16-36-27-074.png
          200 kB
        5. mobile.php
          1 kB
        6. MOBILE-4323_step10_1.png
          MOBILE-4323_step10_1.png
          187 kB
        7. MOBILE-4323_step10_2.png
          MOBILE-4323_step10_2.png
          262 kB
        8. MOBILE-4323_step11.png
          MOBILE-4323_step11.png
          217 kB
        9. MOBILE-4323_step13_2.png
          MOBILE-4323_step13_2.png
          235 kB
        10. MOBILE-4323_step13.png
          MOBILE-4323_step13.png
          182 kB
        11. paypaltest.zip
          54 kB
        12. self enrol video.mov
          1.63 MB
        13. selftest.zip
          60 kB
        14. test enrol video.mov
          1.25 MB

            pferre22 Pau Ferrer
            jleyva Juan Leyva
            Dani Palou Dani Palou
            Isabel Renedo Rouco Isabel Renedo Rouco
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

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