createFullQuestionIndexByGroup($LEMsessid); } else { $this->createFullQuestionIndexByQuestion($LEMsessid); } } protected function createFullQuestionIndexByGroup($LEMsessid) { echo "\n\n\n"; echo CHtml::openTag('div', array('id' => 'index')); echo CHtml::openTag('div', array('class' => 'container')); echo CHtml::tag('h2', array(), gT("Question index")); echo CHtml::openTag('ol'); foreach ($_SESSION[$LEMsessid]['grouplist'] as $key => $group) { // echo ''; // Better to use tracevar / if (LimeExpressionManager::GroupIsRelevant($group['gid'])) { $group['step'] = $key + 1; $stepInfo = LimeExpressionManager::singleton()->_ValidateGroup($key); $classes = implode(' ', array( 'row', $stepInfo['anyUnanswered'] ? 'missing' : '', $_SESSION[$LEMsessid]['step'] == $group['step'] ? 'current' : '' )); $sButtonSubmit=CHtml::htmlButton(gT('Go to this group'),array('type'=>'submit','value'=>$group['step'],'name'=>'move','class'=>'jshide')); echo CHtml::tag('li', array( 'data-gid' => $group['gid'], 'title' => $group['description'], 'class' => $classes, ), $group['group_name'].$sButtonSubmit); } } echo CHtml::closeTag('ol'); echo CHtml::closeTag('div'); echo CHtml::closeTag('div'); App()->getClientScript()->registerScript('manageIndex',"manageIndex()\n",CClientScript::POS_END); } protected function createFullQuestionIndexByQuestion($LEMsessid) { echo CHtml::openTag('div', array('id' => 'index')); echo CHtml::openTag('div', array('class' => 'container')); echo CHtml::tag('h2', array(), gT("Question index")); echo 'Question by question not yet supported, use incremental index.'; echo CHtml::closeTag('div'); echo CHtml::closeTag('div'); App()->getClientScript()->registerScript('manageIndex',"manageIndex()\n",CClientScript::POS_END); } protected function createIncrementalQuestionIndex($LEMsessid, $surveyMode) { echo "\n\n\n"; echo '
";print_r($_SESSION);echo ""; for($i = 1; isset($_SESSION[$LEMsessid]['files'][$i]); $i++) { unlink('upload/tmp/'.$_SESSION[$LEMsessid]['files'][$i]['filename']); } */ // can't kill session before end message, otherwise INSERTANS doesn't work. $completed = templatereplace($thissurvey['surveyls_endtext'], array(), $redata, 'SubmitEndtextI', false, NULL, array(), true ); $completed .= "
Group/Question Validation Results:" . $moveResult['message'] . " |
" . $clang->gT("One or more mandatory questions have not been answered. You cannot proceed until these have been completed.") . "
"; } //Display the "validation" message on page if necessary if (!$showpopups && !$stepInfo['valid'] && $okToShowErrors) { echo "" . $clang->gT("One or more questions have not been answered in a valid manner. You cannot proceed until these answers are valid.") . "
"; } //Display the "file validation" message on page if necessary if (!$showpopups && isset($filenotvalidated) && $filenotvalidated == true && $okToShowErrors) { echo "" . $clang->gT("One or more uploaded files are not in proper format/size. You cannot proceed until these files are valid.") . "
"; } $_gseq = -1; foreach ($_SESSION[$LEMsessid]['grouplist'] as $gl) { $gid = $gl['gid']; ++$_gseq; $groupname = $gl['group_name']; $groupdescription = $gl['description']; if ($surveyMode != 'survey' && $gid != $onlyThisGID) { continue; } $redata = compact(array_keys(get_defined_vars())); Yii::app()->setConfig('gid',$gid);// To be used in templaterplace in whole group. Attention : it's the actual GID (not the GID of the question) echo "\n\n\n"; echo "\n\n \n"; Yii::app()->setConfig('gid',''); } LimeExpressionManager::FinishProcessingGroup($LEMskipReprocessing); echo LimeExpressionManager::GetRelevanceAndTailoringJavaScript(); LimeExpressionManager::FinishProcessingPage(); if (!$previewgrp && !$previewquestion) { $navigator = surveymover(); //This gets globalised in the templatereplace function $redata = compact(array_keys(get_defined_vars())); echo "\n\n\n"; echo templatereplace(file_get_contents($sTemplatePath."navigator.pstpl"), array(), $redata); echo "\n"; if ($thissurvey['active'] != "Y") { echo "" . $clang->gT("This survey is currently not active. You will not be able to save your responses.") . "
\n"; } if ($surveyMode != 'survey' && $thissurvey['questionindex'] == 1) { $this->createIncrementalQuestionIndex($LEMsessid, $surveyMode); } elseif ($surveyMode != 'survey' && $thissurvey['questionindex'] == 2) { $this->createFullQuestionIndex($LEMsessid, $surveyMode); } echo "\n"; echo "\n"; echo "\n"; $_SESSION[$LEMsessid]['LEMpostKey'] = mt_rand(); echo "\n"; if (isset($token) && !empty($token)) { echo "\n\n"; } } if (($LEMdebugLevel & LEM_DEBUG_TIMING) == LEM_DEBUG_TIMING) { echo LimeExpressionManager::GetDebugTimingMessage(); } if (($LEMdebugLevel & LEM_DEBUG_VALIDATION_SUMMARY) == LEM_DEBUG_VALIDATION_SUMMARY) { echo "Group/Question Validation Results:" . $moveResult['message'] . " |