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

CLI Script for User Enrolment

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 4.3
    • Administration
    • None
    • MOODLE_403_STABLE
    • MDL-79794-enrol-user-script
    • Easy
    • Hide

      1. You should have CLI access to the server where Moodle is installed.

      2. Access the Moodle Root Directory: 

      3. Enroll a User as a Student (default role):

      `php admin/enrol.php --user=[username] --courseid=[courseID]`

      4. Enroll a User as a Teacher:

      `php admin/enrol.php --user=[username] --courseid=[courseID] ---role=teacher`
       

      Show
      1. You should have CLI access to the server where Moodle is installed. 2. Access the Moodle Root Directory:  3. Enroll a User as a Student (default role): `php admin/enrol.php --user= [username] --courseid= [courseID] ` 4. Enroll a User as a Teacher: `php admin/enrol.php --user= [username] --courseid= [courseID] ---role=teacher`  

      This pull request introduces a refined CLI script aimed at facilitating the enrolment of users into courses. The script is designed to be run from the command line, providing a straightforward and efficient method for administrators to enrol users into specified courses with designated roles.

      Key Functionalities:

      1. User Enrolment: Administrators can easily enrol users into courses by specifying the username, course ID, and role.

      2. Role Assignment: The script allows for the assignment of roles during the enrolment process, supporting different role types like student, teacher, etc.

      3. Help Option: A help option is provided to guide administrators on the usage of the script, outlining the necessary parameters and providing example commands.

      4. Error Messages: In case of missing or incorrect input, the script provides clear error messages to aid in troubleshooting.

      5. CLI Maintenance Mode Awareness: The script is aware of CLI maintenance mode and will suspend execution if this mode is active, ensuring system integrity during maintenance operations.

      This enhanced script aims at streamlining the user enrolment process, making it a valuable tool for Moodle administrators in managing course enrolments efficiently from the command line interface.

            Unassigned Unassigned
            erseco ernesto
            Matt Porritt Matt Porritt
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 30 minutes
                30m

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