Help with answer validation please

More
1 month 1 week ago - 1 month 1 week ago #215856 by Betriebsleiter
 
Good day!
I am struggling with an answer validation for an array and it would be highly appreciated if someone could help me out here.
I try to validate, that per row: Max > Average (Durchschnitt) > Min.

1) Preferred solution (no idea how to implement) via subquestion validation, so that the user directly sees which box contains a "wrong" answer
My idea here would be to have a code sth like this:
If [this box] is in 1st coloumn : nothing
If [this box] is in 2nd or 3rd coloumn: [this box] >= [box to my left]


2) Another 2nd choice solution that I kind of implemented but doesn't work somehow: 
Validatation for the entire question:
((is_empty(f1_Y1_X1.NAOK) or is_empty(f1_Y1_X2.NAOK) or is_empty(f1_Y1_X3.NAOK)) or (f1_Y1_X3.NAOK >= f1_Y1_X2.NAOK >= f1_Y1_X1.NAOK)) and
((is_empty(f1_Y2_X1.NAOK) or is_empty(f1_Y2_X2.NAOK) or is_empty(f1_Y2_X3.NAOK)) or (f1_Y2_X3.NAOK >= f1_Y2_X2.NAOK >= f1_Y2_X1.NAOK)) and
((is_empty(f1_Y3_X1.NAOK) or is_empty(f1_Y3_X2.NAOK) or is_empty(f1_Y3_X3.NAOK)) or (f1_Y3_X3.NAOK >= f1_Y3_X2.NAOK >= f1_Y3_X1.NAOK)) and
((is_empty(f1_Y4_X1.NAOK) or is_empty(f1_Y4_X2.NAOK) or is_empty(f1_Y4_X3.NAOK)) or (f1_Y4_X3.NAOK >= f1_Y4_X2.NAOK >= f1_Y4_X1.NAOK)) and
((is_empty(f1_Y5_X1.NAOK) or is_empty(f1_Y5_X2.NAOK) or is_empty(f1_Y5_X3.NAOK)) or (f1_Y5_X3.NAOK >= f1_Y5_X2.NAOK >= f1_Y5_X1.NAOK)) and
((is_empty(f1_Y6_X1.NAOK) or is_empty(f1_Y6_X2.NAOK) or is_empty(f1_Y6_X3.NAOK)) or (f1_Y6_X3.NAOK >= f1_Y6_X2.NAOK >= f1_Y6_X1.NAOK)) and
((is_empty(f1_Y7_X1.NAOK) or is_empty(f1_Y7_X2.NAOK) or is_empty(f1_Y7_X3.NAOK)) or (f1_Y7_X3.NAOK >= f1_Y7_X2.NAOK >= f1_Y7_X1.NAOK)) and
((is_empty(f1_Y8_X1.NAOK) or is_empty(f1_Y8_X2.NAOK) or is_empty(f1_Y8_X3.NAOK)) or (f1_Y8_X3.NAOK >= f1_Y8_X2.NAOK >= f1_Y8_X1.NAOK))


It would be highly appreciated, if someone could help me with either solution.
Thanks in advance.

Sample survey is attached.


 
Attachments:
Last edit: 1 month 1 week ago by Betriebsleiter.

Please Log in to join the conversation.

More
1 month 1 week ago #215898 by Joffm
Hi,
your implemented solution works as it is thought to work.
 



To show the row where there is a wrong answer you have to implement a better validation hint.
Something like
{if(f1_Y1_X2.NAOK lt f1_Y1_X1.NAOK OR f1_Y1_X3.NAOK lt f1_Y1_X2.NAOK,"Zeile 1: Die Werte müssen aufsteigend sein",if(f1_Y2_X2.NAOK lt f1_Y2_X1.NAOK OR f1_Y2_X3.NAOK lt f1_Y2_X2.NAOK,"Zeile 2: Die Werte müssen aufsteigend sein",if(f1_Y3_X2.NAOK lt f1_Y3_X1.NAOK OR f1_Y3_X3.NAOK lt f1_Y3_X2.NAOK,"Zeile 3: Die Werte müssen aufsteigend sein",...,"")))))))}
 


Or if you want to display exactly the cell:
{if(f1_Y1_X2.NAOK lt f1_Y1_X1.NAOK,"Der Mittelwert in Zeile 1 muss gleich oder größer dem Minimum sein",if(f1_Y1_X3.NAOK lt f1_Y1_X2.NAOK,"Das Maximum in Zeile 1 muss größer oder gleich dem Mittelwert sein", usw.
 

Joffm

 


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Attachments:

Please Log in to join the conversation.

More
1 month 1 week ago #216128 by Betriebsleiter
Hi Joffm,
thanks for your quick reply - the way to show the exact row is a good idea!
But regarding the overall validation, it - for some reason - doesn't work as intended:

File Attachment:
If i put 1,2,3 in every row, it works like in your screenshot. But if I change one row to something different like 5,6,7 it throws an error?!
If someone had an idea what might be causing that would be highly appreciated.

Please Log in to join the conversation.

More
1 month 1 week ago #216132 by Joffm
Is the comparison "greater" or "greater or equal"? I don't remember.
Because of the first row "1.1.3"

Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
1 month 6 days ago #216168 by Joffm
I saw in your sample survey this validation.

Do you still use it?
((is_empty(f1_Y1_X1.NAOK) or is_empty(f1_Y1_X2.NAOK) or is_empty(f1_Y1_X3.NAOK)) or (f1_Y1_X3.NAOK >= f1_Y1_X2.NAOK >= f1_Y1_X1.NAOK)) and
((is_empty(f1_Y2_X1.NAOK) or is_empty(f1_Y2_X2.NAOK) or is_empty(f1_Y2_X3.NAOK)) or (f1_Y2_X3.NAOK >= f1_Y2_X2.NAOK >= f1_Y2_X1.NAOK)) and
...

You see, this part is wrong syntax.
(f1_Y1_X3.NAOK >= f1_Y1_X2.NAOK >= f1_Y1_X1.NAOK))

(f1_Y1_X3.NAOK >= f1_Y1_X2.NAOK AND f1_Y1_X2.NAOK >= f1_Y1_X1.NAOK)

Joffm
 


Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
1 month 6 days ago #216174 by Betriebsleiter
Great, thanks a lot! That was the mistake indeed. Didn't know my notation doesn't work.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now