]> git.mjollnir.org Git - moodle.git/commitdiff
lots of typos fixed, graph in stats, parameter cleanup etc., somebody could cleanup...
authorskodak <skodak>
Thu, 20 Apr 2006 22:36:22 +0000 (22:36 +0000)
committerskodak <skodak>
Thu, 20 Apr 2006 22:36:22 +0000 (22:36 +0000)
12 files changed:
course/report/log/graph.php
course/report/log/index.php
course/report/log/lib.php
course/report/log/live.php
course/report/log/mod.php
course/report/outline/index.php
course/report/outline/mod.php
course/report/participation/index.php
course/report/participation/mod.php
course/report/stats/graph.php
course/report/stats/index.php
course/report/stats/mod.php

index f888b119ec0b326ecb38ffd712ee9eb2c4dab6fb..976e13f125b58d541a07d18c831db33389d3ed70 100644 (file)
@@ -5,10 +5,10 @@
     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");
index 7649a7f80363532730341229839c69642c01b715..850cc80f51ec53538799892a8bff2404ea374394 100644 (file)
@@ -5,18 +5,18 @@
     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();
 
@@ -34,6 +34,8 @@
         }
     }
 
+    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');
index 7491f7d0561dfb84187f529fd05c9e724c864c78..bb320956b67f8d9eb7961ff2cbbac0c81831ac3d 100644 (file)
@@ -1,4 +1,4 @@
-<?php
+<?php  // $Id$
 
 function print_log_selector_form($course, $selecteduser=0, $selecteddate="today",
                                  $modname="", $modid=0, $modaction="", $selectedgroup=-1,$showcourses=0,$showusers=0) {
index bd8872cf0852a01f110cf7355ab3c437707149a5..a756c5fb8e6ca7a1149e5bb8b9f8fcd8d7262572 100644 (file)
@@ -17,6 +17,8 @@
         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
index 081e41eebe1183b9ef997fe4e8e69dc69c5952c5..92c7eaa26c5904cec4d3df28d93029ecac978bcf 100644 (file)
@@ -1,4 +1,4 @@
-<?php
+<?php  // $Id$
 
     if (!defined('MOODLE_INTERNAL')) {
         die('Direct access to this script is forbidden.');    ///  It must be included from a Moodle page
index b6eb455797e5e5d1d710961dd876fc8f23b1b536..ece44722dfc12095b2166eecfde79c7aff3e6654 100644 (file)
@@ -7,8 +7,8 @@
 
     $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();
@@ -21,7 +21,7 @@
         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");
index a662720ea5f36783df7284f9d759ecca02f01d76..fd43012cc6ebb19ba4e8718c698ca1e0117f2cb1 100644 (file)
@@ -1,4 +1,4 @@
-<?php
+<?php  // $Id$
 
     if (!defined('MOODLE_INTERNAL')) {
         die('Direct access to this script is forbidden.');    ///  It must be included from a Moodle page
index 975f6fb4e40f54d4b371a999cd020bb0dfac163b..a4c78d954b7afb48046697bbfa00c6cbefc1800f 100644 (file)
@@ -1,16 +1,16 @@
-<?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
 
@@ -32,6 +32,8 @@
     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.'&amp;teachers='
+    $baseurl =  $CFG->wwwroot.'/course/report/participation/index.php?id='.$course->id.'&amp;teachers='
         .$teachers.'&amp;instanceid='.$instanceid.'&amp;timefrom='.$timefrom.'&amp;moduleid='
         .$moduleid.'&action='.$action.'&amp;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();
index 48560054d7dabb2796d0e6b8fe6149df450464ab..a58c9511c29ae36f0c5b0c8b8c70b16c1cb99e1b 100644 (file)
@@ -1,5 +1,9 @@
 <?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');
index 1943a3e3c65b036a3375d91dd665f65b5ca72a76..5af56034642b3275d346c0aaa6a5f5fb1b66b150 100644 (file)
@@ -1,14 +1,14 @@
-<?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");
@@ -52,6 +52,7 @@
     $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);
index 47dfc2e2b54d03821b01caeedc37ea16696d681b..6f623c2434101bc6764f3930cfb327796ea3cecf 100644 (file)
@@ -1,4 +1,4 @@
-<?php
+<?php  // $Id$
 
     require_once('../../../config.php');
     require_once($CFG->dirroot.'/lib/statslib.php');
@@ -7,18 +7,18 @@
         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,'&nbsp',$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,'&nbsp',$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>&nbsp;';
+                $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>&nbsp;';
             }
             $table->data[] = $a;
         }
index 5ace60957fa73fd94e379ff87bfec402cff627e2..d8215d910e17b117627da578311358e3d5f5408f 100644 (file)
@@ -1,4 +1,4 @@
-<?php
+<?php  //$Id$
 
     if (!defined('MOODLE_INTERNAL')) {
         die('Direct access to this script is forbidden.');    ///  It must be included from a Moodle page