Cohort external database

Administration tools ::: tool_cohortdatabase
Maintained by Dan Marsden, Catalyst IT
This plugin creates site-level cohorts using a connection to an external database. (similar to enrol_database plugin but instead of creating enrolments it creates site-level cohorts.)
Latest release:
140 sites
37 downloads
28 fans
Current versions available: 3

This plugin creates site-level cohorts using a connection to an external database. 

  • Can be triggered via CLI and/or scheduled task.
  • Creates site-level cohorts
  • Syncronises users in cohorts
  • Optionally auto create users

Screenshots

Screenshot #0

Contributors

Dan Marsden (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Показати коментарі
  • Otaku Dude
    чт 31 бер. 2022 04:31 AM
    Thank you for the response Dan. I saw the csv option in the drive list and had hoped it was a file.
  • Dan Marsden
    чт 31 бер. 2022 05:17 AM
    I haven't used the adodb CSV connnector before - not sure if it works, but you could give it a go - it might be ok - just sounds extremely fragile.
  • Otaku Dude
    пт 1 квіт. 2022 16:48 PM
    Thank you @Dan, one last question if I may, if we can sort out a db connection, if a student is listed twice with 2 or more different cohort requirements, will the plugin create all cohorts?
  • Dan Marsden
    пн 4 квіт. 2022 06:58 AM
    @Otaku - yes. Probably best that you try it out and see if it meets your needs. усміхаюсь
  • Otaku Dude
    пт 13 трав. 2022 18:40 PM
    Hiya @Dan we are now trialing the plugin. We have everything set up correctly I think, but we are not getting any cohorts created. I can ping between servers OK, so connection seems to be fine. We are using mssql and have use sybase quite enabled. I have set it to email admin with errors but I am not receiving anything. Is there any troubleshooting documentation, please.
  • Dan Marsden
    пн 16 трав. 2022 11:30 AM
    @Otaku, Make sure cron is running and check the output of the cohortdatabase task - also try turning on $CFG->showcrondebugging = true; in your config.php to get more output in the cron task.
  • Otaku Dude
    пн 16 трав. 2022 23:01 PM
    Thank you @Dan, I appreciate your time on this. The only error we see is in task_log table is:
    Starting cohort synchronisation...
    Error while communicating with external cohort database
    I'm not sure when the extra output in the cron task will be?
    Thanks, Nigel (Otaku).
  • Dan Marsden
    вт 17 трав. 2022 05:05 AM
    @Nigel, that simply means that the adodb library in Moodle can't connect to your external db server - lots of different things that could cause this, (wrong password, firewall issue, missing drivers on the web server etc) but turn debugging on in your cron and it might give you more output.
  • Dan Marsden
    вт 17 трав. 2022 05:15 AM
    Also @Nigel, hit the "Debug ADOdb connection to external database" checkbox on the cohortdatabase settings page too, along with the showcrondebugging setting you might get some other useful output.
  • Otaku Dude
    вт 17 трав. 2022 23:55 PM
    Thank you @Dan, that seems to have produced something more useful - Missing extension for mssql. I will pass that on to our IT dept.
  • koen roggemans
    вт 30 серп. 2022 14:44 PM
    Hi Dan, Is it possible to push the latest and greatest version of this plugin to the Moodle plugins database. The new cleanup function looks very cool. Thanks!
  • Dan Marsden
    ср 31 серп. 2022 06:54 AM
    @Koen - I finally got round to adding our github action config to the repo and it's triggered an auto-deploy to the plugins db now - thanks! усміхаюсь
  • Simon Lewis
    чт 16 бер. 2023 23:07 PM
    Hi Dan,
    Thanks for a great plugin! We use it a lot.

    I've found an issue with PHP 8.0. When running the scheduled task we get the error:
    odbc_free_result(): supplied resource is not a valid ODBC result resource
    I had the same error with one of our custom plugins, that also uses ODBC, so I managed to fix it I think.
    In classes/sync.php I've added $rs->Close(); to line 113, 267, 366. And that seems to fix the task.
    I'll look out for how you do it in an updated version, as you might well do it a different, better way (or there may be issues with how I've done it), but thought I'd report it here nonetheless.

    thanks a lot,
    Simon
  • Dan Marsden
    пт 17 бер. 2023 04:08 AM
    @Simon - nice catch - looks like a sensible change, feel free to submit a pull request so I can merge that into the main branch - thanks!
  • Ricardo Caiado
    нд 23 лют. 2025 00:07 AM
    Is there any moodle 4.5+ update?
1 2
Please login to post comments