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

Add custom fields to groups and groupings

    XMLWordPrintable

Details

    • MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_403_STABLE
    • MOODLE_403_STABLE
    • MDL-67186_master_v2
    • Hide

      Test group custom field in admin setting

      1. Go to "Site administration > Users"
      2. Confirm "Group custom fields" is in "Course" section.
      3. Click "Group custom fields".
      4. Click "Add a new category".
      5. Confirm a new category "Other fields" is created.
      6. Click category name "Other fields" and change to "Test group custom field category"  then press enter key.
      7. Confirm the category name is changed to "Test group custom field category".
        Click "Short text" from "Add a new custom field" dropdown on the right side of category name.
      8. Fill "Name" with "Group custom text", "Short name" with "groupcustomtext", "Default value" with "Group test value", and click "Save changes".
      9. Confirm "Group custom text" is created in the "Test group custom field category".

      Test grouping custom field in admin setting

      1. Go to "Site administration > Users"
      2. Confirm "Grouping custom fields" is in "Course" section.
      3. Click "Grouping custom fields".
      4. Click "Add a new category".
      5. Confirm a new category "Other fields" is created.
      6. Click category name "Other fields" and change to "Test grouping custom field category" then press enter key.
      7. Confirm the category name is changed to "Test grouping custom field category".
        Click "Short text" from "Add a new custom field" dropdown on the right side of category name.
      8. Fill "Name" with "Grouping custom text", "Short name" with "groupingcustomtext", "Default value" with "Grouping test value", and click "Save changes".
      9. Confirm "Grouping custom text" is created in the "Test grouping custom field category".

      Test group/grouping custom field in the course

      1. Create a new course.
      2. Go to the created course.
      3. Go to "Paticipants > Groups".
      4. Click "Create group".
      5. Confirm "Group default value" is set for "Group custom text" in the "Test group custom field category".
      6. Set "Test CF group" for "Group name", "Gruop updated value" for "Group custom text", and fill other required field, then click "Save changes".
      7. Choose "Test CF group" in the "Groups" and click "Edit group settings".
      8. Confirm "Group updated value" is set for "Group custom text" in the "Test group custom field category".
      9. Go to "Participants > Groupings".
      10. Click "Create grouping".
      11. Confirm "Grouping default value" is set for "Grouping custom text" in the "Test grouping custom field category".
      12. Set "Test CF grouping" for "Grouping name", "Gruoping updated value" for "Grouping custom text", and fill other required field, then click "Save changes".
      13. Click cog icon for "Test CF grouping" row.
      14. Confirm "Grouping updated value" is set for "Grouping custom text" in the "Test grouping custom field category".

      Test import groups

      1. Go to the created course.
      2. Go to "Paticipants > Groups".
      3. Click "Import groups".
      4. Click "Choose a file...", upload file "import_group_tests.csv", and click "Upload this file". (use attached file in this ticket)
      5. Click "Import groups".
      6. Confirm messages below are shown after import.
        • Group Test Import Group 1 added successfully
        • Grouping Test Grouping 1 added successfully
        • Group Test Import Group 1 added to grouping Test Grouping 1 successfully
        • Group Test Import Group 2 added successfully
        • Group Test Import Group 2 added to grouping Test Grouping 1 successfully
      7. Click "Test Import Group 1" in the "Groups" box and click "Edit group settings".
      8. Confirm "Custom field group 1" is in "Group custom field" in the "Test group custom field category".
      9. Click "Cancel" to back to the Groups screen.
      10. Click "Test Import Group 2" in the "Groups" box and click "Edit group settings".
      11. Confirm "Custom field group 2" is in "Group custom field" in the "Test group custom field category".
      12. Click "Cancel" to back to the Groups screen.
      13. Go to "Groupings" page.
      14. Click cog icon for the row "Test Grouping 1".
      15. Confirm "Custom grouping 1" is set for "Grouping custom text" in the "Test grouping custom field category".

      Test backup/restore

      1. Go to the created course.
      2. Go to "Course reuse" in "More" dropdown link in the course menu.
      3. Choose "Backup" from the dropdown.
      4. Make sure the option "Include groups and groupings" is ticked, and click "Jump to final step".
      5. Click "Continue" to finish backup.
      6. Click "Restore" in the "Course backup area".
      7. In the "1. Confirm" section, click "Continue".
      8. In the "2. Destination" section, click something category in the "Restore as a new course > Select a category" section, then click "Continue".
      9. In the "3. Settings" section, make sure "Include groups and grouping" is ticked, then click "Next".
      10. In the "4. Schema" section, click "Next".
      11. in the "5. Review" section, click "Perform restore".
      12. In the "7. Complete" section, click "Continue".
      13. You are in the copied course. Click "Participants".
      14. Go to groups page.
      15. Confirm there are "Test CF group", "Test Import Group 1", and "Test Import Group 2".
      16. Choose "Test CF group" and click "Edit group settings".
      17. Confirm "Group updated value" is set for "Group custom text" in the "Test group custom field category".
      18. Click "Cancel", choose "Test Import Group 1", and click "Edit group settings".
      19. Confirm "Custom field group 1" is in "Group custom field" in the "Test group custom field category".
      20. Click "Cancel", choose "Test Import Group 2", and click "Edit group settings".
      21. Confirm "Custom field group 2" is in "Group custom field" in the "Test group custom field category".
      22. Click "Cancel" to back to the Groups screen.
      23. Go to "Groupings" page.
      24. Click cog icon for "Test CF grouping" row.
      25. Confirm "Grouping updated value" is set for "Grouping custom text" in the "Test grouping custom field category".
      26. Click cog icon for the row "Test Grouping 1".
      27. Confirm "Custom grouping 1" is set for "Grouping custom text" in the "Test grouping custom field category".
      Show
      Test group custom field in admin setting Go to "Site administration > Users" Confirm "Group custom fields" is in "Course" section. Click "Group custom fields". Click "Add a new category". Confirm a new category "Other fields" is created. Click category name "Other fields" and change to "Test group custom field category"  then press enter key. Confirm the category name is changed to "Test group custom field category". Click "Short text" from "Add a new custom field" dropdown on the right side of category name. Fill "Name" with "Group custom text", "Short name" with "groupcustomtext", "Default value" with "Group test value", and click "Save changes". Confirm "Group custom text" is created in the "Test group custom field category". Test grouping custom field in admin setting Go to "Site administration > Users" Confirm "Grouping custom fields" is in "Course" section. Click "Grouping custom fields". Click "Add a new category". Confirm a new category "Other fields" is created. Click category name "Other fields" and change to "Test grouping custom field category" then press enter key. Confirm the category name is changed to "Test grouping custom field category". Click "Short text" from "Add a new custom field" dropdown on the right side of category name. Fill "Name" with "Grouping custom text", "Short name" with "groupingcustomtext", "Default value" with "Grouping test value", and click "Save changes". Confirm "Grouping custom text" is created in the "Test grouping custom field category". Test group/grouping custom field in the course Create a new course. Go to the created course. Go to "Paticipants > Groups". Click "Create group". Confirm "Group default value" is set for "Group custom text" in the "Test group custom field category". Set "Test CF group" for "Group name", "Gruop updated value" for "Group custom text", and fill other required field, then click "Save changes". Choose "Test CF group" in the "Groups" and click "Edit group settings". Confirm "Group updated value" is set for "Group custom text" in the "Test group custom field category". Go to "Participants > Groupings". Click "Create grouping". Confirm "Grouping default value" is set for "Grouping custom text" in the "Test grouping custom field category". Set "Test CF grouping" for "Grouping name", "Gruoping updated value" for "Grouping custom text", and fill other required field, then click "Save changes". Click cog icon for "Test CF grouping" row. Confirm "Grouping updated value" is set for "Grouping custom text" in the "Test grouping custom field category". Test import groups Go to the created course. Go to "Paticipants > Groups". Click "Import groups". Click "Choose a file...", upload file "import_group_tests.csv", and click "Upload this file". (use attached file in this ticket) Click "Import groups". Confirm messages below are shown after import. Group Test Import Group 1 added successfully Grouping Test Grouping 1 added successfully Group Test Import Group 1 added to grouping Test Grouping 1 successfully Group Test Import Group 2 added successfully Group Test Import Group 2 added to grouping Test Grouping 1 successfully Click "Test Import Group 1" in the "Groups" box and click "Edit group settings". Confirm "Custom field group 1" is in "Group custom field" in the "Test group custom field category". Click "Cancel" to back to the Groups screen. Click "Test Import Group 2" in the "Groups" box and click "Edit group settings". Confirm "Custom field group 2" is in "Group custom field" in the "Test group custom field category". Click "Cancel" to back to the Groups screen. Go to "Groupings" page. Click cog icon for the row "Test Grouping 1". Confirm "Custom grouping 1" is set for "Grouping custom text" in the "Test grouping custom field category". Test backup/restore Go to the created course. Go to "Course reuse" in "More" dropdown link in the course menu. Choose "Backup" from the dropdown. Make sure the option "Include groups and groupings" is ticked, and click "Jump to final step". Click "Continue" to finish backup. Click "Restore" in the "Course backup area". In the "1. Confirm" section, click "Continue". In the "2. Destination" section, click something category in the "Restore as a new course > Select a category" section, then click "Continue". In the "3. Settings" section, make sure "Include groups and grouping" is ticked, then click "Next". In the "4. Schema" section, click "Next". in the "5. Review" section, click "Perform restore". In the "7. Complete" section, click "Continue". You are in the copied course. Click "Participants". Go to groups page. Confirm there are "Test CF group", "Test Import Group 1", and "Test Import Group 2". Choose "Test CF group" and click "Edit group settings". Confirm "Group updated value" is set for "Group custom text" in the "Test group custom field category". Click "Cancel", choose "Test Import Group 1", and click "Edit group settings". Confirm "Custom field group 1" is in "Group custom field" in the "Test group custom field category". Click "Cancel", choose "Test Import Group 2", and click "Edit group settings". Confirm "Custom field group 2" is in "Group custom field" in the "Test group custom field category". Click "Cancel" to back to the Groups screen. Go to "Groupings" page. Click cog icon for "Test CF grouping" row. Confirm "Grouping updated value" is set for "Grouping custom text" in the "Test grouping custom field category". Click cog icon for the row "Test Grouping 1". Confirm "Custom grouping 1" is set for "Grouping custom text" in the "Test grouping custom field category".

    Description

      I would like to suggest the improvement of the Custom fields API introduced in Moodle 3.7 https://docs.moodle.org/dev/Custom_fields_API   with the implementation of Custom fields API in the Group and Grouping context.

      This issue could be added to the epic https://tracker.moodle.org/browse/MDL-64626

      Rough tasks:

      • [x] A new admin page for creating custom fields
      • [x] New permissions
      • [x] A new custom fields handler 
      • [x] Update group edit form 
      • [x] Update groups related web services 
      • [x] Update related lib functions (if required)
      • [x] Update csv import/export
      • [x] Update backup/restore
      • [x] Unit tests
      • [x] Behat tests

      Attachments

        Issue Links

          Activity

            People

              tomotsuyuki Tomo Tsuyuki
              adrianjtroncoso Adrián J. Troncoso
              Dmitrii Metelkin Dmitrii Metelkin
              Ilya Tregubov Ilya Tregubov
              Kim Jared Lucas Kim Jared Lucas
              Votes:
              5 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours, 58 minutes
                  2h 58m

                  Clockify

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