Skip to content

Commit

Permalink
Fixed issue: Survey cannot proceed anymore
Browse files Browse the repository at this point in the history
Dev Revert of Fixed issue #10562: Question index highlighting required questions missing. (reverted from commit fbd4db9)
  • Loading branch information
c-schmitz committed Aug 31, 2016
1 parent 43dda12 commit 9383a4b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 71 deletions.
48 changes: 12 additions & 36 deletions application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -14,7 +14,6 @@

class SurveyRuntimeHelper {

private $aStepInfoClass; // The step info class is used to know which group has not been completed correclty (for index only). Because the index is build twice in 2.5 templates, we don't want to redo all the test twices
protected function createFullQuestionIndexMenu($LEMsessid, $surveyMode)
{
if ($surveyMode == 'group')
Expand Down Expand Up @@ -42,11 +41,9 @@ protected function createFullQuestionIndexByGroupMenu($LEMsessid)

if (LimeExpressionManager::GroupIsRelevant($group['gid']))
{
$classes = ' linkToButton ';

$group['step'] = $key + 1;
$active = ($_SESSION[$LEMsessid]['step'] == $group['step']) ? 'current active' : '';
$stepInfoClass = $this->getClassForCurrentGroup($group, $LEMsessid, $key);
$classes = ' linkToButton ';
$sButtonSubmit=CHtml::htmlButton(gT('Go to this group'),array('id'=>'button-'.$group['gid'],'type'=>'submit','value'=>$group['step'],'name'=>'move','class'=>'jshide'));

// Button
Expand All @@ -58,8 +55,7 @@ protected function createFullQuestionIndexByGroupMenu($LEMsessid)




$html .= CHtml::openTag('li', array('class'=>$active.' '.$stepInfoClass));
$html .= CHtml::openTag('li', array('class'=>$active));
$html .= CHtml::link($group['group_name'], array('#'), array('class'=>$classes, 'data-button-to-click'=>'#button-'.$group['gid'], ));
$html .= CHtml::closeTag('li');

Expand Down Expand Up @@ -204,35 +200,6 @@ protected function createFullQuestionIndex($LEMsessid, $surveyMode)

}

/**
* AZDAZD
*/
protected function getClassForCurrentGroup($group, $LEMsessid, $key)
{
if(isset($group['step']))
{
$iCurrentStep = $_SESSION[$LEMsessid]['step'];
$iGroup = $group['step'];

if(!isset($this->aStepInfoClass[$iGroup]))
{
$stepInfoClass = '';
if (isset($group['step']))
{
if ( $group['step'] < $iCurrentStep )
{
$stepInfo = LimeExpressionManager::singleton()->_ValidateGroup($key);
$stepInfoClass = $stepInfo['anyUnanswered'] ? 'missing' : '';
}
}
$this->aStepInfoClass[$iGroup] = $stepInfoClass;
}

return $this->aStepInfoClass[$iGroup];
}
return '';
}

protected function createFullQuestionIndexByGroup($LEMsessid)
{
echo "\n\n<!-- PRESENT THE INDEX (full) -->\n";
Expand All @@ -251,7 +218,16 @@ protected function createFullQuestionIndexByGroup($LEMsessid)
{
$group['step'] = $key + 1;

$stepInfoClass = $this->getClassForCurrentGroup($group, $LEMsessid, $key);
$stepInfoClass = '';
if (isset($group['step']))
{
if ( $group['step'] < $_SESSION[$LEMsessid]['step'])
{
$stepInfo = LimeExpressionManager::singleton()->_ValidateGroup($key);
$stepInfoClass = $stepInfo['anyUnanswered'] ? 'missing' : '';
}
}


$classes = implode(' ', array(
'row',
Expand Down
13 changes: 1 addition & 12 deletions templates/default/css/flat_and_modern.css
Expand Up @@ -7091,17 +7091,6 @@ a.list-group-item-danger.active:focus {


/* Errors */
.input-error
{
.input-error {
border: 1px solid #E75041;
}

ul.dropdown-menu > li.missing
{
background-color: #e74c3c;
}

ul.dropdown-menu > li.missing > a.linkToButton
{
color: #fff;
}
11 changes: 0 additions & 11 deletions templates/news_paper/css/news_paper.css
Expand Up @@ -6880,14 +6880,3 @@ button.close {
.panel-info .panel-title {
color: #fff;
}


ul.dropdown-menu > li.missing
{
background-color: #f2dede;
}

ul.dropdown-menu > li.missing > a.linkToButton
{
color: #fff;
}
12 changes: 0 additions & 12 deletions templates/ubuntu_orange/css/ubuntu_orange.css
Expand Up @@ -6801,15 +6801,3 @@ button.close {
color: #fff;
}
}



ul.dropdown-menu > li.missing
{
background-color: #f2dede;
}

ul.dropdown-menu > li.missing > a.linkToButton
{
color: #fff;
}

0 comments on commit 9383a4b

Please sign in to comment.