id); if (! $user = get_record("user", "id", $user)) { error("User ID is incorrect"); } if (!isteacher($course->id) and $user->id != $USER->id ) { error("You are not allowed to look at this page"); } add_to_log($course->id, "course", "user report", "user.php?id=$course->id&user=$user->id&mode=$mode", "$user->id"); print_header("$course->shortname: Activity Report ($mode)", "$course->fullname", "id\">$course->shortname -> id\">Participants -> id&course=$course->id\">$user->firstname $user->lastname -> Activity Report ($mode)", ""); print_heading("$user->firstname $user->lastname"); echo ""; echo ""; if ($mode != "outline") { echo ""; } else { echo ""; } if ($mode != "complete") { echo ""; } else { echo ""; } if ($mode != "today") { echo ""; } else { echo ""; } if ($mode != "alllogs") { echo ""; } else { echo ""; } echo "
Reports: id&user=$user->id&mode=outline>OutlineOutlineid&user=$user->id&mode=complete>CompleteCompleteid&user=$user->id&mode=today>TodayTodayid&user=$user->id&mode=alllogs>All logsAll logs
"; get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused, $modsectioncounts); switch ($mode) { case "today" : echo "
"; print_log_graph($course, $user->id, "userday.png", time() ); echo "
"; print_log($course, $user->id, usergetmidnight(time()), "ORDER BY l.time DESC"); break; case "alllogs" : echo "
"; print_log_graph($course, $user->id, "usercourse.png"); echo "
"; print_log($course, $user->id, 0, "ORDER BY l.time DESC"); break; case "outline" : case "complete" : default: $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 ""; } } } break; } 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 ago)"; } echo ""; } ?>