Can we optionally show images for questions

More
2 months 1 week ago #157538 by wizard2none
wizard2none created the topic: Can we optionally show images for questions
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.

Please Log in to join the conversation.

More
2 months 1 week ago - 2 months 1 week ago #157539 by Joffm
Joffm replied the topic: Can we optionally show images for 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="http://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
Attachments:
Last Edit: 2 months 1 week ago by Joffm. Reason: Typo

Please Log in to join the conversation.

More
2 months 1 week ago #157540 by wizard2none
wizard2none replied the topic: Can we optionally show images for questions
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.

Please Log in to join the conversation.

More
2 months 1 week ago #157541 by Joffm
Joffm replied the topic: Can we optionally show images for questions
Hi,
your problem is that you have double quotes inside double quotes.
Sorry, in my answer it's the same. Typo.

{if(1,"<img src="/upload/surveys/856746/images/AdobeStock_44437644.jpeg" />","My Picture")}


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
The following user(s) said Thank You: DenisChenu, wizard2none

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now