CompletedAppTask
The measurement collected when the user completes an AppTask.
taskData holds the result of the task (e.g. survey answers), or null if the task has no result. Its JSON type is dk.cachet.carp.completedapptask.<taskType>, so you can trigger on a specific type of task with a SamplingEventTrigger.
- Inheritance
-
- Object
- Serializable
- Data
- CompletedTask
- CompletedAppTask
- Annotations
-
- @JsonSerializable(includeIfNull: false, explicitToJson: true)
Constructors
CompletedAppTask.fromJson
CompletedAppTask.fromUserTask
- UserTask userTask
Creates a completed app task based on the given userTask.
CompletedAppTask
Creates a completed app task with the given taskName and taskType, and optional taskData.
Properties
completedAt
The time when the task was completed, in UTC. Set on creation.
fromJsonFunction
The function which can convert a JSON string to an object of this type.
jsonType
Return the __type to be used for JSON serialization of this class. Default is runtimeType. Only specify this if you need another type.
taskType
The type of AppTask which was completed, if specified.
Known types are the *_TYPE constants of AppTask:
- informed_consent - a task collecting informed consent from the user
- survey - a survey task
- cognition - a cognitive assessment task
- audio - an audio task
- video - a video task
- image - an image task
- health - a task collecting health data
- sensing - a task collecting sensing data
Methods
equivalentTo
Is this data equivalent to other?
This is a custom 'soft' equal (==) operator used to compare two data objects. Used in triggering when some data is collected. Override in subclasses to provide custom equivalence checking.
toJson
Return a JSON encoding of this object.