fwrite ($bf,full_tag("NUMSECTIONS",3,false,$course->numsections));
fwrite ($bf,full_tag("SHOWRECENT",3,false,$course->showrecent));
fwrite ($bf,full_tag("MAXBYTES",3,false,$course->maxbytes));
+ fwrite ($bf,full_tag("SHOWREPORTS",3,false,$course->showreports));
fwrite ($bf,full_tag("MARKER",3,false,$course->marker));
fwrite ($bf,full_tag("VISIBLE",3,false,$course->visible));
fwrite ($bf,full_tag("TIMECREATED",3,false,$course->timecreated));
$course->numsections = addslashes($course_header->course_numsections);
$course->showrecent = addslashes($course_header->course_showrecent);
$course->maxbytes = addslashes($course_header->course_maxbytes);
+ $course->showreports = addslashes($course_header->course_showreports);
$course->marker = addslashes($course_header->course_marker);
$course->visible = addslashes($course_header->course_visible);
$course->timecreated = addslashes($course_header->course_timecreated);
case "MAXBYTES":
$this->info->course_maxbytes = $this->getContents();
break;
+ case "SHOWREPORTS":
+ $this->info->course_showreports = $this->getContents();
+ break;
case "MARKER":
$this->info->course_marker = $this->getContents();
break;
helpbutton("coursegrades", get_string("grades")); ?>
</td>
</tr>
+<tr valign=top>
+ <td><P><?php print_string("showreports") ?>:</td>
+ <td><?php
+ unset($choices);
+ $choices["0"] = get_string("no");
+ $choices["1"] = get_string("yes");
+ choose_from_menu ($choices, "showreports", $form->showreports, "");
+ helpbutton("coursereports", get_string("activityreport")); ?>
+ </td>
+</tr>
<tr valign=top>
<td><P><?php print_string("maximumupload") ?>:</td>
<td><?php
$admindata[]="<a href=\"grade.php?id=$course->id\">".get_string("grades")."...</a>";
$adminicon[]="<img src=\"$CFG->pixpath/i/grades.gif\" height=16 width=16 alt=\"\">";
}
+ if ($course->showreports) {
+ $admindata[]="<a href=\"user.php?id=$course->id&user=$USER->id\">".get_string("activityreport")."...</a>";
+ $adminicon[]="<img src=\"$CFG->pixpath/i/report.gif\" height=16 width=16 alt=\"\">";
+ }
if ($CFG->auth == "email" or $CFG->auth == "none" or $CFG->auth == "manual") {
$admindata[]="<a href=\"$CFG->wwwroot/login/change_password.php?id=$course->id\">".
get_string("changepassword")."...</a>";
}
if ($CFG->allowunenroll) {
$admindata[]="<a href=\"unenrol.php?id=$course->id\">".get_string("unenrolme", "", $course->shortname)."...</a>";
+ $adminicon[]="<img src=\"$CFG->pixpath/i/user.gif\" height=16 width=16 alt=\"\">";
}
- $adminicon[]="<img src=\"$CFG->pixpath/i/user.gif\" height=16 width=16 alt=\"\">";
}
if (!empty($admindata)) {
require_login($course->id);
- if (!isteacher($course->id)) {
- if (! ($type == "usercourse.png" and $user == $USER->id) ) {
- error("Sorry, you aren't allowed to see this.");
- }
+ if (! (isteacher($course->id) or ($course->showreports and $USER->id == $user))) {
+ error("Sorry, you aren't allowed to see this.");
}
if ($user) {
error("Course id is incorrect.");
}
- if (!isteacher($course->id)) {
+ if (! (isteacher($course->id) or ($course->showreports and $USER->id == $user))) {
error("You are not allowed to look at this page");
}
--- /dev/null
+<p align="center"><b>Activity Reports</b></p>
+
+<P>Activity reports are available for each partipant
+ that show what they have done in the current course.</p>
+
+<p>Teachers always have access to these.</p>
+
+<p>Student access to their own reports is an optional course
+ setting set by the teacher. For some courses these
+ reports can be a useful tool for a student to reflect
+ on their involvement and appearance within the online
+ environment, but for some courses this may not be
+ necessary.</p>
+
+<p>Another reason for turning it off is that the report
+ can place a bit of load on the server while being
+ generated. For large or long classes it may be more
+ efficient to keep it off.<p>
$string['showonlytopic'] = "Show only topic \$a";
$string['showonlyweek'] = "Show only week \$a";
$string['showrecent'] = "Show recent activity";
+$string['showreports'] = "Show activity reports";
$string['showtheselogs'] = "Show these logs";
$string['showallcourses'] = "Show all courses";
$string['site'] = "Site";
$db->debug = true;
}
+ if ($oldversion < 2003103100) {
+ table_column("course", "", "showreports", "integer", "4", "unsigned", "0", "", "maxbytes");
+ }
+
return $result;
}
`showrecent` smallint(5) unsigned NOT NULL default '1',
`marker` int(10) unsigned NOT NULL default '0',
`maxbytes` int(10) unsigned NOT NULL default '0',
+ `showreports` int(4) unsigned NOT NULL default '0',
`visible` int(10) unsigned NOT NULL default '1',
`timecreated` int(10) unsigned NOT NULL default '0',
`timemodified` int(10) unsigned NOT NULL default '0',
$db->debug = true;
}
+ if ($oldversion < 2003103100) {
+ table_column("course", "", "showreports", "integer", "4", "unsigned", "0", "", "maxbytes");
+ }
+
return $result;
}
showrecent integer NOT NULL default '1',
marker integer NOT NULL default '0',
maxbytes integer NOT NULL default '0',
+ showreports integer NOT NULL default '0',
visible integer NOT NULL default '1',
timecreated integer NOT NULL default '0',
timemodified integer NOT NULL default '0'
// database to determine whether upgrades should
// be performed (see lib/db/*.php)
-$version = 2003102900; // The current version is a date (YYYYMMDDXX)
+$version = 2003103100; // The current version is a date (YYYYMMDDXX)
$release = "1.2 development"; // User-friendly version number