require_once("../../lib.php");
require_once("$CFG->libdir/graphlib.php");
- $id = required_param('id',PARAM_INT); // Course ID
- $type = required_param('type'); // Graph Type
- $user = optional_param('user',0,PARAM_INT); // Student ID
- $date = optional_param('date'); // A time of a day (in GMT)
+ $id = required_param('id', PARAM_INT); // Course ID
+ $type = required_param('type', PARAM_FILE); // Graph Type
+ $user = optional_param('user', 0, PARAM_INT); // Student ID
+ $date = optional_param('date', 0, PARAM_INT); // A time of a day (in GMT)
if (! $course = get_record("course", "id", $id)) {
error("Course is misconfigured");
require_once('../../lib.php');
require_once('lib.php');
- $id = required_param('id',PARAM_INT);// Course ID
- $group = optional_param('group', -1, PARAM_INT); // Group to display
- $user = optional_param('user', 0, PARAM_INT); // User to display
- $date = optional_param('date', 0, PARAM_CLEAN); // Date to display
- $modname = optional_param('modname', ''); // course_module->id
- $modid = optional_param('modid', ''); // course_module->id
- $modaction = optional_param('modaction', '', PARAM_ALPHAEXT); // an action as recorded in the logs
- $page = optional_param('page', '0', PARAM_INT); // which page to show
- $perpage = optional_param('perpage', '100', PARAM_INT); // how many per page
+ $id = required_param('id', PARAM_INT);// Course ID
+ $group = optional_param('group', -1, PARAM_INT); // Group to display
+ $user = optional_param('user', 0, PARAM_INT); // User to display
+ $date = optional_param('date', 0, PARAM_FILE); // Date to display - number or some string
+ $modname = optional_param('modname', '', PARAM_CLEAN); // course_module->id
+ $modid = optional_param('modid', 0, PARAM_FILE); // number or 'site_errors'
+ $modaction = optional_param('modaction', '', PARAM_PATH); // an action as recorded in the logs
+ $page = optional_param('page', '0', PARAM_INT); // which page to show
+ $perpage = optional_param('perpage', '100', PARAM_INT); // how many per page
$showcourses = optional_param('showcourses',0,PARAM_INT); // whether to show courses if we're over our limit.
- $showusers = optional_param('showusers',0,PARAM_INT); // whether to show users if we're over our limit.
- $chooselog = optional_param('chooselog',0,PARAM_INT);
+ $showusers = optional_param('showusers',0,PARAM_INT); // whether to show users if we're over our limit.
+ $chooselog = optional_param('chooselog',0,PARAM_INT);
require_login();
}
}
+ add_to_log($course->id, "course", "report log", "report/log/index.php?id=$course->id", $course->fullname);
+
$strlogs = get_string('logs');
$stradministration = get_string('administration');
$strreports = get_string('reports');
-<?php
+<?php // $Id$
function print_log_selector_form($course, $selecteduser=0, $selecteddate="today",
$modname="", $modid=0, $modaction="", $selectedgroup=-1,$showcourses=0,$showusers=0) {
error("Only teachers can view logs");
}
+ add_to_log($course->id, "course", "report live", "report/log/live.php?id=$course->id", $course->fullname);
+
session_write_close();
// we override the default framename so header/footer
-<?php
+<?php // $Id$
if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
$modes = array("outline", "complete", "todaylogs", "alllogs");
- $id = required_param('id',PARAM_INT); // course id
- $page = optional_param('page', 0, PARAM_INT);
+ $id = required_param('id',PARAM_INT); // course id
+ $page = optional_param('page', 0, PARAM_INT);
$perpage = optional_param('perpage', 100, PARAM_INT);
require_login();
error("You are not allowed to look at this page");
}
- add_to_log($course->id, "course", "report outline", "course.php?id=$course->id",$course->id);
+ add_to_log($course->id, "course", "report outline", "report/outline/index.php?id=$course->id", $course->fullname);
$stractivityreport = get_string("activityreport");
$strparticipants = get_string("participants");
-<?php
+<?php // $Id$
if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
-<?php
+<?php // $Id$
require_once('../../../config.php');
define('DEFAULT_PAGE_SIZE', 20);
- $id = required_param('id',PARAM_INT); // course id.
- $moduleid = optional_param('moduleid',0,PARAM_INT); // module id.
- $oldmod = optional_param('oldmod',0,PARAM_INT);
- $teachers = optional_param('teachers',0,PARAM_BOOL); // show teachers? off = students.
- $instanceid = optional_param('instanceid',0,PARAM_INT); // instance we're looking at.
- $timefrom = optional_param('timefrom',0,PARAM_INT); // how far back to look...
- $action = optional_param('action','',PARAM_CLEAN);
+ $id = required_param('id', PARAM_INT); // course id.
+ $moduleid = optional_param('moduleid', 0, PARAM_INT); // module id.
+ $oldmod = optional_param('oldmod', 0, PARAM_INT);
+ $teachers = optional_param('teachers', 0, PARAM_BOOL); // show teachers? off = students.
+ $instanceid = optional_param('instanceid', 0, PARAM_INT); // instance we're looking at.
+ $timefrom = optional_param('timefrom', 0, PARAM_INT); // how far back to look...
+ $action = optional_param('action', '', PARAM_ALPHA);
$page = optional_param('page', 0, PARAM_INT); // which page to show
$perpage = optional_param('perpage', DEFAULT_PAGE_SIZE, PARAM_INT); // how many per page
if (!isteacher($course->id)) {
print_error('mustbeteacher', '', $CFG->wwwroot.'/course/view.php?id='.$course->id);
}
+
+ add_to_log($course->id, "course", "report participation", "report/participation/index.php?id=$course->id", $course->fullname);
$strparticipation = get_string('participationreport');
$strviews = get_string('views');
$strnav = "<a href=\"../../view.php?id=$course->id\">$course->shortname</a> ->
<a href=\"../../report.php?id=$course->id\">$strreports</a> -> ". $strparticipation;
- print_header($course->fullname.' '.$strparticipation,$strparticipation,$strnav);
+ print_header("$course->shortname: $strparticipation", "$course->fullname",
+ "<a href=\"../../view.php?id=$course->id\">$course->shortname</a> ->
+ <a href=\"../../report.php?id=$course->id\">$strreports</a> ->
+ $strparticipation");
+
+// print_header($course->fullname.' '.$strparticipation,$strparticipation,$strnav);
$allowedmodules = array('assignment','book','chat','choice','exercise','forum','glossary','hotpot',
'journal','lesson','questionnaire','quiz','resource','scorm',
exit;
}
- $baseurl = $CFG->wwwroot.'/course/participation.php?id='.$course->id.'&teachers='
+ $baseurl = $CFG->wwwroot.'/course/report/participation/index.php?id='.$course->id.'&teachers='
.$teachers.'&instanceid='.$instanceid.'&timefrom='.$timefrom.'&moduleid='
.$moduleid.'&action='.$action.'&perpage='.$perpage;
$instanceid = array_pop(array_keys($instanceoptions));
}
- echo '<form action="'.$CFG->wwwroot.'/course/participation.php" method="post">'.
+ echo '<form action="'.$CFG->wwwroot.'/course/report/participation/index.php" method="post">'.
'<input type="hidden" name="id" value="'.$course->id.'" />'."\n".
'<input type="hidden" name="oldmod" value="'.$moduleid.'" />'."\n".
'<input type="hidden" name="timefrom" value="'.$timefrom.'" />'."\n".
- $sql = 'SELECT DISTINCT e.userid, u.firstname,u.lastname,u.idnumber,u.nickname,count(l.action) as count FROM '
+ $sql = 'SELECT DISTINCT e.userid, u.firstname,u.lastname,u.idnumber,count(l.action) as count FROM '
. $CFG->prefix.'user_'.((!empty($teachers)) ? 'teachers' : 'students').' e '
.' JOIN '.$CFG->prefix.'user u ON u.id = e.userid LEFT JOIN '.$CFG->prefix.'log l ON e.userid = l.userid '
.' AND e.course = l.course AND l.time > '.$timefrom.' AND l.course = '.$course->id.' AND l.module = \''.$module->name.'\' '
$sql .= ' AND '.$table->get_sql_where(); //initial bar
}
- $sql .= ' GROUP BY e.userid,u.firstname,u.lastname,u.idnumber,u.nickname,l.userid';
+ $sql .= ' GROUP BY e.userid,u.firstname,u.lastname,u.idnumber,l.userid';
if ($table->get_sql_sort()) {
$sql .= ' ORDER BY '.$table->get_sql_sort();
<?php // $Id$
+ if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+ }
+
$strparticipation = get_string('participationreport');
$strviews = get_string('views');
$strposts = get_string('posts');
-<?php
+<?php //$Id$
- require_once(dirname(dirname(__FILE__)).'/config.php');
+ require_once('../../../config.php');
require_once($CFG->dirroot.'/lib/statslib.php');
require_once($CFG->dirroot.'/lib/graphlib.php');
- $courseid = required_param('course',PARAM_INT);
- $report = required_param('report',PARAM_INT);
- $time = required_param('time',PARAM_INT);
- $userid = optional_param('userid', 0, PARAM_INT);
- $mode = required_param('mode',PARAM_INT);
+ $courseid = required_param('course', PARAM_INT);
+ $report = required_param('report', PARAM_INT);
+ $time = required_param('time', PARAM_INT);
+ $mode = required_param('mode', PARAM_INT);
+ $userid = optional_param('userid', 0, PARAM_INT);
if (!$course = get_record("course","id",$courseid)) {
error("That's an invalid course id");
$graph->parameter['legend_size'] = 10;
$graph->parameter['x_axis_angle'] = 90;
$graph->parameter['title'] = false; // moodle will do a nicer job.
+ $graph->y_tick_labels = null;
foreach ($stats as $stat) {
$graph->x_data[] = userdate($stat->timeend,get_string('strftimedate'),$CFG->timezone);
-<?php
+<?php // $Id$
require_once('../../../config.php');
require_once($CFG->dirroot.'/lib/statslib.php');
error("Stats is not enabled.");
}
- $courseid = required_param('course',PARAM_INT);
- $report = optional_param('report',0,PARAM_INT);
- $time = optional_param('time',0,PARAM_INT);
- $mode = optional_param('mode',STATS_MODE_GENERAL,PARAM_INT);
- $userid = optional_param('userid',0,PARAM_INT);
+ $courseid = required_param('course', PARAM_INT);
+ $report = optional_param('report', 0, PARAM_INT);
+ $time = optional_param('time', 0, PARAM_INT);
+ $mode = optional_param('mode', STATS_MODE_GENERAL, PARAM_INT);
+ $userid = optional_param('userid', 0, PARAM_INT);
if ($report == STATS_REPORT_USER_LOGINS) {
$courseid = SITEID; //override
}
if ($mode == STATS_MODE_RANKED) {
- redirect($CFG->wwwroot.'/admin/reports.php?time='.$time);
+ redirect($CFG->wwwroot.'/'.$CFG->admin.'/report.php?time='.$time);
}
if (!$course = get_record("course","id",$courseid)) {
error("You need to be a teacher to use this page");
}
+ add_to_log($course->id, "course", "report stats", "report/stats/index.php?course=$course->id", $course->fullname);
+
stats_check_uptodate($course->id);
- $strheader = get_string('stats');
- $strnav = (($course->id != SITEID) ? '<a href="'.$CFG->wwwroot.'/course/view.php?id='.$courseid.'">'.$course->shortname.'</a> -> ' : '').$strheader;
+ $strreports = get_string("reports");
+ $strstats = get_string('stats');
$reportoptions = stats_get_report_options($courseid,$mode);
$menu = choose_from_menu($options,'mode',$mode,'','this.form.submit();',0,true);
- $menu = '<form action="stats.php" method="post">'."\n"
+ $menu = '<form action="index.php" method="post">'."\n"
.'<input type="hidden" name="course" value="'.$course->id.'" />'."\n"
.'<input type="hidden" name="time" value="'.$time.'" />'."\n"
.$menu."\n".'</form>';
- print_header($strheader,$strheader,$strnav,'','',true,' ',$menu);
- echo '<form action="stats.php" method="post">'."\n"
+ print_header("$course->shortname: $strstats", "$course->fullname",
+ "<a href=\"../../view.php?id=$course->id\">$course->shortname</a> ->
+ <a href=\"../../report.php?id=$course->id\">$strreports</a> ->
+ $strstats", '','',true,' ',$menu);
+
+ echo '<form action="index.php" method="post">'."\n"
.'<input type="hidden" name="mode" value="'.$mode.'" />'."\n";
$table->width = '*';
echo "(".get_string("gdneed").")";
} else {
if ($mode == STATS_MODE_DETAILED) {
- echo '<center><img src="'.$CFG->wwwroot.'/course/graph.php?mode='.$mode.'&course='.$course->id.'&time='.$time.'&report='.$report.'&userid='.$userid.'" /></center>';
+ echo '<center><img src="'.$CFG->wwwroot.'/course/report/stats/graph.php?mode='.$mode.'&course='.$course->id.'&time='.$time.'&report='.$report.'&userid='.$userid.'" /></center>';
} else {
- echo '<center><img src="'.$CFG->wwwroot.'/course/graph.php?mode='.$mode.'&course='.$course->id.'&time='.$time.'&report='.$report.'" /></center>';
+ echo '<center><img src="'.$CFG->wwwroot.'/course/report/stats/graph.php?mode='.$mode.'&course='.$course->id.'&time='.$time.'&report='.$report.'" /></center>';
}
}
$table->head[] = get_string('logs');
foreach ($stats as $stat) {
- $a = array(userdate($stat->timeend,get_string('strftimedate'),$CFG->timezone),$stat->line1);
+ $a = array(userdate($stat->timeend-(60*60*24),get_string('strftimedate'),$CFG->timezone),$stat->line1);
if (isset($stat->line2)) {
$a[] = $stat->line2;
}
if (empty($CFG->loglifetime) || ($stat->timeend-(60*60*24)) >= (time()-60*60*24*$CFG->loglifetime)) {
- $a[] = '<a href="'.$CFG->wwwroot.'/course/log.php?id='.$course->id.'&chooselog=1&showusers=1&showcourses=1&user='.$userid.'&date='.usergetmidnight($stat->timeend-(60*60*24)).'">'.get_string('course').' ' .get_string('logs').'</a> ';
+ $a[] = '<a href="'.$CFG->wwwroot.'/course/report/log/index.php?id='.$course->id.'&chooselog=1&showusers=1&showcourses=1&user='.$userid.'&date='.usergetmidnight($stat->timeend-(60*60*24)).'">'.get_string('course').' ' .get_string('logs').'</a> ';
}
$table->data[] = $a;
}
-<?php
+<?php //$Id$
if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page