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

H5P attempts not recorded when multiple users have same email address

    XMLWordPrintable

Details

    • MOODLE_39_STABLE
    • MOODLE_311_STABLE
    • MDL-69467-311
    • MDL-69467-master
    • Hide
      1. Login as admin:
        1. Turn on "allowaccountssameemail" admin setting.
        2. Create two users with the same email address (student A and student B).
        3. Create a course.
        4. Enrol both users on the course.
        5. Create an h5p activity that uses the attached arithmetic quiz.
      2. Login as student A:
        1. Go to the page of the h5p activity.
        2. Open browser's developer tools -> network.
        3. Answer the quiz questions.
        4. Look for an ajax request to .../lib/ajax/service.php?sesskey=...&info=core_xapi_statement_post
        5. Make sure the response data contains "error: false".
        6. Reload the page and go to "Attempts report".
        7. Check the attempt has been saved.
      3. Login as student B:
        1. Same as student A.
      Show
      Login as admin: Turn on "allowaccountssameemail" admin setting. Create two users with the same email address (student A and student B). Create a course. Enrol both users on the course. Create an h5p activity that uses the attached arithmetic quiz. Login as student A: Go to the page of the h5p activity. Open browser's developer tools -> network. Answer the quiz questions. Look for an ajax request to .../lib/ajax/service.php?sesskey=...&info= core_xapi_statement_post Make sure the response data contains "error: false". Reload the page and go to "Attempts report". Check the attempt has been saved. Login as student B: Same as student A.

    Description

      H5P (mod_h5pactivity) posts attempts via the xapi. There it sends the user's email address as an ID. However, Moodle has a setting "allowaccountssameemail" which allows you to have multiple users with the same email address. When this is the case, the xapi just selects the first user with that email address and treats the request as though it came from him.

      This will cause an error when the second user finishes an attempt for a H5P activity: "Statements actor is not the current user"

      When this happens the error is returned by the xapi, but displayed nowhere on the page. I guess this is a different bug or improvement. So I will create a separate issue for it.

      Attachments

        Issue Links

          Activity

            People

              sebsoft Sebastian Berm
              tschroeder Tim Schroeder
              Ferran Recio Ferran Recio
              Sara Arjona (@sarjona) Sara Arjona (@sarjona)
              Gladys Basiana Gladys Basiana
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona)
              Votes:
              8 Vote for this issue
              Watchers:
              17 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                17/Jan/22

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours, 51 minutes
                  4h 51m