carp_study_generator 0.21.1
carp_study_generator: ^0.21.1 copied to clipboard
Utilities for generating CARP Mobile Sensing studies
CARP Study Generator Utility Package #
This utility package helps generate the configuration files needed for a CARP Mobile Sensing study, and uploading this to the CARP web server.
Configuration and Setup #
To use the study generator, do the following in you app:
- Include
carp_study_generatorandtestas part of thedev_dependenciesin thepubspec.yamlfile. - Copy the folder
carpto the root of you project. - Configure
carp.yaml, and the json filesprotocol.json,consent.json, and the language json files (en.json, etc.).
File Structure #
All files used for creating and uploading configurations to CARP is stored in the carp folder in the root of your (app) project file. The name of the json files to upload is specified in the carp.yaml file.
| Folder | Description |
|---|---|
protocols |
The dart file containing the json definition of your StudyProtocol. |
consents |
The dart file containing the json definition of your RPOrderedTask with the informed consent to show to the user. |
lang |
The json language file for each language supported of the form <language>.json. |
Please ignore the test scripts in the carp folder (these are used to execute the commands).
Usage #
Each command is run like this:
flutter test carp/<command>
The available commands are:
help Prints this help message.
dryrun Makes a dryrun testing access to the CARP server, and the protocol, consent, and localizations.
protocol Create a study protocol based on the file 'protocol.json' and uploads it to the CARP server.
consent Create an informed consent based on the file 'consent.json' and uploads it to the CARP server.
localization Create localization support based on the files '<locale>.json' and upload them to the CARP server.
Before uploading a any json files to CARP, run the dryrun command first. It will check and output a list like the following:
[!] Authenticating - CarpServiceException: 401 Unauthorized - The requested email account: user@dtu.dk cannot be found. Request cannot be completed!
[✓] Protocol load - filename: carp/protocols/protocol.json
[!] Protocol parse - FormatException: Unexpected end of input (at character 1)
[✓] Consent load - filename: carp/consents/consent.json
[!] Consent parse - FormatException: Unexpected end of input (at character 1)
[✓] Locale - en
[✓] Locale - da
• 3 issues found!