Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/images/photo_audio_video_file/audio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/images/photo_audio_video_file/files.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/images/photo_audio_video_file/table.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
194 changes: 68 additions & 126 deletions source/photo_audio_video_file.md
Original file line number Diff line number Diff line change
@@ -1,165 +1,107 @@
# "Photo", "Audio", "Video" and "File" question types
# Media question types
**Last updated:** <a href="https://github.com/kobotoolbox/docs/blob/27c3e37a283d79de0cbecebbf3a41d5b6ba6d7df/source/photo_audio_video_file.md" class="reference">11 Sep 2023</a>

Many data collection projects require more than just quantitative data. KoboToolbox allows you to capture various media files from respondents, including photos, audio recordings, videos, and files, to provide key qualitative information and add visual and auditory depth to your datasets.

With KoboToolbox, you can collect different types of media as part of your data
collection project.
The following media question types are available in the KoboToolbox Formbuilder:

When you want to capture images as part of your submissions, use the "Photo"
question type.
| Question type | Description |
|:---------------|:---------------------------------|
| Photo | Capture or upload an image |
| Audio | Record or upload an audio file |
| Video | Record or upload a video file |
| File | Attach a file (e.g., .pdf, .docx) |

If a question requires that you record or attach an audio file, such as when a
long explanation is expected from the respondent, use the "Audio" question type.
The latest version of KoboCollect allows you to record audio within the app
itself without opening a separate app.
The method of capturing or uploading media depends on whether you are using [KoboCollect](https://support.kobotoolbox.org/kobocollect_on_android_latest.html) or [Enketo web forms](https://support.kobotoolbox.org/enketo.html) for data collection. In KoboCollect, you can either upload or record media files directly within the app. With Enketo, you can upload any media file, and record audio directly within the forms.

With the "Video" question type, you will be able to record a video using the
device's camera or attach a video file.

If a question requires that you attach a file such as a PDF, you can use the
"File" question type.

## How to set up "Photo", "Audio", "Video" and "File" question types

### Setting up in the formbuilder

Adding media questions is simple:

- Click the <i class="k-icon k-icon-plus"></i> button to add a new question
- Type the question text, for example "Take a picture of the housing unit", then
click **ADD QUESTION** or press ENTER on your keyboard
- Choose the question type
<p class="note">
<strong>Note:</strong> KoboToolbox also supports background audio recordings for entire interviews or focus group discussions. When background audio recording is active on a form, <strong>Audio</strong> question types <strong>in KoboCollect</strong> are deactivated, as it is not possible to record audio using both features simultaneously. For more information, see <a href="https://support.kobotoolbox.org/recording-interviews.html">Recording interviews with background audio recording</a>.
</p>

![Adding media question](images/photo_audio_video_file/add.gif)
This article covers the following topics:
- Adding media questions in the Formbuilder
- Default and advanced appearances of media questions
- Parameters for media questions

### Setting up in XLSForm
## Adding media questions in the Formbuilder

To add media questions in XLSForm, use the `image`, `audio`, `video`, or `file`
question types as shown in the following example:
To add media questions:
1. Click the <i class="k-icon-plus"></i> button to add a new question.
2. Type the question text and click **+ ADD QUESTION.**
3. Choose the desired question type (Photo, Audio, Video, or File).

| type | name | label | hint |
| :----- | :---------- | :---------------------------------------------------------- | :-------------- |
| image | house_photo | Take a photo of the housing unit | |
| audio | impact | What has been the impact of the project on your household? | Record as audio |
| video | preparation | Record video of the respondent as they prepare the VitaMeal | |
| file | CV | Attach your CV | |
| survey |
![Add a media question to Formbuilder](images/photo_audio_video_file/add.gif)

## Appearance of "Photo", "Audio", "Video" and "File" question types
## Appearances of media questions

### Default appearance
Media questions can display differently depending on whether you are using Enketo web forms or KoboCollect. You can also change the default appearance of media questions. This section details how each question type appears across both platforms, including default and advanced appearance options.

![Default appearances](images/photo_audio_video_file/default_appearances.png)
### Default appearances

### Advanced appearances for "Photo" question type
The table below shows how media questions are displayed by default in Enketo web forms and KoboCollect.

When adding the "Photo" question type, you can choose from a number of
appearances (under the question settings). Appearances change the way the
question is displayed in web forms and KoboCollect.
![Default appearances of media questions](images/photo_audio_video_file/table.png)

![Advanced appearances for photo question type](images/photo_audio_video_file/advanced_appearances_photo.png)
### Advanced appearances

![Advanced appearances](images/photo_audio_video_file/advanced_appearances.png)
Only the **Photo** question type supports advanced appearances. These appearances alter how the question behaves in web forms and KoboCollect, enabling users to do more than just upload or capture images. With advanced appearances, you can draw sketches, add signatures, annotate images, and take selfies.

### Adding advanced appearances in XLSForm
Available appearances include:

You can specify advanced appearances of the "Photo" question in XLSForm under
the appearance column as shown in the following example:
| Appearance | Description |
|:--------------|:-------------|
| signature | Allows the user to capture a signature by signing directly on the device's screen (e.g., for forms that require a digital signature for verification). |
| draw | Enables users to sketch or create drawings directly on the device’s screen (e.g., to capture illustrations or hand-drawn maps). |
| annotate | Allows the user to annotate an image by drawing or writing on it. |
| new | Prompts the user to take a new picture using the device camera (only available when using KoboCollect). |
| new-front | Prompts the user to take a new picture using the device's front-facing camera (only available when using KoboCollect). |

| type | name | label | appearance |
| :----- | :--------- | :------------------------- | :--------- |
| image | sign | Sign here | signature |
| image | drawing | Draw here | draw |
| image | annotation | Take an image and annotate | annotate |
| survey |
To add an advanced appearance:
1. Open the question settings by clicking <i class="k-icon-settings"></i> **Settings** to the right of the question. This will take you to the **Question Options** tab.
2. In **Appearance (Advanced)**, choose the desired appearance.

- If the appearance is not listed, select **Other** and type the name of the appearance in the text box, exactly as written above.

## Background audio recording
![image](images/photo_audio_video_file/appearances.png)

You can record audio in the background when you open the form in KoboCollect.
This can be useful in several data collection scenarios including focus group
discussions and key informant interviews.
## Parameters for media questions

Turn on background audio recording in the formbuilder by clicking on **Layout &
Settings** and enabling the feature.
Beyond their basic function, media questions also offer advanced parameters that allow you to manage file sizes and restrict accepted file types.

![Background audio](images/photo_audio_video_file/background_audio.png)
### Lowering image sizes

<p class="note">
Background audio recording is only available in KoboCollect and
<strong>not</strong> in Enketo web forms.
</p>
If your project involves collecting a significant amount of media, you might encounter difficulties uploading files to KoboToolbox, depending on your internet speed. Users of the [Community Plan](https://www.kobotoolbox.org/pricing/) are also limited to 1GB of free file storage. Therefore, it is advisable to manage the file sizes of the media files you collect.

In XLSForm, you can enable background recording with the `background-audio`
question type. This is considered a "meta" question type and therefore no
`label` is required, only a `name`. Audio quality can be configured under the
`parameters` column, as explained [here](recording-interviews.md).
To define the maximum size of images collected using the **Photo** question type:
1. Open the question settings by clicking <i class="k-icon-settings"></i> **Settings** to the right of the question. This will take you to the **Question Options** tab.
2. Set the **max-pixels** parameter to the value of your choice (e.g., 1000).

| type | name | label |
| :--------------- | :--------------- | :---- |
| background-audio | background_audio | |
| survey |
![image](images/photo_audio_video_file/parameters.png)

<p class="note">
It is not possible to record audio using "Audio" question type while
background audio recording is underway on the form. When background audio
recording is on, all "Audio" question types are deactivated.
<strong>Note:</strong> You can also configure video resolution and image size in <a href="">KoboCollect settings</a>.
</p>

You can read more about background audio recording
[here](recording-interviews.md).
## Restricting accepted file types

## Lowering the file size of collected media
By default, the **File** question type accepts all file types. To restrict the type of files this question accepts:
1. Open the question settings by clicking <i class="k-icon-settings"></i> **Settings** to the right of the question. This will take you to the **Question Options** tab.
2. In the **Accepted Files** text box, list the file extensions that you would like to allow, separated by a comma (e.g., .doc, .pdf, .xlsx)

If you are collecting a lot of media in your project, you might have challenges
uploading them to KoboToolbox depending on the speed of your internet
connection. If you are using the [Global Server or European Union Server](creating_account.md), then you
are also limited to only 1GB of free storage. It is a good idea to manage the
file sizes of collected media files such as images, audio and videos.
![image](images/photo_audio_video_file/files.png)

You can define the maximum size of images you collect using the "Photo" question
type by going to the question settings and setting the "max-pixels" setting in
the formbuilder.
## Troubleshooting

![Max pixels](images/photo_audio_video_file/max-pixels.png)
<details>
<summary><strong>Collecting multiple images or media files</strong></summary>
Media question types only support uploading one file at a time. To allow users to upload multiple files, you can place the media question within a repeat group, or duplicate the media question in the form as many times as needed. You can use <a href="https://support.kobotoolbox.org/skip_logic.html">skip logic</a> to display subsequent media questions only if the previous one is not blank.
</details>

In XLSForm, you can do the same by adding "max-pixels" in the `parameters`
column as follows:
<br>

| type | name | label | parameters |
| :----- | :---- | :------------ | :------------- |
| image | photo | Capture photo | max-pixels=480 |
| survey |
<details>
<summary><strong>Audio recording in Enketo prevents access to other questions</strong></summary>
When a user records an audio question in Enketo, other questions are locked until the recording is complete. This ensures that the audio is fully captured before the user proceeds with the rest of the form.
</details>

In KoboCollect, you can also choose the video quality and photo size through the
Form Management section of the project settings.

You can read more about how to lower file sizes [here](lower_file_size.md).

## Limiting accepted file types for "File" question type

All file types are accepted by default for the "File" question type. In the
formbuilder you can restrict this by doing the following:

- Go to the settings of the "File" question
- Under the "Accepted Files" box, enter the file extensions of the files you
would like to allow, separated by a comma e.g. ".doc, .pdf, .xlsx"

![File types](images/photo_audio_video_file/file_types.png)

In XLSForm, you can limit the accepted file types by specifying file extensions
in the `body::accept` column as follows:

| type | name | label | body::accept |
| :----- | :--- | :------------- | :----------- |
| file | CV | Attach your CV | .pdf, .doc |
| survey |

<p class="note">
Download an XLSForm with examples from this article
<a
download
class="reference"
href="./_static/files/photo_audio_video_file/media_question_types.xlsx"
>here</a
>.
</p>
Loading