- Filter questions

svn path=/trunk/boinc/; revision=16390
This commit is contained in:
David Anderson 2008-11-03 03:06:29 +00:00
parent 1de55a2842
commit a5481e1714
3 changed files with 30 additions and 2 deletions

View File

@ -301,3 +301,12 @@ David Oct 30 2008
bolt_compare.php bolt_compare.php
bolt_map.php bolt_map.php
bossa_admin.php bossa_admin.php
David Nov 2 2008
- Filter questions
html/
inc/
bolt_cat.inc
ops/
bolt_map.php

View File

@ -119,6 +119,21 @@ function breakdown_form($sel_name) {
echo "</ul>"; echo "</ul>";
} }
// return filter and breakdown info for URLs
//
function filter_url() {
global $filter, $filter_cat, $breakdown, $breakdown_cat;
$x = "";
if ($filter && $filter_cat) {
$x .= "&filter=".$filter->name.":$filter_cat";
}
if ($breakdown && $breakdown_cat) {
$x .= "&breakdown=".$breakdown->name.":$breakdown_cat";
}
return $x;
}
// get filter and breakdown from form vars // get filter and breakdown from form vars
// //
function get_filters_from_form() { function get_filters_from_form() {

View File

@ -266,7 +266,7 @@ function show_unit_row($unit, $class, $level, $is_answer) {
echo "<td>$n</td>"; echo "<td>$n</td>";
$n = get_nquestions($unit, $mode); $n = get_nquestions($unit, $mode);
if ($n) { if ($n) {
echo "<td><a href=bolt_map.php?action=questions&course_id=$course_id&name=$unit->name&mode=$mode>$n</a></td>\n"; echo "<td><a href=bolt_map.php?action=questions&course_id=$course_id&name=$unit->name&mode=$mode".filter_url().">$n</a></td>\n";
} else { } else {
echo "<td>0</td>\n"; echo "<td>0</td>\n";
} }
@ -414,8 +414,11 @@ function show_map() {
} }
function show_questions() { function show_questions() {
$name = get_str('name');
global $course_id; global $course_id;
$name = get_str('name');
$mode = get_int('mode');
get_filters_from_form();
$snap = read_map_snapshot($course_id); $snap = read_map_snapshot($course_id);
$qs = $snap->questions[$name]; $qs = $snap->questions[$name];
admin_page_head("Questions about $name"); admin_page_head("Questions about $name");
@ -427,6 +430,7 @@ function show_questions() {
</tr> </tr>
"; ";
foreach ($qs as $q) { foreach ($qs as $q) {
if ($q->mode != $mode) continue;
$user = $snap->users[$q->user_id]; $user = $snap->users[$q->user_id];
echo "<tr> echo "<tr>
<td>".time_str($q->create_time)."</td> <td>".time_str($q->create_time)."</td>