Association question with drag and drop

4 years 6 months ago #85365 by emiliedg
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 !

Please Log in to join the conversation.

4 years 6 months ago #85535 by DenisChenu

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.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).

Please Log in to join the conversation.