Skip to content

Commit

Permalink
Fixed issue #09722: Some core replacement in equation are not updated…
Browse files Browse the repository at this point in the history
… for hidden group

Dev: templatereplace for ASSESSMENT_CURRENT_TOTAL and maybe some other
Dev: replacementArray for QID/GID/SGQ, really think other question part are not needed (we don't render Question then no beforeRenderQuestion event)
  • Loading branch information
Shnoulle committed Jun 28, 2015
1 parent 6bfc23a commit 966da43
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions application/helpers/expressions/em_manager_helper.php
Expand Up @@ -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:"");
Expand Down

0 comments on commit 966da43

Please sign in to comment.