A reviewer approves or rejects a submission in the Peskas Management
Platform, which writes the decision to the form's surveys_flags-<asset_id>
collection under the reviewer's username and to KoBoToolbox; a reviewer can
also decide in KoBoToolbox directly. A pipeline rewrites that collection on
every run, so it reads the decisions from both first and carries them into
the flags it writes and into its validated data.
A decision is one made by any account other than the pipeline's own. Where
the collection and KoBoToolbox both hold one for a submission, the later
wins. KoBoToolbox is read with list_validation_statuses(), every submission
at once.
Arguments
- flags
The form's current flags collection, as returned by
mdb_collection_pull(), orNULL.- pipeline_users
Character. The accounts the pipeline writes statuses as.
- asset_id
Character. The KoBoToolbox asset id;
NULLreads the collection only.- ...
Passed to
list_validation_statuses():token, orusernameandpassword, andurlfor a server other than eu.kobotoolbox.org.
Value
A tibble with one row per reviewed submission: submission_id
(integer), validation_status, validated_at, validated_by. When
KoBoToolbox cannot be read, a warning is logged and the collection's
decisions are returned alone, so the run goes on. With no pipeline
account name it stops with an error, so nothing is overwritten.
Examples
if (FALSE) { # \dontrun{
conf <- read_config()
review_decisions(
flags = mdb_collection_pull(...),
pipeline_users = conf$ingestion$adnap$username,
asset_id = conf$ingestion$adnap$asset_id,
token = conf$ingestion$adnap$token
)
} # }
