mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-48451 report_outline: Added number of distinct users
This commit is contained in:
parent
fd57d685c7
commit
30baca293b
@ -117,7 +117,7 @@ if ($uselegacyreader) {
|
|||||||
$sqllasttime = ", MAX(time) AS lasttime";
|
$sqllasttime = ", MAX(time) AS lasttime";
|
||||||
}
|
}
|
||||||
$logactionlike = $DB->sql_like('l.action', ':action');
|
$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
|
FROM {course_modules} cm
|
||||||
JOIN {modules} m
|
JOIN {modules} m
|
||||||
ON m.id = cm.module
|
ON m.id = cm.module
|
||||||
@ -141,7 +141,7 @@ if ($useinternalreader) {
|
|||||||
if ($showlastaccess) {
|
if ($showlastaccess) {
|
||||||
$sqllasttime = ", MAX(timecreated) AS lasttime";
|
$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
|
FROM {" . $logtable . "} l
|
||||||
WHERE courseid = :courseid
|
WHERE courseid = :courseid
|
||||||
AND anonymous = 0
|
AND anonymous = 0
|
||||||
@ -215,7 +215,7 @@ foreach ($modinfo->sections as $sectionnum=>$section) {
|
|||||||
$numviewscell->attributes['class'] = 'numviews';
|
$numviewscell->attributes['class'] = 'numviews';
|
||||||
|
|
||||||
if (!empty($views[$cm->id]->numviews)) {
|
if (!empty($views[$cm->id]->numviews)) {
|
||||||
$numviewscell->text = $views[$cm->id]->numviews;
|
$numviewscell->text = get_string('numviews', 'report_outline', $views[$cm->id]);
|
||||||
} else {
|
} else {
|
||||||
$numviewscell->text = '-';
|
$numviewscell->text = '-';
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@ $string['eventactivityreportviewed'] = 'Activity report viewed';
|
|||||||
$string['eventoutlinereportviewed'] = 'Outline report viewed';
|
$string['eventoutlinereportviewed'] = 'Outline report viewed';
|
||||||
$string['neverseen'] = 'Never seen';
|
$string['neverseen'] = 'Never seen';
|
||||||
$string['nologreaderenabled'] = 'No log reader enabled';
|
$string['nologreaderenabled'] = 'No log reader enabled';
|
||||||
|
$string['numviews'] = '{$a->numviews} by {$a->distinctusers} users';
|
||||||
$string['outline:view'] = 'View activity report';
|
$string['outline:view'] = 'View activity report';
|
||||||
$string['page-report-outline-x'] = 'Any outline report';
|
$string['page-report-outline-x'] = 'Any outline report';
|
||||||
$string['page-report-outline-index'] = 'Course outline report';
|
$string['page-report-outline-index'] = 'Course outline report';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user