A Practical Guide to Generating a Classroom Assignment Tracking Webpage Using Large Language Models
This article explores how educators can use Large Language Models (LLMs) to generate a fully functional classroom assignment tracking webpage. By translating teaching requirements into structured prompts, teachers without a programming background can leverage LLM code generation capabilities to build interactive web tools featuring drag-and-drop submissions, visual feedback, and built-in timers. The guide details the entire process from requirement analysis and prompt design to core implementation logic and feature iteration, offering a replicable paradigm for solving everyday teaching challenges with AI.
A Practical Guide to Generating a Classroom Assignment Tracking Webpage Using Large Language Models
In daily teaching management, questions like “who submitted the assignment, who hasn’t, and how long it took” seem trivial but consume a significant amount of a teacher’s energy. Traditional methods rely on paper registers or spreadsheet software for manual recording, which is inefficient and lacks classroom interactivity. As the code generation capabilities of Large Language Models (LLMs) mature, teachers no longer need to rely on professional development teams. By describing their requirements in natural language, they can have the model directly output runnable webpage code. This article uses a “Classroom Assignment Submission Status Tracking Webpage” as an example to completely break down the practical path from requirement analysis to feature iteration.
1. Clarify Requirements: Think First, Then Prompt the Model
The prerequisite for an LLM to generate high-quality code is that the requirement description is sufficiently clear. Before starting, it is recommended to break down the core capabilities of this small tool into four dimensions:
- Status Visualization: Each student corresponds to an identifiable graphical element (such as a colored dot with a name), making uncompleted and completed statuses clear at a glance;
- Interactive Feedback: After completing an assignment, students drag their identifier from the “Pending Submission” area to the “Submitted” area, creating a sense of ceremony and participation;
- Incentive Mechanism: The top three students to finish receive a special visual identifier (like a crown badge) to stimulate classroom enthusiasm;
- Process Timing: Timing starts when the first student submits and automatically stops when all students have submitted, helping teachers evaluate assignment difficulty and completion efficiency.
Organizing these dimensions into a structured prompt is the foundation for all subsequent work.
2. Designing the Prompt: A Four-Part Structure
A high-quality prompt typically contains four elements: role setting, interface layout, interaction rules, and output format. A reference structure is as follows:
You are a senior front-end engineer. Please design a classroom assignment submission status tracking webpage:1. The left side of the page displays several colored circular identifiers, each with a student's name inside;2. The right side is a semi-transparent receiving area where students can drag their corresponding dot into;3. The top three completed dots automatically overlay a crown badge;4. Built-in timer: starts timing on the first successful drag, stops and displays the total duration when the last dot is placed;5. The overall visual style uses a soft blue color scheme to create an ocean atmosphere;6. Output as a single HTML file with inlined CSS and JavaScript, runnable directly in a browser.
There are a few key techniques here: First, explicitly request “single-file output” to prevent the model from splitting it into multiple files, which makes it difficult for beginners to run. Second, specifying the interaction method “drag and drop” prompts the model to automatically choose HTML5 native drag-and-drop events (dragstart, dragover, drop) or a mouse event implementation. Third, providing imagery for the visual style (like “ocean atmosphere”) often leads the model to deliver unexpected details in gradient backgrounds and wave decorations.
3. Implementation Logic of Core Interactions
Understanding the technical logic behind the model-generated code helps teachers troubleshoot issues and make secondary modifications themselves.
1. Drag and Drop Logic: The key to implementing the native Drag and Drop API is setting draggable="true" for the dot element, recording the dragged element’s ID via dataTransfer.setData in dragstart, listening to dragover in the receiving area and calling preventDefault() to allow the drop, and finally completing the DOM move in the drop event. The sample code is as follows:
zone.addEventListener('drop', (e) => {e.preventDefault();const id = e.dataTransfer.getData('text/plain');const ball = document.getElementById(id);zone.appendChild(ball);onSubmitted(id); // Record rank, check timer});
2. Ranking and Crowns: Maintain a counter that increments every time a dot successfully drops into the receiving area. When the count is less than or equal to 3, dynamically insert a child element with a crown icon into the dot. At the same time, write the rank, student’s name, and timestamp into a results array for the statistics panel to consume.
3. Timer: Record Date.now() as the start time on the first submission, and use setInterval to refresh the display every second. When “number submitted === total number”, clear the timer and lock the final duration. Note that time formatting (HH
SS) must handle zero-padding logic.
4. Feature Iteration: From Functional to User-Friendly
Once the basic version is running, real classroom scenarios will present more requirements. At this point, you can append prompts to have the model incrementally modify the existing code.
1. Top Statistics Panel: Request dynamic display of information like “Completed: 15/40 people” or “Fastest: John Doe 00:02:15”. In implementation, this monitors changes in the status array and re-renders the statistics area. This allows teachers to grasp the overall progress at a glance without counting one by one, and is convenient for screen projection.
2. Rank Tooltip: When hovering over a submitted name, display “Completed Rank X” as a tooltip. This satisfies the student’s sense of achievement and makes the incentive rules transparent.
3. Batch Roster Import: This is a crucial step towards practicality. Hardcoding student names into the code is unsustainable; an “Upload Excel Roster” button should be added. A pure front-end solution can introduce a spreadsheet parsing library to read the uploaded .xlsx file, extract the name column, rebuild the dot list, and reset the timer and ranking status. The corresponding prompt can be written as:
Add an "Upload Roster" button at the bottom of the page, supporting parsing the first column of an Excel file as student names.After uploading, automatically rebuild the left dot list, clear the submitted area, and reset the timer and statistics.
It should be noted that the upload function involves file parsing. The model should be prompted to implement basic error handling for empty sheets, duplicate names, and non-spreadsheet files to avoid on-site classroom errors.
5. Further Engineering and Usage Suggestions
First, Data Persistence. The current solution loses state upon page refresh. You can ask the model to add automatic saving based on browser local storage, or in a neutral backend scenario, write submission records to object storage or a database, combined with logging services for end-of-semester analysis.
Second, Multi-Device Adaptation. Classrooms commonly use touch interactive whiteboards and tablets. Native HTML5 drag-and-drop has inconsistent compatibility on touch screens. You can request the model to use Pointer Events to uniformly handle mouse and touch dragging.
Third, Privacy Compliance. Student names are sensitive information. If any cloud service is integrated later, desensitization or ID-based anonymization should be applied, complying with institutional data management regulations.
Fourth, Prompt Iteration Method. Do not expect perfect results in one generation. It is recommended to adopt a “generate - run - record issues - targeted follow-up” cycle, raising only one type of modification per prompt. The accuracy of the model’s changes will significantly improve.
Conclusion
The value of this case study lies not in the webpage itself, but in demonstrating a replicable paradigm: translating real pain points in teaching into structured natural language requirements, handing them to an LLM to generate code, and then continuously refining it through multiple rounds of dialogue. Scenarios such as assignment tracking, classroom random selection, group scoring, and recitation check-ins can all apply this same approach. By mastering the three-step method of “requirement breakdown + prompt design + iterative validation,” educators without programming knowledge can also have digital tools customized for their own needs.
