> ## Documentation Index
> Fetch the complete documentation index at: https://formbricks.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Quiz Time

> Build a scored quiz with a variable, block logic and two endings.

A quiz is a survey that keeps a running score and routes to a different ending depending on it. Everything it needs — a variable, conditional logic and multiple endings — is already in the editor.

## What you will build

A trivia quiz that adds a point per correct answer and finishes on a pass or a fail card.

## 1. Create the questions

Open **Surveys**, click **New Survey** and choose **Start from scratch**. Leave the type as **Link survey**.

Add one [select-single](https://formbricks.com/docs/surveys/question-type/select-single.md) question per quiz question, each with one correct choice among the options.

## 2. Add a score variable

Scroll to the **Embedded Data** card below the question list, choose **Add field** then **Create new field**, set the source to **Calculated** and the type to **Number**, name it `score` and give it a default of `0`.

## 3. Add a point per correct answer

This is the part the old version of this page got wrong, so it is worth being precise: **conditional logic belongs to a block, not to a question.** Scroll to the foot of the block, under the question list, and you will find **Conditional Logic** and an `Add logic +` button.

Add one rule per question:

![A rule adding one to the score when the answer is correct](https://mintcdn.com/formbricks/JDqzwa8MOXcZZnn-/images/surveys/best-practices/quiz-time/calculate.webp?fit=max\&auto=format\&n=JDqzwa8MOXcZZnn-\&q=85\&s=87873b99c8f7dcb47139c03d3f1313aa)

Read it as a sentence: **when** the answer equals the correct choice, **then calculate** `score` `Add +` `1`.

> [!NOTE]
>
> A `Calculate` action can add, subtract, multiply, divide or assign. A quiz normally wants **Add +** on a
> number variable — see [Conditional Logic](https://formbricks.com/docs/surveys/general-features/conditional-logic.md) for the full set of
> conditions and actions.

## 4. Show the score and branch on it

Add two endings — a fail card and a pass card. In either card's text, type `@` to recall the score, exactly as you would recall an answer. See [Recall Data](https://formbricks.com/docs/surveys/general-features/recall.md).

Then add a final rule that routes on the total: **when** `score` is greater than or equal to your pass mark, **then jump to** the pass ending.

> [!WARNING]
>
> Order matters. Put the **fail** card above the **pass** card. Endings are reached in order, so anything
> that does not match the pass rule falls through to the card above — which is what you want the failing
> case to hit.

## 5. Activate

**Activate**, then share the link like any other [link survey](https://formbricks.com/docs/surveys/link-surveys/quickstart.md).

> [!TIP]
>
> A quiz makes a good lead magnet: add a [contact info](https://formbricks.com/docs/surveys/question-type/contact-info.md) question before
> the ending and the score arrives attached to an email address.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.