resources:
architecture/flow:
- nemo talks to
lib/enketo-transformer-service/index.js
(separate node app that runs enketo-transformer) to convert our form XML into a JSON object we're able to send to enketo - nemo renders a
<div id="enketo">
inenketo_form.html.erb
- nemo injects 2 variables into JS via a
<script>
tag:window.ENKETO_MODEL_STR
is the form XML from enketo-transformer-servicewindow.ENKETO_INSTANCE_STR
is the optional response XML (when editing)
- enketo injects itself into
document.querySelector('#enketo form')
via jQuery inpacks/enketo.js
- enketo loads the two variables set above and renders the form
- user types in info and hits submit
- enketo submits XML to nemo's existing ODK
/submission
(responses#create
) route - on edit, nemo saves the edited XML to
modified_odk_xml
attachment so as to preserve the originalodk_xml
as required by some orgs
If you get errors trying to yarn install
:
- Make sure you are using the correct node version: the one specified in ../../.nvmrc
- Try explicitly specifying the C++ compiler used by Enketo dependencies:
yarn install -std=c++17