Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question/Feature] add max answer limit to a question #39

Open
medarob opened this issue Jul 30, 2022 · 3 comments
Open

[Question/Feature] add max answer limit to a question #39

medarob opened this issue Jul 30, 2022 · 3 comments

Comments

@medarob
Copy link

medarob commented Jul 30, 2022

We use the extension as a poll/survey tool.

Now we have a use case/question where only a limited number of answers should be possible.

For example:
A question with muliple answers where you can choose between answers like A, B, C or/and D.
Now, answer B can only be choosen 10 times in total.

So, if 10 participants have choosen answer B then answer B should be hidden as an option for any other participant that follows and opens the survey.

I think, if an implementation is possible, you have to include a new "max limit" field for each answer and on every page load you have to check the total amount of answers for a question and if it already matches the number in the "max limit" field then the answer option should be hidden (or not rendered at all).
Furthermore you have to check when you submit the form/page because it's possible that multiple users have opened the form around the same time when the option was still available. If 15 people open the form only the first 10 submits with answer B should be counted. If the 11th user submits the form and has option B selected then an error should appear that this option is not available anymore.

I know in a quiz that is not really the use case, to omit answers or set an answer limit, so my question would be if that functionality could still be added so that the extensions could be used as a poll/survey extension, too?

@bihor
Copy link
Owner

bihor commented Aug 2, 2022

Well a limit would be possible, but the biggest problem is the check after the form submission.
Currently there is only a JavaScript check.
First I must implement a PHP check after a form submit.
Conclusion: this are 2 new features. I will think about it...

@bihor
Copy link
Owner

bihor commented Aug 19, 2022

Note: a general PHP check of the form can now be enabled with the setting phpFormCheck=1

@bihor
Copy link
Owner

bihor commented Apr 23, 2024

Well, I have read this issue now again and I think you will not need it anymore.
I would close it, if so.
Otherwise I think its a special case and not for the GitHub-release.
Only a special version/implementation would be possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants