Giter Club home page Giter Club logo

moodle-local_profilecohort's Introduction

moodle-local_profilecohort

Moodle Plugin CI

Moodle plugin which lets admins manage cohort memberships based on users' custom profile fields

Requirements

This plugin requires Moodle 4.3+

Motivation for this plugin

Moodle core provides a mechanim to manually fill cohorts with users (on Site administration -> Users -> Accounts -> Cohorts). This is fine for small Moodle installations where the cohort members don't change too often and where the Moodle admin has plenty of time to update the cohorts.

Now, larger or fragmented Moodle installations may have the need to manage a large number of cohorts which have a large amount of members and which may also change quite often. Managing cohorts by hand in such scenarios is simply unprofessional overkill - even / particularly if you distribute the work among multiple Moodle admins.

On the other hand these large or fragmented Moodle installations might already have some custom user profile fields which can be leveraged to decide which cohort(s) a user should be a member of. This plugin implements a simple solution to manage cohort memberships based on a users' custom profile field.

Installation

Install the plugin like any other plugin to folder /local/profilecohort

See http://docs.moodle.org/en/Installing_plugins for details on installing Moodle plugins

Usage & Settings

After installing the plugin, it does not do anything to Moodle yet.

To configure the plugin and its behaviour, please visit: Site administration -> Users -> Accounts -> Profile field based cohort membership.

There, you find four tabs:

1. View / edit rules

On this tab, you define the rules mapping custom user profile fields to the cohorts the user will be added to. The defined rules are processed in the order that they are displayed. However, a user matching multiple rules will be added to all the relevant cohorts.

2. Add new rule

When you use the plugin for the first time and there are no rules yet, this is the tab you will be shown second.

On this tab, you can add a new rule mapping a custom user profile field's value to a cohort the user will be added to.

If no custom user profile fields have been defined in your Moodle installation yet, you need to define custom user profile fields first on /user/profile/index.php before you can add rules here.

3. Cohort members

On this tab, you can see the users who are currently members of the cohorts which are managed by this plugin.

This list is just a simple fill-in for a missing managed cohort members list in Moodle core (see below for details), but is sufficient for checking if the cohorts are filled properly.

4. Select cohorts to be managed

When you use the plugin for the first time, this is the tab you will be shown first.

On this tab, you select the cohorts you want this plugin to manage.

Once selected, you will not be able to manually update the members of these cohorts anymore. Furthermore, any users who are currently a member of these cohorts will be removed from the cohorts and the cohorts are then filled from scratch with the users matching the rule(s) you create with this plugin.

If you decide to stop managing a cohort with this plugin and deselect it here, all users who are currently a member of this cohort will keep being a member. Additionally, you will be able to manually update the members of this cohort again.

Capabilities

This plugin does not add any additional capabilities.

How this plugin works

Besides the manual management of cohorts in Moodle core, Moodle is already prepared to let cohorts be managed by plugins. This plugin just leverages this prepared mechanism and marks existing cohorts as managed by local_profilecohort as soon as they are selected to be managed in the plugin.

For adding members to the cohorts, this plugin simply listens for the \core\event\user_loggedin, \core\event\user_loggedinas, \core\event\user_created and \core\event\user_updated events, checks all existing rules and adds the user to the cohorts matching for his custom user profile field values respectively removes him from all managed cohorts which he is already a member but does not match any rules anymore.

Additionally, there is a scheduled task which is used to update the cohorts of all affected users as soon as you create, change or delete any rule in the plugin. Depending on the configuration of your scheduled tasks in Moodle and the cronjob on the Moodle server, there might be a short delay before all user memberships in the cohorts are updated. Nevertheless, any user who logs in before the background task is finished will be updated immediately. If you want to check the plugin's scheduled task, please visit Site Administration -> Server -> Scheduled tasks and search for the "Update cohorts from custom user profile fields" task.

Relation to Totara audiences

