Lists within Settings

Lists within Settings

by Shannon Talbot -
Number of replies: 2

Hi All,

I tried searching for this but the searching is pretty horrible to find what you're looking for (in comparison to something like MSDN).

I have created a plugin much like external_database enrolment. This plugin connects to a database that won't work well with the default plugin. I now have an issue where there is a rare occurance that 2 (sometimes more) classes are actually 1 class or a group of classes would like a central hub page used for generic information that all the students enrolled would be linked to.

Obviously a solution is to modify the database to make this work, however this isn't viable in this situation. 

My solution is that I can make some "courses"/classes deemed as parents and others as "children". I would also have another option that says to either create the child course to not create it.

I was going to add this as a setting at the course level but realised you can't natively plug into the settings of a course page without "hacking" at it. It would also be bad form as it will be directly related to that of the enrolment plugin I made.

So my idea is to have the setting within the plugin it would in the following way:


UI Example


So my idea here is to add a "Tree-Node" settings box (not how to do that) and have these buttons work with it.

You type in the name that the mapped field will be (I should better label this) and you click "Add Parent" this would be the parent course in a single example. This will add that course to the Tree-Node box as a top level item. Then you select this course and Type in the name of a child course you may want to link enrolments from. Then click an add button that applies to how you want it handled. In one case it would be to click "Add Displayed Child" meaning that all its enrolments (from this plugin) would also be passed to the parent but would also still create this course.

However you could also click "Add Hidden Child" meaning that all its enrolments (from this plugin) would also be passed to the parent but the course would not be created or have users enrolled into it smile


Even an example that lays out this type of interface and adds values etc it would be greatly appreciated smile

Average of ratings: -
In reply to Shannon Talbot

Re: Lists within Settings

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Is https://docs.moodle.org/31/en/Course_meta_link what you are looking for?
Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Lists within Settings

by Shannon Talbot -

Thanks mate it seems like a viable option in some cases. However for Audit Reasons we keep copies of classes for every year. This means it's near impossible to find out which one I should use. To top this off when a user's enrolment has expired it seems that the student is being given a manager role instead of an expired enrolment.

Is there no list setting option I can place into my plugin as asked?