Skip to content

Commit

Permalink
Fixed issue #5739: Wrong percentage in graphs with List with Comments…
Browse files Browse the repository at this point in the history
… question types

Fixed issue #5734: Problem upgrading from 1.72 to 1.91+

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_yii@12370 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c_schmitz committed Feb 6, 2012
1 parent 721c172 commit bec5441
Show file tree
Hide file tree
Showing 5 changed files with 482 additions and 486 deletions.
11 changes: 6 additions & 5 deletions application/helpers/admin/statistics_helper.php
Expand Up @@ -156,10 +156,11 @@ function createChart($qid, $sid, $type, $lbl, $gdata, $grawdata, $cache)
else
{
// this block is to remove the items with value == 0
// and an unelegant way to remove comments from List with Comments questions
$i = 0;
while (isset ($gdata[$i]))
{
if ($gdata[$i] == 0)
if ($gdata[$i] == 0 || ($qtype == "O" && substr($lbl[$i],0,strlen($statlang->gT("Comments")))==$statlang->gT("Comments")))
{
array_splice ($gdata, $i, 1);
array_splice ($lbl, $i, 1);
Expand Down Expand Up @@ -2244,10 +2245,10 @@ function generate_statistics($surveyid, $allfields, $q2show='all', $usegraph=0,
foreach ($result->readAll() as $row)
{
$row=array_values($row);

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

//increase counter
$TotalCompleted += $row[0];

Expand Down Expand Up @@ -2532,7 +2533,7 @@ function generate_statistics($surveyid, $allfields, $q2show='all', $usegraph=0,
$justcode[]=$al[0];

//edit labels and put them into antoher array

//first check if $tempcount is > 0. If yes, $row[0] has been modified and $tempcount has the original count.
if ($tempcount > 0)
{
Expand All @@ -2543,7 +2544,7 @@ function generate_statistics($surveyid, $allfields, $q2show='all', $usegraph=0,
{
$lbl[] = wordwrap(FlattenText("$al[1] ($row[0])"), 25, "\n"); // NMO 2009-03-24
$lblrtl[] = utf8_strrev(wordwrap(FlattenText("$al[1] )$row[0]("), 25, "\n")); // NMO 2009-03-24

}

} //end while -> loop through results
Expand Down

0 comments on commit bec5441

Please sign in to comment.