Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: MaxDiff question type alignment

MaxDiff question type alignment 2 years 5 months ago #79538

  • ricardo
  • ricardo's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 116
  • Thank you received: 1
  • Karma: 0
I designed the MaxDiff question using this workaround: docs.limesurvey.org/Workarounds%3A+Quest...axDiff_question_type

When I run the survey, the question in the first section are misaligned, one side being wider than the other:


maxdiff1screen.JPG


However, on the second section, they are aligned


maxdiff2screen.JPG



Has anybody else experienced the same problem? How can I get the questions to be aligned in all sections?

rg
The administrator has disabled public write access.

Re: MaxDiff question type alignment 2 years 5 months ago #79546

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5331
  • Thank you received: 296
  • Karma: 249
Can you please post a link to an activated sample survey?

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: MaxDiff question type alignment 2 years 5 months ago #79565

  • ricardo
  • ricardo's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 116
  • Thank you received: 1
  • Karma: 0
The administrator has disabled public write access.

Re: MaxDiff question type alignment 2 years 5 months ago #79569

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5331
  • Thank you received: 296
  • Karma: 249
The default template uses different styles for odd and even pages, maybe that explains the behavior?

1. Try using a different template, can you reproduce the problem?

2. What happens if you show the survey in all in one mode?

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: MaxDiff question type alignment 2 years 5 months ago #79574

  • ricardo
  • ricardo's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 116
  • Thank you received: 1
  • Karma: 0
1. The problem is reproduced on each template in group by group mode.

2. The problem seems to be solved when I use all in one mode (well... with some of the templates). I guess I could go this way. However, I prefer giving questions to participants one group at a time.

Thanks for the suggestion, though.
The administrator has disabled public write access.

Re: MaxDiff question type alignment 2 years 5 months ago #79594

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5331
  • Thank you received: 296
  • Karma: 249
Quite a weird error, but I still can't say what causes this problem. Might be related to the workaround code.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: MaxDiff question type alignment 2 years 5 months ago #79642

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4270
  • Thank you received: 804
  • Karma: 368
ricardo, can you attach a copy of your survey and template?
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.
The administrator has disabled public write access.

Re: MaxDiff question type alignment 2 years 5 months ago #79662

  • ricardo
  • ricardo's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 116
  • Thank you received: 1
  • Karma: 0
Tony,
See attached. I've attached 2 templates. One of them is the one I'd like to use for the survey, and the other one is the default template in Version 1.92+ Build 120425, which also reproduces the problem

cheers,

ricardo

File Attachment:

File Name: default.zip
File Size: 42 KB


File Attachment:

File Name: limesurvey_survey_854591.lss
File Size: 112 KB


File Attachment:

File Name: nciia2template.zip
File Size: 192 KB
The administrator has disabled public write access.

Re: MaxDiff question type alignment 2 years 5 months ago #79672

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4270
  • Thank you received: 804
  • Karma: 368
Ah, there's a bug in my code when using for multiple questions on a page.

Additionally, you only need to place the script in one question per page.

So you can place this in one question (where Q1, Q2, Q3, Q4 are the question IDs):
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function() {
 
		maxDiff(Q1, 'You cannot select this answer twice.');
		maxDiff(Q2, 'You cannot select this answer twice.');
		maxDiff(Q3, 'You cannot select this answer twice.');
		maxDiff(Q4, 'You cannot select this answer twice.');
 
		function maxDiff(qID, msg) {
			// Move the cells around
			$('#question'+qID+' table.question col:eq(1)').prependTo('#question'+qID+' colgroup.col-responses');
			$('#question'+qID+' table.question thead tr:eq(0) th:eq(0)').prependTo('#question'+qID+' table.question thead tr:eq(0)');
			$('#question'+qID+' table.question tbody tr').each(function(i){
				$('td:eq(0)', this).prependTo(this);
			});
 
			// Style stuff
			$('#question'+qID+' table.question col.odd').css({ 'background-color':'transparent' });
			$('#question'+qID+' table.question tbody th').css({ 'text-align':'center' });
			$('#question'+qID+' table.question tbody tr:even td, #question'+qID+' table.question tbody tr:even th').css({ 'background-color':'#F1F1F1' });
			$('#question'+qID+' table.question tbody tr:odd td, #question'+qID+' table.question tbody tr:odd th').css({ 'background-color':'#FCFCFC' });
 
			// Prevent clicking twice in the same row
			$('#question'+qID+' input.radio').mousedown(function () {
				var clickRow = $(this).parents('tr:eq(0)');
				if ($('input.radio:checked', clickRow).length > 0) {
					alert (msg);
					return false;
				}
			});
			$('#question'+qID+' table.question tbody td').mousedown(function () {
				var clickRow = $(this).parents('tr:eq(0)');
				if ($('input.radio:checked', clickRow).length > 0) {
					alert (msg);
				return 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.
The administrator has disabled public write access.

Re: MaxDiff question type alignment 2 years 5 months ago #79674

  • ricardo
  • ricardo's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 116
  • Thank you received: 1
  • Karma: 0
Dear Tony, Thanks for looking into this.

The width of outer columns has been fixed... but now the blocks are aligned to the left (see pic). Does this have to do with the width of the statements in the column in the middle?. Can something be done with your new script so all the blocks are justified, regardless of length of statements?

This is the link to the active survey

nciia.org/surveys/l19/index.php?sid=85459&lang=en

Cheers,

ricardo
[attachment:1]maxdiffalign.png[/attachment]
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.137 seconds
Donation Image