Skip to main content
Question guards (also called consent gates or validation rules) are server-side validation rules on onboarding questions. They determine whether a participant is eligible to join a quest based on their answers.

How They Work

  1. Participant fills out onboarding questions
  2. Answers are sent to the server: POST /quest/validate-onboarding
  3. Every question with a guard is evaluated
  4. If any guard fails → participant is blocked with rejection messages
  5. If all guards pass → participant can proceed to join
Guard validation is server-side — it cannot be bypassed by participants.

Guard Configuration

Each guard has three fields:
FieldTypeDescription
OperatorstringThe comparison operator (see table below)
ValuestringThe expected value. Single value for eq/neq/gt/gte/lt/lte. Comma-separated for in/not_in.
Rejection MessagestringCustom message shown to the participant if they fail. Default: “Your response does not meet the requirements for this study.”

Available Operators

Which operators are available depends on the question’s response type:
Response TypeAvailable Operators
texteq (Equals), neq (Not equals)
yesnoeq (Equals), neq (Not equals)
numbereq, neq, gt (Greater than), gte (Greater than or equal), lt (Less than), lte (Less than or equal)
numberRangeeq, neq, gt, gte, lt, lte
customOptionseq (Equals), neq (Not equals), in (Is one of), not_in (Is not one of)

Operator Details

OperatorLabelBehavior
eqEqualsCase-insensitive exact match
neqNot equalsCase-insensitive non-match
gtGreater thanParses as float: answer > value
gteGreater than or equalParses as float: answer ≥ value
ltLess thanParses as float: answer < value
lteLess than or equalParses as float: answer ≤ value
inIs one ofValue is comma-separated. Answer (lowercased) must be in the set
not_inIs not one ofValue is comma-separated. Answer (lowercased) must NOT be in the set
When you change a question’s response type, the operator resets to the first valid option if the current operator is no longer available for the new type.

Rejection Behavior

When a participant fails validation:
  • Per-question: Each failed question shows its rejection message in a red inline box below the question
  • Global: A yellow warning banner appears: “You do not meet the eligibility criteria for this quest.”
  • The participant cannot proceed and cannot join the quest

Adding a Guard

  1. Open a quest and navigate to the onboarding section
  2. Click on an onboarding question (or add a new one)
  3. Check “Add validation rule (consent gate)”
  4. Select an operator from the dropdown
  5. Enter the expected value
  6. Optionally customize the rejection message

Worked Examples

Must Be 18 or Older

FieldValue
Question”How old are you?”
Response typenumber
Operatorgte
Value18
Rejection message”You must be at least 18 years old to participate in this study.”
Behavior: If a participant enters 17, they see the rejection message and cannot join.
FieldValue
Question”Do you consent to your data being collected and used for research purposes?”
Response typeyesno
Operatoreq
ValueYes
Rejection message”Consent is required to participate in this study.”
Behavior: If a participant selects “No”, they see the rejection message and cannot join.

Must Be in Target Demographic

FieldValue
Question”What is your occupation?”
Response typecustomOptions
OptionsStudent, Professional, Retired, Other
Operatorin
ValueStudent,Professional
Rejection message”This study is only open to students and working professionals.”
Behavior: If a participant selects “Retired” or “Other”, they see the rejection message and cannot join.

Exclude a Specific Condition

FieldValue
Question”Do you have a history of epilepsy?”
Response typeyesno
Operatoreq
ValueNo
Rejection message”Due to the nature of the visual stimuli in this study, participants with a history of epilepsy cannot participate.”
Behavior: If a participant selects “Yes”, they see the rejection message and cannot join.