Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: No repeat value in matrix question

No repeat value in matrix question 9 Monate 2 Wochen her #97901

  • josegovia
  • josegovias Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 34
  • Dank erhalten: 1
  • Karma: 0
I have a question type array with five sub-questions. In each sub-question the respondent can put a value from 1 to 5.

I want to make the respondent put different values ​​in each sub-question. For example, if the sub-question 1 put the value 3, in the sub-questions 2, 3, 4 and 5 he can not put the value 3.

How can you do this?

Thank you.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

No repeat value in matrix question 3 Monate 4 Wochen her #102900

  • mariays
  • mariayss Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 4
  • Karma: 0
Hi,

I'm newbie in LS. I would like to know how to do no repeat value in matrix question?

Thanks.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

No repeat value in matrix question 3 Monate 4 Wochen her #102904

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 3844
  • Dank erhalten: 690
  • Karma: 330
Which LimeSurvey version are you using?
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.

No repeat value in matrix question 3 Monate 3 Wochen her #102949

  • mariays
  • mariayss Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 4
  • Karma: 0
Version 2.00+ Build 130108.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

No repeat value in matrix question 3 Monate 3 Wochen her #102954

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 3844
  • Dank erhalten: 690
  • Karma: 330
Set up your survey to use JavaScript and add this script to the array question source:

<script type="text/javascript" charset="utf-8">	
 
	$(document).ready(function() {
 
		// The error message
		var errorMsg = 'You can only select one answer per column';
 
		// Identify the question
		var qID = {QID};
		var thisQuestion = $('#question'+qID);
 
		// Listener on the radios
		$('.radio-item', thisQuestion).click(function(event) {
			// Check for more than one answer per column
			var answerCode = $(this).attr('class').split('answer_cell_00')[1].split(' ')[0];
			if($('.answer_cell_00'+answerCode+' input[type="radio"]:checked', thisQuestion).length > 1) {
				alert(errorMsg);
				$('input[type="radio"]', this).attr('checked', false);
			}
		});
	});
</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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

No repeat value in matrix question 3 Monate 3 Wochen her #102988

  • mariays
  • mariayss Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 4
  • Karma: 0
Hi Tony,

I had added the script to the source of the array question, but still can't work. It should be have different answer on 1st, 2nd, 3th, 4th and 5th mention. Any suggestion? Thanks.

Dateianhang:

Dateiname: limesurvey_survey_968932.lss
Dateigröße: 17 KB
Der Administrator hat öffentliche Schreibrechte deaktiviert.

No repeat value in matrix question 3 Monate 3 Wochen her #103013

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 3844
  • Dank erhalten: 690
  • Karma: 330
You indicated that you were using an array question, not an array by column question.

For an an array by column question use this script:
<script type="text/javascript" charset="utf-8">	
 
	$(document).ready(function() {
 
		// The error message
		var errorMsg = 'You can only select one answer per row';
 
		// Identify the question
		var qID = {QID};
		var thisQuestion = $('#question'+qID);
 
		// Listener on the radios
		$('.radio-item', thisQuestion).click(function(event) {
			// Check for more than one answer per row
			var thisRow = $(this).closest('tr');
			if($('input[type="radio"]:checked', thisRow).length > 1) {
				alert(errorMsg);
				$('input[type="radio"]', this).attr('checked', false);
			}
		});
	});
</script>

Here is your survey back with the amended script.

Dateianhang:

Dateiname: limesurvey_survey_9689321.lss
Dateigröße: 17 KB


Having said all of that, I'm interested to know why you don't use a ranking question for this.


.
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.
Letzte Änderung: 3 Monate 3 Wochen her von tpartner.
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Folgende Benutzer bedankten sich: mariays

No repeat value in matrix question 3 Monate 3 Wochen her #103029

  • mariays
  • mariayss Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 4
  • Karma: 0
Hi Tony,

Thanks a lot :) , it works. I use an array coloumn to match the query given by the client, it more about habit. Ranking can be an optional.
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.174 Sekunden
Donation Image