Creating Multiple Choice Questions

Build auto-graded MCQ questions with dynamic variables and conditional answer choices

What is an MCQ?

Multiple Choice Questions present students with a set of predefined answer options. Each option is backed by a Python expression that evaluates to 'True' (correct) or 'False' (incorrect) in the context of the generated variables.

  • Auto-graded — no manual scoring needed
  • Marks are difficulty-based — Low = 1, Medium = 3, High = 5
  • Can be dynamic — use variables in both the prompt and answer expressions
  • Used in both topic practice and course assessments
MCQ questions can still use dynamic variables. The answer choice expressions re-evaluate for each generated instance, so the correct answer can change based on the variable values.

Answer Choices & Expressions

Each choice has two parts: a label (what the student sees) and an expression (Python code determining correctness).

Expression Result Use Case
'True' Correct Static correct answer
'False' Incorrect Static wrong answer (distractor)
str(x > 5) Depends on variables Conditional correctness based on generated values
str(answer == x + y) Depends on variables Compare computed answer against expression

Step-by-Step Creation

1

Define Variables

Create variables that your question will use. These feed into both the prompt and answer choice expressions.

num1 = randint(10, 50)
num2 = randint(10, 50)
total = num1 + num2
2

Select MCQ as the Question Type

Choose Multiple Choice (MCQ) from the question type dropdown when creating a new question. Set the difficulty — this determines the marks (Low=1, Medium=3, High=5).

3

Write the Prompt

Use {variable_name} to insert generated values into the question text.

What is the sum of {num1} and {num2}?
4

Add Answer Choices

Add choices with labels and expressions. The correct choice expression must evaluate to 'True'.

Correct: {total}  →  'True'
Wrong: {num1}  →  'False'
Wrong: {num2}  →  'False'
Wrong: {total - 5}  →  str(total - 5 == total)

Examples

Example 1: True/False Question

Check if a generated number is even

Variables
n = randint(1, 100)
Prompt
Is {n} an even number?
Choices
Yes → str(n % 2 == 0)
No → str(n % 2 != 0)

Example 2: Best Answer Selection

Pick the largest of three generated numbers

Variables
a = randint(1, 20)
b = randint(1, 20)
c = randint(1, 20)
Constraints
a != b
a != c
b != c
Prompt
Which is largest: {a}, {b}, or {c}?
Choices
{a} → str(a == max(a, b, c))
{b} → str(b == max(a, b, c))
{c} → str(c == max(a, b, c))

Explore Other Question Types

See how the other two question types work:

Questions about creating MCQs?

We're here to help

Contact Us