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

Include H5P Activity backup and restore options

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.9
    • 3.9
    • H5P
    • MOODLE_39_STABLE
    • MOODLE_39_STABLE
    • MDL-67713-master
    • Hide

      Both backup and restore are covered by PHPUnitTest:

      • vendor/bin/phpunit mod/h5pactivity/tests/restore_test.php

      Testing setup

      1. Login as admin and create a course
      2. Add a new H5P activity using the provided H5P file (question-set-616.h5p)
      3. Create a student user and enrol to the course
      4. Login as this user, access the H5P activity and do a full attempt (arrive until the end of the activity and send the results).
      5. Logout and login as admin in the course.
      6. Check that h5pactivity_attemps and h5pactivity_attemps_results have been filled as expected:
        1. SQL: SELECT COUNT( * ) FROM mdl_h5pactivity_attempts -> check that returns 1
        2. SQL: SELECT COUNT( * ) FROM mdl_h5pactivity_attempts_results -> check that returns 4

      Manual test

      1. Go to the "course administration -> backup"
        1. Step 1: make sure that "Include user role assignments" and "Include activities and resources" are checked.
        2. Step 2: make sure that the h5p activity is checked and also it's User Data checkbox.
        3. Step 3: just click on "Perform backup" button
        4. Expected result: the backup should perfom as expected without any warning or error and a green message "The backup file was successfully created." will appear with a continue button.
      2. Press the continue button
        1. Expected result: the continue button the mbz backup must appear in the Course backup area table
      3. Click on the "Restore" on the mbz file row.
        1. Step 1: Expected result the H5P activity must appear on the activity list with a green check on the "user data"column
        2. click on the continue button.
        3. Step 2: indicate you want to "Restore as a new course" in "miscellaneous" category.
        4. Step 3: leave all default value and go to next step
        5. Step 4:
          1. make sure that the H5P activity and it's userdata checkbox are checked
          2. change the course name and shortname to not collide with the existing one
          3. go the the next step
        6. Step 5: perform the restore
        7. Expected result: the restore must be executed as expected, without warnings or errors, and a "The course was restored successfully, clicking the continue button below will take you to view the course you restored." must appear.
      4. Click on continue
        1. Expected result: a new course must be created with the H5P activity in it.
      5. Expected result: access the H5P activity and validate that the content displays as it was before with the student (in the case of the admin a warning with the message "This content is displayed in preview mode. No attempt tracking will be stored." will appear over the content, it is ok).
      6. Check that h5pactivity_attemps and h5pactivity_attemps_results have been restored too:
        1. SQL: SELECT COUNT( * ) FROM mdl_h5pactivity_attempts -> check that returns 2
        2. SQL: SELECT COUNT( * ) FROM mdl_h5pactivity_attempts_results -> check that returns 8
      Show
      Both backup and restore are covered by PHPUnitTest: vendor/bin/phpunit mod/h5pactivity/tests/restore_test.php Testing setup Login as admin and create a course Add a new H5P activity using the provided H5P file ( question-set-616.h5p ) Create a student user and enrol to the course Login as this user, access the H5P activity and do a full attempt (arrive until the end of the activity and send the results). Logout and login as admin in the course. Check  that h5pactivity_attemps and h5pactivity_attemps_results have been filled as expected: SQL: SELECT COUNT( * ) FROM mdl_h5pactivity_attempts ->  check  that returns 1 SQL: SELECT COUNT( * ) FROM mdl_h5pactivity_attempts_results ->  check  that returns 4 Manual test Go to the "course administration -> backup" Step 1: make sure that "Include user role assignments" and "Include activities and resources" are checked. Step 2: make sure that the h5p activity is checked and also it's User Data checkbox. Step 3: just click on "Perform backup" button Expected result: the backup should perfom as expected without any warning or error and a green message "The backup file was successfully created." will appear with a continue button. Press the continue button Expected result:  the continue button the mbz backup must appear in the Course backup area table Click on the "Restore" on the mbz file row. Step 1: Expected result  the H5P activity must appear on the activity list with a green check on the "user data"column click on the continue button. Step 2: indicate you want to "Restore as a new course" in "miscellaneous" category. Step 3: leave all default value and go to next step Step 4: make sure that the H5P activity and it's userdata checkbox are checked change the course name and shortname to not collide with the existing one go the the next step Step 5: perform the restore Expected result: the restore must be executed as expected, without warnings or errors, and a "The course was restored successfully, clicking the continue button below will take you to view the course you restored." must appear. Click on continue Expected result: a new course must be created with the H5P activity in it. Expected result: access the H5P activity and validate that the content displays as it was before with the student (in the case of the admin a warning with the message "This content is displayed in preview mode. No attempt tracking will be stored." will appear over the content, it is ok). Check  that h5pactivity_attemps and h5pactivity_attemps_results have been restored too: SQL: SELECT COUNT( * ) FROM mdl_h5pactivity_attempts ->  check  that returns 2 SQL: SELECT COUNT( * ) FROM mdl_h5pactivity_attempts_results ->  check  that returns 8

      As a manager
      I want to able to include H5P activity in course backup and restore process
      So that I can backup and restore courses with all their activities

      Acceptance criteria:

      • H5P activities should be included in the course backup file.
      • H5P activities should be restored from course backup files. 

      List of tasks:

      • Implement backup classes for mod_h5p
      • Implement restore classes for mod_h5p

        1. question-set-616.h5p
          2.92 MB
          Ferran Recio
        2. Screenshot_1.png
          76 kB
          Janelle Barcega
        3. Screenshot_2.png
          90 kB
          Janelle Barcega
        4. Screenshot_3.png
          327 kB
          Janelle Barcega

            tusefomal Ferran Recio
            amaia Amaia Anabitarte
            Carlos Escobedo Carlos Escobedo
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            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 week, 6 hours, 40 minutes
                1w 6h 40m

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