Skip to content

Commit

Permalink
Fixed issue #15723: 'Button group' option in Yes/No and Gender questi…
Browse files Browse the repository at this point in the history
…on doesn't work.
  • Loading branch information
thedirtypanda committed Mar 30, 2020
1 parent ec060a0 commit 7f09eb6
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions application/helpers/qanda_helper.php
Expand Up @@ -2929,7 +2929,12 @@ function do_hugefreetext($ia)
return array($answer, $inputnames);
}

// ---------------------------------------------------------------
/**
* Renders Yes/No Question Type.
*
* @param array $ia
* @return array
*/
function do_yesno($ia)
{
$coreClass = "ls-answers answers-list";
Expand All @@ -2951,7 +2956,7 @@ function do_yesno($ia)
}

$aQuestionAttributes = QuestionAttribute::model()->getQuestionAttributes($ia[0]);
$displayType = $aQuestionAttributes['display_type'];
$displayType = (int) $aQuestionAttributes['display_type'];
$noAnswer = (isset($noAnswer)) ? $noAnswer : false;
$itemDatas = array(
'name'=>$ia[1],
Expand All @@ -2963,7 +2968,6 @@ function do_yesno($ia)
'value' => $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]],
'displayType'=>$displayType,
);
$displayType = (int) $displayType;
if ($displayType === 0) {
$itemDatas['coreClass'] = "{$coreClass} button-list yesno-button";
$answer = doRender('/survey/questions/answer/yesno/buttons/item', $itemDatas, true);
Expand All @@ -2977,7 +2981,12 @@ function do_yesno($ia)
return array($answer, $inputnames);
}

// ---------------------------------------------------------------
/**
* Renders Gender Question Types.
*
* @param array $ia
* @return array
*/
function do_gender($ia)
{
$fChecked = ($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]] == 'F') ? 'CHECKED' : '';
Expand Down

0 comments on commit 7f09eb6

Please sign in to comment.