Skip to content

Commit

Permalink
Fixed issue #17978: Public stat show all response and not only submit…
Browse files Browse the repository at this point in the history
…ted (#2389)

Dev $query was not initialized. Probably some error while porting.
  • Loading branch information
gabrieljenik committed May 20, 2022
1 parent f6d29c7 commit 2d3b176
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions application/helpers/userstatistics_helper.php
Expand Up @@ -1449,6 +1449,12 @@ protected function displayResults($outputs, $results, $rt, $outputType, $surveyi
} elseif (incompleteAnsFilterState() == "complete") {
$criteria->addCondition("submitdate is not null");
}

//check for any "sql" that has been passed from another script
if (!empty($sql)) {
$criteria->addCondition($sql);
}

// prepare and decrypt data
$oResponses = Response::model($surveyid)->findAll($criteria);
foreach ($oResponses as $key => $oResponse) {
Expand Down Expand Up @@ -1565,21 +1571,6 @@ protected function displayResults($outputs, $results, $rt, $outputType, $surveyi
}
}

//check filter option
if (incompleteAnsFilterState() == "incomplete") {
$query .= " AND submitdate is null";
} elseif (incompleteAnsFilterState() == "complete") {
$query .= " AND submitdate is not null";
}

//check for any "sql" that has been passed from another script
if (!empty($sql)) {
$query .= " AND $sql";
}


// $statisticsoutput .= "\n<!-- ($sql): $query -->\n\n";

//store temporarily value of answer count of question type '5' and 'A'.
$tempcount = -1; //count can't be less han zero

Expand Down

0 comments on commit 2d3b176

Please sign in to comment.