Details
Description
this is a small hack to hide an activity or a resource
by prefixing the title/subject of the activity / resource it with a "." character
and still have it active and useful to students.
especially useful for teachers who would like to link to it from some other
Label resource and not have it show up in the topics / sections.
(for visual purposes, mainly)
open "course/lib.php" and change the line:
echo '<li class="activity '.$mod->modname.'" id="module-'.$modnumber.'">'; // Unique ID
to:
// Hide Activities or Resource by prefixing a "." in the title of the activity
if (mb_substr($modinfo->cms[$modnumber]->name,0,1) == '.' AND !$isediting)
else
{ $activebuthidden = ''; }echo '<li '.$activebuthidden.' class="activity '.$mod->modname.'" id="module-'.$modnumber.'">'; // Unique ID
and save it.
now you are ready.
as a teacher, go into editing mode and...
just add a DOT ( "." ) character in the beginning of the subject of the activity or resource...
which makes it invisible to students ( and still visible to teachers in edit mode)
i know ! it is a ugly hack and it is better solved seriously
by adding the proper statuses to the already available "two modes" visibility field
of each module. but i guess this should be discussed in another issue
enjoy
Attachments
Issue Links
- has a non-specific relationship to
-
MDL-4782 allow resources/activities to be hidden but available/active
-
- Closed
-