Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Association question with drag and drop

Association question with drag and drop 4 years 2 months ago #85365

  • emiliedg
  • emiliedg's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 1
  • Karma: 0
Hi everyone !
I'm currently using Limesurvey 1.92 and I was wondering if there is a question type that I could use for an association question with images. I've tried the drag and drop ranking question ( but it didn't work.

What I would like to do is to have 5 images and 5 sentences, each image matches with one sentence (with the drag and drop fonction). Do you think I could do this with Limesurvey ?

Thank you very much !
The administrator has disabled public write access.

Association question with drag and drop 4 years 2 months ago #85535

  • DenisChenu
  • DenisChenu's Avatar
  • Online
  • Moderator Lime
  • Posts: 9555
  • Thank you received: 1372
  • Karma: 389

You need : Image + text.

You can use same workaround (maybe with some adaptation) than:

And don't use workaround D&D image function but this one:

function dragDropRankAddImages(qID, choiceText, rankText) {
	if(!choiceText) {
		choiceText = $('#question'+qID+' td.label label').text();
	if(!rankText) {
		rankText = $('#question'+qID+' td.output tr:first td:eq(1) strong').text();
    dragDropRank(qID, choiceText, rankText);
	$('.connectedSortable'+qID+' li').each(function(i) {
		// Remove any text in the sortable choice or rank items
		$(this).html('<span class="img-sortable"></span><span class="text-sortable">'+$(this).text()+'</span>');
		// Move the images into the appropriate sortable list item
		var liID = $(this).attr('id');
		var imgContainer = $(this).find(".img-sortable");
		liIDArray = liID.split('_');
		$('#question'+qID+' img#'+liIDArray[1]+'').appendTo(imgContainer); 
	$('#sortable1'+qID+', #sortable2'+qID+'').css('min-height',$('#sortable1'+qID).height()+'px');

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time (Need support ?).
A bug not reported is a bug not corrected. | 2.61lts version improved | Need plugins for LimeSurvey ?
The administrator has disabled public write access.
Time to create page: 0.246 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form