Upload enrolment methods

Administration tool ::: tool_uploadenrolmentmethods
Maintained by Eoin Campbell
This plugin allows administrators add the "Course meta link" and "Cohort sync" enrolment methods to a range of courses from a CSV file, and specify the role for the methods participants. They can also delete, enable or disable existing enrolment methods in a course.
Latest release:
713 sites
384 downloads
49 fans
Current versions available: 2

This plugin is an enhanced version of the Upload Metacourse links block plugin on which it is based. It also provides a good work-around for a long-standing issue with the Course upload facility whereby enrolment methods are not fully supported.

Use the command Site administration > Plugins > Enrolments > Upload enrolment methods to upload a CSV file containing lines of the form:

operation, enrolment method, target course shortname, parent course shortname or cohort idnumber, disabled, group[, role]

Note that version 1.2.x requires fields in a fixed order (as above) with no heading line, but version 1.3.0. now supports an initial heading line, and allows you specify the delimiter, e.g.

operation,method,shortname,metacohort,disabled,group[,role]
add,meta,CS101-2345,Computing-Year3,1,CS101,student
upd,meta,CS101-2344,Computing-Year1,0,CS101,editingteacher

Each line of the file contains one record.
Each record is a series of data in any order separated by a specified delimiter.
All fields are required, except role, which is optional for backwards compatibility.
The allowed operations are add, del(ete), and upd(ate).
The allowed methods are 'meta' and 'cohort'.
The allowed disabled status values are 0 (enabled) and 1 (disabled).
The group field is the name of a group into which enrolled students should be placed. It will be created if it doesn't already exist.
The role field must be a valid role name such as editingteacher, student, etc.

This plugin enhances the original in that it is possible to disable existing enrolment methods in batch mode, and also that it can add an enrolment method to a course but leave it disabled.


Screenshots

Screenshot #0

Contributors

