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 1 month 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 1 month ago #85535

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9415
  • Thank you received: 1352
  • Karma: 387

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 developpement are on my free time (Say thanks ?).
A bug not reported is a bug not corrected. | Please, read the documentation | La doc en français à besoin de vous
The administrator has disabled public write access.
Time to create page: 0.196 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form