KuaiJiZi C++ Tutor · Practice

How does automatic practice checking work?

Getting a program to run is only step one — the real question is whether the answer is right. Practice projects in KuaiJiZi C++ Tutor compare your program's output automatically, turning “done” into “correct”.

5 min read practice · auto-check · topic cards project-library exercises only

How the check works

The app compares your program's console output with the exercise's expected output and shows a result bar above the output area:

  • ✅ Output matches the reference — the exercise passes.
  • ❌ Output differs — both the expected output and yours are listed so you can see exactly which line diverges.
Automatic checking applies only to practice projects loaded from the project library. Free building and plain runs in the code editor are not judged — those are the places to experiment.

The full workflow

  1. Open the project library and load a practice project into the workspace.
  2. Solve it with blocks or by editing code directly.
  3. Press Run and wait for compiling and execution to finish.
  4. Read the result bar: a match means it passes; otherwise compare the two outputs and locate the difference.
  5. Fix and run again until it passes.

Using reference-answer code

Practice projects can carry optional reference code, reachable through “View / Import C++ code”, and it stays editable after import. Teachers can use this two ways:

  • Keep the reference to yourself and publish only the task plus expected output, so students solve it independently;
  • Reveal the reference when reviewing, and compare alternative solutions side by side.

Topic cards: answering “why”

Sooner or later a learner asks: “it passes, but why does it work?” Topic cards exist for that moment:

  • Content is organised by knowledge point, covering common exam topics and algorithm difficulties;
  • With AI configured (Settings → AI knowledge), code explanations and error analysis become available;
  • Topic content is archived, so reopening it is instant instead of repeating the request.

AI is optional — see the AI setup guide. Practice and automatic checking work without it.

FAQ

It says mismatch, but my answer looks right

Check the output format first: an extra space, a missing line break or an extra prompt line all count as a mismatch. Print exactly what the task asks for.

Why is free building never judged?

Because there is no expected output to compare against. Use a project-library exercise, or attach reference-answer code to a project.

Can I create my own exercises?

Yes. Package the statement and expected output as a practice project and, optionally, attach reference code — it can then be auto-checked.

The check fails although nothing looks wrong

A build failure produces no run output, so the check cannot pass. Fix the compile errors first (see the compile & run modes guide).

Also prepare the “why”

With AI knowledge configured, learners can get code and error explanations right where they get stuck.

AI setup guide Compile & run modes