Wednesday 6 September 06

Now have my demo server updated to use the current version of the OU VLE Moodle with the LabSpace theme applied. Still getting very confused about the new roles and permissions, I’ve set up the db/access.php page as it looks like it ought to be set up – then I update the version number and run the admin page, but my new capabilities aren’t imported into the database – I can’t quite work out what’s going wrong here. few other queries I have about the new roles are permissions are:

  • docs say that the capability should start with the path to the block or mod, but then the example given is block/… which of course ought to be blocks/… if it’s the path
  • The get_context_instance() is passed an id as the second parameter, and I’ve seen a few examples which all use the instance id but I can’t work out how this should be applied to my block – which would usually be a sticky block so each block won’t have an instance id to use? The examples all seem to be something like:
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
But I don’t know where $cm->id would come from in my case?
  • For user enrolments on courses – how can I figure out if a user is enrolled on a course without using mdl_user_students? I can see the mdl_role_assignments so I assume it’s something to do with this, but I’d need to know what the ‘student’ role was actually called to be able to query reliably – wouldn’t want to have the role id or role name from mdl_role hard coded into my php?

Anyway, for now I’m just going to leave my code using the old Moodle 1.6 functions/tables as I know these will still work with Moodle 1.7 (just deprecated) until I find someone who can help me sort it out!

Leave a Reply

*