Adding small photo with each answer

What is the problem? Please be detailed.

I want to add a small phot to each answer like the question attached here
What ODK tool and version are you using? And on what device and operating system version?

Tablet
What steps can we take to reproduce the problem?
Show me how to add the photo and show an example for that please

What you have you tried to fix the problem?

I tried the media option but didn't work


Anything else we should know or have? If you have a test form or screenshots or logs, attach here.

1 Like

If you are using XLSForm, you can add a media::image column and put the name of the media file (e.g., facemask.jpg). This works for question text and for choices. For the choice, you'll need to add the media::image column to the choices sheet.

Then you have to upload the media files into ODK Aggregate for download or put the media files that you want to include in the /odk/forms/formname-media folder on your phone.

I found this information at http://xlsform.org/#media and there is a sample form there that you can try.

1 Like

Thanks a lot for your reply, I tried it but it doesn't work well..
I have attached a picture for what I get in the tablet

Is there any way to solve this

Thanks
Abrar

It's going to be hard to help without seeing your form. Build a small one question form with just the question 29 and upload it.

Also, please describe how you are getting the media from your computer to the device.

example.xlsx (9.0 KB)

Thanks a lot, I have attached the excel form ..
Regarding the media, I just login my odk account and upload it from the computer ..
also have a probelm in that because in the odk account it only allow me to uplode one photo and i have two for this question

The form you attached is not a valid XLSForm. Did you confirm that the form worked before uploading it? If so, how did you confirm?

Can you also please include the Surgical.jpg and N95.jpg you are hoping to use?

1 Like

Yes this is excel, I converted that using to XLSForm by the softwrae for that and no probelm.

The pictures I need are attached N95

The form you attached is not a valid XLSForm (download here) is not a valid XLSForm.

If I try to convert it to XML, it says "The survey sheet is either empty or missing important column headers." You can confirm by trying http://opendatakit.org/xiframe.

What software did you use to convert it?

When testing this I had issues with media displaying correctly when there are language options in the survey if the media column(s) are not also localized. If you remove the ::English you should be fine. Or you can add a media column for each language. See below. This XLSForm documentation says "::[language] is optional" for media::image::language but it seems like that may not be be always the case, depending on other aspects of your form.

survey tab

+----------------------+-----------+------------------------------+
|         type         |   name    |        label::english        |
+----------------------+-----------+------------------------------+
| select_one mask-type | mask-used | Which mask type did you use? |
+----------------------+-----------+------------------------------+

choices tab

+-----------+----------+----------------------------+-----------------------+
| list name |   name   |       label::english       | media::image::english |
+-----------+----------+----------------------------+-----------------------+
| mask-type | surgical | Normal surgical facemask   | Surgical.jpg          |
| mask-type | n95      | N95 respirators mask       | N95.jpg               |
+-----------+----------+----------------------------+-----------------------+

settings tab (optional)

+------------------+
| default_language |
+------------------+
| english          |
+------------------+

masks.xlsx (9.7 KB)

4 Likes

Hey guys,

I am having a similar issue. I am able to loud images for both of my languages, however I am not able to show the associated label with each image. my appearance is set at compact-1 for the select-one question.

is the size of the image an issue?

Best,
Will O

Can you post the survey question (the line(s) from your survey and choices sheets) and images you are trying to use here? Feel free to change the words (leaving the strings the same number of characters) and just post the image pixel dimensions if the content is confidential.

That was very very helpful , many thanks for helping me in that

Abrar

Thanks a lot for your help , I have solved this

Abrar

5 posts were merged into an existing topic: XLSForm Image Formatting

Exactly my suggestion. The media::image column has to be on the choices list and not in the survey. The inconsistencies in the media column in the survey sheet contributed to it not working.

A post was merged into an existing topic: Using Logo in XLS form

A post was merged into an existing topic: Insert videos and/or images in multiple choice options