Role/Context Design Help

Role/Context Design Help

by Tiogshi Laj -
Number of replies: 8
I'm working on a way for my company to use Moodle as a training site for organizations. The trouble I've encountered is that the documentation is very unclear as to how to create new context elements.

Organizations using our site won't be creating courses for their employees directly; they'll be using course material already created, and contracting us to develop new course material for them if they have very specific needs out of a given training program.

How it is to be arranged is that trainers will create training groups and add their trainees into those, and then those trainees will be able to access courses which are on the training group "whitelist", managed by the trainer.

When trainees enrol in a course, the payment comes out of that training group's account with us, which could be the group's own account, or the organization's. I have a system defined to allow this to work however the organization wishes it, but this structure is necessary; trainees cannot be entering payment information themselves. That payment information comes via the training group they are entering the course through.

Context/Roles Design


My question; I know how to define the Trainer role, and what permissions I want to give him in the Training Group context (a few new administrative capabilities for those contexts). However, I do not know how I can give a Trainer the ability to review the scores generated by content their trainees take (quizzes, SCORM attempts, etc), nor do I know how to define, or at the PHP level create, the Training Group context.

Note that Trainee membership of a Training Group might not be a role, but a simple many-to-many relation. Would you advise this be a role, or a database relation? The only power a trainee has in a Training Group is to see the whitelist of courses, and to have Training Groups they belong to listed in a "Training" block on the site frontpage.
Average of ratings: -
In reply to Tiogshi Laj

Re: Role/Context Design Help

by Tiogshi Laj -
So is this impossible to do as described, or does no-one here know?

Looking into the system, I think I've found code that tells me it is impossible without changing several things in accesslib.php. Mainly, I'd have to take the context/role coloured tree (where each node is coloured with one of the role levels SITE, COURSECAT, COURSE, etc, and where a node of a given level can only have a parent node belonging to one of a set of role levels; COURSECAT is a child of either SITE or COURSECAT, for instance) and re-implement it as a directed acyclic graph (where each node is coloured with one of the role levels, and it can only have child nodes which are in a set of role levels).

The key difference would be that a context can have more than one parent; a Course will have a CourseCat parent and, if it is whitelisted by a Training Group, it will also have a Training Group parent. When looking up if a user X is allowed to view, say, the quiz results of user Y, it'll go up the Course and CourseCat sides looking for a Teacher or Reviewer or Parent, but will also go up the Course and Training Group side looking for a Trainer.

I feel confident I could preserve the capability/override functionality when doing this. I don't know it will work without changes outside accesslib.php and the database. Either way, I would appreciate some real feedback from the community.
In reply to Tiogshi Laj

Re: Role/Context Design Help

by Steve Hyndman -

I don't have a clue how to do what you want, but someone did report in another thread here that she created several unique roles....one of them being an HR role that supposedly allowed a lot of what you're wanting. I asked for the details of how to set-up that role, but haven't heard back yet.

http://moodle.org/mod/forum/discuss.php?d=90181#p398498

Unfortunately, I doubt you will get much help here with your project...it seems "flexible roles & capabilities" are a mystery to nearly everyone. You may make a lot more progress by thinking about how to do what you want without using roles.

Good luck.

Steve

In reply to Steve Hyndman

Re: Role/Context Design Help

by Tiogshi Laj -
That's the trouble. To do it without using the (common, well-defined interface of the) roles system would require me to rewrite all the activity modules I want to use to make complex additional checks against custom database-relation-based permission setups which cannot be explored or overridden through the roles assignment system.

Whereas if I rewrite the roles system, I can create the functionality I want... at the cost of being extremely incompatible with any standard moodle install, and possibly invoking large portents of trouble in interfacing with future versions.

I'm actually very surprised no-one has run into troubles like this when implementing such widely-discussed roles as "HR Manager" and "Parent"... unless no-one has implemented those roles, and much of the debate on this forum is purely philosophical.
In reply to Tiogshi Laj

Re: Role/Context Design Help

by Steve Hyndman -

unless no-one has implemented those roles, and much of the debate on this forum is purely philosophical.

Bingo! smile

I hope someone is able to give you some practical help and guidance. Best of luck.

Steve 

In reply to Tiogshi Laj

Re: Role/Context Design Help

by Paula Clough -

Question: Are the trainers from your organization or are they from the organization using your courses?

Paula C cool

In reply to Paula Clough

Re: Role/Context Design Help

by Tiogshi Laj -
The users who would be using the "Trainer" role are from organizations outside our own, yes. They would join the site, create an Organization/TrainingGroup entity themselves (free and easy to do so), and then hand out "Join Passwords" and the URL to our site to their Trainees (similar to a course join key).


Our own duties on the site would be limited to maintaining the site and training material on it, and providing support. We would not normally be involved in the training process. The "teachers" would not be acting in that role's normal capacity, but placed in that role to have edit access to the course materials.
In reply to Tiogshi Laj

Re: Role/Context Design Help

by Paula Clough -

I have been thinking today about your delemma.  Perhaps a slightly different perspective might help you out.

I have worked for a couple of years for an organization which offered a lot trainings to people in school districts across the state.  They had Moodle as their class base for their own classes.  They used a registration module and a certificate module that allowed users to register for classes.  Those registering would be listed as "registration requested" ( and we would get a generic email that the request had been received). There were those in charge who would then check whether payment had been received or not and change status to "registration accepted".  It was very nice for those facilitating (teaching) the classes as we would be able to mark participants as "completed" or "incomplete" or "withdrawn". Those with a complete status were then emailed a certificate for course completion. It also allowed for easy mass emailings to participants before class began. 

I am not sure which registration, certificate and transcript modules they downloaded and used, but it was a very smooth system.  You might be able to give Course Teachers  permissions in this area without being given mass permissions through out the site. Or you might have your people who OK payment for different organizations have access to mark registrations received.

Just a thought.

Paula C cool

In reply to Tiogshi Laj

Re: Role/Context Design Help

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
It sounds to me like your business rules are sufficiently complicated that they may not be possible with the Moodle roles system unmodified.

It sounds like organisations and training groups can be a separate set of Categories and courses. In these courses, the Trainers can be teachers and the trainees can be students, although you will want to use the facility that lets you rename roles. That gives trainers and trainees quite a lot of flexibility for managing their own affairs, if they choose to use it. You can just give them some default content in their training group course, perhaps just a forum and some documentation, as a starting point.

On the right of your diagram, obviously only your staff will be teachers there. The difficulty is getting the right people, who already have a presence on the left, enrolled in the right courses.

You could make a Trainer role that gives a very few permissions like course view and role assign, and only allow Trainers to assign the Student role. This would then let trainers assign their staff as students in the courses where they have the trainer role.

The only hole here is that they could assign anyone as a student in the course, not just members of their training group.