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

Conditional activity: A group or grouping condition will not be duplicated with activity when admin default setting for restore groups is set to 'no'

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Login as an admin
      2. Go to the Site administration / Courses / Backups / General restore defaults
      3. Untick restore | restore_general_groups and save the changes.
      4. Go to a course and create a group "Group 1"
      5. Create a grouping "Grouping 1" and add "Group 1" to this grouping
      6. Go back to the course home page
      7. Turn editing on
      8. Add an assignment (e.g. "Assignment with group condition")
      9. Add an access restriction to this "Group 1"
      10. Save and return to course
      11. Add another assignment (e.g. "Assignment with grouping condition)
      12. Add an access restriction to this "Grouping 1"
      13. Save and return to course
      14. Duplicate the Assignment with group condition
      15. Confirm that the group condition was duplicated
      16. Duplicate the Assignment with grouping condition
      17. Confirm that the grouping condition was duplicated
      Show
      Login as an admin Go to the Site administration / Courses / Backups / General restore defaults Untick restore | restore_general_groups and save the changes. Go to a course and create a group "Group 1" Create a grouping "Grouping 1" and add "Group 1" to this grouping Go back to the course home page Turn editing on Add an assignment (e.g. "Assignment with group condition") Add an access restriction to this "Group 1" Save and return to course Add another assignment (e.g. "Assignment with grouping condition) Add an access restriction to this "Grouping 1" Save and return to course Duplicate the Assignment with group condition Confirm that the group condition was duplicated Duplicate the Assignment with grouping condition Confirm that the grouping condition was duplicated
    • Affected Branches:
      MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE
    • Pull 3.5 Branch:
    • Pull 3.6 Branch:
    • Pull Master Branch:
      MDL-62666-master

      Description

      Hi,
      we've encountered this bug.

      Steps to reproduce

      I'll start with the steps to reproduce because this will make it clear what happens:

      1. Login as an admin
      2. Go to the setting restore | restore_general_groups, disable it and save
      3. Go to a course and create a group "Group 1"
      4. Create a grouping "Grouping 1" and add "Group 1" to this grouping
      5. Go back to the course home page
      6. Turn editing on
      7. Add an assignment:
        Title e.g. "Assignment with group condition"
        Add an access restriction to this "Group 1"
      8. Save and return to course
      9. Add another assignment:
        Title e.g. "Assignment with grouping condition"
        Add an access restriction to this "Grouping 1"
      10. Save and return to course
      11. Duplicate Assignment with group condition
        => See that the group condition was not duplicated
      12. Duplicate Assignment with grouping condition
        => See that the grouping condition was not duplicated

      If you want to you can do the same steps with the setting restore | restore_general_groups enabled and you will have the result that the group and grouping condition will be duplicated as well.

      The problem here is that the admin setting which only sets default values has impacts in other places - for example in the duplicating function.
      The user cannot change this setting as the duplicating workflow does not present the user nay settings.

      Cause

      The cause is this function (for the group and grouping condition each):

      If the admin setting ist disabled (and groups are existent in the course), this function will always return a false value and therefore the groups condition will not be handled in the function update_after_restore.

      Possible solution(s)

      We can imagine 2 possible solutions:

      • Fix the function include_after_restore to check if we are operating on the same course and if there are groups to return a true
      • Or if the user triggers the duplication button, then all possible restore settings could be activated and ignore the admin settings at this point

      Best, Kathrin

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/Mar/19

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 20 minutes
                  20m