Skip to content

Commit

Permalink
Fixed mandatory checking bug which wrecked multi-mandatory checking. …
Browse files Browse the repository at this point in the history
…(Missing action after if statement for <<PREV)

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@872 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Jan 31, 2004
1 parent 0bc9bd8 commit 35da3ee
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions group.php
Expand Up @@ -34,14 +34,14 @@
#############################################################
*/

//Move current step
//Move current step ###########################################################################
if (!isset($_POST['thisstep'])) {$_POST['thisstep'] = "";}
if (!isset($gl)) {$gl=array("null");}
if (isset($_POST['move']) && $_POST['move'] == " << "._PREV." ") {$_SESSION['step'] = $_POST['thisstep']-1;}
if (isset($_POST['move']) && $_POST['move'] == " "._NEXT." >> ") {$_SESSION['step'] = $_POST['thisstep']+1;}
if (isset($_POST['move']) && $_POST['move'] == " "._LAST." ") {$_SESSION['step'] = $_POST['thisstep']+1;}

//CONVERT POSTED ANSWERS TO SESSION VARIABLES
//CONVERT POSTED ANSWERS TO SESSION VARIABLES #################################################
if (isset($_POST['fieldnames']) && $_POST['fieldnames'])
{
$postedfieldnames=explode("|", $_POST['fieldnames']);
Expand All @@ -52,7 +52,7 @@
}
}

//CHECK IF ALL MANDATORY QUESTIONS HAVE BEEN ANSWERED
//CHECK IF ALL MANDATORY QUESTIONS HAVE BEEN ANSWERED ############################################
if ($allowmandatorybackwards==1 && isset($_POST['move']) && $_POST['move'] == " << "._PREV." ") {$backok="Y";}

if ((isset($_POST['mandatory']) && $_POST['mandatory']) && (!isset($backok) || $backok != "Y"))
Expand All @@ -69,7 +69,7 @@
if ($$multiname == $$multiname2) //so far all multiple choice options are unanswered
{
//The number of questions not answered is equal to the number of questions
if (isset($_POST['move']) && $_POST['move'] == " << "._PREV." ")
if (isset($_POST['move']) && $_POST['move'] == " << "._PREV." ") {$_SESSION['step'] = $_POST['thisstep'];}
if (isset($_POST['move']) && $_POST['move'] == " "._NEXT." >> ") {$_SESSION['step'] = $_POST['thisstep'];}
if (isset($_POST['move']) && $_POST['move'] == " "._LAST." ") {$_SESSION['step'] = $_POST['thisstep']; $_POST['move'] == " "._NEXT." >> ";}
$notanswered[]=substr($multiname, 5, strlen($multiname));
Expand Down Expand Up @@ -179,7 +179,7 @@
}
}

//SUBMIT
//SUBMIT ###############################################################################
if (isset($_POST['move']) && $_POST['move'] == " "._SUBMIT." ")
{
//If survey has datestamp turned on, add $localtimedate to sessions
Expand Down Expand Up @@ -386,7 +386,7 @@
exit;
}

//LAST PHASE
//LAST PHASE ###########################################################################
if (isset($_POST['move']) && $_POST['move'] == " "._LAST." " && (!isset($notanswered) || !$notanswered))
{
//READ TEMPLATES, INSERT DATA AND PRESENT PAGE
Expand Down Expand Up @@ -434,7 +434,7 @@
exit;
}

//SEE IF $sid EXISTS
//SEE IF $sid EXISTS ####################################################################
if ($surveyexists <1)
{
//SURVEY DOES NOT EXIST. POLITELY EXIT.
Expand All @@ -451,7 +451,7 @@
exit;
}

//RUN THIS IF THIS IS THE FIRST TIME
//RUN THIS IF THIS IS THE FIRST TIME ######################################################
if (!isset($_SESSION['step']) || !$_SESSION['step'])
{
if ($tokensexist == 1 && (!isset($_GET['token']) || !$_GET['token']))
Expand Down

0 comments on commit 35da3ee

Please sign in to comment.