function compare_aux($select_name, $xset_name, $snap) { global $top_unit, $course_id, $filter, $filter_cat; global $breakdown, $breakdown_cat; get_filters_from_form(); $select_unit = lookup_unit($top_unit, $select_name); if (!$select_unit) { error_page("no select unit"); } admin_page_head("Unit comparison"); echo "\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"" . URL_BASE . "bolt_admin.css\">\n\t\tThe following compares the alternatives of\n\t\t<b>{$select_name}</b> with respect to <b>{$xset_name}</b>.\n\t\t<p>\n\t"; echo "<table class=\"bolt_box\">"; if ($breakdown) { echo "<tr class=bolt_head1><td colspan=2>Total</td></tr>"; } compare_case(null, $select_unit, $snap, $filter, $filter_cat, null, null); if ($breakdown) { echo "<tr class=bolt_head1><td colspan=2>Breakdown by " . $breakdown->name() . "</td></tr>"; foreach ($breakdown->categories() as $c) { compare_case($c, $select_unit, $snap, $filter, $filter_cat, $breakdown, $c); echo "<p>"; } } echo "</table>"; echo "\n\t\t<form action=bolt_compare.php>\n\t\t<input type=hidden name=action value=compare>\n\t\t<input type=hidden name=course_id value={$course_id}>\n\t\t<input type=hidden name=select_name value=\"{$select_name}\">\n\t\t<input type=hidden name=xset_name value=\"{$xset_name}\">\n\t\t<table width=600><tr><td>\n\t"; filter_form($filter ? $filter->name() : "", $filter_cat); echo "</td><td>"; breakdown_form($breakdown ? $breakdown->name() : ""); echo "\n\t\t</td></tr></table>\n\t\t<p>\n\t\t<input type=submit value=OK>\n\t\t</form>\n\t"; admin_page_tail(); }
function show_questions() { global $course_id; $name = get_str('name'); $mode = get_int('mode'); get_filters_from_form(); $snap = read_map_snapshot($course_id); $qs = $snap->questions[$name]; admin_page_head("Questions about {$name}"); start_table(); echo "<tr>\n\t\t<th>When</th>\n\t\t<th>Who</th>\n\t\t<th>Question</th>\n\t\t</tr>\n\t"; foreach ($qs as $q) { if ($q->mode != $mode) { continue; } $user = $snap->users[$q->user_id]; echo "<tr>\n\t\t\t<td>" . time_str($q->create_time) . "</td>\n\t\t\t<td><a href=student>{$user->name}</td>\n\t\t\t<td>{$q->question}</td>\n\t\t\t</tr>\n\t\t"; } end_table(); admin_page_tail(); }