Closed fran-inserver closed 5 years ago
Hi Francisco,
there are two triggers which update a cohort membership within the plugin:
This should be explained quite well on https://github.com/moodleuulm/moodle-local_profilecohort#how-this-plugin-works.
If you need the user to be member of a given cohort instantly as soon as he fulfills the cohort's membership criteria, you can:
Thanks, Alex
Hi Alexander,
Thanks for your answer.
Here are you are our solution just in case you consider add it to a new version of the plugin.
We are set two new events acting like triggers in events.php
$observers = [ [ 'eventname' => '\core\event\user_loggedin', 'callback' => '\local_profilecohort\profilecohort::set_cohorts_from_profile' ],
Also, we have changed a function in line 196 of profile.php, in order to make new events work:
if ($event) { $userid = $event->userid; } For:
if ($event) {
Would you consider make the changes in a new version of the plugin? Otherwise we would add it to our local copy of the plugin.
Best regards!
2017-12-28 8:32 GMT+01:00 Alexander Bias notifications@github.com:
Closed #14 https://github.com/moodleuulm/moodle-local_profilecohort/issues/14.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/moodleuulm/moodle-local_profilecohort/issues/14#event-1403260234, or mute the thread https://github.com/notifications/unsubscribe-auth/AhRvnQUuG3tz0aQRn6vleWDowSllUEQXks5tE0QXgaJpZM4RNrm0 .
-- Fran Moodle Developer
Hi Francisco,
thank you for your code change suggestion.
After reading the ticket once more, we have decided to evaluate if we can add it to the plugin. Stay tuned.
Thanks, Alex
Thanks.
Sure we'll stay :)
2018-01-22 12:58 GMT+01:00 Alexander Bias notifications@github.com:
Reopened #14 https://github.com/moodleuulm/moodle-local_profilecohort/issues/14.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/moodleuulm/moodle-local_profilecohort/issues/14#event-1434966974, or mute the thread https://github.com/notifications/unsubscribe-auth/AhRvnWrwbFnQzzPgHMwqu7Xb8fdLB1_mks5tNHfcgaJpZM4RNrm0 .
-- Fran Ventas T: +34 622 570 378
Hi Alex, after activating the plugin on our 3.5 platform and testing it several times we still have the problem, that the assignment of a user to the cohort isn´t started and fulfilled by the cronjob, but only after the login of the corresponding user. Have you any idea, what could lead to this problem? Thanks in advance and best regards, Ingo
Hi @fran-inserver,
I am happy that we have finally added these additional event listeners to the plugin on https://github.com/moodleuulm/moodle-local_profilecohort/commit/85302ded374f7bf704814de521cc2e319c78a094.
According to our tests, there were no real downsides for these additional event listeners in terms of performance.
Hi @ingoauhagen,
I have the impression that the problem you are mentioning might either be solved by this commit or should be tackled in a separate issue. Please test the latest code and create a separate issue if you still encounter problems.
Cheers, Alex
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!