Skip to content

Commit

Permalink
Dev: Fix undefined variables
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Sep 1, 2016
1 parent 2f7c58a commit 408815c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
6 changes: 3 additions & 3 deletions application/controllers/survey/index.php
Expand Up @@ -354,7 +354,7 @@ function action()
} else {
$errormsg .= gT("There is no matching saved survey");
}
randomizationGroupsAndQuestions($surveyid, $preview);
randomizationGroupsAndQuestions($surveyid);
initFieldArray($surveyid, $_SESSION['survey_' . $surveyid]['fieldmap']);
}
if ($errormsg) {
Expand Down Expand Up @@ -582,7 +582,7 @@ function action()
$_SESSION['survey_'.$surveyid]['maxstep'] = $_SESSION['survey_'.$surveyid]['totalsteps'];
}
loadanswers();
randomizationGroupsAndQuestions($surveyid, $preview);
randomizationGroupsAndQuestions($surveyid);
initFieldArray($surveyid, $_SESSION['survey_' . $surveyid]['fieldmap']);
}
}
Expand All @@ -603,7 +603,7 @@ function action()
$thissurvey['format'] = 'S';
}
buildsurveysession($surveyid,true);
randomizationGroupsAndQuestions($surveyid, $preview);
randomizationGroupsAndQuestions($surveyid, true);
initFieldArray($surveyid, $_SESSION['survey_' . $surveyid]['fieldmap']);
}

Expand Down
2 changes: 1 addition & 1 deletion application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -437,7 +437,7 @@ function run($surveyid,$args)
if (!isset($_SESSION[$LEMsessid]['step']))
{
buildsurveysession($surveyid);
randomizationGroupsAndQuestions($surveyid, $preview);
randomizationGroupsAndQuestions($surveyid);
initFieldArray($surveyid, $_SESSION['survey_' . $surveyid]['fieldmap']);

if($surveyid != LimeExpressionManager::getLEMsurveyId())
Expand Down
9 changes: 6 additions & 3 deletions application/helpers/frontend_helper.php
Expand Up @@ -1127,11 +1127,14 @@ function checkPassthruLabel($surveyid, $preview, $fieldmap)
function prefillFromCommandLine($surveyid)
{
$reservedGetValues= array('token','sid','gid','qid','lang','newtest','action');
$startingValues= $_SESSION['survey_' . $surveyid]['startingValues'];
if (empty($startingValues))
if (!isset($_SESSION['survey_' . $surveyid]['startingValues']))
{
$startingValues=array();
}
else
{
$startingValues= $_SESSION['survey_' . $surveyid]['startingValues'];
}
if (isset($_GET))
{
foreach ($_GET as $k=>$v)
Expand Down Expand Up @@ -1268,7 +1271,7 @@ function testCaptcha(array $aEnterTokenData, array $subscenarios, $surveyid, $lo
* @param boolean $preview
* @return void
*/
function randomizationGroupsAndQuestions($surveyid, $preview, $fieldmap = array())
function randomizationGroupsAndQuestions($surveyid, $preview = false, $fieldmap = array())
{
// Initialize the randomizer. Seed will be stored in response.
ls\mersenne\setSeed($surveyid);
Expand Down

0 comments on commit 408815c

Please sign in to comment.