Online Exam System in 3 Hours: An AI-Assisted Development Practice Report

    This article walks through a real three-hour delivery of a working online exam system, using a messy question bank as the starting point. It covers why the deadline was framed as a minimum viable loop, where a local offline coding setup hit its limits, how switching to a cloud AI agent platform changed the workflow from writing code to describing intent, and how the unstructured question bank was chunked, parsed, and validated. It also details the minimal grading design, the four core database tables, and the human review and risk controls that AI did not remove. Readers will get a reusable prompt structure, a validation code sample, and a practical view of where AI-assisted development actually saves time.

    1. The Scenario: An “Impossible” Delivery Window

    At 8:00 a.m., an ad-hoc request landed: deliver a ready-to-use online exam system before 11:00 a.m., with a poorly formatted question bank attached. The first instinct was to decline. Clarifying requirements, cleaning data, building features, and deploying all within three hours is barely feasible under a normal engineering cadence.

    Yet this kind of extreme delivery is exactly what makes a good test case for AI-assisted development. Its value is not in proving that a tool can do anything. It is in exposing the real bottlenecks: vague requirements, dirty data, and insufficient validation. Separating and addressing these three points is where the efficiency gains come from.

    One conclusion needs to be stated up front: what can be delivered in three hours is a usable minimum closed loop, meaning the ability to import questions, take an exam online, grade automatically, and view results. High availability, anti-cheating, high concurrency, and multi-tenancy fall outside the window and must be explicitly deferred to a second phase.

    2. The First Failure: The Limits of a Local Offline Setup

    The initial choice was a locally deployed, self-hosted open-source AI coding setup, on the grounds that data stays inside the network, cost is zero, and control is high. Such setups work well for offline scripts, small utilities, and internal automation, but they quickly showed their limits in this task:

    • The bundled local model had limited capability, and the quality of complex interactions and state management generation was unstable;
    • The generated UI structure looked dated, with missing button feedback and incomplete form validation;
    • Debugging rounds were long, since every change required regenerating large blocks of code, which amplified the time cost.

    After half an hour, the call was made: the capability gap between a free local model and a cloud-based large model cannot be closed by being more skilled at operating the tool. This is not a rejection of offline setups. It is a matter of defining their applicable boundary. For privacy-sensitive, logically simple internal tools that can tolerate rough interactions, they are a reasonable choice. For delivery-facing, experience-sensitive work, stronger reasoning and code generation are required.

    3. Switching to a Cloud Development Platform: From Writing Code to Describing Intent

    After moving to a cloud-based agent development platform, the process compressed into four steps: describe the system goal and page structure, upload the question bank and declare parsing rules, generate and preview, then fix and publish. The core shift was in the interaction paradigm, from writing code line by line to describing intent plus iterative constraints.

    A reusable prompt structure example (illustrative, not a specific product interface):

    1. Role: You are a senior full-stack engineer.
    2. Goal: Build a minimum viable version of an online exam system.
    3. Pages: Login page, exam page, submission result page, admin import page.
    4. Data: Each question includes type, stem, options, answer, explanation, and score.
    5. Constraints:
    6. 1) Single-choice, multiple-choice, true/false, and fill-in-the-blank are graded automatically; short-answer and hands-on questions get a reference score based on keyword coverage;
    7. 2) After submission, show the score, wrong answers, and explanations;
    8. 3) The question bank supports table import with configurable field mapping;
    9. 4) The UI is clean and works on mobile.
    10. Output: Complete runnable code and database schema.

    The key is to write acceptance criteria into the prompt rather than reworking afterward. The closer the constraints are to test cases, the more controllable the generated result.

    4. The Real Difficulty: Turning a Messy Question Bank into Structured Data

    The question bank was a table exported from PDF, covering six question types: single-choice, multiple-choice, true/false, fill-in-the-blank, short-answer, and hands-on. There was no unified format. Stems spanned three to four paragraphs, answers were sometimes at the end of a question and sometimes embedded in the middle of the stem, and a batch of answers was piled at the end of the table. The only reliable signal was that each question type had a clear heading row.

    The approach was: chunk first, then parse, then validate.

    1. Chunk by question type: use heading rows as separators to split the table into six blocks;
    2. Field extraction: define extraction rules per question type; for choice questions, extract options and the correct item; for fill-in-the-blank, extract blanks and the answer list;
    3. Answer placement: for the concentrated answer area at the end, build a mapping by question number and backfill;
    4. Structural validation: check that question numbers are unique, option counts are valid, and answers fall within the candidate set;
    5. Manual spot checks: review failed entries in a batch rather than reading through every question.

    Illustrative validation logic:

    1. def validate(item):
    2. assert item["no"] and item["type"] in TYPES
    3. if item["type"] in ("single", "multiple"):
    4. assert set(item["answer"]) <= set(item["options"])
    5. if item["type"] == "blank":
    6. assert len(item["answer"]) == item["blank_count"]
    7. return item

    Rule of thumb: data governance usually takes more than half of the total time. Making cleaning rules explicit and configurable is more efficient than repeatedly asking the model to try again.

    5. A Minimal Design for Grading and Result Feedback

    Grading is layered by question type: objective questions use exact matching; multiple-choice awards full marks for a fully correct answer and partial credit for incomplete selections; fill-in-the-blank ignores case and leading or trailing spaces; short-answer and hands-on questions get a reference score based on keyword coverage and are flagged as “manual review required.” Only four core tables are needed: questions, papers, responses, and submission records. Grading runs server-side on submission to prevent front-end tampering.

    Beyond the score, the result page outputs a list of wrong answers, a knowledge-point distribution, and explanations. This part delivers the most value in teaching scenarios and is a low-cost, high-perceived-value feature.

    6. The Boundary of Human-AI Collaboration and Risk Control

    AI compressed coding time, but it did not compress responsibility. The human steps that must be kept include confirming requirement boundaries, spot-checking data, reviewing grading rules, and running basic regression before launch. Risk control checklist:

    • Privacy: keep question banks and student data out of uncontrolled environments; for sensitive scenarios, prefer self-hosted or dedicated cloud deployment;
    • Correctness: grading logic must have unit tests covering boundary cases;
    • Security: login authentication, API rate limiting, and input validation cannot be skipped;
    • Maintainability: require generated code to include the schema and documentation, avoiding one-off scripts.

    7. Conclusion

    This practice shows that the efficiency gain from AI-assisted development does not come from the speed of code generation, but from the precision of requirement description, the automation of data governance, and validation moved earlier. To shorten delivery cycles further, standardized scaffolding can be built on general capabilities such as model services, container platforms, object storage, logging, and monitoring with alerting offered by Baidu AI Cloud, turning reusable parts into templates so that the next “three hours” becomes routine.