Bienvenue, Invité
Nom d'utilisateur : Mot de passe : Se souvenir de moi

SUJET : punch multi sub-questions using for loop

punch multi sub-questions using for loop il y a 11 mois 2 semaines #95489

  • trivender
  • Portrait de trivender
  • Hors ligne
  • Expert Lime
  • Messages : 118
  • Remerciements reçus 3
  • Karma: 4

Fichier attaché :

Nom du fichier : code.txt
Taille du ficher : 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."
Dernière édition: il y a 11 mois 2 semaines par trivender.
L'administrateur a désactivé l'accès en écriture pour le public.

punch multi sub-questions using for loop il y a 11 mois 2 semaines #95491

  • tpartner
  • Portrait de tpartner
  • Hors ligne
  • LimeSurvey Team
  • Messages : 3813
  • Remerciements reçus 683
  • Karma: 328
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.
L'administrateur a désactivé l'accès en écriture pour le public.

punch multi sub-questions using for loop il y a 11 mois 2 semaines #95495

  • trivender
  • Portrait de trivender
  • Hors ligne
  • Expert Lime
  • Messages : 118
  • Remerciements reçus 3
  • Karma: 4
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."
L'administrateur a désactivé l'accès en écriture pour le public.

punch multi sub-questions using for loop il y a 11 mois 2 semaines #95544

  • tpartner
  • Portrait de tpartner
  • Hors ligne
  • LimeSurvey Team
  • Messages : 3813
  • Remerciements reçus 683
  • Karma: 328
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.
L'administrateur a désactivé l'accès en écriture pour le public.
Modérateurs: ITEd
Temps de génération de la page : 0.124 secondes
Donation Image