Welcome to the LimeSurvey Community Forum

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

Search Results (Searched for: multiple)

  • amilcar_pg
  • amilcar_pg's Avatar
05 Jul 2023 16:27
Please help us help you and fill where relevant:
Your LimeSurvey version:  Community Edition   Version 6.1.2+230606 
Own server or LimeSurvey hosting: Own server
Survey theme/template: Vanilla
==================

Hello everyone!

I have a survey with many multiple questions, and It will be distributed via Internet with one of those providers that pay for who is willing to answer it. One of the problems with this kind of approach is that some people just press the same option over and over, just to get their prize. Therefore, I want to avoid this.

My first approach was to use the "Question validation" feature, however, it just pops up a warning, and the person still can just change one answer and keep on. 

So I was willing to create a hidden question with the equation type that returns me 1 if all previous questions on the array have received the same answer, and 0 otherwise. WIth this, I can add a quota that doesn't allow it, and the respondent will be excluded from the survey.

Unfortunately, I haven't been able to program it by myself. I know that it might be something silly, but can anyone help me please?

Thanks in advance for your assistance. I'm attaching a sample survey with 1 similar question.
  • Joffm
  • Joffm's Avatar
04 Jul 2023 19:07 - 04 Jul 2023 19:17
And using the function "countifop" you shorten it to

single question:
{countifop("==","acc",Q1.NAOK,Q2.NAOK,...))}

multiple question:
{countifop("==","Y",Q1_acc.NAOK,Q2_acc.NAOK,...))}

Here I used "acc" as code and subquestion code. You'd better use numerical codes

[url] manual.limesurvey.org/ExpressionScript_-...mplemented_functions [/url]

Joffm
  • holch
  • holch's Avatar
04 Jul 2023 18:41 - 04 Jul 2023 18:41
Funny enough, usually people have problems with the multiple answer questions, not with the single choice. :-)

With single choice it would be just something like "if(G01Q02=1)" etc.
  • linuxhooligan
  • linuxhooligan's Avatar
04 Jul 2023 15:35 - 04 Jul 2023 18:58
Please help us help you and fill where relevant:
Your LimeSurvey version: 6.1.6+230703
Own server or LimeSurvey hosting: VPS
Survey theme/template: Default
==================

Hi.

We are creating multiple choice and single choice questions similar to this:

QUESTION: You and your collaborator have different views on how to solve a problem, how do you communicate your viewpoints to them?
[ ] TRAIT01 - I leave it be.
[ ] TRAIT02 - agree to do it their way.

QUESTION: Your collaborator made a rude joke during a meeting, and it made you look bad in front of the team. You:
[ ] TRAIT01 - Apologise on their behalf.
[ ] TRAIT02 - Talk to them after the fact.

Since we are testing for personality traits, we need to assign individual value to each trait and then at the end of the survey sum all the values each trait across any number multiple or single choice questions as follows:

* TRAIT01
* TRAIT02

With check boxes, we can reference individual answers and values using the following syntax:  sum(if(G01Q01_acc.NAOK == "Y", 1, 0), if(G01Q02_acc.NAOK == "Y", 1, 0), ... if(G01Q06_acc04.NAOK == "Y", 1, 0))

How is this done using radio buttons?  I have checked the documentation but I must have missed it.  Google has not been able to help me narrow down the syntax either.

Thanks.




 
  • Joffm
  • Joffm's Avatar
02 Jul 2023 08:11
Replied by Joffm on topic Take those marked in a multiple question.
Addition to the "mixed" brands.
Repondents who only used one channel can't answer the question to the other.
So, you should ask them, which channel the used (physical or online, or both).
This you can do by changing Q13a to an array(numbers) with checkbox layout.

And you should limit the number of brands in each column to 5. 
"Which of these brands did you mainly buy in the last 6 month? Please, select up to 5 in each channel."
Then everything is fine, clear and easy.

Joffm 
 
  • Joffm
  • Joffm's Avatar
