diff --git a/application/helpers/SurveyRuntimeHelper.php b/application/helpers/SurveyRuntimeHelper.php index ea3bbf86453..6b5dc41b84b 100644 --- a/application/helpers/SurveyRuntimeHelper.php +++ b/application/helpers/SurveyRuntimeHelper.php @@ -122,6 +122,8 @@ public function run($surveyid,$args) // IF GOT THIS FAR, THEN DISPLAY THE ACTIVE GROUP OF QUESTIONSs + + //GET GROUP DETAILS if ($surveyMode == 'group' && $previewgrp){ $_gid = sanitize_int($param['gid']); @@ -147,19 +149,12 @@ public function run($surveyid,$args) $groupname = $stepInfo['gname']; $groupdescription = $stepInfo['gtext']; - }elseif($surveyMode == 'question' && $previewquestion){ - $_qid = sanitize_int($param['qid']); + }elseif($surveyMode == 'question' && $previewquestion){ + $_qid = sanitize_int($param['qid']); LimeExpressionManager::StartSurvey($surveyid, 'question', $surveyOptions, false, $this->LEMdebugLevel); $qSec = LimeExpressionManager::GetQuestionSeq($_qid); $moveResult = LimeExpressionManager::JumpTo($qSec+1,true,false,true); $stepInfo = $this->stepInfo = LimeExpressionManager::GetStepIndexInfo($moveResult['seq']); - }else{ - - } - - //GET GROUP DETAILS - if ($surveyMode == 'group' && $previewgrp){ - }else{ if (($show_empty_group) || !isset($_SESSION[$LEMsessid]['grouplist'])){ $gid = -1; // Make sure the gid is unused. This will assure that the foreach (fieldarray as ia) has no effect. @@ -168,19 +163,17 @@ public function run($surveyid,$args) } else if ($surveyMode != 'survey') { - if ($previewquestion) { - } else { - $stepInfo = $this->stepInfo = LimeExpressionManager::GetStepIndexInfo($moveResult['seq']); - } - - $gid = $stepInfo['gid']; - $groupname = $stepInfo['gname']; + $stepInfo = $this->stepInfo = LimeExpressionManager::GetStepIndexInfo($moveResult['seq']); + $gid = $stepInfo['gid']; + $groupname = $stepInfo['gname']; $groupdescription = $stepInfo['gtext']; } } + + if ($previewquestion) { $_SESSION[$LEMsessid]['step'] = 0; //maybe unset it after the question has been displayed?