QS: Em validering q
From LimeSurvey Manual
Spørgsmålsvalideringsligning (em_validation_q)
Beskrivelse
Dette er en ligning, der bruges til at validere hele spørgsmålet (f.eks. alle dets dele samlet for et spørgsmål med flere svar). Hvis spørgsmålet ikke opfylder valideringskriterierne, vil em_validation_q_tip-meddelelsen blive vist (den bruger CSS-stilen .error). Dette tip bruger .em_q_fn_validation CSS-stilen, som er skjult som standard i template.css.
Den største forskel mellem denne funktion og underspørgsmålsvalideringsligningerne (em_validation_sq option) er, at hvis spørgsmålet (eller spørgsmålsdelene) mislykkes i valideringen, kan der vises en fejlmeddelelse for denne funktion. Til validering af underspørgsmål vil hver tekstindtastningscelle (f.eks. i en array-spørgsmålstype, men den kan også anvendes på enkeltindtastningsspørgsmålstyper) styles, så baggrundsfarven er (lys)rød.
Gyldige værdier
- Enhver ligning, der gør brug af ExpressionScript-syntaksen, uden omgivende krøllede klammeparenteser.
Example
- You want to collect demographic information from users via a multiple short text question, and you want to validate that the user has entered a valid email address and phone number.
This example shows how the question looks with invalid answers:

And here is what it looks like with one invalid answer:

Here is how you edit a question to enter that information:

And here is part of the Show Logic File output that lets you check the accuracy of your expression and ensure that there are no syntax errors:

As you can see, the validation equation tests that both the email and phone number are either empty or match a regular expression filter.
The validation tip only shows the warning message if the phone or email appears invalid.
If you wish to import the example from above into your LimeSurvey installation, download the following .lsq file: Em_validation_q_example.zip.
Another slightly different example can be downloaded below. It states that none of the three subquestion fields can be empty at the same time and that at least one of them has to be filled in (according to its corresponding regular expression). Download the question from here.