Skip to content

Commit

Permalink
Fixed issue #12345: Error when previewing a question
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Apr 26, 2017
1 parent b512e91 commit 926d8ec
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -22,6 +22,9 @@ class SurveyRuntimeHelper {
* i.e: all the private variable concerning the survey should be moved to the survey model and replaced by a $oSurvey
*/

// parameters
private $param;

// Preview datas
private $previewquestion = false;
private $previewgrp = false;
Expand Down Expand Up @@ -100,6 +103,8 @@ public function run($surveyid,$args)

extract($args); // TODO: Check if still needed at this level

$this->param = isset($param)?$param:'';

///////////////////////////////////////////////////////////
// 1: We check if token and/or captcha form shouls be shown
if (!isset($_SESSION[$this->LEMsessid]['step'])){
Expand Down Expand Up @@ -609,6 +614,7 @@ private function getArgs()
'previewgrp' => $this->previewgrp ,
'previewquestion' => $this->previewquestion ,
'sTemplateViewPath' => $this->sTemplateViewPath ,
'param' => $this->param ,
);
return $aPrivateVariables;
}
Expand Down Expand Up @@ -1883,7 +1889,7 @@ private function setPreview()

}elseif($surveyMode == 'question' && $previewquestion){
$_qid = sanitize_int($param['qid']);
LimeExpressionManager::StartSurvey($surveyid, 'question', $surveyOptions, false, $this->LEMdebugLevel);
LimeExpressionManager::StartSurvey($this->surveyid, 'question', $surveyOptions, false, $this->LEMdebugLevel);
$qSec = LimeExpressionManager::GetQuestionSeq($_qid);
$moveResult = $this->moveResult= LimeExpressionManager::JumpTo($qSec+1,true,false,true);
$stepInfo = $this->stepInfo = LimeExpressionManager::GetStepIndexInfo($moveResult['seq']);
Expand Down

0 comments on commit 926d8ec

Please sign in to comment.