Is it possible to optionally show images for questions in a survey?
Meaning would like to conditionally show images for questions in a survey.
Some questions have text and an image (but the image is not necessary, it just enhances the survey).
Method 1:
Have a question at beginning of survey where the user gets to select a text only version or a version with images? If he/she select text-only version then images are not shown for any of the questions that follow.
Method 2:
Have the system detect the user bandwidth connection and the system decide between a text-only version and version with images. If the system decides text-only version (i.e. due to low bandwidth) then images are not shown for the questions.
Hi,
well, it is easy to realize.
Just include in your question text or in the answer options an expression like
{if(Imagequestion=="1","<img src="https://www.[path to picture]/[filename]" />","Picture of boat")}
If you have an idea how to find out the bandwith, well, it's the same:
{if(bandwidth>xxx,"<img src...","Text")}
But band width shouldn't be a big problem as you can see and test including big pictures or movies.
Of course you can add some text to the image part, as normal HTML.
Regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Thanks for the suggestion. Sounds great, so I'm trying to check the concept.
In my question text if I place:
1) {if(1,"<img src="/upload/surveys/856746/images/AdobeStock_44437644.jpeg" />","My Picture")}
I get on the question preview the following text highlighted in Yellow surrounded by a red rectangle:
if(1, "</span><span title='' class='em-var-string'>", "My Picture")
2) {if(0,"<img src="/upload/surveys/856746/images/AdobeStock_44437644.jpeg" />","My Picture")}
I get in the question preview the following text highlighted in Yellow surrounded by a red rectangle:
if(0, "</span><span title='' class='em-var-string'>", "My Picture")
I assume there's something I'm doing wrong that's keeping the Expression Manager parsing the expression.
Should be
{if(1,"<img src='/upload/surveys/856746/images/AdobeStock_44437644.jpeg' />","My Picture")}
And to add something:
You said the pictures is only "nice to have".
So you probably can lower the quality and resolution of the pictures to avoid any problem with band width.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu, wizard2none
Does this have anything to do with my uni's server tampering with the code so that the students can not have advanced HTML for the questions?
UPDATE
So this whole image with if statements fiasco is due to my need of showing a map on the question. Since the gmaps API thing (short free text) is not very intuitive for the respondents, I came up with this work around.
My goal is to have a drop down choice and every answer will show a map image so that the respondents can have better guess where he/she work.
Now, I have found out this nice website called embed-map.com that can make a gmap iframe. But, then again, the whole iframe can not be displayed with the Limesurvey of my uni's. I can still show this iframe using my localhost installed Limesurvey v3.
Hi,
this is what it should look like (in 2.06)
I just copied your iframe-code into my question.
And this with your other embedding:
BTW: Are you sure you have the rights to do this on this university installation?
And always remember:
After entering something like this in source code mode, never open it again.
The editor changes single quotes to double quotes; then you have the problem of double quotes inside double quotes.
Best regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
I entered the code after I clicked the "source" button so that I use the plain text mode (code-view). Is there any way that this is due to the superadmins from my uni?
@Joffm:
I'm not quite sure what my rights are with my uni's installation. Where can I make sure of that?
I have made sure that I write in the code mode and not opening/editing the question again. It just seemed that the changes are automatic. Is it due to the WYSIWYG that holch have described?