SEL-Columbia / formhub

Mobile Data Collection made easy.
http://formhub.org
BSD 2-Clause "Simplified" License
259 stars 163 forks source link

Use Enketo API for all webform URLs (no hardcoded webform urls) #1344

Open MartijnR opened 9 years ago

MartijnR commented 9 years ago

Simplify the Enketo settings. You really only need 2 settings: enketo_api_url and enketo_api_token.

This means removing the hardcoded webform urls from settings.py and use the Enketo API to always request the webform url. This will make OnaData compatible with enketo-express (the future of enketo) The new app will use the exact same API but a very different (muuuuuch nicer) URL structure.

If performance is a concern, maybe consider using the /survey/all endpoint upon page load which would then allow you to redirect to the appropriate webform URL immediately when a user clicks a button. It may even be worth caching the response for the next page load.