Skip to content

Commit

Permalink
Fixed issue statistics fails to count multi choice when encrypted
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-foster-uk committed Oct 27, 2023
1 parent 35d09e5 commit 99cdf59
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions application/helpers/admin/statistics_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2251,14 +2251,9 @@ protected function displayResults($outputs, $results, $rt, $outputType, $surveyi
$query .= ($sDatabaseType == "mysql") ? Yii::app()->db->quoteColumnName($al[2])." <> '')" : " (".Yii::app()->db->quoteColumnName($al[2])." NOT LIKE ''))";
// all other question types
} else {
$query = "SELECT count(*) FROM {{survey_$surveyid}} WHERE ".Yii::app()->db->quoteColumnName($al[2])." =";

//ranking question?
if (substr((string) $rt, 0, 1) == "R") {
$query .= " '$al[0]'";
} else {
$query .= " 'Y'";
}
$value = (substr((string) $rt, 0, 1) == "R") ? $al[0] : 'Y';
$encryptedValue = getEncryptedCondition($responseModel, $al[2], $value);
$query = "SELECT count(*) FROM {{survey_$surveyid}} WHERE ".Yii::app()->db->quoteColumnName($al[2])." = '$encryptedValue'";
}
} //end if -> alist set

Expand Down

0 comments on commit 99cdf59

Please sign in to comment.