Josepia Tobias
AI & Automation · LMS engine room and enrollment engine

The engine room behind the LMS.

An AI content engine that writes adaptive lessons and quizzes from a teacher's own material, and a serverless automation layer that runs billing, parent messaging, reports and notifications every day without anyone at the desk. Plus the TTC Online enrollment engine, tested in n8n against the GoHighLevel API.

7adaptive versions generated per quiz item
3AI response formats normalized: OpenAI, Anthropic, Gemini
9automated message types to parents
0servers to maintain
Pipeline 01

The AI content engine

A teacher pastes a reading, notes or a chapter and chooses the question types. The engine plans, generates in parallel, checks every item and returns a complete adaptive quiz or a three-level lesson, ready to schedule.

InputTeacher sourceNotes, a passage or a chapter, plus grade and question types
PlanTopic plannerSplits the source into exactly N topics so every item covers new ground
GenerateParallel batchesSmall batches sent concurrently, each told its topics and its question types
RouteAI endpointApps Script with multi-provider failover, or a Make scenario
VerifyParse and validateNormalize, repair JSON, enforce type and count, top up missing items
PublishFirestoreSaved as adaptive slots; scheduled to the grade

Grounded by design

Every prompt carries hard rules: use only what is in the source text, stay at the students' grade level, and write each item in seven versions (three Bloom's levels, Guided, Power Round, Deep Think and Quick Check). The topic planner works only from the source, so nothing outside the lesson can enter the quiz.

Output the system can trust

Responses pass through a provider normalizer that understands OpenAI chat, OpenAI Responses, Anthropic content blocks and Gemini candidates. Text is cleaned of code fences and smart quotes, broken JSON is repaired, and a strict and a lenient parser compete; the one that yields more gradable items wins.

Exact counts, exact types

Each batch is checked against the question types it was assigned. A wrong type triggers one corrective retry with an explicit reminder. If the merged result is short, small top-up batches run until the requested count is reached, and every item is renumbered so IDs never collide.

Failure handled, not hidden

Errors are classified as retryable or final. Rate limits and overloads wait 12 to 15 seconds and try again; timeouts and empty answers retry once. A Make scenario that answers "Accepted" instead of content is detected and reported in plain words.

Cost-aware

An economy mode for free automation plans plans topics locally, sends larger batches and caps retries, so a full adaptive quiz costs the fewest possible operations. If the endpoint is ever unavailable, the teacher gets a ready prompt for any AI assistant instead.

Adaptive at run time

Generation is only half of it. While a student answers, the quiz picks which of the seven versions to show next from speed, accuracy and error streaks, keeping the same item count and points for everyone.

Pipeline 02

Serverless automation with a leader lock

The LMS has no backend server. Automation runs from the staff devices that are already open, so it has to be safe when several are open at once.

ClockEvery 60 secondsEach staff device checks what is due
LockLease in FirestoreA transaction grants one device a 6-minute turn; it is released when the page closes
RunDue jobs onlyBills, reminders, reports, notifications
RecordResumable runsEach run records who was already served, so a crash never double-sends
GuardQuota-awareAt the database daily limit, jobs pause for an hour and catch up

Monthly billing

Bills for the month are generated automatically, including an early run for bills due on the first.

Payment reminders

Before the due date, on the due date and while overdue, with optional automatic deactivation and a per-account hold.

Weekly reports

Per-student, per-course performance reports at a set day and time, every one or more weeks, resumed if interrupted.

Monthly report cards

Grades, effort and a short comment, emailed to each family on schedule.

Pipeline 03

One relay for every message

The LMS decides what to send and when. A single webhook relay per program delivers it by SMS and email, and every message is logged with its delivery status.

EventLMS triggerWelcome, invoice, due soon, due today, overdue, paid, report, report card, trial
RouteProgram relaySeparate relays for the center and TTC Online
DeliverApps Script or MakeCORS-safe calls; the key travels in the body for Apps Script
SendSMS and emailCarrier-safe wording, so texts are not silently filtered
LogMessage logEvery send recorded with status for the admin

Push notifications

Firebase Cloud Messaging on the LMS's own project: new lessons and quizzes for a grade, due-tomorrow and leaving-soon alerts once a day, a teacher's private message, and a checked assignment, delivered to phones even when the LMS is closed.

Ledger to Google Sheets

Payment sessions sync to a Google Sheet through an Apps Script web app, throttled and written with a heartbeat timestamp, so any downstream automation can tell how fresh the data is before acting on it.

Pipeline 04 · Prototype · Lead capture and CRM

The missing piece: where each family comes from

The live TTC Online flow (sign-up, trial, billing, payment proofs) runs inside my LMS. This prototype adds the part it lacks, tracking and CRM follow-up, as a tested automation. Parents come in from our Facebook reel and use the same sign-up form as the live site, each child gets a trial account on the spot, three days of follow-up respect quiet hours, and the family is credited to the source that brought them in. It runs live in the browser, and as an n8n workflow against the GoHighLevel API v2.

CaptureSign-upMy live form's fields + reel UTM
ReceiveWebhookIdempotency key
CleanValidate + normalizePH mobile to +63
DecideDedupe + scoreSibling or duplicate, grade band
CRMParent + trialRetry, dead-letter, replay
Follow upEmail + SMSQuiet hours, carrier-safe
Two real n8n executions of the TTC Online enrollment workflow

Two real n8n executions: a sibling sign-up (same parent, new trial) and a CRM outage (three retries, dead-letter queue, ops alert).

Rules that come from running a real center

  • A second child is a sibling, never a duplicate
  • Texts never contain words carriers filter, so sign-in goes out as "u:" and "p:"
  • One free trial per child: the same child with the same email or mobile is stopped
  • Confirming payment stops every reminder at once
  • Every CRM call retries three times, then the sign-up is kept and the team is alerted
  • Ten automated tests guard all of it
Design decisions

Why it is built this way

No single provider

The engine speaks to one endpoint. Behind it, an Apps Script can try several AI providers in turn, or a Make scenario can be swapped in. Changing models never touches the LMS.

The machine checks; people decide

Generated content lands as a draft the teacher schedules. Automation removes the routine work and leaves the judgment calls with a person.

Free-tier engineering

Leases, throttles, resumable runs and quota pauses keep a whole school's automation inside free plans, which is what makes it viable for a small center and for the schools that license it.

See it from the teacher's side

Sign in with the demo teacher account (username teacher, password 1234) and open Quizzes or Lessons to generate content.