Esempio n. 1
0
function show_choice($top_unit)
{
    global $course_id;
    admin_page_head("Unit comparison");
    echo "\n\t\t<form action=bolt_compare.php>\n\t\t<input type=hidden name=course_id value={$course_id}>\n\t\tThis tool lets you compare alternative lessons.\n\t\tThese lessons must be included in a 'select' unit,\n\t\ttypically with a random selection function.\n\t\tThis must be followed by an exercise set\n\t\tthat tests for the concepts in the lessons.\n\t\t<p>\n\t\tPlease choose a select unit\n\t";
    choose_select($top_unit);
    echo "\n\t\tand an exercise set\n\t";
    choose_xset($top_unit);
    echo "\n\t\t<input type=hidden name=action value=snap_form>\n\t\t<p>\n\t\t<input type=submit value=OK>\n\t";
    admin_page_tail();
}
$course_id = get_int('course_id');
$course = BoltCourse::lookup_id($course_id);
$top_unit = (require_once $course->doc_file());
$action = get_str('action', true);
switch ($action) {
    case "":
        show_choice($top_unit);
        break;
    case "snap_form":
        show_snap_form($top_unit);
        break;
    case "snap_action":
        snap_action();
        break;
    case "compare":
        show_compare();
        break;
    default:
        error_page("Unknown action {$action}");
}
Esempio n. 2
0
            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();
}
$course_id = get_int('course_id');
$course = BoltCourse::lookup_id($course_id);
if (!$course) {
    error_page("no course");
}
$top_unit = (require_once $course->doc_file());
$action = get_str('action', true);
switch ($action) {
    case "":
        show_snap_form();
        break;
    case "snap_action":
        snap_action();
        break;
    case "map":
        show_map();
        break;
    case "questions":
        show_questions();
        break;
    default:
        error_page("Unknown action {$action}");
}