Welcome, Guest
Username: Password: Remember me

TOPIC: Association question with drag and drop

Association question with drag and drop 1 year 7 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 (www.limesurvey.org/fr/forum/development/...rag-and-drop-ranking) 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.

Re: Association question with drag and drop 1 year 7 months ago #85535

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 5845
  • Thank you received: 715
  • Karma: 222
Hello,

You need : Image + text.

You can use same workaround (maybe with some adaptation) than:
docs.limesurvey.org/tiki-index.php?page=...rsion_1.90_and_newer

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');
}

Denis
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.100 seconds
Donation Image