[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phptest-users] [PATCH] disabling view correct answers for user
From: |
Dan Kegel |
Subject: |
[Phptest-users] [PATCH] disabling view correct answers for user |
Date: |
Wed, 21 Aug 2002 21:28:05 -0700 |
OK, turns out this is quite easy. Here's a patch to only
let admins see user answers.
To apply, do
cd phptest
wget http://www.kegel.com/hide_answers.patch
patch -p0 < hide_answers.patch
- Dan
--- view_answers.php.orig Thu Aug 22 00:16:01 2002
+++ view_answers.php Thu Aug 22 00:18:25 2002
@@ -41,6 +41,7 @@
echo '<b>' . $strings['ANSWER_DATE'] . "</b>$row->date<br />";
echo '<b>' . $strings['ANSWER_SCORE'] .
"</b>$row->points/$row->points_possible
<b>($row->score%)</b><br /><br />";
+ if ($user->admin) {
$result = $db->query("SELECT * FROM answers WHERE r_id = $r_id");
while ($row = $db->fetch_object($result)) {
@@ -60,6 +61,7 @@
echo "<b>$strings[ANSWER_CORRECT]</b>$row->answer<br />\n";
echo "<b>$strings[ANSWER_NOTES]</b>" . nl2br($row->additional_notes) .
"<br /><br />\n";
}
+ }
echo "</div>";
require_once('./include/footer.inc.php');
- [Phptest-users] disabling view correct answers for user, John Lacey, 2002/08/21
- Re: [Phptest-users] disabling view correct answers for user, Dan Kegel, 2002/08/21
- Re: [Phptest-users] disabling view correct answers for user, Brandon Tallent, 2002/08/21
- Re: [Phptest-users] disabling view correct answers for user, Dan Kegel, 2002/08/22
- [Phptest-users] [PATCH] disabling view correct answers for user,
Dan Kegel <=
- Re: [Phptest-users] disabling view correct answers for user, Brandon Tallent, 2002/08/22
- Re: [Phptest-users] disabling view correct answers for user, Dan Kegel, 2002/08/22
- Re: [Phptest-users] disabling view correct answers for user, Brandon Tallent, 2002/08/22
- Re: [Phptest-users] disabling view correct answers for user, John Lacey, 2002/08/22
- Re: [Phptest-users] disabling view correct answers for user, Kathleen A . Ferraro, 2002/08/22
- Re: [Phptest-users] disabling view correct answers for user, Brandon Tallent, 2002/08/22