The Condition function allows you to create logical branches within your quiz, that is, direct the user to different pages, results, or offers based on previous responses or values stored in variables. It’s an essential resource for personalizing the experience and displaying relevant content dynamically. How it works You create rules based on variables, and XQuiz checks if those rules are true or false. Depending on the result, the user is sent to a specific path in the funnel. How to configure
  1. Add the Conditions function to the Flow.
  2. Click “Add Condition”.
  3. For each rule, define:
  • Variable: the variable that will be checked (e.g., sum, result, user_type)
  • Operator: the logic that will be used (equal, greater than, less than or equal to, etc.)
  • Value: the number or text that will be compared with the variable’s value.
  1. Combine multiple comparisons using AND or OR connectors.
  2. Connect each condition group to a personalized result page or any other stage.
Practical example (as in the image): In this example, the variable called “sum” is being used to store the result of a mathematical calculation, adding the value of four variables that were defined earlier: beginner, basic, intermediate, and advanced. These variables represent answer options in the quiz, and each has a different numerical value, according to the participant’s knowledge level or profile:
  • beginner is worth 1 point.
  • basic is worth 3 points.
  • intermediate is worth 5 points.
  • advanced is worth 7 points.
The sum variable uses this expression: (beginner) + (basic) + (intermediate) + (advanced) That is, it calculates the total points based on the choices made by the user in previous questions. This strategy is useful when you want to evaluate the participant’s profile and, based on the total accumulated points, direct them to a personalized message or specific offer. For example:
  • IF sum is greater than or equal to 10 AND sum is less than or equal to 25 → Directs to Result 1.
  • IF sum is greater than or equal to 26 AND sum is less than or equal to 40 → Directs to Result 2.
  • IF sum is greater than or equal to 41 AND sum is less than or equal to 55 → Directs to Result 3.
  • IF sum is greater than or equal to 56 → Directs to Result 4.
If no condition is met, the funnel follows the “Else” option. All of this can be configured in the Condition function, based on the sum variable’s value. Another practical example: This Conditions model shows a very common logic in quiz-type tests or knowledge tests, where only correct answers score points. In this example, only one variable called points is used, which accumulates +1 point for each correct answer throughout the quiz. That is, at the end, this variable represents the participant’s total score. The condition function then checks the final value of the points variable and directs the user to the corresponding result, based on their performance. The logic is as follows: Condition Interpretation: IF points ≤ 3
  • Result for those who got up to 3 questions right. May indicate a “beginner” level or “needs improvement”.
SE pontos ≥ 4 E pontos ≤ 6 Resultado intermediário. Pode ser um “nível básico” ou “em desenvolvimento”. SE pontos ≥ 7 E pontos ≤ 8
  • Indica um bom desempenho, talvez “nível avançado”.
SE pontos ≥ 9
  • Resultado mais alto, para quem teve excelente aproveitamento. Pode representar “nível especialista” ou “ótimo domínio do conteúdo”.
SENÃO Caminho padrão caso nenhuma das condições anteriores seja atendida (pode funcionar como segurança ou resposta genérica). Dica Importante: Esse tipo de lógica é ideal para quizzes educacionais, avaliações internas, testes de certificação ou diagnósticos, onde o objetivo é classificar o nível de conhecimento com base na pontuação final. E o melhor: tudo isso é feito com uma única variável (pontos), tornando o fluxo mais simples e fácil de gerenciar.

Lista de operadores – o que significa cada um e quando usar


= Igual a

Verifica se o valor da variável é exatamente igual ao valor definido.
Exemplo:
resultado = 10 → se a variável resultado for exatamente igual a 10, a condição é verdadeira.

Diferente de

Verifica se o valor da variável é diferente do valor especificado.
Exemplo:
resposta ≠ sim → se o valor não for "sim", a condição é atendida.

> Maior que

Verifica se o valor da variável é maior do que o valor informado.
Exemplo:
soma > 30 → usado para pontuações ou faixas de resultado.

Maior ou igual a

Verifica se o valor da variável é maior ou igual ao valor informado.
Exemplo:
pontos ≥ 10 → funciona como um limite mínimo para passar de fase, por exemplo.

< Menor que

Verifica se o valor da variável é menor que o valor especificado.
Exemplo:
soma < 15 → útil para detectar quem teve uma pontuação baixa.

Menor ou igual a

Verifica se o valor da variável é menor ou igual ao valor informado.
Exemplo:
idade ≤ 17 → segmenta pessoas menores de idade.

Contém

Verifica se a variável inclui determinado texto.
Exemplo:
interesse contém emagrecimento → funciona bem para respostas abertas ou múltiplas.

Não contém

Verifica se a variável não possui determinado conteúdo.
Exemplo:
respostas não contém luxo → útil para filtrar perfis sem determinado interesse.

Está definido

Verifica se a variável existe e tem algum valor atribuído (não está vazia).
Exemplo:
Usado para garantir que o usuário preencheu um campo obrigatório.

Está vazio

Verifica se a variável ainda está vazia (sem valor).
Exemplo:
email está vazio → pode ser usada para forçar o preenchimento de um campo antes de seguir.

Começa com

Verifica se o valor da variável começa com uma palavra ou caractere específico.
Exemplo:
email começa com contato → segmenta leads com padrão específico.

Termina com

Verifica se a variável termina com determinada palavra ou caractere.
Exemplo:
email termina com .edu → útil para detectar e-mails institucionais.

Corresponde ao regex

Permite fazer validações usando expressões regulares (avançado).
Exemplo:
Verificar padrões como CPF, número de telefone, etc.

Não corresponde ao regex

Verifica se o valor não segue o padrão de uma expressão regular.

Quando usar a função Condição?

  • Para exibir resultados personalizados com base nas respostas.
  • Para somar pontos e classificar perfis de usuários.
  • Para segmentar leads por interesse ou comportamento.
  • Para ativar ofertas diferentes para públicos diferentes.