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

TOPIC: Seamlessy combine different multiple choice questions

Seamlessy combine different multiple choice questions 1 year 5 months ago #95565

  • Limer2001
  • Limer2001's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 18
  • Thank you received: 2
  • Karma: 0
Hm sloppy, removed it but still not working.
The administrator has disabled public write access.

Seamlessy combine different multiple choice questions 1 year 5 months ago #95615

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 4264
  • Thank you received: 801
  • Karma: 368
You have a syntax error.

This line:
$(".answer").css("padding":"0");

Should be:
$(".answer").css("padding", "0");

Or:
$(".answer").css({
	"padding":"0"
});

The CSS required to make those two questions appear as one is:
#question436 table td {
  height: auto;
}
 
#question436 table.scs {
  border-bottom: 0 none;
}
 
#question436 .survey-question-help {
  display: none;
}
 
#question436 .subquestions-list {
  margin: 0;
}
 
#question436 .answer {
  padding: 0;
}
 
#question437 table.scs {
  border-top: 0 none;
}
 
#question437 td.be {
 display: none;
}
 
#question437 .survey-question-help {
  display: none;
}
 
#question437 .subquestions-list {
  margin: 0;
}
 
#question437 .answer {
  padding: 0;
}

So, to translate that into JavaScript, add this to the first question:
<script type="text/javascript" charset="utf-8">
	$(document).ready(function() {
 
		$(#question{QID} table td).css({ // Table cell heights
			'height': 'auto'
		});
 
		$(#question{QID} table.scs).css({ // Table border
			'border-bottom': '0 none'
		});
 
		$(#question{QID} .survey-question-help).css({ // Question help
			'display': 'none'
		});
 
		$(#question{QID} .subquestions-list).css({ // Margin around answers
			'margin': '0'
		});
 
		$(#question{QID} .answer).css({ // Padding around answers
			'padding': '0'
		});
	});
</script>

And add this to the second question:
<script type="text/javascript" charset="utf-8">
	$(document).ready(function() {
 
		$(#question{QID} table td).css({ // Table cell heights
			'height': 'auto'
		});
 
		$(#question{QID} table.scs).css({ // Table border
			'border-top': '0 none'
		});
 
		$(#question{QID} td.be).parent().css({ // Question text
		 'display': 'none'
		});
 
		$(#question{QID} .survey-question-help).css({ // Question help
			'display': 'none'
		});
 
		$(#question{QID} .subquestions-list).css({ // Margin around answers
			'margin': '0'
		});
 
		$(#question{QID} .answer).css({ // Padding around answers
			'padding': '0'
		});
	});
</script>


Capture2_2013-05-03.JPG
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.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.127 seconds
Donation Image