01 Jul 2023 23:02 - 02 Jul 2023 08:02
Replied by Joffm on topic Take those marked in a multiple question.
Hi,
please, ask again, when you have a finalized workflow and a well defined algorithm which brands have to be displayed.
Let's say, in Q13a there are 4 physical brands (P1,P2,P3,P4), 3 online brands (O1,O2,O3) and 4 mixed brands (M1,M2,M3,M4) selected.
Which have to be displayed and where?
I should say:
Split the question and ask separately these two types of brands. In this case the mixed brands appear twice.
Or use subquestion relevance in Q21 ff:
Insert all subquestions (physical and online). To physical brands show one part of the subquestions, to online brands the other part and to these mixed brands show all. To do this you should recode your brands that you have easy subquestion relevance equations
It's up to you.
Only you know what is the goal of your survey.

I am a bit tired to answer to always changing requirements
You started with

so my solution is to only have 10 fixed variables and show the ones that I have selected in Q13a,


Then you changed to

Of the selected brands, I am only taking the first 5 to apply my next questions, which are Q21 and Q21a.
In these two questions, the 5 brands that they selected in Q13a are evaluated, but Q21 only applies to physical brands and Q21a only to online brands.

And now

but I realized that there are many brands that handle both modalities, both physical and online.



And you really should read the manual and study the sample surveys which you can download there.
Just to avoid questions that only arise because you  are not familiar with the basics of ExpressionScript.

Joffm
 
  • Fran1991
  • Fran1991's Avatar
01 Jul 2023 20:12
Please help us help you and fill where relevant:
Your LimeSurvey version: [see right hand bottom of your LimeSurvey admin screen]
Own server or LimeSurvey hosting:
Survey theme/template:
==================
(Write here your question/remark)Hello to all dear members of the forum.

I want to ask you if anyone knows if we can use a script so that the questions advance automatically in a certain time, that is, I want you to only see information in a certain time and then ask you questions about it, but I only want to show you that information for about 10 seconds.

I have this information in a multiple question of short texts but also some of "show text"

My version: 3.25.10+210128

I remember that there were questions with this option but I couldn't find them, I even looked for them in Version 2.50+ Build 16041

But I was unlucky.

I hope someone has an idea.

Greetings,
  • Mon2016
  • Mon2016's Avatar
01 Jul 2023 19:16
Replied by Mon2016 on topic Take those marked in a multiple question.
Hello Joffm

Thank you very much, I thought that the script was only to randomize the answers,

I tell you that in the text of the question of Q21 and Q21a I replaced the "eqBrands" by the "strBrands_p" or the "strBrands_o" as the case may be and everything was displayed correctly.

I also thought that it would only apply for the codes that I mentioned to you. hehehehe, but I realized that there are many brands that handle both modalities, both physical and online.



The only thing that worries me is something, when doing the randomization of the brands it may be that the ones that were evaluated in Q21 I did not evaluate in Q21a since both are randomly shown differently.

Is there a way to make the randomization the same for both subquestions of strBrands?

Or, in your case, take the first 5 that you mark regardless of the order, only respecting the position of the list of brands?

Thanks again for all your help.
  • Joffm
  • Joffm's Avatar
01 Jul 2023 18:33
Replied by Joffm on topic Take those marked in a multiple question.
Hi,

it registers commas to separate each brand

Exactly, this is what the "list" function does.
And it is necessary.
In the script you see this line
var arrp = strp.split(',');
Meaning: the comma separated text is inserted in an array and the comma is used as separator.

But: Where is the script in question "strBrands"

On the other hand you inserted ALL brands into strBrand_o. I thought only brands 2,13,16,19, 37,45 are online brands.


Joffm

 
  • Mon2016
  • Mon2016's Avatar
01 Jul 2023 18:19
Replied by Mon2016 on topic Take those marked in a multiple question.
Hello Joffm

Thank you very much for your help, now you opened up a bigger picture than what I was looking for.

