From a5481e1714eea29ef39e2aa39e27734a24b9b63e Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 3 Nov 2008 03:06:29 +0000 Subject: [PATCH] - Filter questions svn path=/trunk/boinc/; revision=16390 --- bolt_checkin_notes.txt | 9 +++++++++ html/inc/bolt_cat.inc | 15 +++++++++++++++ html/ops/bolt_map.php | 8 ++++++-- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/bolt_checkin_notes.txt b/bolt_checkin_notes.txt index 12c35e2bcf..4fd1e27c5b 100644 --- a/bolt_checkin_notes.txt +++ b/bolt_checkin_notes.txt @@ -301,3 +301,12 @@ David Oct 30 2008 bolt_compare.php bolt_map.php bossa_admin.php + +David Nov 2 2008 + - Filter questions + + html/ + inc/ + bolt_cat.inc + ops/ + bolt_map.php diff --git a/html/inc/bolt_cat.inc b/html/inc/bolt_cat.inc index 7b65625cc0..96a0d9e7d7 100644 --- a/html/inc/bolt_cat.inc +++ b/html/inc/bolt_cat.inc @@ -119,6 +119,21 @@ function breakdown_form($sel_name) { echo ""; } +// 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 // function get_filters_from_form() { diff --git a/html/ops/bolt_map.php b/html/ops/bolt_map.php index 6f42ae1c8b..67e050a5f4 100644 --- a/html/ops/bolt_map.php +++ b/html/ops/bolt_map.php @@ -266,7 +266,7 @@ function show_unit_row($unit, $class, $level, $is_answer) { echo "$n"; $n = get_nquestions($unit, $mode); if ($n) { - echo "name&mode=$mode>$n\n"; + echo "name&mode=$mode".filter_url().">$n\n"; } else { echo "0\n"; } @@ -414,8 +414,11 @@ function show_map() { } function show_questions() { - $name = get_str('name'); 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"); @@ -427,6 +430,7 @@ function show_questions() { "; foreach ($qs as $q) { + if ($q->mode != $mode) continue; $user = $snap->users[$q->user_id]; echo " ".time_str($q->create_time)."