From: stronk7 Date: Thu, 20 Nov 2003 18:45:52 +0000 (+0000) Subject: This report shows the total number of views for each activity in a course. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=cc652b4d769d49fd6dde0900b895b8bd124da79e;p=moodle.git This report shows the total number of views for each activity in a course. It is based in the "Outline User Activity Report". I commit it here, but you (Martin, of course) decide if you want to link to it from the "logs" page. --- diff --git a/course/outline_rep.php b/course/outline_rep.php new file mode 100644 index 0000000000..1fcf763b02 --- /dev/null +++ b/course/outline_rep.php @@ -0,0 +1,131 @@ +id) or ($course->showreports and $USER->id == $user->id))) { + error("You are not allowed to look at this page"); + } + + add_to_log($course->id, "course", "course report", "course.php?id=$course->id",$course->id); + + $stractivityreport = get_string("activityreport"); + $strparticipants = get_string("participants"); + $stroutline = get_string("outline"); + $strcomplete = get_string("complete"); + $stralllogs = get_string("alllogs"); + $strtodaylogs = get_string("todaylogs"); + + if ($course->category) { + print_header("$course->shortname: $stractivityreport", "$course->fullname", + "id\">$course->shortname -> + $stractivityreport"); + } else { + print_header("$course->shortname: $stractivityreport ($mode)", "$course->fullname", + "id&course=$course->id\">$user->firstname $user->lastname -> + $stractivityreport -> $strmode"); + } + print_heading("$course->fullname"); + + echo ""; + echo ""; + echo "
$stractivityreport:
"; + + get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused); + + $sections = get_all_sections($course->id); + + for ($i=0; $i<=$course->numsections; $i++) { + + if (isset($sections[$i])) { // should always be true + + $section = $sections[$i]; + + if ($section->sequence) { + echo "
"; + echo "

"; + switch ($course->format) { + case "weeks": print_string("week"); break; + case "topics": print_string("topic"); break; + default: print_string("section"); break; + } + echo " $i

"; + + echo ""; + } + } + } + + print_footer($course); + + +function print_outline_row($mod, $instance, $result) { + $image = "modname/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"$mod->modfullname\">"; + + echo ""; + echo "$image"; + echo ""; + echo " modfullname\""; + echo " HREF=\"../mod/$mod->modname/view.php?id=$mod->id\">$instance->name"; + echo "   "; + echo ""; + if (isset($result->info)) { + echo "$result->info"; + } else { + echo "

-

"; + } + echo ""; + echo "   "; + if (isset($result->time)) { + $timeago = format_time(time() - $result->time); + echo "".userdate($result->time)." ($timeago)"; + } + echo ""; +} + +?> +