Skip to content

SurveyUserTask

A UserTask that shows a survey or cognitive test from an RPAppTask.

Created by SurveyUserTaskFactory and put on the AppTaskController.userTaskQueue when the RPAppTask is triggered. The app shows the widget (a SurveyPage) to the user.

Key points:

  • Call onStart when the user starts the task. This resumes background sampling of the task's measures.
  • On submit, adds an RPTaskResultData measurement with status SurveyStatus.submitted, pauses background sampling and marks the task done.
  • On cancel, also adds the partial result (status SurveyStatus.canceled), pauses background sampling and marks the task canceled.
Inheritance

Constructors

SurveyUserTask

SurveyUserTask(
  1. AppTaskExecutor<AppTask> executor
)

Properties

hasWidget

bool get hasWidget
override

Does this user task has a user interface (Widget) to show to the user?

rpAppTask

RPAppTask get rpAppTask

The RPAppTask from which this user task originates from.

widget

Widget? get widget
override

The widget to be shown to the user as part of this task, if any. Note that the user interface may not be available before the onStart method has been called.

Methods

onStart

void onStart()
override

Callback from the app when this task is to be started.