Skip mandatory questions via script

Plus d'informations
il y a 2 mois 2 semaines #172051 par kensikat
kensikat a créé le sujet : Skip mandatory questions via script
Hi everybody,

I'm setting a cookie via js so that participants who take the survey again dont have to answer the first two pages again (I want participants to take the survey more than once).
I know how to skip a page by activating the next button in my script. However it doesnt work when the questions are set to be mandatory.
I want them to be mandatory for the first time, so setting them to be non-mandatory is not an option sadly.

Does anyone know how to disable the mandatory feature for all questions on a page via js?
I wasnt able to find an answer with my search of the forums.

Advice would be greatly appreciated!

Greetings,
Kaspar

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 2 mois 2 semaines #172056 par DenisChenu
DenisChenu a répondu au sujet : Skip mandatory questions via script
Just enter some value via js too …

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 .

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 2 mois 2 semaines #172057 par kensikat
kensikat a répondu au sujet : Skip mandatory questions via script
That could work but is kind of an unelegant workaround. Since there are quite a few questions in different formats on those two that would be kind of a hassle. I was hoping for an easier solution.

Still, thank you for your quick answer. If there isnt any better solution, I'll have to go that way.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 2 mois 2 semaines #172060 par kensikat
kensikat a répondu au sujet : Skip mandatory questions via script
So, I found the option to remove the class "mandatory" from all elements.

var mandatoryelems = document.querySelectorAll(".mandatory");
alert(mandatoryelems.length);

[].forEach.call(mandatoryelems, function(el) {
el.classList.remove("mandatory");
});

Still a prompt appears that tells me that not all questions have been answered and stops me from activating the next button.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 2 mois 2 semaines #172061 par DenisChenu
DenisChenu a répondu au sujet : Skip mandatory questions via script
You use cookie … but if you use another system, for example token or prefill value by url or … etc …

You can use relevance on the first 2 group directly …

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 .

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 2 mois 2 semaines #172062 par DenisChenu
DenisChenu a répondu au sujet : Skip mandatory questions via script
Mandatory system is tested via PHP … hopefully …

Then 2 solution:
- Set relevance to 0
- Put a value in answer

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 .
Les utilisateur(s) suivant ont remercié: LouisGac

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 2 mois 2 semaines #172064 par kensikat
kensikat a répondu au sujet : Skip mandatory questions via script
The first option sounds like the way to go.
Can you explain how I'd set that up to work? Or is there anything about it in the manual? If so, could you link it to me?

Thank you in advance!

Connexion ou Créer un compte pour participer à la conversation.

Commencez dès maintenant !

Créez simplement un compte et commencez à utiliser LimeSurvey dès aujourd'hui.

Inscrivez-vous maintenant

Inscrivez-vous à notre Newsletter!