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

Let the embed.php redirect to login (requirement for the app)

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.8
    • 3.8
    • H5P
    • MOODLE_38_STABLE
    • MOODLE_38_STABLE
    • MDL-67076-master
    • Hide

      Setup

      1. Upload the test-h5p.html file to the $CFG->wwwroot.
      2. Login as admin.
      3. Create a student (s1).
      4. Create a course "Course 1".
      5. Access to the course.
      6. Enrol s1 to the course.
      7. Create a "Folder" resource.
      8. Upload the arithmetic-quiz.h5p to the "Folder".

      Testing scenario 1. No redirection vs redirection

      1. Login as admin.
      2. Go to the "Course 1".
      3. Click on the "Folder" resource and copy the URL for the arithmetic-quiz.h5p file.
      4. Open $CFG->wwwroot/test-h5p.html in a new tab.
      5. Paste the previous URL into the "H5P file URL" form field.
      6. Click the Display button.
      7. Check the H5P content is displayed and working as expected.
      8. Open a different browser (for instance, if you're using Chrome, open Firefox).
      9. Open $CFG->wwwroot/test-h5p.html
      10. Paste the previous URL into the "H5P file URL" form field.
      11. Click the Display button.
      12. Check the following error is displayed: "Course or activity not accessible. (You are not logged in)"
      13. Open $CFG->wwwroot/test-h5p.html
      14. Paste the previous URL into the "H5P file URL" form field.
      15. Select the "preventredirect" checkbox.
      16. Click the Display button.
      17. Check the page is redirected to the login page.
      18. Login as s1.
      19. Check the H5P content is displayed and working as expected.
      Show
      Setup Upload the test-h5p.html file to the $CFG->wwwroot. Login as admin. Create a student (s1). Create a course "Course 1". Access to the course. Enrol s1 to the course. Create a "Folder" resource. Upload the arithmetic-quiz.h5p to the "Folder". Testing scenario 1. No redirection vs redirection Login as admin. Go to the "Course 1". Click on the "Folder" resource and copy the URL for the arithmetic-quiz.h5p  file. Open $CFG->wwwroot/test-h5p.html in a new tab. Paste the previous URL into the "H5P file URL" form field. Click the Display button. Check  the H5P content is displayed and working as expected. Open a different browser (for instance, if you're using Chrome, open Firefox). Open $CFG->wwwroot/test-h5p.html Paste the previous URL into the "H5P file URL" form field. Click the Display button. Check the following error is displayed: "Course or activity not accessible. (You are not logged in)" Open $CFG->wwwroot/test-h5p.html Paste the previous URL into the "H5P file URL" form field. Select the "preventredirect" checkbox. Click the Display button. Check the page is redirected to the login page. Login as s1. Check  the H5P content is displayed and working as expected.
    • H5P Sprint Relase 3.8

      Dani Palou has raised this issue:

      When the embed.php file is opened in a browser where the user is not logged in, an error is displayed, instead of redirecting the user to the login page.

      The mobile app won't have a Moodle web session in the iframe. It has a script to auto-login the user in the iframe, but it has some limitations (e.g. it only works in https sites) so it'd be nice if the user can authenticate manually inside the iframe if we cannot authenticate him automatically.

      A new parameter will be added to the embed to let the app to use it to redirect (instead of display the error).

        1. arithmetic-quiz.h5p
          731 kB
          Sara Arjona (@sarjona)
        2. image-2019-11-07-10-02-23-699.png
          178 kB
          Janelle Barcega
        3. test-h5p.html
          0.5 kB
          Sara Arjona (@sarjona)

            sarjona Sara Arjona (@sarjona)
            sarjona Sara Arjona (@sarjona)
            Dani Palou Dani Palou
            Andrew Lyons Andrew Lyons
            Janelle Barcega Janelle Barcega
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 40 minutes
                1h 40m

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