How to add multiple media files in a single question (using media::image, media::audio columns)

Hi Arif, thanks for your response. I had reviewed both the bird form and the xlsform link but unfortunately it doesn't say how to put mulitple images in the question itself, meaning in the survey tab (and not in the choices tab, as the images/audios should not be associated with any particular answer).

Do you know how to add multiple images or audios in the survey tab so they appear below the question label but before the list of answer choices in the ODK Collect app?

Hi @Jlemaire

the case you described is not possible in ODK Collect. Each question can have one image one audio file and one video file. If you have a select one/multiple question each option can have one image one audio file and one video file as well.

2 Likes

@Grzesiek2010 is correct in terms of intentional features. I haven't tried this myself but you might be able to do something like a question with a label, then a read-only select with audio, then a question with a hint all on a single screen (see field-list documentation) to get the behavior you want. The part I'm not sure about is whether you can play audio or video from a read-only select.

For images, the approach generally taken is to create a composite image with all the visual elements you want displayed.

1 Like

That's true there are some possible workarounds. You can try my form:
multipleMediaTest.zip (22.3 KB)
Ther result would be like:

4 Likes

Hi Grzesiek2010,

Thanks for posting and uploading your work around!

I have used the xlsx form from you zip file and tested it inside an ODK Collect based app. Unfortunately it is not working for me. Instead I get radio buttons and images underneath each other (I need them next to each other like in your screenshot):


Do you know why this might be?

Try to update the app to the newest version from Google Play.

1 Like

Hi Grzesiek2010 -- many thanks! we were using v.1.22.0 but just updated to the version released yesterday v1.22.3 and now it works.

Could you tell us how you hid the period (.) however? We copied your XLSForm but couldn't see how that was done.

Also, is there any documentation you can share on the 'appearance' you used (“columns-4 no-buttons”)?

Thank you very much.

What period? I don't understand.

The appearance I used: columns-4 no-buttons is a new appearance we added in the latest version. It's not documented yet (because it's new) but we will do that soon.

columns-4 means you want to use select options in 4 columns
no-buttons means don't use radioButtons/checkBoxes but use media files if exist.

so generally it's a select_one question where options are placed in 4 columns using just images, and the question is read-only so you can't select anything.

Great! Thanks for adding these new appearance features!! They are super helpful :slight_smile:

We meant the "." in the label of q1:

1 Like

We thought the label could not be empty but it turns out it can (when read-only?), so we took out the ".". Thanks again for your help!

5 posts were split to a new topic: How can I include several audio files for a single question?

and how can i put an image in each multiple choice answer option? that would help me a lot

is it possible to add the images this way you did just accessing the ODK.build builder? the one that we set up the form just by dragging the options

It depend what you want to achieve. In ODK Build you can and media files to particular questions:
image
but it's not possible to do the same with choices that you use in select_one/select_multiple questions. If you use ODK Build you can export your form to xls file and then add required changes.

1 Like

it's enough if i just put the image in the question..
however you didn't put the example of how I write this, just showed the option in odk.build..
could you please write an example of how I would write so that the image would be attached to the question? I'm a little layman in programming so I assemble my forms in the builder. I'm very grateful and I look forward to hearing back....

Hi Bruno,
If you wish to display an image with your select, you can add an image column in the choices tab of the XLSX file you have otherwise finished and downloaded from Build, then place the filename(s) of the image(s) there.

You would add it similar to the yellow cells here:
image

This is what it will look like in Enketo, it'll be similar in Collect:

And if you don't want to see the buttons, only the images, then add an appearance column if it's not already there and enter no-buttons in it.

wow thank you so much for answering me, it clarified a lot...
I saw that you have a good understanding, I've been racking my brains for days to know how I fill out a form using XLSX or XML, do you understand? I would like to have a form already filled out but using the xml in a way that I can upload the file in the application with some questions already answered and others not.. I hope you understand this will help me a lot. I'm waiting

ok and then , how do I convert this XLS to XML so I can import it to the app?

because this form of xsl the app does not read

Do you mean a default answer to a question? You can use default to set static or dynamic prefilled answers for the form this way

I upload my XLSX forms to ODK Central, which validates and converts to XML, I don't know what your configuration is, but there are online and offline methods to convert to XML XForms, (another)

is this ODK service Central, paid or free?