Skip to content

Commit

Permalink
Fixed issue #09465: Array (number)(with checkbox) question type highl…
Browse files Browse the repository at this point in the history
…ight the rows that have been answered

Fixed issue : Array (number) (default (dropdown)) question type don't remind actual answer
  • Loading branch information
Shnoulle committed Jan 21, 2015
1 parent c93a025 commit b0d57c8
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions application/helpers/qanda_helper.php
Expand Up @@ -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)
Expand Down Expand Up @@ -5539,7 +5550,7 @@ function do_array_multiflexi($ia)

for($ii=$minvalue; ($reverse? $ii>=$maxvalue:$ii<=$maxvalue); $ii+=$stepvalue) {
$answer .= '<option value="'.str_replace('.',$sSeparator,$ii).'"';
if(isset($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname2]) && $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname2] === $ii) {
if(isset($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname2]) && (string)$_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname2] == (string)($ii)) {
$answer .= SELECTED;
}
$answer .= ">".str_replace('.',$sSeparator,$ii)."</option>\n";
Expand Down

0 comments on commit b0d57c8

Please sign in to comment.