Details
-
Type:
Sub-task
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 1.9.4
-
Fix Version/s: None
-
Component/s: Administration
-
Labels:None
-
Difficulty:Easy
-
Affected Branches:MOODLE_19_STABLE
Description
The log report function could be made more useful by simply adding a few more actions to the $actions array in course/report/log/lib.php
// Prepare the list of action options.
$actions = array(
'view' => get_string('view'),
'add' => get_string('add'),
'update' => get_string('update'),
'attempt' => 'Quizzes',
'view discussion' => 'Forum',
'delete' => get_string('delete'),
'-view' => get_string('allchanges')
);
A further enhancement would be to add another selector for the module so that all actions pertaining to a single module could be viewed.
Another approach is to add the names of all of the available modules to the "Activities" tab:
/// Add this to both locations in course/report/log/lib.php
$allmods = get_records("modules");
$activities = array();
foreach ($allmods as $thismod) { $activities[$thismod->name] = "Every " . $thismod->name; }
///
$selectedactivity = "";
Then in course/lib.php modify the code like this:
/*
if ('site_errors' === $modid) { $joins[] = "( l.action='error' OR l.action='infected' )"; } else if ($modid) { $joins[] = "l.cmid = '$modid'"; }
*/
if (('site_errors' === $modid) || ('site_news' ===$modid)) {
if ('site_errors' === $modid) { $joins[] = "( l.action='error' OR l.action='infected' )"; } else if ($modid) { $joins[] = "l.cmid = '$modid'"; }
} elseif ($modid) { $joins[] = "l.module = '$modid'"; }