Using pictures in ranking question

More
6 years 1 month ago #57716 by paulfiner
paulfiner replied the topic: Using pictures in ranking question
Hi Tony

I finally got some time to try your workaround and managed to get the first part sorted.
However, the images part doesn't seem to work and the 3 images I have tried just appear in the question text.

My example survey is still live so you can see what I mean.

Please Log in to join the conversation.

More
6 years 1 month ago #57723 by DenisChenu
DenisChenu replied the topic: Using pictures in ranking question
Hello Paul,

For me it work ?
There are some disgracious but it's need some modification in template.css
#question2505 .dragDropTable li {
    background: none repeat scroll 0 50% transparent;
    border: 0 none;
    height: 80px;
    width: 80px;
}
#question2505 .dragDropTable .dragDropChoiceList, #question2505 .dragDropTable .dragDropRankList {
    min-height: 80px;
    min-width: 80px;
    width: auto;
}
Somethink like that :)

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).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
6 years 1 month ago #57725 by paulfiner
paulfiner replied the topic: Using pictures in ranking question
Hi

It seems to be working now. I added in your extra bit of CSS and everything works.
Thanks for all you help (and Tony!)

Cheers

Paul

Please Log in to join the conversation.

More
6 years 1 month ago #57730 by tpartner
tpartner replied the topic: Using pictures in ranking question

but it's need some modification in template.css

Yep, thanks Shnoulle, you need to modify the CSS for the size of your images as stated in the workaround:

These styles are for the default template using 50x50px images (as in the Demo) and may need to be modified for other templates or image sizes.


Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
6 years 1 month ago #57731 by paulfiner
paulfiner replied the topic: Using pictures in ranking question
I have now added in all the images to complete the question and it looks good.

How difficult would it be to arrange the images into 2 or 3 columns?
In my actual question I have 24 brands on the left and the respondent must rate their top 12.
Having all 24 brands in a long list doesn't look too nice.

Cheers

Paul

Please Log in to join the conversation.

More
6 years 1 month ago #57735 by tpartner
tpartner replied the topic: Using pictures in ranking question
There is no real way to force an unordered list to wrap into columns but adding something like the following to template.css should wrap the lists into rows. I'm not sure this behaviour is very intuitive though.
#question2505 .dragDropTable .dragDropChoiceList, 
#question2505 .dragDropTable .dragDropRankList {
    width: 285px;
}
 
#question2505 .dragDropTable li {
    float: left;    
}

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
5 years 11 months ago - 5 years 11 months ago #61066 by mattias01
mattias01 replied the topic: Using pictures in ranking question
what kind of questions should I use to achieve that effect with drag and drop my images? libraries and documentation indicating where I add?
Last Edit: 5 years 11 months ago by mattias01.

Please Log in to join the conversation.

More
5 years 7 months ago #65048 by Hunch
Hunch replied the topic: Using pictures in ranking question
Using pictures with drag and drop was exactly what i needed. Thanks!

I want people te drag 3 images in preferred order (within one column). I can solve this by hiding the ranking column, but limesurvey doesn't store this column.

Is it possible to load the images directly into the ranking column and hide the choises column?

Please Log in to join the conversation.

More
4 years 1 month ago #93810 by nicktruch
nicktruch replied the topic: Using pictures in ranking question
Hi,

I'm desperately trying to implement the drag-and-drop function in LS 1.92, but I can't even see any effect on the ranking question which remains untouch. Here is what I've done, following this workaround instructions :
1. JS activated as told in set up your survey to use javascript'
2. I've placed the large script in my template.js file :
first time here :
$(document).ready(function(){
HERE
});
and second time here :
HERE
$(document).ready(function(){
 
});
3. I've placed the following code in the source of my ranking question :
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
   dragDropRank("99638X1X9");	
});
</script>
4. I've inserted the CSS at the end of the template.css and I'm using the default template
I've checked that template.js is called from startpage.psptl
Here is a screenshot of my question and of the preview.



To test that it works, I use the 'preview question' button...



Where am I wrong ?
Attachments:

Please Log in to join the conversation.

More
4 years 1 month ago #93813 by tpartner
tpartner replied the topic: Using pictures in ranking question
Do you get any JavaScript errors in the console?

Can you activate a test survey for us to see?

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
3 years 11 months ago - 3 years 11 months ago #96130 by nicktruch
nicktruch replied the topic: Using pictures in ranking question
Hi,

(sorry for the delay, I haven't seen your reply)

I've simplified to process just to test the drag and drop function (without images).

Here it is : I've checked both template.js and css and here is a screenshot of my question source...
The test survey is here : enquetes.univ-lyon2.fr/index.php?sid=87266&lang=fr

No more javascript errors in the console...

:-(
Attachments:
Last Edit: 3 years 11 months ago by nicktruch.

Please Log in to join the conversation.

More
3 years 11 months ago #96138 by tpartner
tpartner replied the topic: Using pictures in ranking question
You have the wrong question ID .

The script in the source should be:
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function() {
		dragDropRank(370);
	});
</script>

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
3 years 11 months ago #96141 by nicktruch
nicktruch replied the topic: Using pictures in ranking question
It works !!!!!

Thanks 1000 times,
I love u LimeSurvey Team :-*

Please Log in to join the conversation.

More
6 months 1 hour ago - 6 months 1 hour ago #143607 by Kevin01
Kevin01 replied the topic: Using pictures in ranking question
Can someone please help me with this work around? I attached a few files.

Thanks,
Kevin
Last Edit: 6 months 1 hour ago by Kevin01.

Please Log in to join the conversation.

More
5 months 4 weeks ago #143625 by tpartner
tpartner replied the topic: Using pictures in ranking question
This workaround is totally obsolete. Please open a new topic/thread and explain exactly what you are trying to do.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: Kevin01

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now