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

Bulk assign roles in course categories when using Upload users

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      To test with the sample test file:

      1, Create MGMT category:

      Go to Site administration > Courses tab > Add a category. Set category name and id number to be 'MGMT', then click "Create category".

      2, Create course management1 under MGMT category:

      Go to Site administration > Courses tab >Add a new course. Enter course full name and course short name as management1. Then click "save and display".

      3, Upload users:

      Go to Site administration > Users tab > Upload users. Drop upload_users.csv to the file upload area and click "Upload users".

      In Upload users preview, see that users here have category MGMT and categoryrole student.

      Click "Upload users", verify that no error message is logged through Enrollment column.  Verify that at the bottom of the page, it says "Users created: 2 Users skipped: 0 Errors: 0". Click "Continue".

      4, Verify category role:

      Go to Site administration > Courses tab > Manage courses and categories. Go to category MGMT > Assign roles  (small gear next to it), verify that there are 2 users with role 'manager' and their other information match with upload_users.csv.

      5, Verify course role:

      Go to the course page for management1, click on Participant, verify that there are 2 users with role 'student'(category role) and 'teacher'(specific course role) and their other information match with upload_users.csv.

      Show
      To test with the sample test file: 1, Create MGMT category: Go to Site administration > Courses tab > Add a category. Set category name and id number to be 'MGMT', then click "Create category". 2, Create course management1 under MGMT category: Go to Site administration > Courses tab >Add a new course. Enter course full name and course short name as management1. Then click "save and display". 3, Upload users: Go to Site administration > Users tab > Upload users. Drop upload_users.csv to the file upload area and click "Upload users". In Upload users preview, see that users here have category MGMT and categoryrole student. Click "Upload users", verify that no error message is logged through Enrollment column.  Verify that at the bottom of the page, it says "Users created: 2 Users skipped: 0 Errors: 0". Click "Continue". 4, Verify category role: Go to Site administration > Courses tab > Manage courses and categories. Go to category MGMT > Assign roles  (small gear next to it), verify that there are 2 users with role 'manager' and their other information match with upload_users.csv. 5, Verify course role: Go to the course page for management1, click on Participant, verify that there are 2 users with role 'student'(category role) and 'teacher'(specific course role) and their other information match with upload_users.csv.
    • Affected Branches:
      MOODLE_37_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      When using Upload users (https://docs.moodle.org/37/en/Upload_users), we would like to bulk assign roles (e.g. teacher) within a course category. For instance, if in the CSV file we have columns (username, category, role) and one row (MyUser, humanities, teacher), then after creating the user, MyUser should have been assigned teacher role to materials under humanities category.

      Test file upload_users.csv is attached below.

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Aurora Jiang Aurora Jiang
              Peer reviewer:
              Mathew May
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 30 minutes
                1h 30m