There is a long-standing similar (and even more powerful) mechanism in Totara (https://www.totaralms.com/) called "audiences". This plugin was inspired by Totara audiences, but does neither reuse its code nor strive to fully reimplement it for Moodle.

Companion plugin local_cohortrole

This plugin provides a mapping from custom user profile fields to cohorts. If you are looking for a mapping from custom user profile fields to system roles, you might want to look at local_cohortrole as a companion plugin.

local_cohortrole is maintained by Paul Holden and published on https://moodle.org/plugins/local_cohortrole. The development of this plugin and local_cohortrole is not related or synchronized in any way, we just want to recommend it as a solution approach as we are using both plugins in combination in production.

Managed cohorts member list in Moodle Core

Unfortunately, Moodle core does not have a members list for managed cohorts. That's why we added this member list to this plugin as a fill-in.

However, we created a Moodle tracker ticket on https://tracker.moodle.org/browse/MDL-58840 which proposes to add a managed cohorts member list to Moodle core.

Please vote for this ticket if you want to have this realized.

Theme support

This plugin acts behind the scenes, therefore it should work with all Moodle themes. This plugin is developed and tested on Moodle Core's Boost theme. It should also work with Boost child themes, including Moodle Core's Classic theme. However, we can't support any other theme than Boost.

Plugin repositories

This plugin is published and regularly updated in the Moodle plugins repository: http://moodle.org/plugins/view/local_profilecohort

The latest development version can be found on Github: https://github.com/moodle-an-hochschulen/moodle-local_profilecohort

Bug and problem reports / Support requests

This plugin is carefully developed and thoroughly tested, but bugs and problems can always appear.

Please report bugs and problems on Github: https://github.com/moodle-an-hochschulen/moodle-local_profilecohort/issues

We will do our best to solve your problems, but please note that due to limited resources we can't always provide per-case support.

Feature proposals

Due to limited resources, the functionality of this plugin is primarily implemented for our own local needs and published as-is to the community. We are aware that members of the community will have other needs and would love to see them solved by this plugin.

Please issue feature proposals on Github: https://github.com/moodle-an-hochschulen/moodle-local_profilecohort/issues

Please create pull requests on Github: https://github.com/moodle-an-hochschulen/moodle-local_profilecohort/pulls

We are always interested to read about your feature proposals or even get a pull request from you, but please accept that we can handle your issues only as feature proposals and not as feature requests.

Moodle release support

Due to limited resources, this plugin is only maintained for the most recent major release of Moodle as well as the most recent LTS release of Moodle. Bugfixes are backported to the LTS release. However, new features and improvements are not necessarily backported to the LTS release.

Apart from these maintained releases, previous versions of this plugin which work in legacy major releases of Moodle are still available as-is without any further updates in the Moodle Plugins repository.

There may be several weeks after a new major release of Moodle has been published until we can do a compatibility check and fix problems if necessary. If you encounter problems with a new major release of Moodle - or can confirm that this plugin still works with a new major release - please let us know on Github.

If you are running a legacy version of Moodle, but want or need to run the latest version of this plugin, you can get the latest version of the plugin, remove the line starting with $plugin->requires from version.php and use this latest plugin version then on your legacy Moodle. However, please note that you will run this setup completely at your own risk. We can't support this approach in any way and there is an undeniable risk for erratic behavior.

Translating this plugin

This Moodle plugin is shipped with an english language pack only. All translations into other languages must be managed through AMOS (https://lang.moodle.org) by what they will become part of Moodle's official language pack.

As the plugin creator, we manage the translation into german for our own local needs on AMOS. Please contribute your translation into all other languages in AMOS where they will be reviewed by the official language pack maintainers for Moodle.

Right-to-left support

This plugin has not been tested with Moodle's support for right-to-left (RTL) languages. If you want to use this plugin with a RTL language and it doesn't work as-is, you are free to send us a pull request on Github with modifications.

Maintainers

The plugin is maintained by
Moodle an Hochschulen e.V.

Copyright

The copyright of this plugin is held by
Moodle an Hochschulen e.V.

Individual copyrights of individual developers are tracked in PHPDoc comments and Git commits.

Initial copyright

This plugin was initially built by
Davo Smith
Synergy Learning UK
www.synergy-learning.com

on behalf of
Ulm University
Communication and Information Centre (kiz)

and maintained and published by
Ulm University
Communication and Information Centre (kiz)
Alexander Bias

It was contributed to the Moodle an Hochschulen e.V. plugin catalogue in 2022.

moodle-local_profilecohort's People

Contributors

abias avatar davosmith avatar kathrin84 avatar lucaboesch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

moodle-local_profilecohort's Issues

Cohort duplicated when new field added

Hi,

Maybe I do something wrong.

1- I created a single entry template.
{{ department }}

2- Then, I want to add a new value to generate new cohorts. So I add a line to my template choosing LF delimiter (Linux server):
{{ department }}
{{ institution }}

All my department existing cohorts were duplicated. And the old cohorts no longer get synchronized.

dynamic updating of cohorts based on field changes

maybe I was just getting a little overly optimistic about this... but I was under the impression that if a users' custom profile field changed that the users' cohort assignments/enrollments would also update dynamically. My testing, so far has disproved this... (or maybe there's a step I'm missing?) ... if it is capable of dynamically managing cohort assignment, rather than just running a one-time process at the time it's configured/assigned, that would make this tool absolutely foundational (and even relevant enough for me to implement it across our 2000 cohorts...but would also require the pagination request I saw elsewhere)

Pagination required

Hello, this plugin is very handy. The only problem we have with it is that it loads very slowly when there are lots of rules as in our case. We have nearly 500 rules (https://MYMOODLEURL.com/local/profilecohort/index.php) and the page takes a good minute to load all of the data. Can you add pagination as a setting so admins can choose to display let's say 50 rules per page?

Feature request: Display of the number of members in the group members overview

There are two pieces of information that interest me in connection with the plugin:
a) The members of a global group
b) The number of members of a global group

I can see the number of members of a global group in the normal settings of the system.
I can see the members of a global group in the plugin.

It would be nice if I could also see the number of members of a group in the plugin itself: "cohort member"-site, behind the names of the groups
The addition is quickly implemented. - Thanks for the good structure.
This may also be relevant for other people.

No Default values

This plugin seems to be what we need, and its by far one of the best written plugins I've seen, kudos to you guys!

I just that can't pass the error "No custom user profile fields have been defined.
You need to define custom user profile fields before you can add rules here - please visit User profile fields to create at least one custom user profile field
" even though I created custom fields.

There is a similar case already, but the resolution does not seems to be the same for my case..

Thanks in advance for any support.

Some Users are skipped

We have set up a profile field base cohort that is based off of two checkbox style profile fields. The rules are set up to assign users to a cohort if value 1 is "No" and value 2 is "Yes". The rule works for a vast majority of the users (3600+), but we have found there is a subset (35) of users that are not added. Of the 35 users, we verified that none are suspended or deleted. We also reviewed their login activity and nearly all of them had recent logins. We also reviewed mdl_user.lastlogin and mdl_user.timemodified and determined that many had very recently logged in or changed their account profile; two of the events that should trigger cohort membership (in addition to the regularly scheduled task that updates the cohort).

including moodle core profile fields

Is it also possible to integrate the moodle standard profile fields such as e-mail or Institution to make a profile field based assignment to global groups?

Make sure that the scheduled task really updates all cohorts

It has been reported outside Github that the scheduled task apparently does not update all existing cohorts / rules for all users. There may be cases when a user's profile field value is changed, his cohort memberships are not updates until his next login even though the schedule task runs properly in the meantime.

This behaviour should be investigated.

Bug: the rule overview does not always load with many rules

Hello!
I use the user profile data to set groups for all courses and their semesters: that makes 250 rules.
The rule overview does not always load and the page remains empty. A reload usually helps.
I haven't noticed any problems with saving changes in the rule overview.
I still have to test how the system reacts when I add more rules.

Moodle: 3.11.13+ / Plugin: v3.11-r4 (2021061303)

Best regards
Stephan

Remove duplicate heading

On recent Moodle 4 versions, this plugin shows a duplicate heading:

grafik

The second heading could be removed.

Bulk removal of Cohort members

Hi!

First of all THANK YOU! for this plugin, it does really help my site administration. I would like to add a suggestion to bulk remove the members once the cohort doesn't applies to them. For instance, If I add a cohort of 150 users, it works perfectly. But if the member needs to change, I have to remove the users one by one. If there was a way to remove them in bulk, that would be awesome.

Thanks and be safe!

show number of users in a cohort in parenthesis beside cohort name.

Hello, just a small feature proposal.
Under "Cohort Members" (administration -> users -> profile field based cohort membership) the cohort names are displayed as well as a dropdown arrow to the left of them. I.e.:

Cohort 1
Cohort 2
Cohort 3
etc.

I'd like to propose showing the current total number of users in each cohort in parenthesis beside the Cohort Name and dropdown arrow:

Cohort 1 (27)
Cohort 2 (31)
Cohort 3 (14)
etc.

Thank you for this plugin.

The cron job is not performing

The cron job is not perform until the updatecohort is enable in config.
But where i can go and enable the updatecohort?
I manually enabled through database. it works fine.

update_all_cohorts_from_rules includes deleted users

The sql in update_all_cohorts_from_rules could include a check that the user is not deleted before adding them to a cohort to avoid adding deleted users to cohorts based on the custom user profile fields.

There is an argument that Moodle should, when a user is deleted, remove those mdl_user_info_data records, however we have seen instances in Moodle databases where this is not the case (i.e. this query returns rows: select * from mdl_user_info_data where userid in (SELECT id FROM mdl_user where deleted=1);)

We recently discovered that this plugin had added deleted users to a cohort which then caused an issue trying to assign a role to members of that cohort.

Auto Enrol and Profile based cohorts

Hi,
When I installed this plugin. The autoEnrol Cohort plugin stops working. I like the flexibiblity of your rules but cannot afford to lose out on the autoenrol cohort plugin feature of using standard Moodle fields to enrol users into a cohort.
What do you think is the way out?

Feature request: skip disabled users

Disabled users are also sorted into global groups if the rules match.
It would be nice if you could determine in the plugin or in the individual rules that deactivated users are not assigned.

I implemented a general restriction in the plugin myself. - Thanks for the good setup.
This may also be relevant for other people.

Updating members in cohorts automatically

Hi,

First of all, thanks a lot for your amazing job with this plugin. Is really usefull for some large installations we are building.

Is there any way to run a task that match the users with their cohort? We only achieve to do the match when the user lo g in the platform but we would like to check that the user belongs to the cohort as soon as hi/she match the rule.

Thanks a lot!

Do not update cohort membership at user login (provide option)

Hello, we have a huge number of users on our Moodle and they often log in at the same time. It is possible to have an option to not execute the profile check upon log in, but only by the scheduled task?

Actually I remember such an option, but I cannot find it anymore, maybe it was from a different plugin.

Thank you for your attention.

enhancement in rule

If it is possible you can add "from"- "to" or <= and >=, now we are using exact match.
so that rule list can be minimized.

Rules do not work correctly if the user profile field is numerical

I had an issue in my set of rules with a user field that had one-digit numbers as values (standing for the semester number - like 1, 2, 3 ...). All the rule sets (two or three rules connected with AND) that had this field gave incorrect results or just no results (empty sets).
I finally resolved the problem changing numerical values to textual representation (like 2 -> 'two'). Now all the rule sets give correct results.
As a side effect, an error was generated when the first value from the pull-down list (of numerical values) was selected, preventing from creating the rule.
I am on Moodle 3.8.1, PHP 7.4, ArchLinux system.

Delete rule not and move to position not working

We're having a problem trying to delete rules and move their position.

When we select a rule to be deleted, it does get highlighted and crossed out but when we hit save the rule it still shown.

When we try to move a rule, changing the value in the dropdown successfully moves the rule to the new position but when we hit save it returns to its previous position.

Are we doing something wrong?

Aside from that, this is a fantastic plugin that we could not live without!

Moodle version: 3.9.17
Plugin version: v4.0-r1 (2022071200)

No custom profile fields listed in add new rule tab

After a not torough update from moodle 3.10 to moodle 3.11.7 (by our supplier), all our cohorts based on a conditional profilefield are empty.

Sysadmin updated this plugin from 3.10 to 3.11, entries are still in local_profilecohort table but all our cohorts (more than 70 with 20k users) are now empty.

Any clues why conditional customfields are not taken in charge?

Thank for any help you could provide.

Rules not applied to new users created with LDAP sync scheduled task

I Have Moodle with standard LDAP authentication, without any LDAP plugin customization. When user login to the system for the first time, the rule is applied in he becomes the member of the cohort. Then I deleted the user, ran the auth_ldap\task\sync_task that authomatically creates users from LDAP. The same user with the same data is created again but this time the user is not added to the cohort. If I update any data in user profile in LDAP and then run the auth_ldap\task\sync_task again, then he is added to the cohort as it should be. So the issue is only with creating new users with auth_ldap\task\sync_task. Scheduled task \local_profilecohort\task\update_cohorts doesn't fix the issue because it updates cohort membership only if the rule has changed or created.
I checked the logs an there is a record of creating the user so it appears that the user creating event is triggered.

I tested and reproduced this issue on two Moodle installation with different LDAPs: one is Moodle 3.7.2+ (Build: 20191012) connected to MS Active Directory and the other is Moodle 3.6.3+ (Build: 20190322). I installed latest version of the plugin on both systems.

Simple suggestion of the workaround would be to add another scheduled task that updates all membership to all users regardles of changes done to user profile data. We could run that task every night to catch those users not covered with create user event.

Support date time custom profile fields

We have a use case when we would like to split users based on date time user profile field. In our case we would like to get users with specific date or later.

Feature request: optical adjustment of the rule overview

Hello!
I use the user profile data to set groups for all courses and their semesters: This gives me 250 rules.
With this number of rules, the overview suffers a little.
Moodle: 3.11.13+ / Plugin: v3.11-r4 (2021061303)

It would be good if the individual rules could be distinguished quickly. - I am attaching an example.
An extension to this would be if the associated rules were given the style of one line.
For clarity, a view with page selection would be good, where you can select the number of displayed elements: 25, 50, 75, 100, all

Best regards
Stephan

raw-scss.txt

Add access capabilities

Adding capabilities to the plugin would be great. Since there are capabilities to manage cohorts themselves without having to be an admin, adding them to this plugin would make sense. I think two would make the most sense:

  • Manage rules - capability to add, change, delete rules
  • View rules - capability to view the rules for particular cohort.

I like this plugin, especially being able to reproduce functionality found in Totara

Default Values don't appear

Hello

We have set some default values for our Custom Fields. When we assign these field values to the learners, nothing seems to assign the cohorts, however, if we export the data and then reimport it using a UTF-8 CSV file, then it assigns the relevant information to the cohort.

For example -
Internal staff - Employed
Contractors - Contractor
External Users - External

We don't get everything imported, as we have 8 admin users, so these get left behind - and these are not synchronised to the Employed cohort.

Thanks in Advanced
John

make this plugin more robust against moodle-bugs: make an option to sync cohorts every night

This is not really a bug-report for this plugin, but a proposal for a more robust design, and maybe an explanation for #38 #40 #30 #29 #32 .
The design of this plugin, when to update cohorts, should work when the rest of Moodle, around this plugin, works as expected. But in real life Moodle or other plugins will have bugs and this could lead to incoherent cohorts, which will stay incoherent forever.

our Setup

  • BelWü-hosted Moodle 4.0.2 with php-caching
  • v4.0-r1 of this plugin

my story behind

Until a few weeks ago I used the "smartcohort"-plugin to fill my cohorts automatically. As this plugin does not work with Moodle 4 anymore, I switched to this plugin. While testing and experimenting with some test-cohorts and -rules I experienced, that, on our installation, this plugin did not work as described in the readme.

Together with the BelWü-support we found out that we are faced with (another) Moodle4-caching-problem:

  • upon an change in a rule, this plugin sets the "updatecohort"-config-var with "set_config" here:
    set_config('updatecohorts', true, 'local_profilecohort');
  • in the underlying sql-database I can immediately observe that in the table "mdl_config_plugins", in the line with "plugin=local_profilecohort name=updatecohorts" the field "value" changes from "0" to "1".
  • the update_cohorts-task of this plugin, called by cron, checks this config-var with get_config here:
    if (get_config('local_profilecohort', 'updatecohorts')) {
  • ...and the reproducible observation is, that, within our setup mentioned above, cohorts will never be updated and the "updatecohorts"-field in the database will never change to "0", so this if-condition must have been false

It turned out that clearing the (php-)caches solves this problem for at least the next run of the update_cohorts-task, maybe even for some hours. But at least on the next day updating cohorts upon a changed rule wont work anymore.

So the conclusion is: set_config / get_config is broken in Moodle 4.0.2 when using (php-)caching on your server. Maybe the real problem is within set_config, maybe this method writes to the database, but does not update the content of the cache correctly.

The temporary workaround from the BelWü-support is to not use get_config, but to access the database directly:

    public function execute() {
        global $DB;
        $record = $DB->get_record("config_plugins", Array("plugin" => "local_profilecohort", "name" => "updatecohorts"), $fields = "value");
        if ($record->value == "1") {
        // if (get_config('local_profilecohort', 'updatecohorts')) {
            $manager = new profilecohort();
            $manager->update_all_cohorts_from_rules();
            set_config('updatecohorts', '0', 'local_profilecohort');
        }

...which makes "update the cohorts on the change of a rule" work again.

But, I experienced another problem:

  • if I make a change to a Moodle-user "by hand", through the admin-interface, this change reaches the cohort-mapping. (In this case the update_cohorts-task isn't involved, this is made with the \core\event\user_updated -event)
  • if the Ldap-plugin makes a change to a Moodle-user, because of a change in the external user-database, this change would not reach the cohorts.
    Maybe this is "just" another caching-problem or maybe the Ldap-plugin does not call \core\event\user_updated correctly.

proposal

As said above I didn't consider this as a real bug of this plugin, as using
set_config, get_config and
\core\event\user_loggedin, \core\event\user_loggedinas, \core\event\user_created and \core\event\user_updated events
is recommended in the developper-docs, e.g. here:
https://docs.moodle.org/dev/Developer_FAQ#How_do_I_get.2Fset_configuration_settings.3F

But in the real wild things often do not work as they should. The Moodle-core itself or other plugins will have bugs.

The design of this plugin is in a way that it relies on the correct work of the code around it. There is no mechanism correcting incoherent cohorts, regardless why they got incoherent.

So, how about

  • a configurable option for the update_cohorts-task to make him call update_all_cohorts_from_rules() every night?
  • or, alternatively offer a second task, which could be as simple as a copy of the update_cohorts-task without the if-branch
    public function execute() {
            $manager = new profilecohort();
            $manager->update_all_cohorts_from_rules();
            set_config('updatecohorts', '0', 'local_profilecohort');
        }

The original task could be called from cron e.g. every 15min, but is resource-friendly watching the updatecohorts-config-var.
The second task could be called every 12 or 24 hours syncing all cohorts and correcting everything which went wrong before.

[As this is my first post here: Many thanks for this plugin and all the work with it!]

Permissions for custom roles to use this plugin on user creation

Hey there, its a really good plugin however, I'm unsure as to how to give my lower-level admin users the ability to see this field on the user profile creation tab. For example Id like a manager/teacher to be able to view the extra user profile field and adjust it accordingly.

Essentially make a way for roles to view the profile category on the user creation/edit page

Bug: Groups are not set correctly after profile update

Hello!
I have defined a large number of rules and group assignments (250).
All assignments are dependent on a status in the profile (self-defined profile field).
I didn't want to integrate a second query for each rule and wanted to solve this using the source code.
The customization in the code works fine (public static function set_cohorts_from_profile(... ).
The order of processing is not correct when the user profile is saved.
The group assignments are processed first and then the self-defined profile fields are updated. As a result, you have to update the profile twice before a group change takes effect, or you have to wait until the cron has run through once.

Moodle: 3.11 / Plugin: v3.11-r4 (2021061303)

In my current case, this is not a problem, since the profile fields are first updated using CRON and then the group assignment is processed. I run both once a night.

Best regards

get_all_user_name_fields() is deprecated

Debugger output - Moodle 3.11.8, local_profilecohort v3.11-r2 2021061301

The following showed after setting up a rule and switching to the "Cohort members" tab:

get_all_user_name_fields() is deprecated. Please use the \core_user\fields API instead

line 3384 of /lib/deprecatedlib.php: call to debugging()
line 108 of /local/profilecohort/classes/profilecohort.php: call to get_all_user_name_fields()
line 72 of /local/profilecohort/classes/profilecohort.php: call to local_profilecohort\profilecohort->output_members()
line 43 of /local/profilecohort/index.php: call to local_profilecohort\profilecohort->output_form()

Cohorts not included in "moodle/cohort:view" capability

I just noticed that our "Managers" who have their view site-wide cohorts capability (moodle/cohort:view) set to allow cannot see any of the cohorts created using this plugin. The cohorts show up on the site-wide cohorts page, but not on the 'Only cohort members' drop-down list of a self-enrolment settings page.

Or Conditions

Hi!

I have been testing out this component and am curious, is it possible to have or conditions as well?

We have several use cases I am trying to see if this could handle.

If field "Enrollment Semester" = 20191 put in cohort "Fall students"
If field "StudentProgram"= MBA put in cohort "All MBA Students"

If field "Enrollment Semester"= 20191 or 20192 put in cohort "Fall/Spring students"

If field "StudentProgram" = MBA and (field "Enrollment Semester" = 20191 or 20192) put in cohort "Fall/Spring All Modes MBA students"

If field "StudentProgram"= MBA and field "Enrollment Method" = Online and (field "Enrollment Semester"=20191 or 20192) put in cohort "Online Fall/Spring MBA Students"

Thanks for all of your help!

Scott

page load time

we have around 80 rule. while we open the profile field based cohort it takes around an hour to open the page. to add another two rule it takes 2.5 hours. i am enclosing the database details of the plugin.
We use windows 2008 IIS
moodle 3.2.2+
php 7.0.3

note: it may not by you plugin may be but whenever i open the page server hits 100% utilization and java is the highest load it takes.

cohort relation.xlsx

Improvement: Text consistency at the beginning and end

Hello!
It would be good if you can check a text match at the beginning and at the end of a string.

Often you can work with checking a match or the availability of a substring.
Because of organizational reasons we have to concatenate several items of information in one field. We are lucky that all partial information are unique. This means that the check at the beginning and end is not absolutely necessary.

In general, it would be a profitable improvement.

Rules are only applied, when user was manually updated, not when created or logged in

I can't seem to get the Plug-In to work and I have no idea why that could be. I created a profile field, assigning every user to an organisation and then created the rule, that every user in the organisation should be in a cohort. No user was assigned.

When I clicked on a single user and updated the profile, they would then be assidned to the cohort. But when a new user is created or a user logs in, they are not assigned. Only after being manually updated, which of yourse defeats the purpose of the Plug-In automatically managing the cohorts.
Is there anything I can do to fix this issue. I would really appreciate the help.

Add 2 conditions to a rule

I tried this plugin out on Moodle 3.1 so I'm not sure if it worked as intended. I would like to be able to set 2 conditions before a user is added to a cohort, such as "Custom Profile Field 1 is set to X" AND "Custom Profile Field 2 is set to Y". Is this possible?
A good example of what I mean is in the Enrol Attributes plugin at https://moodle.org/plugins/enrol_attributes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.