Skip to content

Commit

Permalink
Dev: refactoring "GROUP DETAILS", first step: easier conditions to re…
Browse files Browse the repository at this point in the history
…ad for active survey
  • Loading branch information
LouisGac committed Mar 30, 2017
1 parent 9f06e77 commit ef2ef61
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -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']);

Expand All @@ -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.
Expand All @@ -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?
Expand Down

0 comments on commit ef2ef61

Please sign in to comment.