---
title: MultipleChoice
framework: docc
role: symbol
role_heading: Directive
path: docc/multiplechoice
---

# MultipleChoice

Defines a single question and multiple possible answers to include in the Assessments section of a tutorial page.

## Declaration

```swift
@MultipleChoice {
    ...
}
```

## Overview

Overview Use the MultipleChoice directive to define a descriptive question that assesses the reader’s knowledge after they complete the steps in a tutorial. Multiple choice questions appear in the assessments section of a tutorial  page. Provide a question and several choices. @Tutorial(time: 30) {          ...

@Assessments {         @MultipleChoice {             What element did you use to add space around and between your views?

@Choice(isCorrect: false) {                 A state variable.

@Justification(reaction: "Try again!") {                     Remember, it's something you used to arrange views vertically.                 }             }

@Choice(isCorrect: true) {                 A `VStack` with trailing padding.

@Justification(reaction: "That's right!") {                     A `VStack` arranges views in a vertical line.                 }             }

@Choice(isCorrect: false) {                              ...                            }         }       } } Contained Elements A multiple choice question contains the following items: Containing Elements The following items include multiple choice questions: Assessments

## Topics

### Offering Choices

- [Choice](docc/choice.md)

## See Also

### Related Documentation

- [Tutorial](docc/tutorial.md)
