Below is a file resource that has its Restrict Access settings set. It is grayed-out so that the user knows it is a conditional resource, and the critieria for its access is clear to all.
The displayed text "Not available unless: Your category is hq" means that the user cannot access (read) the resource unless his Custom Profile has been set to "hq". It serves a vital purpose and is useful when a student needs to be informed that a criteria needs to be met or score needs to be attained before he or she is allowed to access that resource.
In my humble opinion, I find the conditional text as intrusive to design of the course page. It does stick out and the eye cannot avoid it. I also think that sometimes the conditional text is redundant and would be better if it were not visible. For example, in the business context, some files may be made inaccessible to a user because the user is unconfirmed. He or she is still on probation. Hence, the Moodle administrator may want the staff to not click and access the resource, but only see the resource as being there on the course page.
The purpose of this post is to show you how to remove the conditional text. At the end of this post, your home will look like this:
Okay, now seriously, At the end of this post, your screens will looks like this:
The correct Figure 1. The Administrator/Manager/Editing Teacher's view after a file resource has been restricted of its access. Turn Editing is set to On. |
Figure 7. What Wallace sees if the resource is grayed out because he does not meet the Restricted Access conditions. |
So which files to modify then to achieve this?
availability/classes/condition.php
Firstly, comment off the half of the return get_string(...) function.
availability/classes/availability.php
Secondly, set both array variables $string['hidden_marker']and $string['list_root_and'] to space (' ') . This 'clears' the text.
Finally, make sure you "Purge all caches" and refresh your browser's page.
Well, that's all folks! Welcome to another hack which adds more administrative burden to the Moodle Administrator because although it may help with the situation, it gives the Administrator additional details to remember before the next major Moodle version upgrade. Yup. In the meantime, have fun!
Frankie Kam
No comments:
Post a Comment