Skip mandatory questions via script

Mehr
4 Monate 6 Tage her #172051 von kensikat
kensikat erstellte das Thema 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

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
4 Monate 6 Tage her #172056 von DenisChenu
DenisChenu antwortete auf das Thema: 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 .

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
4 Monate 6 Tage her #172057 von kensikat
kensikat antwortete auf das Thema: 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.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
4 Monate 6 Tage her #172060 von kensikat
kensikat antwortete auf das Thema: 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.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
4 Monate 6 Tage her #172061 von DenisChenu
DenisChenu antwortete auf das Thema: 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 .

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
4 Monate 6 Tage her #172062 von DenisChenu
DenisChenu antwortete auf das Thema: 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 .
Folgende Benutzer bedankten sich: LouisGac

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
4 Monate 6 Tage her #172064 von kensikat
kensikat antwortete auf das Thema: 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!

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha