Validation based on equation

Mehr
1 Jahr 8 Monate her - 1 Jahr 8 Monate her #133089 von andreafc
andreafc erstellte das Thema Validation based on equation
I have two multiple choice questions Q1 and Q2.
For each of them I have more than 20 checkboxes.
Each checkbox of Q1 has a score of 3 (in my mind) and every checkbox of Q2 has a score of 6.

I need the final score to be exactly 51 (sum of 3*number of checks in Q1 + 6*number of checks in Q2). So I set up an equation question with the expression:
{9+count(that.Moduli3)*3+count(that.Moduli6)*6}

Would you guide me in the process of setting a condition such that if the score of equation is not exactly 51 the survey will not proceed?

I tried read forums and the manual, but still is not clear to me how to do.
I'm new to LimeSurvey so I will really appreciate your help!
Thanks a lot!
Letzte Änderung: 1 Jahr 8 Monate her von andreafc.

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
1 Jahr 8 Monate her #133100 von tpartner
tpartner antwortete auf das Thema: Validation based on equation
Assuming question codes "Q1" and Q2" and both questions are on the same screen, something like this in the Question validation equation for both questions:
sum(count(that.Q1)*3, count(that.Q2)*6) == 51

And, this for the Question validation tip:
{if(sum(count(that.Q1)*3, count(that.Q2)*6) == 51, 'Okay to proceed', 'Cannot proceed')}

If the questions are on separate pages, place those in Q2 only.

Sample survey attached:

Dateianhang:

Dateiname: limesurvey...4444.lss
Dateigröße:28 KB

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Anhang:

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
1 Jahr 8 Monate her - 1 Jahr 8 Monate her #133128 von andreafc
andreafc antwortete auf das Thema: Validation based on equation
Thanks a lot!
It works if I test the survey you sent, but it doesn't if I put it on my survey...
The prompt and the numbers selected are shown correctly. However, with the correct score I cannot proceed...

Can you help me figure out why?

Thanks again
Anhang:
Letzte Änderung: 1 Jahr 8 Monate her von andreafc.

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
1 Jahr 8 Monate her #133158 von tpartner
tpartner antwortete auf das Thema: Validation based on equation
You have relevance on those questions which may mess things up but try adding .NAOK:

sum(count(that.Moduli3.NAOK)*3, count(that.Moduli6.NAOK)*6) == 51

And:

{if(sum(count(that.Moduli3.NAOK)*3, count(that.Moduli6.NAOK)*6) == 51, 'Numero crediti corretto', 'Numero crediti errato')}

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
1 Jahr 8 Monate her - 1 Jahr 8 Monate her #133159 von andreafc
andreafc antwortete auf das Thema: Validation based on equation
Thanks. This doesn't change things, but thanks to your answer I noticed that the relevance equation got automatically transformed into something strange.

This was the relevance equation I originally set up:
((BorsaINPS.NAOK != "1") and (GiaSottomesso.NAOK == "N") and (Dottorandi.NAOK == "N") and (SoloOnline.NAOK == "N"))
Then for some question it was automatically changed into:
((565358X8X136.NAOK != "1") and (565358X8X138.NAOK == "N") and (565358X8X139.NAOK == "N") and (565358X8X140.NAOK == "N"))

Having fixed that, now everything works!
I don't know if this is the place, but perhaps the automatic change is a bug we can signal.
Letzte Änderung: 1 Jahr 8 Monate her von andreafc.

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
1 Jahr 8 Monate her #133197 von jelo
jelo antwortete auf das Thema: Validation based on equation

andreafc schrieb: noticed that the relevance equation got automatically transformed into something strange.

The strange something is the SQGA identifier.
manual.limesurvey.org/SGQA_identifier

Bitte Anmelden 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