getQuestionAttributes($ia[0]);
$query = "SELECT other FROM {{questions}} WHERE qid=".$ia[0]." AND language='".$_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['s_lang']."' ";
$result = Yii::app()->db->createCommand($query)->query();
foreach ($result->readAll() as $row)
{
$other = $row['other'];
}
//question attribute random order set?
if ($aQuestionAttributes['random_order']==1) {
$ansquery = "SELECT * FROM {{answers}} WHERE qid=$ia[0] AND language='".$_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['s_lang']."' and scale_id=0 ORDER BY ".dbRandom();
}
//question attribute alphasort set?
elseif ($aQuestionAttributes['alphasort']==1)
{
$ansquery = "SELECT * FROM {{answers}} WHERE qid=$ia[0] AND language='".$_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['s_lang']."' and scale_id=0 ORDER BY answer";
}
//no question attributes -> order by sortorder
else
{
$ansquery = "SELECT * FROM {{answers}} WHERE qid=$ia[0] AND language='".$_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['s_lang']."' and scale_id=0 ORDER BY sortorder, answer";
}
$ansresult = dbExecuteAssoc($ansquery)->readAll(); //Checked
$anscount = count($ansresult);
if (trim($aQuestionAttributes['display_columns'])!='')
{
$dcols = $aQuestionAttributes['display_columns'];
}
else
{
$dcols= 1;
}
if (trim($aQuestionAttributes['other_replace_text'][$_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['s_lang']])!='')
{
$othertext=$aQuestionAttributes['other_replace_text'][$_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['s_lang']];
}
else
{
$othertext=gT('Other:');
}
if (isset($other) && $other=='Y') {$anscount++;} //Count up for the Other answer
if ($ia[6] != 'Y' && SHOW_NO_ANSWER == 1) {$anscount++;} //Count up if "No answer" is showing
$wrapper = setupColumns($dcols , $anscount,"answers-list radio-list","answer-item radio-item");
$iBootCols = round(12/$dcols);
$ansByCol = round($anscount/$dcols); $ansByCol = ($ansByCol > 0)?$ansByCol:1;
//$answer = 'IKI: '.$iBootCols.' '.$ansByCol.' '.$wrapper['whole-start'];
$answer = '