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

Improve badges workflow: Move enable badge action to a modal

XMLWordPrintable

    • MOODLE_405_STABLE
    • MOODLE_405_STABLE
    • MDL-82168-main
    • Hide

      Note: Mostly covered by automated tests (PHPUnit and behat). However, the following must be manually tested.

       

      Setup

      1. Download the attached MDL-82168.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.

      1. Login as student1 to the course "MDL-82168-test".
      2. Go to the "Assignment name 1" activity.
      3. Login as admin.
      4. Go to the course "MDL-82168-test".
      5. Access "Badges > Manage badges".
      6. Add an "Activity completion" criterion for "Unpublished without criteria course badge", selecting the "Assignment name 1" activity.
      7. Access "More > Course reuse > Backup".
      8. Create a backup including badges.
      9. Restore the backup in the same course (to duplicate badges with the same name).

       

      Testing scenario. Enable badges with duplicated name

      1. Access "Badges > Manage badges".
      2. Enable access for badge "Published course badge" (the unavailable one).
      3. Check a success toast is displayed saying that the badge has been enabled.
      4. Enable access for badge "Unpublished without criteria course badge" (any of them, because both are disabled).
      5. Check a success toast is displayed saying that the badge has been enabled.
      6. Check n info toast is displayed also saying that the badge has been issued X users (at least 1).
      7. Disable badge "Published course badge".
      8. Check a success notification is displayed saying it has been disabled.
      9. Access to the other "Published course badge" badge.
      10. Enable it from the Overview page.
      11. Check it's enabled.
      Show
      Note: Mostly covered by automated tests (PHPUnit and behat). However, the following must be manually tested.   Setup Download the attached MDL-82168.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. Login as student1 to the course " MDL-82168 -test". Go to the "Assignment name 1" activity. Login as admin. Go to the course " MDL-82168 -test". Access "Badges > Manage badges". Add an "Activity completion" criterion for "Unpublished without criteria course badge", selecting the "Assignment name 1" activity. Access "More > Course reuse > Backup". Create a backup including badges. Restore the backup in the same course (to duplicate badges with the same name).   Testing scenario. Enable badges with duplicated name Access "Badges > Manage badges". Enable access for badge "Published course badge" (the unavailable one). Check a success toast is displayed saying that the badge has been enabled. Enable access for badge "Unpublished without criteria course badge" (any of them, because both are disabled). Check a success toast is displayed saying that the badge has been enabled. Check n info toast is displayed also saying that the badge has been issued X users (at least 1). Disable badge "Published course badge". Check a success notification is displayed saying it has been disabled. Access to the other "Published course badge" badge. Enable it from the Overview page. Check it's enabled.
    • 3
    • HQ 2024 Sprint I2.3 Moppies

      As it was raised in MDL-43938 as a workaround, badges are restored respecting their original names, without looking if they are repeated or not.

      Once MDL-43938 and MDL-82057 are merged, duplicated badges will be allowed in different courses but, when they are imported/restored, they will still keep their name (so they will skip the unique restriction for the same context that was added in MDL-43938).

      This issue is to move the Enable access confirmation to a real modal, to improve the UX and make the code easier to maintain

       

       

      This issue is to avoid having duplicated badge names in the same course when importing/restoring them. This could be achieved by:

      • Improving the restore mechanism, adding a method similar to restoredbops::calculate_course_names() to rename them when there is an existing badge in the course with this name.
      • Reviewing the method to "Enable badges", raising an error and not letting them be enabled when the name collides with another badge in the same course.

        1. MDL-82168_error.png
          MDL-82168_error.png
          97 kB
        2. MDL-82168_success.png
          MDL-82168_success.png
          82 kB
        3. MDL-82168.feature
          6 kB
        4. MDL-82168.png
          MDL-82168.png
          510 kB

            sarjona Sara Arjona (@sarjona)
            sarjona Sara Arjona (@sarjona)
            Mikel Martín Corrales Mikel Martín Corrales
            Ferran Recio Ferran Recio
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 days, 6 hours, 40 minutes
                2d 6h 40m

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