I tell you that I did what you indicated and everything seems to be correct, there is only something that I do not know if I have not done well, since in "strBrands_p" and "strBrands_o" it registers commas to separate each brand, so when using the relevant equation "strlen(strBrands_p)>0" I guess it's taking those commas and doesn't display Q21 questions well.

Can you help me figure out what I did wrong?

I am attaching my lss survey to see if you could guide me where I went wrong.


Thanks again for all your help.

​​​​​​​Moon
  • Joffm
  • Joffm's Avatar
01 Jul 2023 16:40
Replied by Joffm on topic Take those marked in a multiple question.

Of the selected brands, I am only taking the first 5 to apply my next questions, which are Q21 and Q21a.

LimeSurvey does not store the order. So how do you decide which are the "first 5"?
At random?
Then there is a really short solution. If you have something else inmind, please, explain!

Do not "join" the brands in "eqBrands", but use the function "list" and assign the brands separated (physical - online) to a next question of type "multiple short text" (one subquestion for physical one for online. This question you hide with the css class "hidden"
I called it "strBrands" with subquestion codes "p" (physical" and "o" (online).
Now in "eqBrands" you assign with two equations.
{strBrands_p=list(if(Q13a_1=="Y","A",""), if(Q13a_3=="Y","C",""), if(Q13a_4=="Y","D",""),..., if(Q13a_43=="Y","q",""), if(Q13a_44=="Y","r",""), if(Q13a_46=="Y","t",""), if(Q13a_47=="Y","u",""))}

{strBrands_o=list(if(Q13a_2=="Y","B",""), if(Q13a_13=="Y","M",""), if(Q13a_16=="Y","P",""), if(Q13a_19=="Y","S",""), if(Q13a_37=="Y","k",""), if(Q13a_45=="Y","s",""))}

In this question you insert this script, which randomizes the brands and then displays only the first 5 into each subquestion.
Code:
<script type="text/javascript" charset="utf-8">
 
function shuffle(array) {
  var currentIndex = array.length, temporaryValue, randomIndex;
  // While there remain elements to shuffle...
  while (0 !== currentIndex) {
    // Pick a remaining element...
    randomIndex = Math.floor(Math.random() * currentIndex);
    currentIndex -= 1;
    // And swap it with the current element.
    temporaryValue = array[currentIndex];
    array[currentIndex] = array[randomIndex];
    array[randomIndex] = temporaryValue;
  }
  return array;
}
 
    $(document).on('ready pjax:scriptcomplete',function(){
      var strp=$('#question{QID} input[type="text"]:eq(0)').val().replace(/\s+/g, '');
      var stro=$('#question{QID} input[type="text"]:eq(1)').val().replace(/\s+/g, '');
 
// Fill the arrays
      var arrp = strp.split(',');
      var arro = stro.split(',');
// Shuffle and truncate
      arrp = shuffle(arrp);
      arrp = arrp.slice(0,5).join('');
      arro = shuffle(arro);
      arro = arro.slice(0,5).join('');
// Fill the subquestion with the results
      $('#question{QID} input[type="text"]:eq(0)').val(arrp);
      $('#question{QID} input[type="text"]:eq(1)').val(arro);
      $('#ls-button-submit').trigger('click');
   });
</script>

Then you use the same equation to pipe the brands into your questions; instead of "eqBrands" you use "strBrands_p" and "strBrands_o".
Quickly changed with the "search and replace" button.

And you may use a question relevance using the string length, like
Q2101: strlen(strBrands_p)>0
Q2102: strlen(strBrands_p)>1
...

That's all.


By the way:
What is this?
count(Q13a_1.NAOK,Q13a_3.NAOK,Q13a_4.NAOK,Q13a_5.NAOK,Q13a_6.NAOK,Q13a_7.NAOK,Q13a_8.NAOK,Q13a_9.NAOK,Q13a_10.NAOK,Q13a_11.NAOK,Q13a_12.NAOK,Q13a_14.NAOK,Q13a_15.NAOK,Q13a_17.NAOK,Q13a_18.NAOK,Q13a_20.NAOK,Q13a_21.NAOK,Q13a_22.NAOK,Q13a_23.NAOK,Q13a_24.NAOK,Q13a_25.NAOK,Q13a_26.NAOK,Q13a_28.NAOK,Q13a_29.NAOK,Q13a_30.NAOK,Q13a_31.NAOK,Q13a_32.NAOK,Q13a_33.NAOK,Q13a_34.NAOK,Q13a_35.NAOK,Q13a_36.NAOK,Q13a_38.NAOK,Q13a_39.NAOK,Q13a_40.NAOK,Q13a_41.NAOK,Q13a_42.NAOK,Q13a_43.NAOK,Q13a_44.NAOK,Q13a_46.NAOK,Q13a_47.NAOK)==1 or count(Q13a_1.NAOK,Q13a_3.NAOK,Q13a_4.NAOK,Q13a_5.NAOK,Q13a_6.NAOK,Q13a_7.NAOK,Q13a_8.NAOK,Q13a_9.NAOK,Q13a_10.NAOK,Q13a_11.NAOK,Q13a_12.NAOK,Q13a_14.NAOK,Q13a_15.NAOK,Q13a_17.NAOK,Q13a_18.NAOK,Q13a_20.NAOK,Q13a_21.NAOK,Q13a_22.NAOK,Q13a_23.NAOK,Q13a_24.NAOK,Q13a_25.NAOK,Q13a_26.NAOK,Q13a_28.NAOK,Q13a_29.NAOK,Q13a_30.NAOK,Q13a_31.NAOK,Q13a_32.NAOK,Q13a_33.NAOK,Q13a_34.NAOK,Q13a_35.NAOK,Q13a_36.NAOK,Q13a_38.NAOK,Q13a_39.NAOK,Q13a_40.NAOK,Q13a_41.NAOK,Q13a_42.NAOK,Q13a_43.NAOK,Q13a_44.NAOK,Q13a_46.NAOK,Q13a_47.NAOK)==2 or
... more and more ...
count(Q13a_1.NAOK,Q13a_3.NAOK,Q13a_4.NAOK,Q13a_5.NAOK,Q13a_6.NAOK,Q13a_7.NAOK,Q13a_8.NAOK,Q13a_9.NAOK,Q13a_10.NAOK,Q13a_11.NAOK,Q13a_12.NAOK,Q13a_14.NAOK,Q13a_15.NAOK,Q13a_17.NAOK,Q13a_18.NAOK,Q13a_20.NAOK,Q13a_21.NAOK,Q13a_22.NAOK,Q13a_23.NAOK,Q13a_24.NAOK,Q13a_25.NAOK,Q13a_26.NAOK,Q13a_28.NAOK,Q13a_29.NAOK,Q13a_30.NAOK,Q13a_31.NAOK,Q13a_32.NAOK,Q13a_33.NAOK,Q13a_34.NAOK,Q13a_35.NAOK,Q13a_36.NAOK,Q13a_38.NAOK,Q13a_39.NAOK,Q13a_40.NAOK,Q13a_41.NAOK,Q13a_42.NAOK,Q13a_43.NAOK,Q13a_44.NAOK,Q13a_46.NAOK,Q13a_47.NAOK)==15



Doesn't it only mean: count>0?
And if you had read the manual about the variables "self" and "that", it is shortened to
count(that.Q13a.NAOK)>0

Joffm
  • Joffm
  • Joffm's Avatar
01 Jul 2023 11:46
Sorry, but I already wrote 

Yes, it is a new question, not related to "Can I use answer of ranking question in following questions?"

Why don't you open a new thread?
I am not surprised to read frequently "I searched the forum but did not find" if a question about random select of multiple choices is hidden in a thread about ranking.


This again is not related to your initial topic "Can I use answer of ranking question in following questions?"

Remember: This is not a dialogue, this is a forum.

So, please: New topic, new thread.

Joffm
  • Mon2016
  • Mon2016's Avatar
01 Jul 2023 08:44
Replied by Mon2016 on topic Take those marked in a multiple question.
Hello Joffm,

I'm sorry to write again on the subject, I was doing what you recommended me to do for the Q21 questions, (I hope you remember since several days have passed) everything goes perfectly but now I am going through something complicated for me.

I put in context:

I have a multiple choice question (Q13a) where I show a large list of brands where they were able to buy

Of the selected brands, I am only taking the first 5 to apply my next questions, which are Q21 and Q21a.

In these two questions, the 5 brands that they selected in Q13a are evaluated, but Q21 only applies to physical brands and Q21a only to online brands.

The codes that only apply to online, that is, they should not be shown in Q21 and if in Q21a they are these:

2
13
16
19
37
45

I have tried many ways to do this jump but can't do it. Anyone faced with this kind of problem?

I am attaching a test survey to make it easier to identify my problem


Thank you Joffm for your patience.

Greetings

Moon
  • Sekhmet
  • Sekhmet's Avatar
30 Jun 2023 15:41 - 30 Jun 2023 15:42
Sous-réponse dans une réponse was created by Sekhmet
Aidez-nous à vous aider et remplissez les cases appropriées :
Votre version de LimeSurvey : Version de votre LimeSurvey : Version 5.6.28
Votre propre serveur ou LimeSurvey Cloud : Cloud
Thème :
Vanilla
==================

Bonjour,

Dans le cadre de ma thèse d'exercice de médecine et la réalisation d'un questionnaire, je me retrouve à utiliser LimeSurvey !
Parmi les questions de mon questionnaire j'aurais souhaité en créer une avec une nouvelle question dans la réponse cochée, une sorte de mise en abime.
Je m'explique :
La question qui se rapproche le plus de celle que je veux créer est celle à Choix multiples avec commentaires (Type: P).
Je souhaiterais créer une question à choix multiples, puis, reproduire le même schéma de choix multiples pour chaque réponse cochée.
Type :
Réponse A
     - sous réponse A1
     - sous réponse A2
     - sous réponse A3
     - sous-réponse A4
Réponse B
     - sous réponse B1
     - sous réponse B2
Réponse C
     - sous réponse C1
     - sous réponse C2
     - sous réponse C3

Est-ce possible ? Si oui, savez-vous comment ?

En vous remerciant,


Sekhmet
 
  • Stiegi64
  • Stiegi64's Avatar
28 Jun 2023 22:34
Hallo Joffm,

Vielen Dank für den Hinweis auf dein Tutorial.
Leider klappt das mit der RegEx-Validierung noch nicht.
Ich habe die Beispielumfage angehängt:
Anhand der Antwort bei Frage 1 soll sich die RegEx-Validierung in Frage 2 ändern.
Leider ist hier gar keine Antwort mehr valide.
Bei Frage 3 und 4 habe ich den Code in die Frage- bzw- Subfrage-Vaidierungsgleichung eingegeben. Bei diesen Fragen wird der RegEx-Code gar nicht angewandt.
Der Code zum Abfragen, welche Antwort bei Frage 1 gewählt wurde, funktioniert (s. Hilfetext Frage 5). Auch die beiden verwendeten RegEx-Codes funktionieren prinzipiell (s. Frage 6 und 7). Hast du eine Idee, woran es liegen kann, dass alles einzeln funktioniert, aber in Kombination nicht mehr? Der Logikprüfer zeigt mir auch keine Syntaxfehler an.

Und dann noch eine Frage zur Eingabemaske: Bei Frage 8 habe ich anstelle der multiplen kurzen Textfragen eine Frage vom Typ kurzer Text ausgewählt.
Die Eingabemaske wird korrekt angezeigt. Kann es hierbei zu Fehlern kommen oder ist das problemlos möglich?

Liebe Grüße
Stiegi


PS: Das Problem mit der veralteten LS-Version werde ich an die Verantwortlichen weitergeben. Ich fürchte nur, dass das erst mittel- bis langfristig angegangen werden kann.

 
Displaying 691 - 705 out of 761 results.

Lime-years ahead

Online-surveys for every purse and purpose