The Ultimate Quiz is a trivia game about historical rulers that generates questions by scraping Wikipedia. Instead of using a fixed question bank, the game pulls real data—birth dates, death dates, reign periods, successors—and turns it into multiple-choice questions on the fly.
The game also tracks how well you're doing and adapts accordingly. Questions you get wrong come back more often, while ones you've mastered appear less frequently. This is based on spaced repetition techniques used in flashcard apps.
The game uses BeautifulSoup (a Python library) to scrape Wikipedia pages for historical rulers. It extracts structured information like birth/death dates, reign periods, and successor names, then stores this in a Ruler class.
This object-oriented approach keeps the scraping logic separate from the game mechanics. Adding a new ruler just means pointing the scraper at a new Wikipedia page—the rest of the system handles it automatically.
The mastery system is inspired by spaced repetition algorithms like the Leitner System and SuperMemo. The basic idea: questions you answer correctly move to higher 'levels' and appear less often, while questions you miss drop back down and come up more frequently.
The system also tracks how long you take to answer. Fast correct answers indicate strong recall, while slow answers (even if correct) suggest the material isn't fully learned yet. A simple linear regression predicts future performance when recycling old questions.
1class MasterySystem:
2 def __init__(self, numLevels, listQuestions):
3 self.levels = [[] for _ in range(numLevels)] # Mastery boxes
4 self.stats = {} # Tracks correct/incorrect per question type
5
6 def updateLevel(self, question, correct):
7 # Move question up a level if correct, down if incorrect
8 currentLevel = self.findLevel(question)
9 if correct:
10 newLevel = min(currentLevel + 1, self.numLevels - 1)
11 else:
12 newLevel = max(currentLevel - 1, 0)
13 self.moveToLevel(question, newLevel)Questions are generated dynamically from the scraped ruler data. Each question pulls information from one ruler (e.g., 'When did Queen Victoria die?') and generates wrong answers using data from other rulers, making it harder to guess based on familiarity.
The system tracks response time along with correctness. A fast correct answer lowers the question's difficulty, while a slow answer (even if correct) keeps it at a higher difficulty level. This helps distinguish between genuine knowledge and lucky guesses.
The game includes several features to help players track their progress and understand the mechanics.
This project combined web scraping, data parsing, and adaptive learning algorithms into an interactive quiz game. The spaced repetition system provides a practical application of learning science principles, while the dynamic question generation ensures varied content without manual question authoring.