Skip to content

Commit

Permalink
Fixed issue #05766: exclude_all_others_auto does not work
Browse files Browse the repository at this point in the history
Dev was not working for Multiple Choice with Comments
  • Loading branch information
TMSWhite committed Jun 18, 2012
1 parent 25266fd commit 420595a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion application/helpers/common_helper.php
Expand Up @@ -3254,7 +3254,7 @@ function questionAttributes($returnByName=false)
"caption"=>$clang->gT('Exclusive option'));

$qattributes["exclude_all_others_auto"]=array(
"types"=>"M",
"types"=>"MP",
'category'=>$clang->gT('Logic'),
'sortorder'=>131,
'inputtype'=>'singleselect',
Expand Down
3 changes: 2 additions & 1 deletion application/helpers/expressions/em_manager_helper.php
Expand Up @@ -1358,6 +1358,7 @@ public function _CreateSubQLevelRelevanceAndValidationEqns($onlyThisQseq=NULL)
switch ($type)
{
case 'M': //Multiple choice checkbox
case 'P': //Multiple choice with comments checkbox + text
if ($this->sgqaNaming)
{
$sq_name = substr($sq['jsVarName'],4);
Expand Down Expand Up @@ -1385,7 +1386,7 @@ public function _CreateSubQLevelRelevanceAndValidationEqns($onlyThisQseq=NULL)
if (count($sq_names) > 0) {
$relpart = "sum(" . implode(".relevanceStatus, ", $sq_names) . ".relevanceStatus)";
$checkedpart = "count(" . implode(".NAOK, ", $sq_names) . ".NAOK)";
$eoRelevantAndUnchecked = "(" . $eoVarName . ".relevanceStatus && " . $eoVarName . "=='')";
$eoRelevantAndUnchecked = "(" . $eoVarName . ".relevanceStatus && is_empty(" . $eoVarName . "))";
$eoEqn = "(" . $eoRelevantAndUnchecked . " && (" . $relpart . " == " . $checkedpart . "))";

$this->em->ProcessBooleanExpression($eoEqn, $qinfo['gseq'], $qinfo['qseq']);
Expand Down

0 comments on commit 420595a

Please sign in to comment.