View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
03307Bug reportsSurvey takingpublic2010-09-11 03:31
Reporteruser3704Assigned Toc_schmitz  
PrioritynormalSeveritypartial_block 
Status closedResolutionno change required 
Product Version1.82+ 
Summary03307: Quotas set for array question types do not work if two entries exist on the same question
Description

If you have an array question (Type A or B), and you wish to add quotas on certain values of the answers of that question, if two entries are made on the same answer, which is possible and seems like it should be, the quota does not work. For example, if I have an answer 'Pie' on a 10-point question, and I set my quota to be activated when 'Pie' is 9 or 10, it actually attempts to check that 'Pie' is both 9 and 10, which is impossible, and so the quota is never triggered.

Attached is a survey file that will trigger this error. Try to get the second quota to increment, by activating the survey and running it, and answering 'Family Guy' and ranking 'Computer Science' as a 4 or a 5.

Additional Information

In common.php, under the function getQuotaInformation() can only for each entry in the quota_members table return one field entry. However, in index.php, the function check_quota, which is used to get information on and enforce quotas, attempts to handle this case by assuming that getQuotaInformation() returns multiple fields for array type questions where two quotas have been set on the same answer. However, as mentioned above, getQuotaInformation() does not do this, and so check_quota will fail due to that fact. Also, what appears to be a todo comment is written right above this attempt to handle the case, although it does not mention an issue.

I am unsure as to how I would go about fixing it, but if I was a developer I would push for the quota_members table to contain the current value of the quota, which would save a lot of database querying involved in checking it. Alternatively, the quota code for these types of questions could be altered to support lt, gt, and eq so that this never becomes an issue. Fixing these two methods would prove difficult as-is given how the response table looks.

TagsNo tags attached.
Attached Files
Quota bug 2 survey.csv (4,778 bytes)
Quota_bug_185RC3.csv (3,988 bytes)
Bug heat8
Complete LimeSurvey version number (& build)
I will donate to the project if issue is resolved
Browser
Database type & versionMySQL version 5.0.67-community
Server OS (if known)Unix
Webserver software & version (if known)Apache version 2.2.11
PHP VersionPHP version 5.2.8

Users monitoring this issue

There are no users monitoring this issue.

Activities

user372

2009-06-09 08:01

  ~08347

Last edited: 2009-06-09 08:14

@ SpencerPolk: I'm not sure, but there were some fixes for quotas from v1.82 to v1.85RC3 - perhaps this issue was fixed - can you give it a try?
Btw. in your attached survey structure there are no quotas configured!

@ jasebo: is this a supported scenario?

user3704

2009-06-09 18:31

  ~08362

I'm not sure why the uploaded file doesn't seem to have any quotas configured, since when I downloaded and looked at it it did, but I'm uploading it again in case.

I will try the latest version to see if that resolves the issue.

user3704

2009-06-12 23:43

  ~08470

I have installed Limesurvey 1.85R3 on my server and I was able to replicate the bug. I will add the survey that I replicated it with to this report.

jcleeland

jcleeland

2009-07-21 11:14

reporter   ~08887

I think maybe there's another bug with importing quotas.. but I'll leave that for the moment :-)

jcleeland

jcleeland

2009-07-21 15:55

reporter   ~08888

I'm going to work on this bug on the basis that this particular quota should be treated like:

If there are 10 answers with either 4 or 5 as the answer, the quota gets triggered.

That'll be using "OR" as the boolean logic for multiple answers within a question.

This is all retrofitting, and I think in LS2 we should should treat quotas as just another option/action for conditions.

c_schmitz

c_schmitz

2010-03-10 21:59

administrator   ~11298

Hi Jason,
are you still working on this issue?

c_schmitz

c_schmitz

2010-09-11 03:31

administrator   ~12829

Updated the documentation accordingly that multiple quota-members on the same question/subquestion are always 'AND' connected and so never come true.

Issue History

Date Modified Username Field Change
2009-06-09 02:22 user3704 New Issue
2009-06-09 02:22 user3704 Status new => assigned
2009-06-09 02:22 user3704 Assigned To => user372
2009-06-09 02:22 user3704 File Added: Quota bug 2 survey.csv
2009-06-09 02:22 user3704 Database & DB-Version => MySQL version 5.0.67-community
2009-06-09 02:22 user3704 Operating System (Server) => Unix
2009-06-09 02:22 user3704 Webserver => Apache version 2.2.11
2009-06-09 02:22 user3704 PHP Version => PHP version 5.2.8
2009-06-09 08:01 user372 Note Added: 08347
2009-06-09 08:01 user372 Assigned To user372 => jcleeland
2009-06-09 08:03 user372 Note Edited: 08347
2009-06-09 08:03 user372 Status assigned => feedback
2009-06-09 08:14 user372 Note Edited: 08347
2009-06-09 08:24 jcleeland Status feedback => acknowledged
2009-06-09 08:29 jcleeland Status acknowledged => new
2009-06-09 18:31 user3704 Note Added: 08362
2009-06-12 17:34 c_schmitz Status new => feedback
2009-06-12 23:43 user3704 Note Added: 08470
2009-06-12 23:44 user3704 File Added: Quota_bug_185RC3.csv
2009-07-21 11:14 jcleeland Note Added: 08887
2009-07-21 15:55 jcleeland Note Added: 08888
2009-07-21 15:56 jcleeland Status feedback => confirmed
2010-02-24 11:35 c_schmitz Sticky Issue No => Yes
2010-02-24 11:36 c_schmitz Sticky Issue Yes => No
2010-03-10 21:59 c_schmitz Note Added: 11298
2010-09-11 03:31 c_schmitz Note Added: 12829
2010-09-11 03:31 c_schmitz Status confirmed => closed
2010-09-11 03:31 c_schmitz Assigned To jcleeland => c_schmitz
2010-09-11 03:31 c_schmitz Resolution open => no change required
2010-10-25 00:18 c_schmitz Category Survey at Runtime => Survey taking