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

Import/Copy badges into other courses

XMLWordPrintable

    • MOODLE_405_STABLE
    • MOODLE_405_STABLE
    • MDL-82057-main
    • Hide

      Note: Backup, restore and import are covered by behat tests.

       

      Setup

      1. Download the attached MDL-82057.feature.
      2. Run the following command to create a course with a few badges:

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

        It might fail while creating the users if they already exist in your local instance. If that's the case, this error can be ignored.
        If  MDL-82162  hasn't been integrated yet, I recommend using the UI to load it (instead of CLI). This feature can be found in "Site administration > Development > Create testing scenarios".

      3. Login as admin.
      4. Go to the course "MDL-43938-test".
      5. Access "Badges > Manage badges".
      6. Award the "Published course badge" to one of the students.

       

      Testing scenario 1. Copy course without user data

      1. Access "Course reuse > Copy course".
      2. Give a name to the course. Leave "Include user data" set to No.
      3. Click the "Copy and view" button.
      4. Run the cron.
      5. Go to the copied course.
      6. Access "Badges > Manage badges".
      7. Confirm the 3 badges have been copied into the new course.
      8. Confirm they are "Not available".
      9. Enable the "Published course badge" badge.
      10. Confirm no user has awarded it.

       

      Testing scenario 2. Copy course with user data

      1. Access "Course reuse > Copy course".
      2. Give a name to the course.
      3. Set "Include user data" Yes.
      4. For "Include role enrolments", check "Student".
      5. Click the "Copy and view" button.
      6. Run the cron.
      7. Go to the copied course.
      8. Access "Badges > Manage badges".
      9. Confirm the 3 badges have been copied into the new course.
      10. Confirm they are "Not available".
      11. Enable the "Published course badge" badge.
      12. Confirm at least one student has awarded it (the one you use in step #6 for the Setup).
      Show
      Note: Backup, restore and import are covered by behat tests.   Setup Download the attached MDL-82057.feature . Run the following command to create a course with a few badges: php admin/tool/generator/cli/runtestscenario.php --feature="absolute/path/to/file.feature" It might fail while creating the users if they already exist in your local instance. If that's the case, this error can be ignored. If   MDL-82162   hasn't been integrated yet, I recommend using the UI to load it (instead of CLI). This feature can be found in "Site administration > Development > Create testing scenarios". Login as admin. Go to the course " MDL-43938 -test". Access "Badges > Manage badges". Award the "Published course badge" to one of the students.   Testing scenario 1. Copy course without user data Access "Course reuse > Copy course". Give a name to the course. Leave "Include user data" set to No. Click the "Copy and view" button. Run the cron. Go to the copied course. Access "Badges > Manage badges". Confirm the 3 badges have been copied into the new course. Confirm they are "Not available". Enable the "Published course badge" badge. Confirm no user has awarded it.   Testing scenario 2. Copy course with user data Access "Course reuse > Copy course". Give a name to the course. Set "Include user data" Yes. For "Include role enrolments", check "Student". Click the "Copy and view" button. Run the cron. Go to the copied course. Access "Badges > Manage badges". Confirm the 3 badges have been copied into the new course. Confirm they are "Not available". Enable the "Published course badge" badge. Confirm at least one student has awarded it (the one you use in step #6 for the Setup).
    • 5
    • HQ 2024 Sprint I2.2 Moppies

      While looking at MDL-43938 we identify some improvements that should be done to copy/import badges. Currently:

      • Badges are only included when user data and activities are selected; if any of these options are unchecked while creating a backup, badges are automatically excluded from the backup.
      • Badges are only copied when "Include user data" is set to Yes and "Include role enrolments" has any role checked.

      This is confusing because, although not all the badge information can be copied/exported (depending on the options selected), some information could also be included in backups/course copies if user data or activities weren't selected. For instance:

      • If the user data is not selected (in backup or when copying a course), the badge information (name, description, image, ...) and the criteria can be included because it's independent of the users.
      • If the activities are not selected (in backup), the badge information (name, description, image...) can still be copied. Criteria and users awarding the badge will be excluded (but, at least, the rest of the information, can be copied (and will probably save time for users).

      So this issue is to review the workflow for the:

      • backup to remove the current dependency of badges with user data and activities.
      • copy course to remove the current dependency of badges with user data and enrolments.

      The information included will be different (depending on whether the user data/activities must be added or not), but at least, the basic badges information could be copied even when no user data is selected.

        1. image-2024-06-13-10-53-19-374.png
          image-2024-06-13-10-53-19-374.png
          63 kB
        2. image-2024-06-13-10-53-40-786.png
          image-2024-06-13-10-53-40-786.png
          67 kB
        3. MDL-82057_copiedcourse.png
          MDL-82057_copiedcourse.png
          62 kB
        4. MDL-82057_copysettings.png
          MDL-82057_copysettings.png
          11 kB
        5. MDL-82057_originalcourse.png
          MDL-82057_originalcourse.png
          47 kB
        6. MDL-82057.feature
          6 kB
        7. MDL-82057 - 1.png
          MDL-82057 - 1.png
          309 kB
        8. MDL-82057 - 2.png
          MDL-82057 - 2.png
          273 kB

            sarjona Sara Arjona (@sarjona)
            sarjona Sara Arjona (@sarjona)
            Laurent David Laurent David
            Ferran Recio Ferran Recio
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            11 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 22 minutes
                1d 22m

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