Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track partial form submissions #5737

Merged
merged 1 commit into from
Oct 2, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,9 @@ object AnalyticsEvents {
*/
const val PERMISSIONS_DIALOG_CANCEL = "PermissionsDialogCancel"
const val PERMISSIONS_DIALOG_OK = "PermissionsDialogOK"

/**
* Tracks how often a form is finalized using a `ref` attribute on the `submission` element
*/
const val PARTIAL_FORM_FINALIZED = "PartialFormFinalized"
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.json.JSONException;
import org.json.JSONObject;
import org.odk.collect.analytics.Analytics;
import org.odk.collect.android.analytics.AnalyticsEvents;
import org.odk.collect.android.application.Collect;
import org.odk.collect.android.database.instances.DatabaseInstanceColumns;
import org.odk.collect.android.exception.EncryptionException;
Expand Down Expand Up @@ -361,6 +362,10 @@ private Instance exportData(boolean markCompleted, FormSaver.ProgressListener pr
// now see if the packaging of the data for the server would make it
// non-reopenable (e.g., encryption or other fraction of the form).
boolean canEditAfterCompleted = formController.isSubmissionEntireForm();
if (!canEditAfterCompleted) {
Analytics.log(AnalyticsEvents.PARTIAL_FORM_FINALIZED, "form");
}

boolean isEncrypted = false;

// build a submission.xml to hold the data being submitted
Expand Down