ForHosting KIT · Education

Shuffle quiz answer choices with a seed

Shuffle a question's answers with a seed number and get the same order back every time: Paris, London, Berlin and Madrid with seed 7 become Berlin, London, Madrid and Paris, and you are told the correct answer now sits last. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Choices
Paris, London, Berlin, Madrid
Correct index
0
Seed
7
You get
Choices
Berlin, London, Madrid, Paris
Correct index
3
Original correct index
0
Choice count
4

Multiple-choice quizzes need fair option order without losing the key. If every student always sees the correct answer first, scores inflate; if you scramble with non-reproducible randomness, you cannot re-score, A/B test, or debug a single item. This seeded multiple choice shuffle takes the answer choices, the index of the correct one, and an integer seed, then returns a deterministically reordered list and the new correct index. The same triple of inputs always yields the same order, so exam forms, LMS exports, and offline mobile packs stay bit-stable.

Why seeded shuffle matters for quizzes and assessments

Classroom and product quizzes usually author options in a canonical order—correct answer first, or in curriculum sequence—then need a presentation order that does not leak the key. A pure random shuffle at render time breaks reproducibility: two graders opening the same attempt see different positions, screenshots no longer match logs, and paper printouts cannot be regenerated after a server restart. Seeding the shuffle with a stable integer—student id hash, form variant number, attempt counter, or a fixed classroom seed—gives you controlled variety and a fixed mapping you can recompute later.

Use one seed per form variant or per learner if you want independent orders; reuse the same seed when you need identical booklets across devices.

Where a seeded choice shuffle earns its keep

Learning management systems call a seeded quiz answer shuffle when exporting forms so each section gets a different option order without rewriting the item bank. Exam integrity tools rotate distractor order per seat while retaining an audit trail: given the seed and original key, any auditor can recompute the presented order. Failed validation does not consume balance.

Keep choice lists short, pin goldens for your critical seeds, and you get reproducible multiple-choice presentation for LMS plugins, homework generators, and edge workers without standing up a custom shuffle service of your own.

LMS form variants

Export one item bank into several exam forms by seeding each form id so option order differs while the correct index stays tracked for auto-grading.

Per-student presentation order

Hash a student id into a seed and shuffle choices so each learner sees a different order without changing the underlying question key.

How many choices can I send?

Between 2 and 50 inclusive. Fewer than two is not a multiple-choice set; more than fifty is rejected to keep the contract bounded.

Why shuffle quiz answers with a seed instead of at random?

Because a seeded order can be rebuilt later. Two graders opening the same attempt see the answers in the same positions, printed booklets can be regenerated, and any single item can be checked again without guessing what a student saw.

How do I give each student a different answer order?

Use a different seed for each student or each form variant, and every one gets its own order. Reuse the same seed whenever you need identical booklets on paper and on every device.

How do I know where the correct answer ended up?

The result gives the shuffled list together with the new position of the correct answer, so automatic marking keeps working. In the example, Paris starts first and ends in the last of the four places.

Does it add the letters A, B, C and D?

No. It only reorders the answer texts and keeps track of the correct one. If your quiz shows letters next to the answers, add them in your own layout after the shuffle.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/edu/multiple-choice-shuffle-seeded

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/edu/multiple-choice-shuffle-seeded \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"choices":["Paris","London","Berlin","Madrid"],"correct_index":0,"seed":42}'
{
  "choices": [
    "Paris",
    "London",
    "Berlin",
    "Madrid"
  ],
  "correct_index": 0,
  "seed": 42
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "edu.multiple_choice_shuffle_seeded",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Out-of-range correct indices fail with invalid_input instead of silently pointing at the wrong option.

Why seeded shuffle matters for quizzes and assessments

This endpoint implements Fisher–Yates driven by a mulberry32 generator initialized from your seed, so the permutation is fully determined by choices length, content order, seed, and the original correct index. You never re-derive the key from text matching after the fact: the response includes the new correct_index alongside the shuffled choices, which is the contract auto-graders and player UIs need. When the original index is outside the array bounds, the task fails with invalid_input naming the range, because a wrong key index is worse than no shuffle. Empty or single-choice lists are also rejected so the API stays honest about what a multiple-choice item is.

Input contract, response shape, and error behaviour

Pair the response with your own letter labels A–D if the UI needs letters; this capability only reorders strings and tracks the key. Keep seeds in the signed thirty-two-bit range you care about; the PRNG uses the seed as an unsigned thirty-two-bit state while the response still echoes the integer you provided. POST a JSON body with three required fields. choices is an array of at least two and at most fifty strings (aliases options and answers are accepted). correct_index is a zero-based integer naming which entry is correct in that authoring order (alias answer_index). seed is a finite integer that initializes the PRNG (alias shuffle_seed). Numeric or boolean choice elements are stringified; objects and nulls are rejected. On success the body returns choices as the shuffled array, correct_index as the new position of the same answer text, original_correct_index echoing the input index, seed echoing the integer you sent, and choice_count equal to the array length. Example: choices Paris, London, Berlin, Madrid with correct_index zero and seed forty-two always produce the same order and the same new index for Paris.

Where a seeded choice shuffle earns its keep

Mobile offline packs precompute permutations at publish time and embed seed plus correct_index so devices never need a live random API.

Offline quiz packs

Precompute seeded shuffles at publish time and ship choices plus correct_index so mobile apps grade offline with full auditability.

How do I shuffle multiple-choice answers with a seed?

Send choices (array of strings), correct_index (zero-based), and seed (integer). The API returns the shuffled choices and the new correct_index for the same answer.

What if correct_index is out of range?

The task fails with invalid_input. The index must satisfy 0 ≤ correct_index < choices.length; bad keys are never silently remapped.

Is the shuffle deterministic?

Yes. The same choices, correct_index, and seed always produce the same order and new index. No Math.random or clock is used.

What does the seeded choice shuffle cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →