Skip to content

Commit

Permalink
Fixed issue #13358: Usage of .question in end message broken
Browse files Browse the repository at this point in the history
  • Loading branch information
lacrioque committed Feb 22, 2018
1 parent 532a809 commit 72aba24
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -1067,7 +1067,7 @@ private function moveSubmitIfNeeded()
$this->aSurveyInfo['aCompleted']['showDefault'] = false; $this->aSurveyInfo['aCompleted']['showDefault'] = false;
// NOTE: this occurence of template replace should stay here. User from backend could use old replacement keyword // NOTE: this occurence of template replace should stay here. User from backend could use old replacement keyword
//$this->aSurveyInfo['aCompleted']['sEndText'] = templatereplace($this->aSurveyInfo['surveyls_endtext'], array(), $redata, 'SubmitAssessment', false, null, array(), true); //$this->aSurveyInfo['aCompleted']['sEndText'] = templatereplace($this->aSurveyInfo['surveyls_endtext'], array(), $redata, 'SubmitAssessment', false, null, array(), true);
$this->aSurveyInfo['aCompleted']['sEndText'] = $this->processString($this->aSurveyInfo['surveyls_endtext']); $this->aSurveyInfo['aCompleted']['sEndText'] = $this->processString($this->aSurveyInfo['surveyls_endtext'], 2);
} }


$redata = compact(array_keys(get_defined_vars())); $redata = compact(array_keys(get_defined_vars()));
Expand Down Expand Up @@ -1101,7 +1101,7 @@ private function moveSubmitIfNeeded()
$this->aSurveyInfo['aCompleted']['showDefault'] = false; $this->aSurveyInfo['aCompleted']['showDefault'] = false;
// NOTE: this occurence of template replace should stay here. User from backend could use old replacement keyword // NOTE: this occurence of template replace should stay here. User from backend could use old replacement keyword
//$this->aSurveyInfo['aCompleted']['sEndText'] = templatereplace($this->aSurveyInfo['surveyls_endtext'], array(), $redata, 'SubmitAssessment', false, null, array(), true); //$this->aSurveyInfo['aCompleted']['sEndText'] = templatereplace($this->aSurveyInfo['surveyls_endtext'], array(), $redata, 'SubmitAssessment', false, null, array(), true);
$this->aSurveyInfo['aCompleted']['sEndText'] = $this->processString($this->aSurveyInfo['surveyls_endtext']); $this->aSurveyInfo['aCompleted']['sEndText'] = $this->processString($this->aSurveyInfo['surveyls_endtext'], 2);
} }


// Link to Print Answer Preview ********** // Link to Print Answer Preview **********
Expand Down Expand Up @@ -1197,16 +1197,18 @@ private function moveSubmitIfNeeded()
* @param string $sString the string to evaluate * @param string $sString the string to evaluate
* @return string * @return string
*/ */
private function processString($sString) private function processString($sString, $iRecursionLevel = 1)
{ {
if (strpos($sString, "{") !== false) { $sProcessedString = $sString;

if((strpos($sProcessedString, "{") !== false)){
// process string anyway so that it can be pretty-printed // process string anyway so that it can be pretty-printed
$aStandardsReplacementFields = getStandardsReplacementFields($this->aSurveyInfo); $aStandardsReplacementFields = getStandardsReplacementFields($this->aSurveyInfo);
$sProcessedString = LimeExpressionManager::ProcessString( $sString, null, $aStandardsReplacementFields); $sProcessedString = LimeExpressionManager::ProcessString( $sString, null, $aStandardsReplacementFields, $iRecursionLevel);
} else {
$sProcessedString = $sString;
} }



return $sProcessedString; return $sProcessedString;
} }


Expand Down

1 comment on commit 72aba24

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous version 3 is the default, but more : need a 'static' option too… In end message we don't need javascript.

Please sign in to comment.