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

Add duration, completion and success to H5P activity attempts

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      All involved code parts are tested automatically:

      • PHP Unit Test: vendor/bin/phpunit -c mod/h5pactivity/
      • Behat: --tags=@mod_h5pactivity

      Manual testing

      Note: for this test you need access to the database. Review the SQL queries and change "mdl_" to your prefix if you've changed it.

      1. Login as admin
      2. Create a course and a user and enrol it as a student. 
      3. Edit the course and create an H5P activity using the attached H5P package (file question-set-616.h5p)
      4. Login as a student and go to the course
      5. Access the H5P activity and do one attempt with these answers:
        1. Which of the berries listed below are berries you can pick in the wild? check "Halle Berry" and "Cocktail cherry"
        2. Drag and drop: from left to right drag the first image to "Blueberry", the second to "Redcurrant" and the third to "Cloudberry" (like the image attached )
        3. Which one of the following berries are red? select "Cranberries"
        4. Click on "Finish" button.
        5. Check that your result is 2/6 and a message "Oh, no! This didn't go so well" appears.
      6. Click on the "Retry" button to start a new attempt with the following answers:
        1. Which of the berries listed below are berries you can pick in the wild? check "Blueberry", "Strawberry", "Raspberry" and "Cloudberry".
        2. Drag and drop: from left to right drag the first image to "Blueberry", the second to "Redcurrant" ans the third to "Cloudberry" (the same as the image attached before)
        3. Which one of the following berries are red? select "Cranberries"
        4. Click on "Finish" button.
        5. Check that your result is 6/6 and a message "Congratulation! You did very well!" appears.
      7. Now access the DB and check the following data:
        1. SQL:

          SELECT * FROM mdl_h5pactivity_attempts

          1. Check that the 2 attempts appears
          2. Check that both have some duration bigger than 0
          3. Check that both have completion = 1
          4. Check that the one with rawscore of 2 have success = 0 and the one with rawscore of 6 have success = 1
          5. Note down the attemptsid and the rawscores, we will need for the next validations
        2. SQL:

          SELECT * FROM mdl_h5pactivity_attempts_results

          1. Check that there are 8 entries: 4 with one attemptid (the one with rawscore = 2) and 4 with the other (the one with rawscore = 6)
          2. Check that all results have a duration > 0
          3. Check that all results have completion = 1
          4. Check that only two entries have "success = 0":
            1. one with interactiontye = "compound" and rawscore = 2
            2. another with  interactiontye = "choice" and rawscore = 0
            3. Check that both have the same attemptid
        3. SQL: 

          SELECT ar.* FROM mdl_h5pactivity_attempts a
            JOIN mdl_h5pactivity_attempts_results ar
              ON a.id = ar.attemptid AND a.rawscore = ar.rawscore
             AND a.duration = ar.duration AND a.completion = ar.completion
             AND a.success = ar.success

          1. Check that there are only 2 results
          2. Check that both interactiontype are "compound"
      Show
      All involved code parts are tested automatically: PHP Unit Test: vendor/bin/phpunit -c mod/h5pactivity/ Behat: --tags=@mod_h5pactivity Manual testing Note: for this test you need access to the database. Review the SQL queries and change "mdl_" to your prefix if you've changed it. Login as admin Create a course and a user and enrol it as a student.  Edit the course and create an H5P activity using the attached H5P package (file question-set-616.h5p ) Login as a student and go to the course Access the H5P activity and do one attempt with these answers: Which of the berries listed below are berries you can pick in the wild? check "Halle Berry" and "Cocktail cherry" Drag and drop: from left to right drag the first image to "Blueberry", the second to "Redcurrant" and the third to "Cloudberry" (like the image attached ) Which one of the following berries are red? select "Cranberries" Click on "Finish" button. Check that your result is 2/6 and a message "Oh, no! This didn't go so well" appears. Click on the "Retry" button to start a new attempt with the following answers: Which of the berries listed below are berries you can pick in the wild? check "Blueberry", "Strawberry", "Raspberry" and "Cloudberry". Drag and drop: from left to right drag the first image to "Blueberry", the second to "Redcurrant" ans the third to "Cloudberry" (the same as the image attached before) Which one of the following berries are red? select "Cranberries" Click on "Finish" button. Check that your result is 6/6 and a message "Congratulation! You did very well!" appears. Now access the DB and check the following data: SQL: SELECT * FROM mdl_h5pactivity_attempts Check that the 2 attempts appears Check that both have some duration bigger than 0 Check that both have completion = 1 Check that the one with rawscore of 2 have success = 0 and the one with rawscore of 6 have success = 1 Note down the attemptsid and the rawscores, we will need for the next validations SQL: SELECT * FROM mdl_h5pactivity_attempts_results Check that there are 8 entries: 4 with one attemptid (the one with rawscore = 2) and 4 with the other (the one with rawscore = 6) Check that all results have a duration > 0 Check that all results have completion = 1 Check that only two entries have "success = 0": one with interactiontye = "compound" and rawscore = 2 another with  interactiontye = "choice" and rawscore = 0 Check that both have the same attemptid SQL:  SELECT ar.* FROM mdl_h5pactivity_attempts a JOIN mdl_h5pactivity_attempts_results ar ON a.id = ar.attemptid AND a.rawscore = ar.rawscore AND a.duration = ar.duration AND a.completion = ar.completion AND a.success = ar.success Check that there are only 2 results Check that both interactiontype are "compound"
    • Affected Branches:
      MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_39_STABLE
    • Pull Master Branch:
      MDL-68381-master

      Description

      H5P xAPI statements can provide a duration field to know the time spent in that content. In order to have a better attempt report, this data should be stored in the attempts table.

      It happens the same with other fields like result.completion and result.success that can be helpful for future features like completion conditions and must be stored in attempts as well.
       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              tusefomal Ferran Recio
              Reporter:
              tusefomal Ferran Recio
              Peer reviewer:
              Carlos Escobedo
              Integrator:
              Sara Arjona (@sarjona)
              Tester:
              Janelle Barcega
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                15/Jun/20

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 week, 15 minutes
                  1w 15m