Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: punch multi sub-questions using for loop

punch multi sub-questions using for loop 1 Jahr 2 Monate her #95489

  • trivender
  • trivenders Avatar
  • OFFLINE
  • Expert Lime
  • Beiträge: 139
  • Dank erhalten: 5
  • Karma: 5

Dateianhang:

Dateiname: code.txt
Dateigröße: 2 KB

I want to punch the products based upon the brands selected . Right now my CODE 1 is working fine but this is not a good way to do this.I want to do it using code 1 (using loop).Can someone please help me why it is not working.I spent several hours but no success. please help.

brands question id is B.
array Brands has brands sub-questions codes.

I have attached my code because it is not reflecting properly here.
Trivender Singh
Survey Designer and Programmer
"I always suggest to have a group by group display layout and create a seprate group for each question. This will be extra work but you will get flexiblity to create your question by using more than more lime survey question types."
Letzte Änderung: 1 Jahr 2 Monate her von trivender.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

punch multi sub-questions using for loop 1 Jahr 2 Monate her #95491

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4049
  • Dank erhalten: 739
  • Karma: 341
The loop won't work because everything inside the Expression Manager curly braces is parsed at the server level so cannot contain JavaScript variables.
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.

punch multi sub-questions using for loop 1 Jahr 2 Monate her #95495

  • trivender
  • trivenders Avatar
  • OFFLINE
  • Expert Lime
  • Beiträge: 139
  • Dank erhalten: 5
  • Karma: 5
Tony thank you very much...

I also tried ((B_1.NAOK == "Y")) but no success. This condition works fine in relevance field . Can you please help me how can I use it in for loop.
Trivender Singh
Survey Designer and Programmer
"I always suggest to have a group by group display layout and create a seprate group for each question. This will be extra work but you will get flexiblity to create your question by using more than more lime survey question types."
Der Administrator hat öffentliche Schreibrechte deaktiviert.

punch multi sub-questions using for loop 1 Jahr 2 Monate her #95544

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4049
  • Dank erhalten: 739
  • Karma: 341
Well, as I said, I don't think you can do this using Expression Manager and a loop. The "Brands" and "Products" arrays don't exist when the expression is parsed so the loop cannot work.

I think you'll have to do it the hard way.
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.148 Sekunden
Donation Image