In a busy gymnastics lesson, the teacher cannot stand beside every pupil at the same time. One group may be receiving hands-on guidance while other groups still need a clear task, a model to copy, and meaningful feedback. This classroom reality inspired Gym Balance Pro, an interactive balance and strength trainer for primary school gymnastics.
In the original PESTA email discussion, Jason Lum explained the intended learning flow: pupils practise balance poses, hold each position for three seconds, explore different variations, and use functional strengthening exercises when greater stability is needed. The aim was not to automate the teacher. It was to keep pupils purposefully engaged and give them a simple feedback loop while the teacher rotated among groups.
Starting with a Gemini prototype
The first version was created through vibe coding in Google AI Studio with Gemini. The app demonstrated the core idea of using a webcam and pose estimation to recognise a pupil in view, monitor a balance hold, and progress through a set of challenges.
I downloaded the source code from Google AI Studio as a project ZIP. This made it possible to run the code locally and examine what would be required for use inside SLS.
The prototype worked on an external host, but SLS presented a more demanding environment. Camera permission had to work within the learning platform, and the browser's Content Security Policy blocked scripts loaded from a public content delivery network. MediaPipe also attempted to fetch additional model and WebAssembly files at runtime, which produced access errors in the SLS-hosted package.
Using the Codex app to make it work in SLS
I used the Codex app to trace each browser error, inspect the MediaPipe loading process, and rebuild the project as a self-contained SLS interactive.
The camera, drawing, pose-estimation, model, and WebAssembly assets were copied into the project instead of being loaded from an external CDN. The build process was then adapted to embed the secondary MediaPipe assets into the final package. This resolved the Content Security Policy and 403 errors that appeared only after the interactive was uploaded to SLS.
The resulting version now includes:
- seven balance activity types: one-point, two-point, three-point, four-point, airplane, flamingo, and knee-hug balance;
- three progressive holds within each activity;
- camera-based body landmark detection and a stillness check for the required three-second hold;
- a visible hold-progress indicator and completion count;
- a teacher-check mode when a camera is unavailable, permission is blocked, or direct observation is preferred;
- immediate status messages that guide the pupil into view and through the hold;
- an automatic prompt to visit the Strength Lab when a pupil is struggling;
- five supporting drills: dynamic skipping, prone extension or Superman, stork stand, forearm plank, and elevated plank;
- xAPI evidence containing the activity, completion score, mode, timing, and text feedback.
One especially important improvement came from classroom testing. A pupil could see that the camera was active but might still wonder, "What shape am I supposed to make?" Codex was used to add a clear stick-figure scaffold beside every balance activity and every Strength Lab drill. Each guide includes a simple shape, a short description, and focused movement cues.
That visual scaffold changes the experience significantly. The camera is no longer an unexplained judge. The pupil can compare a target shape, attempt it, observe progress, and adjust.
Privacy by design
Camera-based learning understandably raises privacy and PDPA questions. The SLS-ready version therefore processes camera frames live in the pupil's browser. The saved evidence does not contain photographs, video, or raw pose landmarks. It records only the learning information needed for review, such as the selected activity, whether each hold was completed, the duration, the use of camera or teacher-check mode, and text feedback.
This distinction is important. The camera is used as a temporary sensor, not as a recording device.
The teacher-check fallback is equally important. If a device lacks a camera, the pupil declines permission, or the browser cannot start pose estimation, the teacher can still validate each attempt manually. The learning sequence remains usable.
Why this is useful for sports learning
Gym Balance Pro has several features that make an interactive worth pitching for PE and sports education.
First, it provides a clear success criterion. "Hold this balanced shape with control for three seconds" is specific, observable, and easy for a pupil to understand.
Second, it supports purposeful repetition. Pupils complete three variations rather than repeating one pose without reflection. The progress indicator makes practice visible without turning the activity into a high-stakes test.
Third, it links performance to physical preparation. When stability is difficult, the pupil is directed to an appropriate Strength Lab rather than simply being told that the attempt failed. This connects the visible outcome to trainable qualities such as ankle control, core tension, posterior-chain strength, shoulder stability, and elastic footwork.
Fourth, the stick-figure guides reduce ambiguity. In movement learning, concise visual information can often be understood faster than a paragraph of instructions, especially in a noisy activity space.
Finally, the interactive supports station-based pedagogy. While the teacher provides close feedback to one group, another group can follow the scaffold, practise, and collect simple evidence. The saved result can help the teacher decide who is ready to progress and who may need closer observation.
From AI-generated prototype to classroom resource
This project demonstrates a productive relationship between educators and generative AI. Gemini helped create the first working camera prototype quickly. The downloaded code provided something concrete to discuss and test. Codex then supported the less visible but essential work: debugging platform restrictions, localising dependencies, protecting privacy, creating fallbacks, improving the movement scaffolds, integrating xAPI evidence, and packaging the activity for SLS.
The final quality did not come from a single prompt. It came from an iterative loop of teacher feedback, browser evidence, source-code inspection, modification, rebuilding, uploading, and testing in the real platform.
Project files
- Live interactive: Launch Gym Balance Pro
- Shareable source package:
gym-balance-pro-v2-(no-pic-strength-lab-version)-source.zip - SLS upload package:
gym-balance-pro-sls.zip
The source package excludes node_modules, generated build folders, environment files, and other unnecessary bulk. It retains the local MediaPipe runtime assets because they are part of the SLS camera solution.
Acknowledgement: The educational problem and prototype context came from Jason Lum and the PESTA digital think tank team's exploration of secure camera-based movement feedback. The initial app was prototyped in Google AI Studio with Gemini, then further developed, scaffolded, debugged, and packaged using the Codex app.