From b0d57c8adf66bad609338d76f57835e1e7a69a9f Mon Sep 17 00:00:00 2001 From: Denis Chenu Date: Wed, 21 Jan 2015 12:10:25 +0100 Subject: [PATCH] Fixed issue #09465: Array (number)(with checkbox) question type highlight the rows that have been answered Fixed issue : Array (number) (default (dropdown)) question type don't remind actual answer --- application/helpers/qanda_helper.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/application/helpers/qanda_helper.php b/application/helpers/qanda_helper.php index fabecb40ebf..4a4fcb4a831 100644 --- a/application/helpers/qanda_helper.php +++ b/application/helpers/qanda_helper.php @@ -5478,14 +5478,25 @@ function do_array_multiflexi($ia) /* Check the sub Q mandatory violation */ if ($ia[6]=='Y' && !empty($aMandatoryViolationSubQ)) { - //Go through each labelcode and check for a missing answer! If any are found, highlight this line - $emptyresult=0; + //Go through each labelcode and check for a missing answer! Default :If any are found, highlight this line, checkbox : if one is not found : don't highlight + // PS : we really need a better system : event for EM ! + $emptyresult=($aQuestionAttributes['multiflexible_checkbox']!=0) ? 1 : 0; foreach($labelcode as $ld) { $myfname2=$myfname.'_'.$ld; - if(in_array($myfname2, $aMandatoryViolationSubQ)) + if($aQuestionAttributes['multiflexible_checkbox']!=0) { - $emptyresult=1; + if(!in_array($myfname2, $aMandatoryViolationSubQ)) + { + $emptyresult=0; + } + } + else + { + if(in_array($myfname2, $aMandatoryViolationSubQ)) + { + $emptyresult=1; + } } } if ($emptyresult == 1) @@ -5539,7 +5550,7 @@ function do_array_multiflexi($ia) for($ii=$minvalue; ($reverse? $ii>=$maxvalue:$ii<=$maxvalue); $ii+=$stepvalue) { $answer .= '\n";