Tangerine-Community / Tangerine

Digitize your offline data collection. Create your Forms online with Tangerine Editor, conduct them offline with the Tangerine Android App. All results you collect can be exported as a CSV file, easy for processing in a spreadsheet. Tangerine has been used in over 1 million assessments and surveys in over 60 countries and in 100 languages.
http://www.tangerinecentral.org/
GNU General Public License v3.0
48 stars 30 forks source link

Save initial form response docs with included metadata #3635

Closed esurface closed 6 months ago

esurface commented 8 months ago

Users of the case module reported finding incomplete form responses with empty metadata include 'caseId', 'eventId', 'location' etc.. These erroneous forms can be created if the tangyFormsPlayer.saveFormResponse() function fails to complete (possibly due to a crash or database layer error).

The code changed in this PR simplifies the saveFormResponse function so it always saves the form response with any metadata included in the tangy-form dom element. There was no need that I can think of to save the form response without the metadata.

esurface commented 8 months ago

I tested this with locally with clients using sync protocol 1 and 2.

esurface commented 8 months ago

Not applicable for online-survey clients