Building a Replayable Quiz

Build a playable Python terminal quiz with stable answer identities, shuffled choices, JSON answer records, and independent practice of this round’s mistakes.

ProjectPython

Introduction

Building a Replayable Quiz is a practical Python project for learners who know the language basics and want to make a playable terminal application. Build the logic that selects questions from a local JSON bank, keeps answers correct when options move, and turns this round's mistakes into a separate practice round.

Two Guided Labs take you from answering known questions to saving and reusing answer records. One independent Challenge applies the same mechanisms to a new nature quiz. Each unit starts with its own prepared files.

What You Will Learn

  • Select a limited set of questions without duplicates and shuffle complete option objects without changing the bank.
  • Map displayed answer numbers to stable option IDs, keeping each answer attached to its question.
  • Ask again after invalid input and quit without recording an unanswered question as wrong.
  • Save submitted question and option ID pairs in a UTF-8 JSON file.
  • Select only answered mistakes for a new practice round, including the valid case of no mistakes, while preserving the original bank and record.

Who This Course Is For

This course is for Python learners who want to connect familiar data structures and functions into an interactive program.

Prerequisites: Python functions, lists, dictionaries, conditionals, and loops, plus basic terminal use and changing directories. The Guided Labs explain JSON, file operations, random selection, input validation, and the supplied function parameters before you use them.

Learning environment: A browser-based WebIDE provides an editor, terminal, Python, question banks, and the application shell. You implement five functions in logic.py; the supplied presentation engine, command-line program, and banks are preserved. Questions, interface labels, and program output are in English.

Frequently Asked Questions

Do I need to install software or create an account for a quiz service?

No local installation or external quiz account is needed. The project uses local files and Python's standard library in the prepared environment.

Am I writing the whole application from scratch?

No. You implement question selection, option movement, input handling, record saving, and mistake selection. The supplied engine presents questions and feedback; the supplied command-line program reads files and displays the final score.

What makes the Challenge different?

You reuse the taught functions with a different nature question bank. Correctness must follow question and option identity even when text or option IDs recur across different questions. The same program must still work with the original bank.

Can I stop early or finish with no mistakes?

Yes. Entering q before answering leaves that question unrecorded. An all-correct round produces an empty practice round. New record paths keep previous records intact.

Teacher

labby
Labby
Labby is the LabEx teacher.

Recommended For You

no data