How to use existing functionality to create new fucntionality

How to use existing functionality to create new fucntionality

by Liam de Haas -
Number of replies: 0

Hello


I want to create site-wide groups and group pages so they can work together. I've decided to use Cohorts, Courses and Activities to achieve this.

You can do this all by hand but I want this to be a plugin so you can walk through the entire process step by step. 


The first step is creating a Cohort. Moodle already has the functionality for this with a form and the processing for that form. I want to use this in my own plugin but I cant figure out how. I can't link directly to the page where you can add Cohort because I can't say where it has to go from there as the next step is creating a Course and adding the Cohort to that automatically. So I thought of recreating the form in my plugin but I can't figure any of the code out as it is complete chinese for me. I understand there is a form but how is it build up and why that way? how do i display it? etc. 

What I want is to use that form (By either using the standard form or creating my won and processing that into a Cohort) and give the Cohort idea through to the next step so I can automatically add that specific Cohort to a Course that is created in that next step.


I'm a complete Moodle novice and I would rather not do this but I have to. 


Average of ratings: -