---
title: "Quiz Time"
icon: "brain"
description: "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](/surveys/question-type/select-single) 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.** Open the [Flow tab](/surveys/general-features/flow-tab) next to Questions. Each block has an `Add logic +` button under it; choose **Set value**, then **Add a condition**.

Add one rule per question:

![A rule on the Flow tab: If interest equals High-Yield Savings, then Set value score to the expression @score + 1](/images/surveys/best-practices/quiz-time/set-value-rule.webp)

Read it as a sentence: **If** the answer equals the correct choice, **Then Set value** `score` to `@score + 1`.

<Note>
  A **Set value** action writes an expression into the field, so adding a point is `@score + 1` on a number field.
  See [Set value](/surveys/general-features/set-value) for the expressions you can write, and
  [Conditional Logic](/surveys/general-features/conditional-logic) for the full set of conditions and actions.
</Note>

## 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](/surveys/general-features/recall).

Then add a final rule that routes on the total: **If** `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.
</Warning>

## 5. Activate

**Activate**, then share the link like any other [link survey](/surveys/link-surveys/quickstart).

<Tip>
  A quiz makes a good lead magnet: add a [contact info](/surveys/question-type/contact-info) question before
  the ending and the score arrives attached to an email address.
</Tip>
