Skip to content

Commit

Permalink
BUGFIX: Checks to see that session variables exist in checkgroupfordi…
Browse files Browse the repository at this point in the history
…splay function before using them.

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@978 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Apr 9, 2004
1 parent 4677e82 commit d9bb6e7
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions index.php
Expand Up @@ -340,6 +340,11 @@ function makegraph($thisstep, $total)

function checkgroupfordisplay($gid)
{
//This function checks all the questions in a group to see if they have
//conditions, and if the do - to see if the conditions are met.
//If none of the questions in the group are set to display, then
//the function will return false, to indicate that the whole group
//should not display at all.
global $dbprefix;
$countQuestionsInThisGroup=0;
$countConditionalQuestionsInThisGroup=0;
Expand Down Expand Up @@ -378,13 +383,19 @@ function checkgroupfordisplay($gid)
if ($thistype == "M" || $thistype == "P")
{
$fieldname=$row['cfieldname'].$row['value'];
$cfieldname=$_SESSION[$fieldname];
$cvalue="Y";
if (isset($_SESSION[$fieldname]))
{
$cfieldname=$_SESSION[$fieldname];
$cvalue="Y";
}
}
else
{
$cfieldname=$_SESSION[$row['cfieldname']];
$cvalue=$row['value'];
if (isset($_SESSION[$row['cfieldname']]))
{
$cfieldname=$_SESSION[$row['cfieldname']];
$cvalue=$row['value'];
}
}
if ($cfieldname == $cvalue)
{
Expand Down

0 comments on commit d9bb6e7

Please sign in to comment.