Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Calculate with values from answers/multiple choice question

Calculate with values from answers/multiple choice question 2 Jahre 2 Wochen her #87783

  • blukas
  • blukass Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 10
  • Karma: 0
Hi all

we are using limesurvey as a calculation tool, this means depending on an answer, a price in EUR/USD is calculated.
So far I managed to get it working for
- drop-down question (here I use the answer code, e.g. price = {Element1+Element2}
- multiple numerical input, here I use the number of items and multiply them with their price,
e.g. price = {(product1.NAOK*833)+(product2.NAOK*94)} (833 and 94 being the price)

However, I am struggling with the multiple choice questions.
e.g. from question "options1" with the two options/subanswers "options1_1" and "options1_2" I want to calculate a price. {(options1_1.NAOK*833)+(options1_2.NAOK*94)} doesn't work

What code do I have to use to get a 1 or 0 depending whether a multiple choice question box is checked or not? Because then I can multiply this with the price....

Thanks a lot
Lukas
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Calculate with values from answers/multiple choice question 2 Jahre 1 Woche her #87955

  • blukas
  • blukass Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 10
  • Karma: 0
Ok, Maybe my question was a Bit confusing...
Multiple Choice question with subanswers "question1_sub1"
if I select/tick the answer box the next question (equation) should calculate 1 x 400, if I dont tick it the equation should be 0 x 400
What Code do I use in the equation?

Thank you very much in advance
Lukas
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Calculate with values from answers/multiple choice question 2 Jahre 1 Woche her #88001

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 6551
  • Dank erhalten: 868
  • Karma: 257
Not sure but
something like that
{if(question1_sub1=="Y",product1.NAOK*833,0)}
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.130 Sekunden
Donation Image