Skip to content

Commit

Permalink
Fixed issue #8631: Array/matrix question in dropdown presentation doe…
Browse files Browse the repository at this point in the history
…s not show "Please choose..." anymore
  • Loading branch information
c-schmitz committed Feb 2, 2014
1 parent b28b3a4 commit b9323a6
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions application/helpers/qanda_helper.php
Expand Up @@ -4858,16 +4858,21 @@ function do_array($ia)
$answer .= "\t<td >\n"
. "<select name=\"$myfname\" id=\"answer$myfname\" onchange=\"$checkconditionFunction(this.value, this.name, this.type);\">\n";

// If not mandatory and showanswer, show no ans
// Dropdown representation is en exception - even if mandatory or SHOW_NO_ANSWER is disable a neutral option needs to be shown where the mandatory case asks actively
if ($ia[6] != 'Y' && SHOW_NO_ANSWER == 1)
{
$answer .= "\t<option value=\"\" ";
if (!isset($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname]) || $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname] == '')
{
$answer .= SELECTED;
}
$answer .= '>'.$clang->gT('No answer')."</option>\n";
$sOptionText=$clang->gT('No answer');
}
else
{
$sOptionText=$clang->gT('Please choose...');

This comment has been minimized.

Copy link
@Shnoulle

Shnoulle Feb 3, 2014

Collaborator

If question is mandatory and $SESSION['survey'.Yii::app()->getConfig('surveyID')][$myfname]!="" then we don't have these option, no ?

}
$answer .= "\t<option value=\"\" ";
if (!isset($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname]) || $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname] == '')
{
$answer .= SELECTED;
}
$answer .= '>'.$sOptionText."</option>\n";
foreach ($labels as $lrow)
{
$answer .= "\t<option value=\"".$lrow['code'].'" ';
Expand Down

0 comments on commit b9323a6

Please sign in to comment.