Monthly Archives: April 2015

version-15-04

Because the March version of Smap ran over time, its been a short month for the development team.  Hence we have only added two functions in this release. These are:

  1. the ability to pre-load survey results from a CSV file into a survey. These can then be used to assign tasks to users.
  2. allowing users to complete their tasks using Web Forms as well as with fieldTask.

 Tasks Refresher and Rationale for the new Features

Tasks can be created from a blank form or from existing survey results.  In the second case, when the assigned user opens the task, it will be pre-populated with those results. Up until now you had to populate the initial data for these tasks by  completing forms using either fieldTask or WebForms.

However you may have a list of assets that need to be inspected, or hospital clinics that need to be visited stored in a spreadsheet or an external system.  In which case you can now load that spreadsheet directly into a form and then allocate tasks to people to go and complete those surveys. That is inspect the asset, visit and audit the hospital clinic etc.

Secondly using web forms you can assign tasks to people with laptops or iPhones as well as users with the Android app fieldTask.

Features

  • Data in the CSV can include text, integers, barcodes, GPS coordinates, images, video and audio.
  • Columns in the CSV file that do not match a question in the form are ignored
  • It is not necessary to include all of a forms questions in the CSV file
  • You can replace existing results or append.
  • Forms need to be marked, in the settings dialog of the editor, as accepting data uploaded from a file.  This should reduce the chance of accidental loading of data to the wrong form.
  • You can load either a single csv file with just text.  Alternatively you can load a zip file containing a CSV and images, video, audio files.
  • Tasks on Web Forms are shown as red buttons rather than the blue buttons for blank forms

Limitations

  • Polygon and line question types are not supported
  • The file must be CSV format and not excel format
  • The survey cannot be empty.  That is you must have submitted at least one completed form prior to loading the tasks.  You can use Web Forms for this and if this initial piece of data is not required it can be cleared when you load the tasks from the CSV file.
  • FieldTask does not show images from preloaded data.  This is a high priority issue to fix in the next release.

Demonstration – Asset Inspection

Inspection Form

For this demonstration I created a form that included a text, image, select_one and geopoint question.  I set the “name” question to be read only so it would not be updated during the survey. All of these except for the select_one question are going to be pre-populated from a CSV file.

form

This form was loaded to the server.

CSV File

The CSV file looks like the following image.  Column headings should match the name of the question where you want to put the data.  The exception is for geopoint (GPS coordinates) questions.  If you have columns labelled “lat” for latitude and “lon” for longitude then the values from these columns will be loaded into the geopoint question.

csv The image files in the pic_asset column need to be added to a directory along with the CSV file. This directory should be zipped and then uploaded to the Server.

Uploading the CSV file

On the tasks page select “Load Tasks From File”.  Then select the Form to load the data into.  Indicate whether or not you want existing data replaced and select your CSV or ZIP file.  Then press “Save”.

Assigning Tasks

You can then click on “Add Task Group” to assign the asset surveys to users.

assignments

Screen shot of tasks paging showing 3 tasks to inspect assets

Completing The Tasks

Using Web Forms

webform tasks

Web Forms Launcher screen showing tasks assigned to the user as red buttons

When you click on a task it will show in a web form.

asset

Web form with data pre-populated from a CSV file

Note: the asset name question is a text question set to “read only”, hence the asset name from the CSV file cannot be edited.  However the location and the picture can be replaced.  The “health of asset” which was not in the CSV file can also be filled in.

Final results

After the user presses the submit button the updated information will be available on the server.

results

Results after one task completed

Note: You can see that the record loaded from CSV file has been replaced by the completed survey results.  In this case the location and picture were not changed.

Bug Fixes

We only did one bug fix in this release which was a the request of Zarkman.

  • The menus on the Webforms page have been made consistent with other pages.  That is the links to Admin, Analysis etc have been put into a “Modules” drop down menu.

version-15-03

This release is primarily about adding support for iPhones and iPads when they are using Web Forms.  You can now take photos, and videos with your iPhones when completing smap surveys.  I’d like to thank Zarkman for donating an iPhone to Smap Consulting in order to help with the testing of this new capability.

zarkmaniphone

