Welcome to the LimeSurvey Community Forum

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

Array with dropdown. How don't repeat answers?

More
9 years 3 months ago #115375 by Rony
Hello everyone,
I have created questions to assess the importance of something. So I'm using the array with dropdown. But I wish the answers could not be repeated in the sub-questions. Does anyone know how to do this?
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 3 months ago #115378 by holch
Hmmm, sorry, but I don't really understand the problem. Why would answers repeat in the dropdown? Only if you put them various times...

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: DenisChenu
The topic has been locked.
More
9 years 3 months ago - 9 years 3 months ago #115416 by Rony
Thank you for your reply. I will send to you an example. The survey is in Portuguese, but its okay. I think you will understand the problem. Here you are: pesquisacpm.limequery.org/index.php/487483/lang-pt-BR

In Question 1, for example, the question requires the respondent to choose the alternatives in order of priority. But, as the answers are repeated in the dropdown list, the respondent may put the same alternative in sub-questions 1st place (1º lugar), 2nd place (2º lugar) and 3rd place (3º lugar). I would like when the respondent put a an alternative in a sub-question, this alternative could not be repeated in the other sub-questions. This is understandable? Congratulations!
Last edit: 9 years 3 months ago by Rony.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 3 months ago #115422 by holch
No problem with portuguese, sitting here in São Paulo... ;-)

So I guess what you mean is, that if the first choice has been made, this should not be available in the second dropdown and the the choices made in the first and second should not be available in the third.

This is a tricky one, because the way your questionnaire is design respondents can respond any of the questions at any time.

I probably would create a different question type (maybe Array by column) and allow only 1st, 2nd and 3rd place.

Or maybe it is possible to work with conditions (hide drop down 2 and 3 and show 2 when 1 has been answered, 3 when 1 and 2 have been answered) and then work with array filter.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
More
9 years 3 months ago #115424 by Rony
:) You understood the problem perfectly!!! :cheer:

I will think about your considerations. I liked this format as it is. It is easy to view and to understand. Array by column is more difficult, I guess. I don't know. Anyway, thank you!!!


P.S.: Holch, Já que você está em São Paulo e fala português, poderia me ajudar mais com meu questionário, hehehe... Eu precisaria de alguém 'experiente' para dar uma olhada nele como um todo. Poderíamos trocar contato. Eu teria grande satisfação em retribuir de alguma forma. O que acha? abç!
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 3 months ago #115425 by holch
I think the format it nice, but it doesn't really help if the questions look good but don't work as expected.

But give it a try with the array filter. Not sure if the array filter works on the same page and if it works on the fly. As far as I can remember, it does. But I am not sure if it works with this question type.

Then there is always the chance that a Javascript workaround will help, but I am no expert in that.

Sobre a ajuda: No momento as coisas são malucas aqui. Estamos finalizando o ano. Estou no forum apenas nos momentos de "descansar a cabeça". Então vai ficar dificil. Mas pode enviar e eu vejo se consigo dar uma olhada quando tiver um tempinho.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
More
9 years 3 months ago #115429 by Rony
Again, thank you, holch. I'll think about what you told me and try somehow. I do not know Java, so this hypothesis is ruled out for me. I'll think about what is best for my case: keep it that way, or change to some other way.

P.S.: Vou lhe enviar uma mensagem privada para falar sobre a "ajuda". abç
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 3 months ago #115443 by tpartner
Replied by tpartner on topic Array with dropdown. How don't repeat answers?
I would use an array question and the unique() function for question validation - something like this post - www.limesurvey.org/en/forum/design-issue...-in-thumbnail#112838

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
9 years 3 months ago - 9 years 3 months ago #115472 by Rony
Thany you, tpartner!!!

your suggestion is very good and solve my problem (I read the other topics and also helped a lot). But I could not apply it. I copied the functions in the "Question validation equation" and in the "Question validation tip". But it do not work. I do not know if I did right. I guess yes. I'll put on annex what I did. If you can look, see question C1. But do not worry, you've helped a lot. I'll keep trying. Now I think I'm in the right way. :)

best regards!!!
Last edit: 9 years 3 months ago by Rony.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 3 months ago #115490 by DenisChenu
Replied by DenisChenu on topic Array with dropdown. How don't repeat answers?

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
9 years 3 months ago #115501 by Mazi

Rony wrote: Thany you, tpartner!!!

your suggestion is very good and solve my problem (I read the other topics and also helped a lot). But I could not apply it. I copied the functions in the "Question validation equation" and in the "Question validation tip". But it do not work. I do not know if I did right. I guess yes. I'll put on annex what I did. If you can look, see question C1. But do not worry, you've helped a lot. I'll keep trying. Now I think I'm in the right way. :)

best regards!!!

I just tested your LSS file and it works fine. The user can only proceed if unique answers were given!?

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
More
9 years 3 months ago #115542 by Rony
:)
It's working now with the function: unique (self) and count (self)==max (self)

Thank you, Denis.

Lack a little adjustment now. The message "Each item must be different" appears to enter any value in dropdow list at any item and not only when appear repeated values in more than one item.

Here is (attached) that has been done, if anyone wants to look. Now it's close to being ready :laugh:

a big hug to all
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose