[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Phptest-users] Possible to sort test results by group?
From: |
Brandon |
Subject: |
Re: [Phptest-users] Possible to sort test results by group? |
Date: |
Fri, 13 Jun 2003 08:46:58 -0700 (PDT) |
It's not possible to do currently, but you can add
support to do it pretty easily. For example, here is
a quick hack to do it. Add the following to
view_results.php
if (!empty($group)) {
$group_id = pt_get_group_id($group)
$query .= "WHERE group_id = $group_id ";
}
Add it right after this part:
// build sql query. If $user_id we want to
restrict results to a particular user.
$query = "SELECT * FROM results ";
if ($user_id != -1) {
$query .= "WHERE user_id = $user_id ";
$result2 = $db->query("SELECT real_name FROM
users WHERE user_id = $user_id");
list($real_name) = $db->fetch_array($result2);
}
Now you can see results for one particular group by
adding a ?group=group_name to the url. For instance,
view_results.php?group=centrallibrary.
If you wanted to do it by group id instead of group
name, change it to this:
if (!empty($group_id)) {
$query .= "WHERE group_id = $group_id ";
}
Brandon
--- Jody Cleveland <address@hidden>
wrote:
> Hello,
>
> I'm currently using phptest for a skills assessment
> for over 300 people.
> The people all work for different libraries within
> our consortium.
> Anyway, there are 30 libraries. What I'd like to do
> is create a group
> for each library. The director of each library has
> requested the results
> from each of their staff. As it stands now, I'm
> going to have to do a
> lot of sifting through test results.
>
> Is there any way to only display results for a
> specific group?
>
>
> --
> Jody Cleveland
> (address@hidden)
>
>
> _______________________________________________
> Phptest-users mailing list
> address@hidden
>
http://mail.nongnu.org/mailman/listinfo/phptest-users