Skip to content

Commit

Permalink
Fixed bug #835: "No answer" condition doesn't work if depending on Li…
Browse files Browse the repository at this point in the history
…st(Radio) question - 2nd try

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/phpsurveyor@2830 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed May 1, 2007
1 parent 064e288 commit 4229077
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions admin/conditions.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@
}
break;
}
$canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['code'], "", $clang->gT("No answer"));
$canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['code'], " ", $clang->gT("No answer"));
}
}
elseif ($rows['type'] == "R")
Expand All @@ -350,7 +350,7 @@
{
$canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$i, $qck[0], $qck[1]);
}
$canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$i, "", $clang->gT("No answer"));
$canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$i, " ", $clang->gT("No answer"));
}
unset($quicky);
}
Expand All @@ -362,19 +362,19 @@
case "Y":
$canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], "Y", $clang->gT("Yes"));
$canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], "N", $clang->gT("No"));
$canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], "", $clang->gT("No answer"));
$canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], " ", $clang->gT("No answer"));
break;
case "G":
$canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], "F", $clang->gT("Female"));
$canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], "M", $clang->gT("Male"));
$canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], "", $clang->gT("No answer"));
$canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], " ", $clang->gT("No answer"));
break;
case "5":
for ($i=1; $i<=5; $i++)
{
$canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], $i, $i);
}
$canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], "", $clang->gT("No answer"));
$canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], " ", $clang->gT("No answer"));
break;
case "W":
case "Z":
Expand All @@ -401,7 +401,7 @@
if ($rows['type'] != "M" && $rows['type'] != "P" && $rows['type'] != "J" && $rows['type'] != "I")

{
$canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], "", $clang->gT("No answer"));
$canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], " ", $clang->gT("No answer"));
}
break;
}
Expand Down
4 changes: 2 additions & 2 deletions qanda.php
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ function do_list_radio($ia)
if ($ia[6] != "Y" && $shownoanswer == 1)
{
$rowcounter++;
$answer .= "\t\t\t\t\t\t <input class='radio' type='radio' name='$ia[1]' id='answer$ia[1]NANS' value='' ";
$answer .= "\t\t\t\t\t\t <input class='radio' type='radio' name='$ia[1]' id='answer$ia[1]NANS' value=' ' ";
if (((!isset($_SESSION[$ia[1]]) || $_SESSION[$ia[1]] == "") && (!isset($defexists) || !$defexists)) || ($_SESSION[$ia[1]] == ' ' && (!isset($defexists) || !$defexists)))
{
$answer .= " checked"; //Check the "no answer" radio button if there is no default, and user hasn't answered this.
Expand Down Expand Up @@ -949,7 +949,7 @@ function do_list_flexible_radio($ia)
if ($ia[6] != "Y" && $shownoanswer == 1)
{
$rowcounter++;
$answer .= "\t\t\t\t\t\t <input class='radio' type='radio' name='$ia[1]' id='answer$ia[1]NANS' value='' ";
$answer .= "\t\t\t\t\t\t <input class='radio' type='radio' name='$ia[1]' id='answer$ia[1]NANS' value=' ' ";
if ((!isset($defexists) || $defexists != "Y") && (!isset($_SESSION[$ia[1]]) || $_SESSION[$ia[1]] == ""))
{
$answer .= " checked"; //Check the "no answer" radio button if there is no default, and user hasn't answered this.
Expand Down

0 comments on commit 4229077

Please sign in to comment.