Admin setting for stats: ranked courses get userthreshold

This commit is contained in:
mjollnir_
2005-11-03 22:45:35 +00:00
parent ce4a0f541f
commit 7b89e1898f
3 changed files with 7 additions and 1 deletions
+3 -1
View File
@@ -578,7 +578,9 @@ class configvarrss extends configvar {
$stats['statsruntimestart'] = new configvar (get_string('configstatsruntimestart','admin'),
print_time_selector("statsruntimestarthour","statsruntimestartminute",make_timestamp(2000,1,1,$config->statsruntimestarthour,$config->statsruntimestartminute),5,true) );
$stats['statsuserthreshold'] = new configvar (get_string('configstatsuserthreshold','admin'),
'<input type="text" name="statsuserthreshold" size="4" value="'.$config->statsuserthreshold.'" />');
////////////////////////////////////////////////////////////////////
+1
View File
@@ -105,6 +105,7 @@ $string['configsmtpuser'] = 'If you have specified an SMTP server above, and the
$string['configstatsfirstrun'] = 'This specifies how far back the logs should be processed <b>the first time</b> the cronjob wants to process statistics. If you have a lot of traffic and are on shared hosting, it\'s probably not a good idea to go too far back, as it could take a long time to run and be quite resource intensive. (Note that for this setting, 1 month = 28 days. In the graphs and reports generated, 1 month = 1 calendar month.)';
$string['configstatsmaxruntime'] = 'Stats processing can be quite intensive, so use a combination of this field and the next one to specify when it will run and how long for.';
$string['configstatsruntimestart'] = 'What time should the cronjob that does the stats processing <b>start</b>?';
$string['configstatsuserthreshold'] = 'If you enter a non-zero, non numeric value here, for ranking courses, courses with less than this number of enrolled users (students + teachers) will be ignored';
$string['configteacherassignteachers'] = 'Should ordinary teachers be allowed to assign other teachers within courses they teach? If \'No\', then only course creators and admins can assign teachers.';
$string['configthemelist'] = 'Leave this blank to allow any valid theme to be used. If you want to shorten the theme menu, you can specify a comma-separated list of names here (Don\'t use spaces!).
For example: standard,orangewhite.';
+3
View File
@@ -583,6 +583,9 @@ function stats_get_parameters($time,$report,$courseid,$mode) {
$param->fields = 'max(students+teachers) as line1,max(activestudents+activeteachers) AS line2,'
.'max(activestudents+activeteachers)'.$real.'/max(students+teachers)'.$real.' AS line3';
$param->extras = 'HAVING max(students+teachers) != 0';
if (!empty($CFG->statsuserthreshold) && is_numeric($CFG->statsuserthreshold)) {
$param->extras .= ' AND max(students+teachers) > '.$CFG->statsuserthreshold;
}
$param->orderby = 'line3 DESC';
$param->line1 = get_string('users');
$param->line2 = get_string('activeusers');