saveStudyProtocol method
Saves study as JSON to filename.
Returns true if successful.
Implementation
@override
Future<bool> saveStudyProtocol(String studyId, SmartphoneStudyProtocol study) async {
bool success = true;
info("Saving study protocol - id: '$studyId'.");
try {
final json = jsonEncode(study);
File(filename(studyId)).writeAsStringSync(json);
} catch (exception) {
success = false;
warning("Failed to save study protocol '$studyId' - $exception");
}
return success;
}