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

SUJET : Preventing a person from choosing his/her own name off the dropdown list

Preventing a person from choosing his/her own name off the dropdown list il y a 8 mois 1 semaine #101631

  • merclimcg
  • Portrait de merclimcg
  • Hors ligne
  • Fresh Lemon
  • Messages : 2
  • Karma: 0
Noob alert.

I created a peer evaluation survey for my company. I have a dropdown list that contains all employees in the company. How can I prevent a person taking the survey from choosing his/her own name off the list and evaluating him/herself?

This is a close survey but not an anonymous one and I activated token tracking.

Any help will be much appreciated.

Thanks.

merclim
L'administrateur a désactivé l'accès en écriture pour le public.

Preventing a person from choosing his/her own name off the dropdown list il y a 8 mois 1 semaine #101642

  • tpartner
  • Portrait de tpartner
  • Hors ligne
  • LimeSurvey Team
  • Messages : 4054
  • Remerciements reçus 740
  • Karma: 341
Assuming that drop-down option contains the token first-name and the token last-name, separated by a space, you can set up your survey to use JavaScript and add this to the question source. It will remove the option.

<script type="text/javascript" charset="utf-8">	
	var firstName = '{TOKEN:FIRSTNAME}';
	var lastName = '{TOKEN:LASTNAME}';
 
	$(document).ready(function() { 
 
		$('#question{QID} option').filter(function() {
			return $(this).text() == firstName+' '+lastName;
		}).remove();
    });
</script>
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.
Dernière édition: il y a 8 mois 1 semaine par tpartner.
L'administrateur a désactivé l'accès en écriture pour le public.
Cet utilisateur a été remercié pour son message par: merclimcg

Preventing a person from choosing his/her own name off the dropdown list il y a 8 mois 1 semaine #101650

  • merclimcg
  • Portrait de merclimcg
  • Hors ligne
  • Fresh Lemon
  • Messages : 2
  • Karma: 0
Holy molly! tpartner, it worked like a charm! Zillion thanks to you man!
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