LimeSurvey bug tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
04189Bug reports v1.xStatisticspublic2010-03-09 15:162010-06-08 21:51
Reporteriboguev 
Assigned Tomachaven 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformIntelOSWindowsOS VersionVista
Product Version1.87+ 
Target Version1.90RC1Fixed in Version1.90RC1 
Summary04189: Response Statistics - Date and number fields filters not working
DescriptionWhen I go to "Browse Responses for this survey" and select "Get statistics for these responses" I am not able to filter on fields that are of "Numerical input", "Array (Multi Flexible) (Numbers)" or "date" type.

When I configure a filter on such answer field it returns ALL responses as result.
TagsNo tags attached.
LimeSurvey build number8429
BrowserIE8 or Opera
Database & DB-VersionMy SQL
Operating System (Server)Apache/2.2.14 (Unix)
WebserverApache/2.2.14 (Unix)
PHP VersionPHP Version 5.2.12
Attached Filescsv file icon limesurvey_survey_49528.csv [^] (4,956 bytes) 2010-04-04 09:50

- Relationships
related to 04368closedMazi Date filter doesn't work in statistics 

-  Notes
User avatar (11268)
lemeur (administrator)
2010-03-09 22:14
edited on: 2010-03-09 22:28

First information Date questions are not supported in statistics.

Correction: I'm wrong. Date quesitons are not supported in the stats report, but are supported in the report query.

User avatar (11270)
lemeur (administrator)
2010-03-09 22:42

I confirm the bug
User avatar (11316)
lemeur (administrator)
2010-03-13 00:03

Hi Tim,
While investigating this bug I came to a strange code.

In statistics.php you build a $summary Array containing all the fieldnames to be displayed in the report: am I right ?

Then you call "generate_statistics($surveyid,$summary,$summary, ...)

The second parameter of this function is $allfields, which is used later around line 299:
if (in_array($pv, $allfields))
{
  ==> here is built the $selects[] array that is used for building the filter SQL query
}

But If I'm right, this means you can only filter responses on a specific answers IF AND ONLY IF the question is select for display !

Please I would really like to have your input on this as it will help fixing this bug.

Thanks in advance,
Thibault
User avatar (11317)
lemeur (administrator)
2010-03-13 00:18

[00:15] <lemeur> $summary cannot be used a replacement for $allfields
[00:16] <lemeur> this is because $summary is only a list of question files prefixed with question type , and allfields is a list of filter fields
[00:16] <lemeur> for instance in summary for a numerical quesiton you'll have "N49528X1X41"
[00:17] <lemeur> but in allfileds you should have N49528X1X41G (for greater), ...
[00:17] <lemeur> anyway, there is a bug for sure

The above statement is true if we want to use $allfields as in line 300:
if (in_array($pv, $allfields))
{
 ==> build $selects[] array.
}
User avatar (11530)
iboguev (reporter)
2010-03-29 07:03

Guys,

Excuse my ignorance but the current "feedback" staus of this item - does it mean the bug is not going to get fixed?

I am very eager to see this one sorted as it seriously affects the inbuilt response filtering feature use.

Cheers,
Ivor
User avatar (11531)
lemeur (administrator)
2010-03-29 09:50

You're right the status should be set back to Confirmed.

Thibault
User avatar (11568)
rakete (developer)
2010-04-01 21:33

this form eats posts.

Thibault, can you provide me an example survey with answers to test some?

I think the problem is that these question types were added after the statistics_function.php and it was not updated accordingly. There is a lot of if($questionType==...) stuff.

Greetings
User avatar (11582)
lemeur (administrator)
2010-04-04 09:56

Hi Tim,
Any survey with numerical and Date question will demonstrate the bug in the Statistics Filter.
See the attached survey, activate it, answer it with answer 10 and then 20 for the numerical question and then try in the stats filter to filter on numerical answer >= 15. The result is that you gett the 2 answers !

The Date and Numerical questions were added before the statistics_function.php file was added.

Please read my post 11317 as it gives the bug cause.

Also read my post 11316 as it focuses on another issue: you can only filter on a question which is selected for display which seems not logical.

TIA,
Thibault
User avatar (11976)
Mazi (developer)
2010-05-26 16:30
edited on: 2010-05-26 16:31

A user just reported a similiar problem when trying to filter by a date question. We should try to fix this at the 1.90RC.

Machaven, you said you were working on statistics, can you have a look?

User avatar (12004)
machaven (developer)
2010-05-27 08:51

Fixed in SVN, i think numerical input was fixed by the date type fix, because its working :)

- Issue History
Date Modified Username Field Change
2010-03-09 15:16 iboguev New Issue
2010-03-09 17:53 ElMatador69 Status new => assigned
2010-03-09 17:53 ElMatador69 Assigned To => lemeur
2010-03-09 22:14 lemeur Note Added: 11268
2010-03-09 22:28 lemeur Note Edited: 11268 View Revisions
2010-03-09 22:42 lemeur Note Added: 11270
2010-03-09 22:42 lemeur Status assigned => confirmed
2010-03-12 23:57 lemeur Issue Monitored: lemeur
2010-03-12 23:57 lemeur Status confirmed => assigned
2010-03-12 23:57 lemeur Assigned To lemeur => rakete
2010-03-13 00:03 lemeur Note Added: 11316
2010-03-13 00:03 lemeur Status assigned => feedback
2010-03-13 00:18 lemeur Note Added: 11317
2010-03-29 07:03 iboguev Note Added: 11530
2010-03-29 07:03 iboguev Status feedback => assigned
2010-03-29 09:50 lemeur Note Added: 11531
2010-03-29 09:50 lemeur Status assigned => confirmed
2010-04-01 21:33 rakete Note Added: 11568
2010-04-04 09:50 lemeur File Added: limesurvey_survey_49528.csv
2010-04-04 09:56 lemeur Note Added: 11582
2010-05-05 11:59 Mazi Status confirmed => assigned
2010-05-26 16:29 Mazi Target Version => 1.90RC1
2010-05-26 16:30 Mazi Note Added: 11976
2010-05-26 16:30 Mazi Assigned To rakete => machaven
2010-05-26 16:31 Mazi Note Edited: 11976 View Revisions
2010-05-26 17:05 jonasfiles Issue Monitored: jonasfiles
2010-05-26 17:19 Mazi Relationship added related to 04368
2010-05-27 08:51 machaven Note Added: 12004
2010-05-27 08:52 machaven Status assigned => resolved
2010-05-27 08:52 machaven Fixed in Version => 1.90RC1
2010-05-27 08:52 machaven Resolution open => fixed
2010-06-08 21:51 c_schmitz Status resolved => closed


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker