Desacitvation of an option where it has been chosen X times

More
2 years 11 months ago #122962 by Josh
Josh created the topic: Desacitvation of an option where it has been chosen X times
Hello!

I have created a survey with a question which has several options.
I want than, where one of those options has been chosen like 40 times, for example, this option will be desactivated (grey or hidden).

Is it possible to do that?
Or do I have to check the results file to desactivate it myself manually?

Thank you in advance for your answer,
Josh.

Please Log in or Create an account to join the conversation.

More
2 years 11 months ago #122963 by gabrieljenik
gabrieljenik replied the topic: Desacitvation of an option where it has been chosen X times
I believe there is no standard way of doing that.
You could do it by adding some Javascript development in the question body, that checks, via ajax, the number of times the options were used and disable the ones desired.

Cheers,
Gabriel - www.Encuesta.Biz - Authorized Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Assistance on LimeSurvey forum and LimeSurvey core developpement are on my free time (Say thanks ?)....[img]
The following user(s) said Thank You: Josh

Please Log in or Create an account to join the conversation.

More
2 years 11 months ago #122965 by Josh
Josh replied the topic: Desacitvation of an option where it has been chosen X times
Okay, thank you for your answer. :)

Please Log in or Create an account to join the conversation.

More
2 years 11 months ago - 2 years 11 months ago #122973 by DenisChenu
DenisChenu replied the topic: Desacitvation of an option where it has been chosen X times
I think you can use beforeQuestionRender with the last version.
manual.limesurvey.org/BeforeQuestionRender
Find the count of each ansers (using quota or fixed number), getQuotaCompletedCount give you how to search in the survey DB.
For each answer up to ... the number
Get the 'answers' , use regexp or php.net/manual/fr/book.xmlreader.php to search for the line to remove (remove seems more easy to add 'readony" first).

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
Last Edit: 2 years 11 months ago by DenisChenu.

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!