Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Search Results (Searched for: validation)

  • Joffm
  • Joffm's Avatar
Yesterday 19:35
Hi, I do not see any issue with (as I wrote "You have to use NAOK")
1. validation equation
Q18_SQ005.NAOK == "Y" or count(self.NAOK) == 2 or count(self.NAOK) == 3

2. validation tip
{if(count(self.NAOK) !=2 and count(self.NAOK) !=3 and Q18_SQ005.NAOK !="Y","Please, select 2 or 3 options","")}
Of course you can improve it.





 

File Attachment:

File Name: limesurvey...53_J.lss
File Size:47 KB


And you should change the "max.value" in Q18A to "count(that.Q18)"

Joffm
  • holch
  • holch's Avatar
Yesterday 17:19
Just tested it and I confirm. And to be honest, I don't have a solution (yet). However, what I noticed:

Look at your video. When you check 2 or 3 answers, the text disappears and the little (!) turns blue.

But if you mark the exclusive option, the text disappears, but the symbol is still red.

Actually, thinking about it, you shouldn't use any equation in the message field. The message only appears if they conditions are not met. So you can just put the text, without having to taylor it, I think. So at the moment, there is something wrong with your Question validation equation, but the text disappears, because you have an equation in your Question validation tip. So the text disappears, but the warning is still there.

That is where we have to start from.
  • blocka
  • blocka's Avatar
Yesterday 16:00
I've tried that, but alas, seems to make no difference. I figure a screen movie might help, so if you have 90 seconds, this explains what I'm trying to accomplish (and provides a review of how I have my validation equation set up):

1drv.ms/v/s!ApZ2h3V5HB1io_91YXC0-7HnU7mfUQ?e=VUVWB2
  • blocka
  • blocka's Avatar
15 May 2024 21:19
Thanks muchly for the suggestion. I tried adding the validation equation, but I still cannot select "None" (Q18_SQ005).
I've attached the survey in the event you might have time to take a peak...
  • Joffm
  • Joffm's Avatar
15 May 2024 20:45
Hi,
I should say:
A question validation like (Q01_9 = exclusive option)
Q01_9=="Y" or count(self)==2 or count(self)==3

and an tip like
{if(count(self)!=2 and count(self)!=3 and Q01_9!="Y","Please, select 2 or 3 options","")}
  • DenisChenu
  • DenisChenu's Avatar
08 May 2024 12:52
Replied by DenisChenu on topic Append existing responses?
Validation on the name question

manual.limesurvey.org/StatFunctions
I use EMAIL and NAME for the title of the questions

1. Create an equation question (EMAILNAME) with equation set to {join(EMAILNAOK,NAME.NAOK)} (same group)
2. In NAME validation : {statCountIf(EMAILNAME.sgqa, EMAILNAME.NAOK) < 1} and set tip to : This name was already used with this email

It work only for Submitted value, if you want to really avoid duplicate {statCountIf(EMAILNAME.sgqa, EMAILNAME.NAOK, 0, 0) < 1}
 
  • Bruno_d
  • Bruno_d's Avatar
02 May 2024 16:28
Aidez-nous à vous aider et remplissez les cases appropriées :
Votre version de LimeSurvey : Version de votre LimeSurvey : Version 3.28.71 .
Votre propre serveur
Thème :
Fruity
==================
Bonjour,
J'aimerais réaliser un questionnaire non anonyme avec accès sur invitation en accès public et persistance des réponses.
Phase 1
Les données sont saisies par un premier utilisateur
Phase 2
Un message est envoyé à un deuxième utilisateur pour contrôle des saisies puis validation (URL +
?Phase=2)
dans un groupe uniquement accessible en phase 2
Phase 3
Un message est envoyé à un comité d'évaluation (URL +
?Phase=3) qui doit remplir un groupe uniquement accessible en phase 3.

