Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Check if more than one multiple choice has been selected

Check if more than one multiple choice has been selected 2 Monate 2 Wochen her #104435

  • arna
  • arnas Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 1
  • Karma: 0
Hello, I am new to Limesurvey - thanks for the fantastic software and good documentation. It is refreshing to use open-source which is so established and well maintained. I will definitely make a donation or contribute otherwise :)

One thing I am a bit stuck on and would appreciate help with:

I need to write an expression which checks whether more than one multiple choice has been chosen.

Is there a way of assigning the value 1 to subquestions so I could use something like: count(that.Qcode.value) > 1 ??

Thanks
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Check if more than one multiple choice has been selected 2 Monate 2 Wochen her #104507

  • tomscher
  • tomschers Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 22
  • Dank erhalten: 5
  • Karma: 2
Hi,
Not sure what kind of question you are using and what you want to do in the long run...
I assume it's the "Array Numbers (Checkbox Layout)" version with 5 columns and only one row.

You could try to fill this in a question afterwards:

{if(sum(Test_A_1, Test_A_2, Test_A_3, Test_A_4, Test_A_5) > 1, "More than one alternative was selected", "One or no alternative was selected")}

If you just want to validate the number of checked alternatives, then you can simply use the same idea (without the if-clause) in the validate answer field of the respective question.

Does that help?
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Check if more than one multiple choice has been selected 2 Monate 2 Wochen her #104542

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 3813
  • Dank erhalten: 683
  • Karma: 328
You cannot assign assessment values to Multiple Choice subquestions. However given a Multiple Choice with question code "Q1" and sub-question codes "A1", "A2", "A3", "A3", you can use an equation like this:

{if(sum(Q1_A1 == "Y", Q1_A2 == "Y", Q1_A3 == "Y", Q1_A4 == "Y") > 1, 'More than one checked', '')}
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.158 Sekunden
Donation Image