Eoin Campbell (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Nancy Nalmpanti
    Fri, 21 Aug 2020, 11:05 PM
    Hi Eoin, I keep receiving result: "Cohort not found."
    Has anyone managed to add cohort sync in moodle 3.9.1?
  • Eoin Campbell
    Sat, 22 Aug 2020, 12:00 AM
    I think the problem might be that you have to match on the cohort ID number, not the name.
  • Nancy Nalmpanti
    Sat, 22 Aug 2020, 12:10 AM
    Resolved! the first line has to contain the following field headings: operation,method,shortname,metacohort,disabled[,group,role] (don't comment them out)
    Thank you for the great tool Eoin smile
  • Eoin Campbell
    Sat, 22 Aug 2020, 12:28 AM
    I've just fixed the documentation on the Description to mention the heading columns, which I just added in version 1.3.0.
  • Jacques Barzic
    Tue, 6 Oct 2020, 10:18 PM
    Hi,
    I've install the plugin and it works fine.
    I've a question/suggesion:
    Now, use this plugin is only possible for "Site Administrator".
    Is there now a solution to allow this plugin for "site manager"?
    If no, my suggestion is to do that in a future version wink.
  • Dean Handby
    Tue, 23 Feb 2021, 6:26 AM
    Hello,

    Just wondering whether something can be tweaked to accompany two cohort syncs adds in one go via .csv file?

    Currently when doing this, it says the enrolment method already used and will not enrol the second cohort sync group.

    Is there a way around this?

    Thanks
  • Eoin Campbell
    Wed, 24 Feb 2021, 10:03 PM
    I checked this out and you can add 3 different cohorts to the same course in a single file, and you can also add the same cohort into 2 different courses in the same CSV file. Can you explain your problem a bit better?
  • Dean Handby
    Thu, 8 Apr 2021, 12:29 PM
    Hi,

    Sorry for the delay in replying. Basically we have multiple roles in our system in which we would like to allocate by using this method.

    Exam1 with student-cohort with role "RS" and "RI" these roles are different in their nature but have the required outcome.

    Because you cannot specify multiple roles in the upload without a second line. It says the "enrolment method already linked to course" pops up rejecting the action.

    Example 1 which works.
    Operation,method,shortname,metacohort,disabled,role
    add,cohort,Test1,Student-cohort,0,rs
    add,cohort,Test2,Student-cohort,0,rs

    Example 2 which fails
    Operation,method,shortname,metacohort,disabled,role
    add,cohort,Test1,Student-cohort,0,rs (Have also tried combinations of rs,ri in this line) nothing seems to work.
    add,cohort,Test1,Student-cohort,0,ri

    I hope this makes sense.

    Kind Regards,
    Dean



  • Maxime Cruzel
    Wed, 21 Apr 2021, 11:01 PM
    Hello,

    Worked for a cohort method but in the metacohort column :
    Fail with cohort ID
    Success with cohort short name
  • Eoin Campbell
    Sun, 25 Apr 2021, 5:17 PM
    Hi Maxime, I would need more information to take a look at this. If you think its a bug, use the Bug tracker at https://github.com/ecampbell/moodle-tool_uploadenrolmentmethods/issues
  • Joanne Tucker
    Tue, 5 Oct 2021, 10:57 PM
    This is a very useful tool! Has anyone else seen error messages relating to the tool, when editing roles? Error message seems to suggest there a missing string in the languages file:

    Invalid get_string() identifier: 'uploadenrolmentmethods:add' or component 'tool_uploadenrolmentmethods'. Perhaps you are missing $string['uploadenrolmentmethods:add'] = ''; in C:\wamp64\www\moodle/admin/tool/uploadenrolmentmethods/lang/en/tool_uploadenrolmentmethods.php?
    line 353 of \lib\classes\string_manager_standard.php: call to debugging()
    line 7284 of \lib\moodlelib.php: call to core_string_manager_standard->get_string()
    line 2589 of \lib\accesslib.php: call to get_string()
    line 2434 of \lib\accesslib.php: call to get_capability_string()
    line 118 of \admin\roles\classes\capability_table_base.php: call to get_capability_docs_link()
    line 135 of \admin\roles\classes\capability_table_with_risks.php: call to core_role_capability_table_base->display()
    line 708 of \admin\roles\classes\define_role_table_advanced.php: call to core_role_capability_table_with_risks->display()
    line 257 of \admin\roles\define.php: call to core_role_define_role_table_advanced->display()

    I'm running Moodle 3.11 with the latest version of UploadEnrolmentMethods (v 1.3.4)
  • Carly Born
    Thu, 28 Oct 2021, 11:03 PM
    Thank you for this plugin, I've been using it successfully for a year or so now. however, today, I cannot get it to work properly. It continues to say that it can't find the courses, although they do exist. I've tested a little bit, and cannot figure out why it's not finding a course that I can verify is in the database.

    I'm using UploadEnrolmentMethods (v.1.3.4), and Moodle 3.9.10

    Do you have any ideas?
  • Eoin Campbell
    Sat, 30 Oct 2021, 8:36 PM
    If you work in Excel (in a non-English language) and save to CSV, perhaps the delimiters are wrong. Send CSV fragment to help@moodle2word.net and I can take a look. I have in the past attempted to upload the enrolment CSV file on the wrong Moodle page, "Upload courses" rather than "Upload enrolment methods". If the course shortname contains non-ASCII characters or commas, that will also cause problems.
  • So Phi
    Wed, 12 Jan 2022, 10:13 PM
    Hi Eoin,

    thanks for this great plugin. It saves SO MUCH time!! smile

    Regards

    Sonja
  • Jose Pico
    Wed, 2 Feb 2022, 1:17 PM
    Hi Eoin,

    Thank you so much for this plugin. It's been of great help for my team. However, while doing QA processes around the define roles functionality, the below warning came out. Another user reported this back in October 2021, and would like to add that adding the missing strings to the plugin's language file solve the warning.

    Invalid get_string() identifier: 'uploadenrolmentmethods:add' or component 'tool_uploadenrolmentmethods'. Perhaps you are missing $string['uploadenrolmentmethods:add'] = ''; in C:\wamp64\www\moodle/admin/tool/uploadenrolmentmethods/lang/en/tool_uploadenrolmentmethods.php?
    line 353 of \lib\classes\string_manager_standard.php: call to debugging()
    line 7284 of \lib\moodlelib.php: call to core_string_manager_standard->get_string()
    line 2589 of \lib\accesslib.php: call to get_string()
    line 2434 of \lib\accesslib.php: call to get_capability_string()
    line 118 of \admin\roles\classes\capability_table_base.php: call to get_capability_docs_link()
    line 135 of \admin\roles\classes\capability_table_with_risks.php: call to core_role_capability_table_base->display()
    line 708 of \admin\roles\classes\define_role_table_advanced.php: call to core_role_capability_table_with_risks->display()
    line 257 of \admin\roles\define.php: call to core_role_define_role_table_advanced->display()

    Solution: Add the below to the tool_uploadenrolmentmethods.php
    $string['uploadenrolmentmethods:add'] = 'Add/Upload enrolment methods';
    $string['uploadenrolmentmethods:delete'] = 'Delete enrolment methods';

    Kind regards,
    Jose
1 2 3
Please login to post comments