Permalink
Browse files

Fixed issue #13358: Usage of .question in end message broken

  • Loading branch information...
lacrioque committed Feb 22, 2018
1 parent 532a809 commit 72aba24d9f2cb48472ab273e5fe244547c13fde4
Showing with 9 additions and 7 deletions.
  1. +9 −7 application/helpers/SurveyRuntimeHelper.php
@@ -1067,7 +1067,7 @@ private function moveSubmitIfNeeded()
$this->aSurveyInfo['aCompleted']['showDefault'] = false;
// 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'] = $this->processString($this->aSurveyInfo['surveyls_endtext']);
$this->aSurveyInfo['aCompleted']['sEndText'] = $this->processString($this->aSurveyInfo['surveyls_endtext'], 2);
}
$redata = compact(array_keys(get_defined_vars()));
@@ -1101,7 +1101,7 @@ private function moveSubmitIfNeeded()
$this->aSurveyInfo['aCompleted']['showDefault'] = false;
// 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'] = $this->processString($this->aSurveyInfo['surveyls_endtext']);
$this->aSurveyInfo['aCompleted']['sEndText'] = $this->processString($this->aSurveyInfo['surveyls_endtext'], 2);
}
// Link to Print Answer Preview **********
@@ -1197,16 +1197,18 @@ private function moveSubmitIfNeeded()
* @param string $sString the string to evaluate
* @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
$aStandardsReplacementFields = getStandardsReplacementFields($this->aSurveyInfo);
$sProcessedString = LimeExpressionManager::ProcessString( $sString, null, $aStandardsReplacementFields);
} else {
$sProcessedString = $sString;
$sProcessedString = LimeExpressionManager::ProcessString( $sString, null, $aStandardsReplacementFields, $iRecursionLevel);
}
return $sProcessedString;
}

1 comment on commit 72aba24

@Shnoulle

This comment has been minimized.

Collaborator

Shnoulle commented on 72aba24 Feb 22, 2018

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.