Skip to main content

Class SurveyResponse

Flat data bag that captures one survey question's participant response along with the metadata needed to validate it (required flag, attention-check expected values).

[Serializable]
public class SurveyResponse

Inheritance​

Remarks​

All response values are stored as strings, regardless of the original UI element type (radio button label, text field text, slider integer). This uniformity lets the structure be JSON-serialised and transmitted without a type-per-question-variant class hierarchy, and means the attention-check comparison logic in BaseSurveyHandler operates on a single IEnumerable{string} interface.

Multi-select questions (checkbox groups) produce multiple entries in values, which is why it is a List rather than a scalar string.

The attention-check and required fields are carried on the response object (rather than the question data) so that SurveyResponse}) can produce a self-contained list that validation methods can process without needing to re-query the original SurveyItemData assets.

Fields​

attentionCheckValues​

The correct expected values for this question if it is a catch question (attention check). Compared against values using the attentionCondition operator.

public string[] attentionCheckValues

Field Value​

string[]

attentionCondition​

Indicates the logical condition used to evaluate the attention check. A value of LogicalCondition.AND means all values must match attentionCheckValues, while LogicalCondition.OR means at least one must match.

public int attentionCondition

Field Value​

int

Remarks​

This integer acts as a flag to determine how attention check values are evaluated:

  • 0LogicalCondition.AND � All values must match.
  • 1LogicalCondition.OR � At least one value must match.

See LogicalCondition enum for more detail.

isAttentionCheck​

true if this question functions as an attention-check catch question whose response must be validated before the survey can be submitted.

public bool isAttentionCheck

Field Value​

bool

required​

Indicates whether this question is required to be answered before submission.

public bool required

Field Value​

bool

title​

Display title of the question as shown to the participant, including question number and required marker. Used as the column header in exported data.

public string title

Field Value​

string

values​

One or more string values the participant selected or typed. Multiple values occur for checkbox (multi-select) questions. Slider values are stored as their integer string representation.

public List<string> values

Field Value​

List<string>

  • Remarks
  • Fields
    • attentionCheckValues
    • attentionCondition
    • isAttentionCheck
    • required
    • title
    • values