Skip to content

RPAppTask

An AppTask that asks the user to complete a Research Package task.

The rpTask can be a survey, a cognitive test, or any other RPTask from Research Package. Add it to a protocol with a trigger, like any other task. When triggered, it shows up as a SurveyUserTask in the AppTaskController.userTaskQueue.

Key points:

For example, a PeriodicTrigger triggers the survey on a regular basis, and a RecurrentScheduledTrigger schedules a recurrent survey, e.g. every Monday at 8pm:

protocol.addTaskControl(
  RecurrentScheduledTrigger(type: RecurrentType.daily, time: TimeOfDay(hour: 13)),
  RPAppTask(type: AppTask.SURVEY_TYPE, name: 'WHO-5 Survey', rpTask: who5Task),
  phone,
);
Inheritance
Annotations

Constructors

RPAppTask.fromJson

RPAppTask.fromJson(
  1. Map<String, dynamic> json
)

RPAppTask

RPAppTask({
  1. String? name,
  2. required String type,
  3. String title = '',
  4. String? description = '',
  5. String instructions = '',
  6. int? minutesToComplete,
  7. Duration? expire,
  8. bool notification = false,
  9. List<Measure>? measures,
  10. required RPTask rpTask,
})

Properties

fromJsonFunction

Function get fromJsonFunction
override

The function which can convert a JSON string to an object of this type.

rpTask

RPTask rpTask
getter/setter pair

The survey, cognitive test or other Research Package task to show to the user.

Methods

toJson

Map<String, dynamic> toJson()
override

Return a JSON encoding of this object.