From 1e8edc3b8dfbf56bb57533fb27d9792f8832e43d Mon Sep 17 00:00:00 2001 From: Jason Cleeland Date: Fri, 9 Apr 2004 07:38:30 +0000 Subject: [PATCH] All array type questions now listen to the "shownoanswer" setting from config.php git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@982 b72ed6b6-b9f8-46b5-92b4-906544132732 --- qanda.php | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/qanda.php b/qanda.php index 89a55c37478..842a0d33fd2 100644 --- a/qanda.php +++ b/qanda.php @@ -1019,7 +1019,7 @@ function do_gender($ia) function do_array_5point($ia) { - global $dbprefix; + global $dbprefix, $shownoanswer; $qquery = "SELECT other FROM {$dbprefix}questions WHERE qid=".$ia[0]; $qresult = mysql_query($qquery); while($qrow = mysql_fetch_array($qresult)) {$other = $qrow['other'];} @@ -1034,7 +1034,7 @@ function do_array_5point($ia) { $answer .= "\t\t\t\t\t$xc\n"; } - if ($ia[6] != "Y") //Question is not mandatory + if ($ia[6] != "Y" && $shownoanswer == 1) //Question is not mandatory { $answer .= "\t\t\t\t\t"._NOTAPPLICABLE."\n"; } @@ -1051,7 +1051,7 @@ function do_array_5point($ia) if (isset($_SESSION[$myfname]) && $_SESSION[$myfname] == $i) {$answer .= " checked";} $answer .= " onClick='checkconditions(this.value, this.name, this.type)' />\n"; } - if ($ia[6] != "Y") + if ($ia[6] != "Y" && $shownoanswer == 1) { $answer .= "\t\t\t\t\t\n"; } @@ -1103,7 +1103,7 @@ function do_array_10point($ia) if (isset($_SESSION[$myfname]) && $_SESSION[$myfname] == $i) {$answer .= " checked";} $answer .= " onClick='checkconditions(this.value, this.name, this.type)' />\n"; } - if ($ia[6] != "Y") + if ($ia[6] != "Y" && $shownoanswer == 1) { $answer .= "\t\t\t\t\t"._YES."\n" . "\t\t\t\t\t"._UNCERTAIN."\n" . "\t\t\t\t\t"._NO."\n"; - if ($ia[6] != "Y") //Question is not mandatory + if ($ia[6] != "Y" && $shownoanswer == 1) //Question is not mandatory { $answer .= "\t\t\t\t\t"._NOTAPPLICABLE."\n"; } @@ -1156,7 +1156,7 @@ function do_array_yesnouncertain($ia) . "\t\t\t\t\t\t"._INCREASE."\n" . "\t\t\t\t\t"._SAME."\n" . "\t\t\t\t\t"._DECREASE."\n"; - if ($ia[6] != "Y") //Question is not mandatory + if ($ia[6] != "Y" && $shownoanswer == 1) //Question is not mandatory { $answer .= "\t\t\t\t\t"._NOTAPPLICABLE."\n"; } @@ -1209,7 +1210,7 @@ function do_array_increasesamedecrease($ia) . "\t\t\t\t\t\t{$ansrow['answer']}\n"; foreach ($anscode as $ld) @@ -1375,6 +1373,7 @@ function do_array_flexiblecolumns($ia) $answer .= "\t\t\t\t\n"; $fn++; } + foreach($anscode as $ld) { $myfname=$ia[1].$ld; @@ -1384,9 +1383,6 @@ function do_array_flexiblecolumns($ia) $inputnames[]=$myfname; } $answer .= "\t\t\t\n"; - unset($labelans); - unset($labelcode); - unset($oldmyfname); return array($answer, $inputnames); }