moodle-an-hochschulen / moodle-availability_cohort Goto Github PK
View Code? Open in Web Editor NEWMoodle availability plugin which lets users restrict resources, activities and sections based on cohorts.
License: GNU General Public License v3.0
Moodle availability plugin which lets users restrict resources, activities and sections based on cohorts.
License: GNU General Public License v3.0
probably easier to convert to a records call instead of recordset.
This issue serves as a reminder that this plugin still uses YUI in its JavaScript code.
Currently, I am not aware that you can build availability_* plugins without YUI.
But as soon as Moodle core supports this, this plugin should be adapted.
Hi
I have a request that I think would add great value to the plugin.
In our case specifically we work with many different companies who have different branches within the company, so my example will be based on this, but it could easily be applied to different teachers teaching the same course but having separate cohorts per teacher.
If you have for instance you have 10 companies each with 20 branches you end up with 200 cohorts.
Company all 10 companies get access to the same study material and content with one exception each one has a custom certificate for their company, which means using your plugin we can achieve this by restricting each certificate to the 20 cohorts linked to that company, but this does mean adding 200 restriction rules per course, which sucks but I can deal with that if I must.
Where my issue comes in is company one then opens 2 new branches which means that besides creating the cohort's we need to remember to go add these 2 new cohorts to all the restriction settings in all the courses. We use a cohort naming convention of "Company Name - Branch - subbranch"
What I would like to propose is a way to tell the plugin to restrict based on "Cohort Name Contains" or "Cohort Name =" (which is basically what ti doe now.
The Contains function would allow people to enter a portion of the cohort name and restrict based on any cohort that contains that word, which drastically cuts down on the amount of restriction rules that need to be added to an activity.
In my organisation, we have hundreds of cohorts (for a specific reason), the 25 limit is inappropriate.
Would it be possible to use the in-place search that we can find during the cohort enrollment ?
In locallib.php, there are some functions which are used to gather information about multiple cohorts at once.
It would be worthwhile to transfer these functions to Moodle core to /lib/cohortlib.php
I have a section of a course restricted to a cohort. If a person with manager role tries to add content it's all fine, however, when he tries to rename/delete content he receives the following error:
Error code: codingerror
* line 498 of /lib/pagelib.php: coding_exception thrown
* line 830 of /lib/pagelib.php: call to moodle_page->magic_get_context()
* line 1456 of /lib/weblib.php: call to moodle_page->__get()
* line 169 of /availability/condition/cohort/classes/condition.php: call to format_string()
* line 159 of /availability/classes/condition.php: call to availability_cohort\condition->get_description()
* line 526 of /availability/classes/tree.php: call to core_availability\condition->get_standalone_description()
* line 476 of /availability/classes/tree.php: call to core_availability\tree->get_full_information_recursive()
* line 216 of /availability/classes/info.php: call to core_availability\tree->get_result_information()
* line 2774 of /lib/modinfolib.php: call to core_availability\info->is_available()
* line 2737 of /lib/modinfolib.php: call to section_info->get_available()
* line 1900 of /lib/modinfolib.php: call to section_info->__get()
* line 1921 of /lib/modinfolib.php: call to cm_info->obtain_dynamic_data()
* line 1234 of /lib/modinfolib.php: call to cm_info->get_user_visible()
* line 3030 of /lib/moodlelib.php: call to cm_info->__get()
* line 515 of /lib/externallib.php: call to require_login()
* line 91 of /course/classes/output/course_module_name.php: call to external_api::validate_context()
* line 3776 of /course/lib.php: call to core_course\output\course_module_name::update()
* line 8059 of /lib/moodlelib.php: call to core_course_inplace_editable()
* line 478 of /lib/external/externallib.php: call to component_callback()
* line 261 of /lib/externallib.php: call to core_external::update_inplace_editable()
* line 81 of /lib/ajax/service.php: call to external_api::call_external_function()
He has all the rights for cohort:
What could be the problem?
As admin I can rename/remove content without problems. Once the restriction is removed also managers can rename/remove content.
Hi. thank you for developing this useful module.
When copy a course that use availability cohort module, copy failed. this error in log appear
Adhoc task failed: core\task\asynchronous_copy_task,Call to undefined function availability_cohort\cohort_get_cohort()
Backtrace:
When i remove that activity that use availability cohort module, copy become successful.
Hi, there are already groups in core moodle, so for what is the cohort? Sorry, I do not understand the plugin description. Perhaps you can also show a picture with the settings of one activity or participants? Or is the cohort one step higher than a course?
(I'm also fine with an answer in german or PM ;-)
We use v. v3.5-r3 of the plugin in Moodle 3.5 - I can't select from all cohorts, because the list only shows the first 25 of currently 54 global cohorts. That resembles exactly the first page in the cohorts-management section. How can I set the rest of the cohorts with the plugin? (In other areas usually all items are available in the respective menues...)
when i used the cohort restriction feature, i can still see in the subscribers all students and not just the ones in the cohort
The use of cohort_get_available_cohorts($context);
in frontend.php (https://github.com/moodleuulm/moodle-availability_cohort/blob/master/classes/frontend.php#L87) only returns 25 cohorts by default. See the function definition at Moodle: https://github.com/moodle/moodle/blob/MOODLE_35_STABLE/cohort/lib.php#L239
I'm not sure what makes the most sense here for a fix, be it some hardcoded limit, or maybe something that you could have an end user set in a setting? Thoughts?
For the case we are using this, we hardcoded it to 1000. The call was changed to:
return cohort_get_available_cohorts($context, 0, 0, 1000);
After installing plugin, cohort filtering is not being displayed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.