Skip to content

Commit

Permalink
Fixed issue: Quota not working for array 10-point
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Mar 27, 2020
1 parent ad061e3 commit 8040fd5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions application/controllers/admin/quotas.php
Expand Up @@ -564,16 +564,16 @@ public function getQuotaAnswers($iQuestionId, $iSurveyId, $iQuotaId)
}
}
} elseif ($aQuestionType == Question::QT_B_ARRAY_10_CHOICE_QUESTIONS) {
$aAnsResults = Answer::model()
->with('answerl10ns', array('language' => $sBaseLang))
->findAllByAttributes(array('qid' => $iQuestionId));
$aAnsResults = Question::model()
->with('questionl10ns', array('language' => $sBaseLang))
->findAllByAttributes(array('parent_qid' => $iQuestionId));

$aAnswerList = array();

foreach ($aAnsResults as $aDbAnsList) {
for ($x = 1; $x < 11; $x++) {
$tmparrayans = array('Title' => $aQuestion['title'], 'Display' => substr($aDbAnsList['answer'], 0, 40).' ['.$x.']', 'code' => $aDbAnsList['code']);
$aAnswerList[$aDbAnsList['code']."-".$x] = $tmparrayans;
$tmparrayans = array('Title' => $aQuestion['title'], 'Display' => substr($aDbAnsList->questionl10ns[$sBaseLang]->question, 0, 40).' ['.$x.']', 'code' => $aDbAnsList['title']);
$aAnswerList[$aDbAnsList['title']."-".$x] = $tmparrayans;
}
}
} elseif ($aQuestionType == Question::QT_Y_YES_NO_RADIO) {
Expand Down

0 comments on commit 8040fd5

Please sign in to comment.