Skip to content

Commit

Permalink
Fixed issue #12919: Question-by-question does not work with EM
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Nov 15, 2017
1 parent f003d23 commit 7c7e82c
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -515,7 +515,7 @@ private function initMove()
$this->initTotalAndMaxSteps();
$this->checkIfUseBrowserNav(); // Check if user used browser navigation, or relaoded page

if ($this->move != 'clearcancel' && $this->move != 'confirmquota'){
if ($this->sMove != 'clearcancel' && $this->sMove != 'confirmquota'){
$this->checkPrevStep(); // Check if prev step is set, else set it
$this->setMoveResult();
$this->checkClearCancel();
Expand All @@ -525,7 +525,7 @@ private function initMove()

// CHECK UPLOADED FILES
// TMSW - Move this into LEM::NavigateForwards?
$this->filenotvalidated = checkUploadedFileValidity($this->iSurveyid, $this->move);
$this->filenotvalidated = checkUploadedFileValidity($this->iSurveyid, $this->sMove);

//SEE IF THIS GROUP SHOULD DISPLAY
if ($_SESSION[$this->LEMsessid]['step'] == 0) {
Expand Down Expand Up @@ -729,11 +729,11 @@ private function checkIfUseBrowserNav()
* Seems OK only when movenext but not with move by index : same with $this->aMoveResult = LimeExpressionManager::GetLastMoveResult(true);
*/
$this->LEMskipReprocessing = true;
$this->move = "movenext"; // so will re-display the survey
$this->sMove = "movenext"; // so will re-display the survey
}else{
// trying to use browser back buttons, which may be disallowed if no 'previous' button is present
$this->LEMskipReprocessing = true;
$this->move = "movenext"; // so will re-display the survey
$this->sMove = "movenext"; // so will re-display the survey
$this->bInvalidLastPage = true;
$this->backpopup = gT("Please use the LimeSurvey navigation buttons or index. It appears you attempted to use the browser back button to re-submit a page."); // TODO: twig
}
Expand Down Expand Up @@ -767,12 +767,12 @@ private function checkClearCancel()
*/
private function setPrevStep()
{
if (isset($this->move))
if (isset($this->sMove))
{
if(!in_array($this->move,array("clearall","changelang","saveall","reload")))
if(!in_array($this->sMove,array("clearall","changelang","saveall","reload")))
$_SESSION[$this->LEMsessid]['prevstep'] = $_SESSION[$this->LEMsessid]['step'];
else // Accepted $move without error
$_SESSION[$this->LEMsessid]['prevstep']= $this->move;
$_SESSION[$this->LEMsessid]['prevstep']= $this->sMove;
}
else
{
Expand Down Expand Up @@ -889,7 +889,7 @@ private function checkIfFinished()
}

if ($this->aMoveResult['finished'] == true){
$this->move = 'movesubmit';
$this->sMove = 'movesubmit';
}

if ($this->sMove == "movesubmit" && $this->aMoveResult['finished'] == false){
Expand Down Expand Up @@ -1166,7 +1166,6 @@ private function setVarFromArgs($args)
$this->param = $param;

// Todo: check which ones are really needed
$this->move = isset( $move ) ?$move :null ;
$this->LEMskipReprocessing = isset( $LEMskipReprocessing )?$LEMskipReprocessing :null ;
$this->thissurvey = isset( $thissurvey )?$thissurvey :null ;
$this->iSurveyid = isset( $surveyid )?$surveyid :null ;
Expand Down Expand Up @@ -1734,10 +1733,10 @@ private function setGroup()
if ($this->sSurveyMode != 'group'){
$this->aStepInfo = LimeExpressionManager::GetStepIndexInfo($this->aMoveResult['seq']);
}

$this->gid = $this->aStepInfo['gid'];
$this->groupname = $this->aStepInfo['gname'];
$this->groupdescription = $this->aStepInfo['gtext'];

}
}
}
Expand Down

0 comments on commit 7c7e82c

Please sign in to comment.