Le tout fonctionne correctement mais j'aurais aimé qu'en phase 3, les données en phase 1 apparaissent soit en readonly, soit sous forme de recap dans le groupe de phase 3 dans un champs affichage de texte.
Et, bien sûr, si je vais directement sur le groupe "phase 3", les données des groupes précédents sont perdus :((.
Existe-t-il un moyen de ne pas les perdre ?
Merci d'avance pour vos réponses
Bonne fin de journée
Bruno
  • ezraboni
  • ezraboni's Avatar
28 Apr 2024 17:00 - 28 Apr 2024 17:01
Hi Joffm,

Thank you so much for the quick response! I used your solution for array question and added a question validation per your instruction. It's working fine on my end. :)

Again, thank you so much for the help!

Regards,
Ezra
  • Joffm
  • Joffm's Avatar
28 Apr 2024 11:52 - 28 Apr 2024 11:57
Hi,
at first you have to consider:
These are two independent questions.
1a. Which attributes do you associate with category 1?
1b. Which attributes do you associate with category 2?
Both "multiple". This is straightforward, easy and built-in.

Additionally you may display these two questions side by side, like this
 
As here you only display two multiple questions your requirement is still fulfilled.
Unfortunately you did not answer the questions at the beginning (why not?)
Therefore we can't know if you are allowed to use javascript.
But here it is.
Put it in one of the questions (and you have to enter into css classes: "flex-layout")
Code:
<script type="text/javascript" data-author="Tony Partner">    
    $(document).ready(function() {
 
        // The number of questions to wrap in the flex container
        var numberQuestions = 2;
 
        // Identify the questions
        var thisQuestion = $('#question{QID}');        
        var rowQuestions = thisQuestion.add(thisQuestion.nextAll('.question-container:lt('+(numberQuestions-1)+')'));
 
        // Wrap the questions in a <div> element
        rowQuestions.wrapAll('<div class="question-flex-container" />');
    });
</script>

Code:
<style type="text/css">@media only screen and (min-width: 576px) {    
        .question-flex-container {
            display: flex;
            justify-content: space-evenly;
        }
.flex-layout.question-container {     width:100%;  
    }
</style>



And of course you can use an array(numbers) with checkbox layout.
Here you have to use your own question validation equation to make sure that there is at least one checkbox per column selected.
Furthermore you have to insert the "Other"-option.
Add a question of type "short text" after your array
Put this script into the array question
Code:
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
    // Identify the questions
    var thisQuestion = $('#question'+{QID}+'');
    var nextQuestion1 = $(thisQuestion).nextAll('.text-short:eq(0)');
    var nextQuestions = $(nextQuestion1);
    var nextLength = nextQuestions.length;
    var sqLength = ('tr.answers-list', thisQuestion).length;
 
    // Hide the short-text questions
    $(nextQuestions).hide();
 
    // Move the hidden text inputs into the array
    for (i = 0; i < nextLength; i++) {
        var workingIndex = (sqLength - 1) - (nextLength - i);
        var nextQ = nextQuestions[i];
        $('th.answertext:eq('+workingIndex+')', thisQuestion).append($('input[type="text"]', nextQ)).closest('tr').addClass('otherRow');
    }
 
// Some styling...
    $('input[type="text"]', thisQuestion).css({
        'width': '100%'
    });
});
</script>[/i]


Like this
 


Joffm
  • nebulameek
  • nebulameek's Avatar
25 Apr 2024 14:09
Using simulated data for testing was created by nebulameek
Because the logic of the questionnaire can be very complex at times, manual testing might result in certain logical aspects not being thoroughly tested. Therefore, I have an idea to use a program to create a batch of simulated data to automatically test the questionnaire. For instance, I could choose to run 200 or 1000 sets of simulated data for testing, and record any information that fails validation, in order to identify any logical issues. At present, I'm not sure how to implement this feature, so I'm seeking advice on possible solutions or existing plugins that could be utilized.
  • DenisChenu
  • DenisChenu's Avatar
22 Apr 2024 10:46
En utilisant regexpMatch : manual.limesurvey.org/ExpressionScript_-...mplemented_functions
dans la validation : manual.limesurvey.org/Question_type_-_Sh...on_(em_validation_q)

Pour les mails : regexpMatch("/^.+?@.+?\..+$/", self.NAOK)

 
  • AntPIC
  • AntPIC's Avatar
20 Apr 2024 16:09
Replied by AntPIC on topic validation of multiple numeric inputs
Thanks Joffm

/^(195[0-9]|19[6-9][0-9]|20[0-9]{2}|2100)$/
  • Joffm
  • Joffm's Avatar
20 Apr 2024 15:25
Replied by Joffm on topic validation of multiple numeric inputs
You see what I entered to limit from 1950 to 2024.
And you may use
[url] regex101.com/ [/url]
to get more familiar with regular expressiona.
 
  • AntPIC
  • AntPIC's Avatar
20 Apr 2024 11:31
Replied by AntPIC on topic validation of multiple numeric inputs
and if i want a range between 1900-2100? What i have to insert?
  • Joffm
  • Joffm's Avatar
20 Apr 2024 11:15
Replied by Joffm on topic validation of multiple numeric inputs
It is correct syntax, but it allows 
1492
8745
Not very realistic years
Displaying 1 - 15 out of 172 results.

Lime-years ahead

Online-surveys for every purse and purpose