Skip to main content

Class SurveyPageDataHandler

Collects survey responses from a co-located SurveyPageGenerator, bookmarks the session with start and end Unix timestamps, and transmits the complete payload to the backend when the scenario ends.

[RequireComponent(typeof(SurveyPageGenerator))]
public class SurveyPageDataHandler : MonoBehaviour

Inheritance​

Remarks​

Attach this component to the same GameObject as the SurveyPageGenerator. It records the survey response and start/end timestamps. The timestamps are Unix epoch milliseconds.

Data transmission is wired to the GameMode end-of-scenario hook so all data types (sensor logs, feedback metrics, survey responses) are transmitted in the same pipeline with the same retry/queuing guarantees.

Methods​

SendToServer(Action)​

Stamps the end time, snapshots the questionnaire responses from the SurveyPageGenerator, serialises the payload to JSON, and enqueues it for transmission.

public void SendToServer(Action callback)

Parameters​

NameTypeDescription
callbackActionInvoked after the payload has been accepted by the send queue.

Remarks​

The end timestamp is captured here rather than in BaseSurveyHandler.OnSurveySubmit so that it reflects the moment the game mode fires the send event, not the moment the participant clicked Submit (which may occur slightly earlier due to the attention-check modal delay).