end_time) {
$d = $view->end_time - $view->start_time;
$dur = "$d seconds";
} else {
$dur = "---";
}
if ($view->result_id) {
$result = BoltResult::lookup_id($view->result_id);
$qs = str_replace("action=answer", "action=answer_page", $result->response);
$x = "
Score: $result->score
Answer page";
}
echo "
$view->id |
".time_str($view->start_time)." |
$dur |
$view->item_name |
".mode_name($view->mode)." $x |
";
//".phase_name($view->phase)." |
echo "
".action_name($view->action)." |
";
}
function show_views() {
global $user;
global $course;
$views = BoltView::enum("user_id=$user->id and course_id=$course->id order by id desc");
start_table();
table_header("ID", "Time", "Duration", "Item", "Mode",
// "Phase",
"Action");
foreach ($views as $view) {
show_view($view);
}
end_table();
}
function show_refresh($r) {
echo "
".time_str($r->create_time)." |
$r->name
course_id&refresh_id=$r->id&action=start>Start
course_id&refresh_id=$r->id&action=resume>Resume
|
".time_str($r->due_time)." |
";
}
function show_refreshes() {
global $user;
global $course;
$refreshes = BoltRefreshRec::enum("user_id=$user->id and course_id=$course->id");
start_table();
table_header("Created", "Unit", "Due");
foreach ($refreshes as $r) {
show_refresh($r);
}
end_table();
}
require_once("../inc/bolt_db.inc");
$course_id = get_int('course_id');
$course = BoltCourse::lookup_id($course_id);
if (!$course) error_page("No such course");
page_head("Your history in $course->name");
show_views();
show_refreshes();
echo "
Resume course
";
page_tail();
?>