Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Partially Randomized Answers For Array Typed Questions

Partially Randomized Answers For Array Typed Questions 1 Jahr 8 Monate her #92002

  • david2013
  • david2013s Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 26
  • Dank erhalten: 3
  • Karma: 2
There is Javascript workaround for Multiple Options & List (radio) questions if you want to partially randomized answers. I'm wondering can we do something similar to Array Type questions? See below, can we randomize first 5 attributes but keep other at the end? Also, can we add "other" option to the grid too so that respondent can enter some text?

1 2 3 4 5
Attribute 1
Attribute 2
Attribute 3
Attribute 4
Attribute 5
Other
Anhang:
Letzte Änderung: 1 Jahr 8 Monate her von david2013. Begründung: Grid doesn't appear properly
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Partially Randomized Answers For Array Typed Questions 1 Jahr 8 Monate her #92069

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4266
  • Dank erhalten: 803
  • Karma: 368
1) Follow the instructions regarding answer/subquestion codes here - docs.limesurvey.org/tiki-index.php?page=...List_radio_questions

2) Set your array to "Random answer order"

3) Add this script to the source of the array (this code is for the plain "Array" question and may need to be modified for other question types):
<script type="text/javascript" charset="utf-8">
	$(document).ready(function() {
 
		// Identify some elements
		var q1ID = '{QID}';
		var q1 = $('#question'+q1ID+'');
		var tbody = $('tr[id^="javatbd"]:eq(0)', q1).parent();
 
		// Find the number of answers
		var ansCount = $('tr[id^="javatbd"]', q1).length;
 
		// Place the last answer created at the end of the list
		$('tr[id$="X'+q1ID+ansCount+'"]', q1).appendTo($(tbody));
	});
</script>

Regarding the "Other" option, you can add a following short-text question that is shown conditionally when an option in that array row is clicked.
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.

Re: Partially Randomized Answers For Array Typed Questions 1 Jahr 8 Monate her #92647

  • david2013
  • david2013s Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 26
  • Dank erhalten: 3
  • Karma: 2
Thank you very much
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.118 Sekunden
Donation Image