Skip to content

Commit

Permalink
Fixed issue #12484: questions in this survey.There are 30
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Nov 17, 2017
1 parent a32c02a commit 264d94f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
7 changes: 5 additions & 2 deletions application/core/LSETwigViewRenderer.php
Expand Up @@ -253,8 +253,11 @@ public function renderTemplateFromString( $line, $aDatas, $oTemplate, $bReturn=f
}
}

$aDatas["aSurveyInfo"]['languagecode'] = $languagecode;
$aDatas["aSurveyInfo"]['dir'] = (getLanguageRTL($languagecode))?"rtl":"ltr";
$showxquestions = Yii::app()->getConfig('showxquestions');
$aDatas["aSurveyInfo"]['bShowxquestions'] = ( $showxquestions == 'show' || ($showxquestions == 'choose' && !isset($this->aSurveyInfo['showxquestions'])) || ($showxquestions == 'choose' && $this->aSurveyInfo['showxquestions'] == 'Y'));
$aDatas["aSurveyInfo"]['languagecode'] = $languagecode;
$aDatas["aSurveyInfo"]['dir'] = (getLanguageRTL($languagecode))?"rtl":"ltr";
$aDatas["aSurveyInfo"]['iTotalquestions'] = $_SESSION['survey_'.$aDatas['aSurveyInfo']['sid']]['totalquestions'];

// Add all mother templates path
while($oRTemplate->oMotherTemplate instanceof TemplateConfiguration){
Expand Down
4 changes: 0 additions & 4 deletions application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -532,10 +532,6 @@ private function initMove()
$this->bShowEmptyGroup = true;
}

// For welcome screen
$this->thissurvey['iTotalquestions'] = $_SESSION['survey_'.$this->iSurveyid]['totalquestions'];
$showxquestions = Yii::app()->getConfig('showxquestions');
$this->thissurvey['bShowxquestions'] = ( $showxquestions == 'show' || ($showxquestions == 'choose' && !isset($this->aSurveyInfo['showxquestions'])) || ($showxquestions == 'choose' && $this->aSurveyInfo['showxquestions'] == 'Y'));
}

}
Expand Down
4 changes: 2 additions & 2 deletions templates/default/views/subviews/welcome.twig
Expand Up @@ -42,15 +42,15 @@
<!-- Question count -->
<div class="{{ aSurveyInfo.class.questioncount }} text-muted" {{ aSurveyInfo.attr.questioncount }}>
<div class='{{ aSurveyInfo.class.questioncounttext }}' {{ aSurveyInfo.attr.questioncounttext }}>

{# If survey creator set "show x questions" in survey setting #}
{% if aSurveyInfo.bShowxquestions == true %}
{% if aSurveyInfo.iTotalquestions < 1 %}
{{ "There is no question in this survey" | t }}
{% elseif aSurveyInfo.iTotalquestions == 1 %}
{{ "There is 1 question in this survey" | t }}
{% else %}
{{ "There are " ~ aSurveyInfo.iTotalquestions ~ " questions in this survey." | t}}
{% set nbQuestions = "There are " ~ aSurveyInfo.iTotalquestions ~ " questions in this survey." %}
{{ nbQuestions | t}}
{% endif %}
{% endif %}
</div>
Expand Down

0 comments on commit 264d94f

Please sign in to comment.