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

Enable delegate plugins to include delegated sections in the backup

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.4
    • Course
    • MOODLE_404_STABLE
    • MDL-80191-main-v05
    • Hide

      Prepare testing scenarios

      1. Install mod_subsection from MDL-80191-main branch. To do so:
        1. Run this command from your instance root folder:

          git clone -b MDL-80191-main https://github.com/aanabit/mod_subsection mod/subsection

        1. Login as admin a install the plugin.
      1. Run this command in your instance root folder to have all behat libraries loaded:

        php admin/tool/generator/cli/runtestscenario.php

      1. Create the testing course from testing_scenario.feature. There are two possible ways:
        1. Option 1: Go to site administration -> development -> Create testing scenarios. Once there, upload the file and submit it to process it.
        2. Option 2: you can use the terminal:

          php admin/tool/generator/cli/runtestscenario.php --feature="absolute/path/to/file.feature"

      1. Validate that you have a course called MDL-80191-scenario

      Manual tests must be done in order.

      Manual test 1: backup form checkboxes

      1. Go to the MDL-80191-scenario course page.
      2. Navigate to the "Course reuse --> backup" option in the tertiary navigation.
      3. Click the "Next" button to go to the second step of the process (selecting course structure elements)
        1. Validate that under the activity "Subsection activity" there's a indented section that has two elements inside: "Subsection content" and "Subactivity". Something like the sceenshort
        2. (sample screenshot of how it should look like)
      4. Uncheck "Subsection activity"
        1. Validate that both "Subsection content" and "Subactivity" checkboxes became disabled.
      5. Check again "Subsection activity" and uncheck "Subsection content"
        1. Validate that only the checkboxes from "Subactivity" are now disabled.
      6. Check again "Subsection content". Now uncheck the user data on "Subsection activity"
        1. Validate that the user data checkboxes from "Subsection content" and "Subactivity" are disabled.
      7. Check again  the user data on "Subsection activity" and uncheck the user data from "Subsection content"
        1. Validate the user data from "Subactivity" is disabled.
      8. Check again the user data from "Subsection content"
        1. Validate all subsection elements have the checkboxes enabled.

      Manual test 2: execute backup

      1. Go to the MDL-80191-scenario course page.
      2. Navigate to the "Course reuse --> backup" option in the tertiary navigation.
      3. Click "Jump to the final step" to execute the backup
        1. If needed, run the instance cron to execute the backup in background
        2. Validate no errors appear.
      4. Click on the continue button once the backup is done.
        1. Validate the is the backup file in the course backup area.

      Manual test 3: restore form checkboxes

      1. Go to the MDL-80191-scenario course page.
      2. Navigate to the "Course reuse --> restore" option in the tertiary navigation.
      3. Click on the "Restore" link of the backup file created in manual test 2.
      4. Click continue to go to the destination step.
      5. Select some category from the "Restore as a new course" and click on continue.
      6. Click the "Next" button to go to the Shcema step of the process
        1. Validate that under the activity "Subsection activity" there's a indented section that has two elements inside: "Subsection content" and "Subactivity". Something like the sceenshort
        2. (sample screenshot of how it should look like)
      7. Uncheck "Subsection activity"
        1. Validate that both "Subsection content" and "Subactivity" checkboxes became disabled.
      8. Check again "Subsection activity" and uncheck "Subsection content"
        1. Validate that only the checkboxes from "Subactivity" are now disabled.
      9. Check again "Subsection content". Now uncheck the user data on "Subsection activity"
        1. Validate that the user data checkboxes from "Subsection content" and "Subactivity" are disabled.
      10. Check again  the user data on "Subsection activity" and uncheck the user data from "Subsection content"
        1. Validate the user data from "Subactivity" is disabled.
      11. Check again the user data from "Subsection content"

      Manual test 4: perform restore

      1. Go to the MDL-80191-scenario course page.
      2. Navigate to the "Course reuse --> restore" option in the tertiary navigation.
      3. Click on the "Restore" link of the backup file created in manual test 2.
      4. Click continue to go to the destination step.
      5. Select some category from the "Restore as a new course" and click on continue.
      6. Click the "Next" button to go to the Shcema step of the process
      7. With all the course structure selected (this is how it should be by default), click the "Next" button to go to the review step.
      8. Click on the Perform restore button.
        1. If needed, run the instance cron to execute the restore in background
        2. Validate no errors appear.
      9. Click on the continue button once the restore is done.
        1. Validate the new course have the same structure as the original MDL-80191-scenario
      10. Click on the "Subsection activity" activity
        1. Validate you see the subsection activity page with a "Subactivity" activity.

      Manual test 5: perform import

      1. Create a new empty course and navigate to it.
      2. Navigate to the "Course reuse --> import" option in the tertiary navigation.
      3. Select the MDL-80191-scenario course as import data from and click on continue.
      4. Click on the Jump to final step to execute the import
        1. Validate no errors appear.
      5. Click on the continue button once the import is done.
        1. Validate the course have the same structure as the original MDL-80191-scenario (ignore the original news forum)
      6. Click on the "Subsection activity" activity
        1. Validate you see the subsection activity page with a "Subactivity" activity.

       

      Show
      Prepare testing scenarios Install mod_subsection from MDL-80191 -main branch. To do so: Run this command from your instance root folder: git clone -b MDL-80191-main https://github.com/aanabit/mod_subsection mod/subsection Login as admin a install the plugin. Run this command in your instance root folder to have all behat libraries loaded: php admin/tool/generator/cli/runtestscenario.php Create the testing course from testing_scenario.feature . There are two possible ways: Option 1: Go to site administration -> development -> Create testing scenarios. Once there, upload the file and submit it to process it. Option 2: you can use the terminal: php admin/tool/generator/cli/runtestscenario.php --feature="absolute/path/to/file.feature" Validate that you have a course called MDL-80191 -scenario Manual tests must be done in order. Manual test 1: backup form checkboxes Go to the MDL-80191 -scenario course page. Navigate to the "Course reuse --> backup" option in the tertiary navigation. Click the "Next" button to go to the second step of the process (selecting course structure elements) Validate that under the activity "Subsection activity" there's a indented section that has two elements inside: "Subsection content" and "Subactivity". Something like the sceenshort (sample screenshot of how it should look like) Uncheck "Subsection activity" Validate that both "Subsection content" and "Subactivity" checkboxes became disabled. Check again "Subsection activity" and uncheck "Subsection content" Validate that only the checkboxes from "Subactivity" are now disabled. Check again "Subsection content". Now uncheck the user data on "Subsection activity" Validate that the user data checkboxes from "Subsection content" and "Subactivity" are disabled. Check again  the user data on "Subsection activity" and uncheck the user data from "Subsection content" Validate the user data from "Subactivity" is disabled. Check again the user data from "Subsection content" Validate all subsection elements have the checkboxes enabled. Manual test 2: execute backup Go to the MDL-80191 -scenario course page. Navigate to the "Course reuse --> backup" option in the tertiary navigation. Click "Jump to the final step" to execute the backup If needed, run the instance cron to execute the backup in background Validate no errors appear. Click on the continue button once the backup is done. Validate the is the backup file in the course backup area. Manual test 3: restore form checkboxes Go to the MDL-80191 -scenario course page. Navigate to the "Course reuse --> restore" option in the tertiary navigation. Click on the "Restore" link of the backup file created in manual test 2. Click continue to go to the destination step. Select some category from the "Restore as a new course" and click on continue. Click the "Next" button to go to the Shcema step of the process Validate that under the activity "Subsection activity" there's a indented section that has two elements inside: "Subsection content" and "Subactivity". Something like the sceenshort (sample screenshot of how it should look like) Uncheck "Subsection activity" Validate that both "Subsection content" and "Subactivity" checkboxes became disabled. Check again "Subsection activity" and uncheck "Subsection content" Validate that only the checkboxes from "Subactivity" are now disabled. Check again "Subsection content". Now uncheck the user data on "Subsection activity" Validate that the user data checkboxes from "Subsection content" and "Subactivity" are disabled. Check again  the user data on "Subsection activity" and uncheck the user data from "Subsection content" Validate the user data from "Subactivity" is disabled. Check again the user data from "Subsection content" Manual test 4: perform restore Go to the MDL-80191 -scenario course page. Navigate to the "Course reuse --> restore" option in the tertiary navigation. Click on the "Restore" link of the backup file created in manual test 2. Click continue to go to the destination step. Select some category from the "Restore as a new course" and click on continue. Click the "Next" button to go to the Shcema step of the process With all the course structure selected (this is how it should be by default), click the "Next" button to go to the review step. Click on the Perform restore button. If needed, run the instance cron to execute the restore in background Validate no errors appear. Click on the continue button once the restore is done. Validate the new course have the same structure as the original MDL-80191 -scenario Click on the "Subsection activity" activity Validate you see the subsection activity page with a "Subactivity" activity. Manual test 5: perform import Create a new empty course and navigate to it. Navigate to the "Course reuse --> import" option in the tertiary navigation. Select the MDL-80191 -scenario course as import data from and click on continue. Click on the Jump to final step to execute the import Validate no errors appear. Click on the continue button once the import is done. Validate the course have the same structure as the original MDL-80191 -scenario (ignore the original news forum) Click on the "Subsection activity" activity Validate you see the subsection activity page with a "Subactivity" activity.  
    • 5
    • C->HQ 2024 Sprint I2.2 Moppies

      This issue is part of the course hierarchy project

      Issue goals

      Since MDL-80190 delegated sections can be omitted from the course section list. However, backup and restore needs a way of backup and restore delegated sections.

      • Add a method into the backup API so plugins can include delegated sections in the backup file.
      • Add a UI element to represent when an activity has a delegated section. This means presenting the list of activities of the section as they are children of the parent activity.
      • Add a step in the restore so a plugin can replace the restored delegateid field from the course_section table.
      • Incorporate this logic into https://github.com/aanabit/mod_subsection so the plugin can update the delegateid field when restored.

      Future issues

      The final mod_subsection will use the same mechanism to handle backups and restores.

       

            tusefomal Ferran Recio
            tusefomal Ferran Recio
            Laurent David Laurent David
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 week, 1 day, 6 hours
                1w 1d 6h

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