A user changing their settings on the Smap Server using the Zarkman donated iPhone

New Features

iPhone and iPad support

You can now complete surveys on your iPhone and iPad using WebForms. These surveys can included images, video and GPS coordinates.

If you conduct surveys that don’t take pictures then they can be submitted offline and will be stored until you have a network connection. However, when using an iPhone, if you take pictures as part of your survey then you will not be able to save the results as draft.  Also if you are offline when you submit, then the results will not be stored to be submitted when you are back on line.  You will need to stay in the web page until you get a network connection and then re-submit.  You can open multiple pages in order to complete multiple surveys, with images and offline, while using an iPhone.

To complete a survey on your iPhone, use Safari to go to your server. Then select WebForms and finally select the big blue button for the survey you want to complete.

This capability was in large part enabled through upgrading to the latest version of enketo-core as well as being assisted by the sponsorship of Zarkman.

Grid layout for Web Forms

Thanks to the the new version of enketo-core you can layout your web forms in a grid.

grid

An example grid layout from enketo running in web forms

To turn your survey into a web form grid you need to:

1. Add a settings sheet to your xlsform containing

style
theme-grid

2. Add w1, w2 etc to the appearance columns of questions that you don’t want to appear full width.

This example form from enketo has more detailed information.

Email Notifications

The email address to which to send a notification can now be obtained from the survey results.  When creating a notification specify the question from which to get these addresses.  This can be a select one, select multiple or text question. They question can be in a repeating group in which case all the emails entered will be used as the “to” address for the notification.

To specify multiple email addresses in a text question separate each email address with commas.

Getting email addresses from a select_multiple question

The names of choices in a select multiple question are used to create the data base table that stores the results.  These database column names cannot contain ‘@’ or ‘.’.  Hence for select multiple questions you have to modify the way the email address is specified.

  • Replace ‘@’  with ‘_amp_’
  • Replace ‘.’ with ‘_dot_’
emails

Choices sheet to specify notification emails addresses chosen by select_multiple

In select_one and text questions you can simply write the email as normal.

Email Message Text

You can now specify the text to be included in an email notification.  This can be specified for each notification.  Alternatively a default email text can be specified in the organisation settings.

Specifying the email domain

The email domain to be used for emails can be specified at the whole of server level in the “server” table.  Alternatively it can be specified for the organisation in the organisation settings.

PDF Generation

You can attach a PDF of the results to an email notification.  A PDF will be automatically generated using the same grid layout as is available for WebForms.  However in this release its still very much beta code.

More usefully a template for the PDF can be specified in the surveys settings.  Go to the survey editor and click on the “File” menu and then “Settings”.  Fields in the template that have the same name as a question will be populated with the results of the question.

PDF’s  can also be downloaded from a table view of the survey results. Goto the analysis page and create a table containing the survey results.  A menu button will be shown to the left of each record.  If you click on that you have the option to download a PDF or open a WebForm containing the record.  Note this feature is only enabled if the ability to edit surveys is specified in the organisation settings.

Miscelaneous

  • Files in the /smap/temp directory are now deleted each time you upgrade
  • If you rename a survey or delete it and then restore it then you can still download the XLS form that was used to create that survey.

Bug Fixes

The following issues have been fixed.

  • The default language could not be specified in the settings for the survey.
  • If you had two levels or more of repeating groups then when you exported results an unnecessary row containing data from the main form would have been added to the results.
  • Could not add media to questions using Firefox
  • Images of type “ico” were shown in the dashboard with an audio thumbnail
  • Filter values used in cascading selects were not allowed to have spaces.
  • When exporting surveys with more than one “/” in their name then the export failed.

Update (Version 15.03.02)

I have updated the released code to address some relatively minor bugs.

  • Notifications for soft deleted surveys were still being shown in the notifications list
  • The xls template for editing forms has been updated to include the settings tab and a column for the “style”.  You can use this to format web forms in a grid.
  • The link to this blog from the server home page was pointing to the release notes for version 15.02

Update (Version 15.03.03)

Updated for a very significant bug.  The web forms code was not included in the previous release!  So if your web forms was looking a bit flat and not responsive to relevant conditions then this would be why.  Installing this the .03 version should fix it.