See https://reemeijer.nl/mock_exam/ for a sales pitch!
A fully interactive Rust CLI tool that quizzes you on built-in questions and gives you detailed results with the option to save them. The base for mock_exam is vibe coded with Claude. The example exams are also created with AI and I did NOT check if the answers are correct. They are mainly as example in the repository.
I wanted to have a easy way of creating my own mock exams with the help of AI and having the freedom of changing it how I want to have the questions.
Yes, you may!
There is also a crate free vibe coded version found at Codeberg.
- 3 question types: Multiple Choice, True/False, and Open-Ended (self-asses)
- 15 built-in questions covering Rust, CS, Networking, OS, and Math (not checked on rightness!)
- Shuffleable question order
- Choose how many questions to answer
- Instant feedback after each answer (with explanations where available)
- Detailed results with score, grade (not really doing a great job in version 1.0!), and per-question breakdown
- Save results as plain
.txt, structured.json, or both
# 1. Clone the project
# 2. Build with command: cargo build --release
# 3. To run: cargo run --release
# or, after building:
./target/release/mock_examMOCK EXAM RESULTS
============================================================
Exam : Rust Quiz
Date : 2024-12-01 14:30:00
Score : 4/5 (80.0%)
Grade : B — Good
...
{
"exam_title": "Rust Quiz",
"date": "2024-12-01 14:30:00",
"score_percent": 80.0,
"question_results": [ ... ]
}No code changes needed!
Create a file with the .exam.json extension and drop it next to the binary. The program will detect it automatically and offer it as a source at startup.
Place any *.exam.json files inside the exams/ folder in the same directory where you placed the binairy. The following example exams are added, created by AI:
mock_exam ← the binary
exams/
geography.exam.json
python_basics.exam.json
linux_cli.exam.json
sql_fundamentals.exam.json
http_web.exam.json
my_custom.exam.json ← add your own here
When you run mock_exam you will see a numbered menu:
── QUESTION SOURCE
Found 5 exam file(s) in this directory:
│ [0] Built-in questions (15 questions)
│ [1] geography.exam.json
│ [2] http_web.exam.json
│ [3] linux_cli.exam.json
│ [4] python_basics.exam.json
│ [5] sql_fundamentals.exam.json
Choose source (0–5):
If the exams/ folder does not exist, the program falls back to scanning the current directory.
mock_exam path/to/my_quiz.exam.json{
"title": "My Quiz Title",
"questions": [
...
]
}The title field sets the exam name automatically — no prompting needed.
{
"type": "multiple_choice",
"text": "Which planet is closest to the Sun?",
"options": ["Venus", "Earth", "Mercury", "Mars"],
"correct_option": 3,
"explanation": "Mercury is the closest planet to the Sun."
}options: 2–5 answer strings (shown as A, B, C…)correct_option: 1-based index of the correct option (3 = third option = C)explanation: optional, shown after answering
{
"type": "true_false",
"text": "The Great Wall of China is visible from space.",
"correct": false,
"explanation": "This is a common myth; it is far too narrow to see from orbit."
}{
"type": "open_ended",
"text": "Explain what a DNS server does.",
"sample_answer": "A DNS server translates human-readable domain names into IP addresses.",
"explanation": null
}sample_answeris shown after the user answers so they can self-assessexplanationis optional (usenullto omit)
| Score | Grade |
|---|---|
| 90–100% | A — Excellent! |
| 80–89% | B — Good |
| 70–79% | C — Satisfactory |
| 60–69% | D — Needs Improvement |
| < 60% | F — Please review the material |