Skip to content

Commit

Permalink
Fixed issue #08308: questions that nothing depends upon trigger the r…
Browse files Browse the repository at this point in the history
…eevaluation of every conditionnal expression in the survey
  • Loading branch information
LouisGac committed Nov 17, 2017
1 parent 2698967 commit adf09d2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion application/config/version.php
Expand Up @@ -17,5 +17,5 @@
$config['dbversionnumber'] = 325;
$config['buildnumber'] = '';
$config['updatable'] = true;
$config['assetsversionnumber'] = '3006';
$config['assetsversionnumber'] = '3008';
return $config;
8 changes: 5 additions & 3 deletions application/helpers/expressions/em_manager_helper.php
Expand Up @@ -7143,7 +7143,7 @@ static function GetRelevanceAndTailoringJavaScript($bReturnArray=false)
$allJsVarsUsed=array();
$rowdividList=array(); // list of subquestions needing relevance entries
/* All function for expression manager */

App()->getClientScript()->registerScriptFile(Yii::app()->getConfig('generalscripts')."expressions/em_javascript.js" );
/* Call the function when trigerring event */
App()->getClientScript()->registerScript("triggerEmClassChange","triggerEmClassChange();\n",CClientScript::POS_END);
Expand Down Expand Up @@ -7652,10 +7652,12 @@ static function GetRelevanceAndTailoringJavaScript($bReturnArray=false)
foreach($qrelQIDs as $qrelQID)
{
$sQid = str_replace("relChange","",$qrelQID);
if(!in_array($sQid, $aQuestionsWithDependencies) )
{
if(!in_array($sQid, $aQuestionsWithDependencies) ){
$aQuestionsWithDependencies[]=$sQid;
}

// We add the question having condition itself to the array of question to check
$aQuestionsWithDependencies[] = $arg['qid'];
}


Expand Down
7 changes: 3 additions & 4 deletions assets/scripts/survey_runtime.js
Expand Up @@ -114,8 +114,8 @@ function checkconditions(value, name, type, evt_type)
result = result[2]
}

// $isRelevant = $.inArray(result, aQuestionsWithDependencies); NEED TO ADD THE QUESTIONS WITH CONDITIONS BEFORE WE CAN USE IT !!!!
var $isRelevant = 1;
var $isRelevant = $.inArray(result, aQuestionsWithDependencies);// NEED TO ADD THE QUESTIONS WITH CONDITIONS BEFORE WE CAN USE IT !!!!
//var $isRelevant = 1;
if($.isFunction(window.ExprMgr_process_relevance_and_tailoring ) && $isRelevant!=-1)
ExprMgr_process_relevance_and_tailoring(evt_type,name,type);
}
Expand Down Expand Up @@ -174,7 +174,7 @@ function fixnum_checkconditions(value, name, type, evt_type, intonly)
clearTimeout(window.correctNumberField);
window.correctNumberField = null;
}

var addition = "";
if(cleansedValue && cleansedValue.split("").pop().match(/(,)|(\.)/)){
addition = cleansedValue.split("").pop();
Expand Down Expand Up @@ -479,4 +479,3 @@ function doToolTipTable()
}
});
}

0 comments on commit adf09d2

Please sign in to comment.