diff --git a/application/helpers/expressions/em_manager_helper.php b/application/helpers/expressions/em_manager_helper.php index 2cf8298cf7f..18bfdaaaea6 100644 --- a/application/helpers/expressions/em_manager_helper.php +++ b/application/helpers/expressions/em_manager_helper.php @@ -6620,8 +6620,20 @@ function _ValidateQuestion($questionSeq,$force=false) { // Process relevant equations, even if hidden, and write the result to the database $textToParse=(isset($LEM->qattr[$qid]['equation']) && trim($LEM->qattr[$qid]['equation'])!="") ? $LEM->qattr[$qid]['equation'] : $qInfo['qtext']; - $result = flattenText($LEM->ProcessString($textToParse, $qInfo['qid'],NULL,false,1,1,false,false,true));// More numRecursionLevels ? - $sgqa = $LEM->qid2code[$qid]; // there will be only one, since Equation + //$result = flattenText($LEM->ProcessString($textToParse, $qInfo['qid'],NULL,false,1,1,false,false,true));// More numRecursionLevels ? + $sgqa = $LEM->qid2code[$qid]; + $redata=array(); + $result = flattenText(templatereplace( // Why flattenText ? htmlspecialchars($string,ENT_NOQUOTES) seem better ? + $textToParse, + array('QID'=>$qInfo['qid'],'GID'=>$qInfo['gid'],'SGQ'=>$sgqa), // Some date for replacement, other are only for "view" + $redata, + '', + false, + $qInfo['qid'], + array(), + true // Static replace + )); + if($LEM->knownVars[$sgqa]['onlynum']) { $result=(is_numeric($result)?$result:"");