This commit is contained in:
Dan Poltawski 2015-12-01 16:24:00 +00:00 committed by Eloy Lafuente (stronk7)
commit b56a046175
2 changed files with 4 additions and 3 deletions

View File

@ -117,7 +117,7 @@ if ($uselegacyreader) {
$sqllasttime = ", MAX(time) AS lasttime";
}
$logactionlike = $DB->sql_like('l.action', ':action');
$sql = "SELECT cm.id, COUNT('x') AS numviews $sqllasttime
$sql = "SELECT cm.id, COUNT('x') AS numviews, COUNT(DISTINCT userid) AS distinctusers $sqllasttime
FROM {course_modules} cm
JOIN {modules} m
ON m.id = cm.module
@ -141,7 +141,7 @@ if ($useinternalreader) {
if ($showlastaccess) {
$sqllasttime = ", MAX(timecreated) AS lasttime";
}
$sql = "SELECT contextinstanceid as cmid, COUNT('x') AS numviews $sqllasttime
$sql = "SELECT contextinstanceid as cmid, COUNT('x') AS numviews, COUNT(DISTINCT userid) AS distinctusers $sqllasttime
FROM {" . $logtable . "} l
WHERE courseid = :courseid
AND anonymous = 0
@ -215,7 +215,7 @@ foreach ($modinfo->sections as $sectionnum=>$section) {
$numviewscell->attributes['class'] = 'numviews';
if (!empty($views[$cm->id]->numviews)) {
$numviewscell->text = $views[$cm->id]->numviews;
$numviewscell->text = get_string('numviews', 'report_outline', $views[$cm->id]);
} else {
$numviewscell->text = '-';
}

View File

@ -27,6 +27,7 @@ $string['eventactivityreportviewed'] = 'Activity report viewed';
$string['eventoutlinereportviewed'] = 'Outline report viewed';
$string['neverseen'] = 'Never seen';
$string['nologreaderenabled'] = 'No log reader enabled';
$string['numviews'] = '{$a->numviews} by {$a->distinctusers} users';
$string['outline:view'] = 'View activity report';
$string['page-report-outline-x'] = 'Any outline report';
$string['page-report-outline-index'] = 'Course outline report';