Skip to content

Commit

Permalink
Dev: added stepInfo to private variables
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Nov 22, 2016
1 parent 6e303cb commit 1ba22c5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -47,6 +47,7 @@ class SurveyRuntimeHelper {
private $moveResult = null; // Contains the result of LimeExpressionManager::JumpTo() OR LimeExpressionManager::NavigateBackwards() OR NavigateForwards::LimeExpressionManager(). TODO: create a function LimeExpressionManager::MoveTo that call the right method
private $move = null; // The move requested by user. Set by frontend_helper::getMove() from the POST request.
private $invalidLastPage; // Just a variable used to check if user submitted a survey while it's not finished. Just a variable for a logic step ==> should not be a Class variable (for now, only here for the redata== get_defined_vars mess)
private $stepInfo;

// Popups: HTML of popus. If they are null, no popup. If they contains a string, a popup will be shown to participant.
// They could probably be merged.
Expand Down Expand Up @@ -122,12 +123,11 @@ public function run($surveyid,$args)
if ($surveyExists < 1){
$this->renderNoMatchingSurvey($sTemplateViewPath, $redata);
}

// createFieldMap($surveyid,'full',false,false,$_SESSION[$LEMsessid]['s_lang']);

//GET GROUP DETAILS
if ($surveyMode == 'group' && $previewgrp){
// setcookie("limesurvey_timers", "0"); //@todo fix - sometimes results in headers already sent error
$_gid = sanitize_int($param['gid']);

LimeExpressionManager::StartSurvey($thissurvey['sid'], 'group', $surveyOptions, false, $LEMdebugLevel);
Expand All @@ -147,7 +147,7 @@ public function run($surveyid,$args)
$_SESSION[$LEMsessid]['step'] = $moveResult['seq'] + 1; // step is index base 1?
}

$stepInfo = LimeExpressionManager::GetStepIndexInfo($moveResult['seq']);
$stepInfo = $this->stepInfo = LimeExpressionManager::GetStepIndexInfo($moveResult['seq']);
$gid = $stepInfo['gid'];
$groupname = $stepInfo['gname'];
$groupdescription = $stepInfo['gtext'];
Expand All @@ -165,9 +165,9 @@ public function run($surveyid,$args)
LimeExpressionManager::StartSurvey($surveyid, 'question', $surveyOptions, false, $LEMdebugLevel);
$qSec = LimeExpressionManager::GetQuestionSeq($_qid);
$moveResult = LimeExpressionManager::JumpTo($qSec+1,true,false,true);
$stepInfo = LimeExpressionManager::GetStepIndexInfo($moveResult['seq']);
$stepInfo = $this->stepInfo = LimeExpressionManager::GetStepIndexInfo($moveResult['seq']);
} else {
$stepInfo = LimeExpressionManager::GetStepIndexInfo($moveResult['seq']);
$stepInfo = $this->stepInfo = LimeExpressionManager::GetStepIndexInfo($moveResult['seq']);
}

$gid = $stepInfo['gid'];
Expand Down Expand Up @@ -646,6 +646,7 @@ private function getArgs()
'assessments' => $this->assessments ,
'moveResult' => $this->moveResult ,
'move' => $this->move ,
'stepInfo' => $this->stepInfo ,
'invalidLastPage' => $this->invalidLastPage ,
'backpopup' => $this->backpopup ,
'popup' => $this->popup ,
Expand Down Expand Up @@ -1015,7 +1016,7 @@ private function checkIfFinished()
$move = $this->move = 'movesubmit';
}else{
$_SESSION[$LEMsessid]['step'] = $moveResult['seq'] + 1; // step is index base 1
$stepInfo = LimeExpressionManager::GetStepIndexInfo($moveResult['seq']);
$stepInfo = $this->stepInfo = LimeExpressionManager::GetStepIndexInfo($moveResult['seq']);
}

if ($move == "movesubmit" && $moveResult['finished'] == false){
Expand Down

0 comments on commit 1ba22c5

Please sign in to comment.