Home > Uncategorized > How to Dynamically Display Answer Images

How to Dynamically Display Answer Images

 

Overview

 

Part of the SurveyToGo features is the ability to attach and display images as answers. One way is to assign images manually to each answer, as you can learn in this link: http://support.dooblo.net/entries/22814656-How-to-add-images-to-Answers-and-Topics

In this HowTo, you’ll learn a dynamic way to assign and display images as answers.

 

  1. Step 1: Add the wanted images to the survey
  2. Step 2: Create Attachment Source
  3. Step 3: Assign the attachment source to the question

 

Step 1: Add the wanted images to the survey

 

All images used, need to be uploaded to the survey. To upload images files to the survey, go to the survey’s Advanced tab, click on the “Edit survey attachments” link and add your files through the “New” button:

 

 

Step 2: Create Attachment Source

 

  1. Go to the survey Advanced tab and open the “Edit attachment source” link:

     

  2. Click on the “+” button to add the attachment source, and name it as you will. To add images to the attachment source, you need to use this code:

    list.AddFromAttachment(“ImageName”);

     

    “ImageName” should be replaced with a name of an image you uploaded to the survey.

    Each image you’ll add to the attachment source will be displayed for each answer, according to the order you added in. For example, in the screen shot below, you see the “MyNewAttachSrc” attachment source, where three images are added: “A.jpg”, “B.jpg” and “C.jpg”, in this order. This means that in the question I’ll use this attachment source, image “A.jpg” will be displayed in answer index 1, “B.jpg” will be displayed in answer index 2, and “C.jpg” will be displayed in answer index 3:

 

 

 

When you finish with the attachment source, click “OK”.

Step 3: Assign the attachment source to the question

Go to the question’s Advanced tab, and choose the relevant attachment source to be defined for the “AnswerAttachmentSourse” property:


 

 

That’s it!

 

Visit us at: http://www.dooblo.net

 

Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: