Skip to content

Commit

Permalink
Fixed issue #17720: Wrong statistics with Other answers in single cho…
Browse files Browse the repository at this point in the history
…ice questions (#2203)

Co-authored-by: encuestabizdevgit <devgit@encuesta.biz>
  • Loading branch information
gabrieljenik and encuestabizdevgit committed Jan 11, 2022
1 parent 57beb3c commit 74f4ee3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions application/helpers/admin/statistics_helper.php
Expand Up @@ -1451,9 +1451,9 @@ protected function displaySimpleResults($outputs, $results, $rt, $outputType, $s
// just count the number of 'other' values - that way with failing Javascript the statistics don't get messed up
/* This query selects a count of responses where "other" has been selected */
foreach ($oResponses as $oResponse) {
$sResponseColumn = $al[2];
$column = substr($sResponseColumn, 0, strlen($sResponseColumn) - 5);
if ($column == '-oth-' && !empty($oResponse->$sResponseColumn)) {
$otherValueColumn = $al[2];
$answerOptionColumn = substr($otherValueColumn, 0, strlen($otherValueColumn) - 5);
if (!empty($oResponse->$answerOptionColumn) && $oResponse->$answerOptionColumn == '-oth-') {
$row += 1;
}
}
Expand Down Expand Up @@ -2223,9 +2223,9 @@ protected function displayResults($outputs, $results, $rt, $outputType, $surveyi
// just count the number of 'other' values - that way with failing Javascript the statistics don't get messed up
/* This query selects a count of responses where "other" has been selected */
foreach ($oResponses as $oResponse) {
$sResponseColumn = $al[2];
$column = substr($sResponseColumn, 0, strlen($sResponseColumn) - 5);
if ($column == '-oth-' && !empty($oResponse->$sResponseColumn)) {
$otherValueColumn = $al[2];
$answerOptionColumn = substr($otherValueColumn, 0, strlen($otherValueColumn) - 5);
if (!empty($oResponse->$answerOptionColumn) && $oResponse->$answerOptionColumn == '-oth-') {
$row += 1;
}
}
Expand Down

0 comments on commit 74f4ee3

Please sign in to comment.