Details
-
Type:
Improvement
-
Status:
Reopened
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 1.9.3
-
Fix Version/s: None
-
Component/s: Block: Mrbs
-
Labels:None
-
Affected Branches:MOODLE_19_STABLE
Description
We've had a similar request from several people so thought I'd post the diff code for the changes we made to the block. Will achieve the following:
1. Allow the block to be displayed on course pages;
2. Fix the capability checking - it only checks at the site level. By default the teacher can view/read/write the mrbs block. However the teacher role is usually not assigned at the site level, rather at the course level and/or occasionally at the front page level. The changes check against CONTEXT_COURSE rather than CONTEXT_SYSTEM.
I don't use the block so maybe there are reasons this code was never included.
Cheers,
Shane.
Hi Anthony,
I think that there would be no problem to do this addition. In my own Moodle I changed only one line to get this working.
Open the file blocks/mrbs/block_mrbs.php and add ", 'course' => true" to the code in line 14
My code looks like this and the block is shown to every user who has gotten one of the three mrbs roles
function applicable_formats() {
return array('site' => true,'my' => true, 'course' => true);
}
It would be nice if you could put this addition into the normal code.
Best regards,
Ralf