View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
19172Bug reportsOtherpublic2023-10-20 22:09
Reporterwangzhen2 Assigned Tomfavetti  
PrioritynoneSeverityminor 
Status closedResolutionduplicate 
Product Version6.2.x 
Summary19172: Quota exceeded limit
Description

When my quota setting only requires 1 person, and 5 people come to answer at the same time, they have all answered the question corresponding to the quota and entered the next page. In the end, they can all submit, which will lead to the quota exceeding, and the actual quota number becomes 5. I have checked the code, and I know it's an issue with the judgment on line 1879 in frontend_helper.php. I don't understand the meaning of $bAllHidden, because I found that it is always false here.

Steps To Reproduce

Steps to reproduce

Create three question groups. In the first group, add a single-choice question with options 1, 2, and 3. Set a quota for option 1 of this single-choice question, with the quota limit set to one. Create any question in the other two groups. Use group-based pagination, and start the questionnaire for testing. When 5 people enter the questionnaire simultaneously and all select option 1 of the single-choice question in the first group, then click the next page, continue this process, and in the end, you will find that all 5 people have successfully submitted without any prompt that the quota has been exceeded.

Expected result

When clicking the next page or submitting on the last page, also verify whether all quotas have been exceeded.

Actual result

Quota exceeded

TagsNo tags attached.
Bug heat8
Complete LimeSurvey version number (& build)6.2.9
I will donate to the project if issue is resolvedNo
Browser
Database type & versionmysql 5.7
Server OS (if known)
Webserver software & version (if known)
PHP Versionphp 7.4

Relationships

duplicate of 16925 assignedp_teichmann Feature requests Quota : enforced option (checked on all page) 

Users monitoring this issue

mfavetti

Activities

wangzhen2

wangzhen2

2023-10-13 05:53

reporter   ~77682

1697169157820.jpg (98,024 bytes)   
1697169157820.jpg (98,024 bytes)   
mfavetti

mfavetti

2023-10-13 08:31

developer   ~77683

From my understanding, only completed responses count towards a quota. Also in your example (group by group presentation), the quota is only checked when the respondent clicks next on the first group. So I think it's working as intended.

Maybe this is more of a feature request to have quotas evaluated on every group change rather than only on a group change that contains a question tied to a quota? So once you have enough completes to satisfy a quota, anyone in the middle of the survey that would exceed that quota gets stopped the next time they change groups?

mfavetti

mfavetti

2023-10-13 08:41

developer   ~77684

L1879 basically says if the response satisfies all the conditions for the quota and either one of the quota fields was posted or all the quota fields are questions with the "always hide this question" setting enabled. It's this posted part that means it only considers quota which had a value that was sent via post. (ie. the question for the quota was in the group that was just displayed when they clicked next)

mfavetti

mfavetti

2023-10-13 08:43

developer   ~77685

Last edited: 2023-10-13 08:44

I think if you replace $bPostedField on line L1879 with true you'll get the behavior you want. (always check quota regardless of if it was in post data for last request)

mfavetti

mfavetti

2023-10-13 08:45

developer   ~77686

Last edited: 2023-10-13 09:05

in any case, I think this isn't a bug.

Works exactly as documented here: https://manual.limesurvey.org/Survey_quotas

Actually, read the section at the bottom called "Limiting max number of responses in survey using a hidden question"

You can use a hidden equation based off of the question and set the quota on that equation to achieve the desired functionality, I think.

wangzhen2

wangzhen2

2023-10-16 04:54

reporter   ~77712

Thank you for your reply. I tried the method you mentioned, and it indeed can implement quota restrictions. However, isn't this too cumbersome? I need to create a hidden question corresponding to each question that does not need to have a hidden quota. For a simpler approach, I might prefer to replace $bPostedField with true.

mfavetti

mfavetti

2023-10-16 07:57

developer   ~77714

It might be simpler, but every time you update to a new version you'd need to change it again. Alsothe code base could change, which means you'd have to figure out what/where to modify again. I think it's easier in the long run to use the supported method of achieving the functionality you want.

DenisChenu

DenisChenu

2023-10-18 10:14

developer   ~77766

A solution can be create quota with hidden question …

If i don't make error : there are a feature request : https://bugs.limesurvey.org/view.php?id=16925

mfavetti

mfavetti

2023-10-20 22:09

developer   ~77820

i'm closing this as it's basically a feature request and DenisChenu made 16925 accordingly

Issue History

Date Modified Username Field Change
2023-10-13 05:38 wangzhen2 New Issue
2023-10-13 05:38 wangzhen2 File Added: image.png
2023-10-13 05:52 wangzhen2 File Deleted: image.png
2023-10-13 05:53 wangzhen2 Note Added: 77682
2023-10-13 05:53 wangzhen2 File Added: 1697169157820.jpg
2023-10-13 05:53 wangzhen2 Bug heat 0 => 2
2023-10-13 05:55 wangzhen2 Issue Monitored: wangzhen2
2023-10-13 05:55 wangzhen2 Bug heat 2 => 4
2023-10-13 05:55 wangzhen2 Issue End Monitor: wangzhen2
2023-10-13 05:55 wangzhen2 Bug heat 4 => 2
2023-10-13 08:31 mfavetti Note Added: 77683
2023-10-13 08:31 mfavetti Bug heat 2 => 4
2023-10-13 08:41 mfavetti Note Added: 77684
2023-10-13 08:43 mfavetti Note Added: 77685
2023-10-13 08:43 mfavetti Issue Monitored: mfavetti
2023-10-13 08:43 mfavetti Bug heat 4 => 6
2023-10-13 08:44 mfavetti Note Edited: 77685
2023-10-13 08:45 mfavetti Note Added: 77686
2023-10-13 08:45 mfavetti Note Edited: 77686
2023-10-13 09:05 mfavetti Note Edited: 77686
2023-10-16 04:54 wangzhen2 Note Added: 77712
2023-10-16 07:57 mfavetti Note Added: 77714
2023-10-18 10:14 DenisChenu Note Added: 77766
2023-10-18 10:14 DenisChenu Bug heat 6 => 8
2023-10-18 10:15 DenisChenu Relationship added duplicate of 16925
2023-10-20 22:09 mfavetti Assigned To => mfavetti
2023-10-20 22:09 mfavetti Status new => closed
2023-10-20 22:09 mfavetti Resolution open => duplicate
2023-10-20 22:09 mfavetti Note Added: 77820