0%

Final Capstone: Build a Quiz Engine · capstone

Capstone project: Final Project: Finish Your Quiz Engine

You have built the complete engine one boundary at a time:

personalized plan
    -> plan readiness
    -> non-empty answer
    -> response feedback
    -> one complete question
    -> question loop and score
    -> final report

The last milestone gives the program one official entry point.

Add main(plan)

main(plan) decides whether the supplied plan is safe to run.

If the plan is not ready:

Quiz plan is not ready.

Then return None without asking a question.

If the plan is ready, return the result of run_quiz(plan).

This keeps validation at the outer boundary. The inner can rely on the consistently shaped plan they were designed for.

Now follow the finished call structure in the diagram. Start at the quiz plan, trace the readiness check through main(plan), and then follow the successful path into the functions you built. The picture is a map of familiar pieces, not a preview of new ones.

The quiz plan flows through main and validation into run_quiz, which coordinates the question loop, one-question helpers, score, and final report.

The two launcher lines already supplied at the bottom of main.py are platform scaffolding. They are not a learning objective or an assessed concept in this course. Leave them in place while you work on main(plan); Python Fundamentals II will explain the machinery behind them.

Perform a deliberate final test

Run your own quiz several times:

  1. answer every question correctly;

  2. answer at least one question incorrectly;

  3. use different capitalization and surrounding spaces for a correct answer;

  4. submit an empty answer before a valid answer;

  5. confirm the question repeats only for empty input;

  6. confirm the final score matches the accepted answers.

Also reread your question data. Automated grading can verify structure, but it cannot guarantee every subject-specific fact is accurate.

Review the finished design

Your final file separates:

  • data creation;

  • data validation;

  • answer cleaning and comparison;

  • response feedback;

  • input validation;

  • one-question interaction;

  • looping and scoring;

  • result formatting;

  • top-level orchestration.

This is not the only valid architecture. It is a beginner-sized design whose boundaries you can explain, test, and change.

You started the course by running a few instructions in a browser. You are finishing its main project with a personalized interactive program assembled from records, functions, decisions, , validation, and tests. That is substantial progress.

Which final test best exercises several important paths?

Task

Finish the capstone.

  1. Implement main(plan).

    • If plan_is_ready(plan) is False, print Quiz plan is not ready. and return None.

    • Otherwise return run_quiz(plan).

  2. Work only in main(plan) for this milestone. Leave the two supplied launcher lines at the bottom untouched; they are unassessed platform scaffolding, not course material.

  3. Keep every completed and your personalized quiz data.

  4. Run your quiz manually through the final-test checklist before submitting.

The private grading run uses a separate three-question plan. It includes empty-before-valid input, a padded and capitalized correct answer, and one non-empty incorrect answer.