Skip to content

Commit

Permalink
Bugfix: Checking questions that occur before the current one was brok…
Browse files Browse the repository at this point in the history
…en because the comparison list wasn't showing Text type questions. This fixes the bug, and likewise fixes the "copy" questions bug, because the error was causing conditions script to believe that the question was the last one in the survey, and therefore there couldn't be any subsequent questions to copy the condition to.

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@1142 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Aug 26, 2004
1 parent fb5f30b commit 1f6a7b5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions admin/conditions.php
Expand Up @@ -191,8 +191,8 @@
$qquery = "SELECT *\n"
. "FROM {$dbprefix}questions, {$dbprefix}groups\n"
."WHERE {$dbprefix}questions.gid={$dbprefix}groups.gid\n"
."AND {$dbprefix}questions.sid=$sid\n"
."AND type not in ('S', 'D', 'T', 'Q')";
."AND {$dbprefix}questions.sid=$sid\n";

$qresult = mysql_query($qquery) or die ("$qquery<br />".mysql_error());
$qrows = array(); //Create an empty array in case mysql_fetch_array does not return any rows
while ($qrow = mysql_fetch_assoc($qresult)) {$qrows[] = $qrow;} // Get table output into array
Expand All @@ -203,7 +203,10 @@
{
if ($qrow["qid"] != $qid && $position=="before")
{
$questionlist[]=$qrow["qid"];
if ($qrow['type'] != "S" && $qrow['type'] != "D" && $qrow['type'] != "T" && $qrow['type'] != "Q")
{
$questionlist[]=$qrow["qid"];
}
}
elseif ($qrow["qid"] == $qid)
{
Expand Down

0 comments on commit 1f6a7b5

Please sign in to comment.