# Trilhar: a study video that listens to itself

> Why we started Trilhar, an early and free study app for Portugal's national exams, and how its videos and questions are made and checked while no teacher reviews them yet.

Case study · Clandestine Hours · 2026-10-20 · https://clandestinehours.com/notes/a-study-video-that-listens-to-itself/

- **Product:** Trilhar, our own: free study paths to Portugal's national exams, with short videos and questions along the way
- **Content:** 45 videos and 1,785 questions across Biologia e Geologia (exam 702), Matemática A (exam 635) and Física e Química A (exam 715), on 20 October 2026. The site marks the last two as previews. Six interactive pages, all marked prototype.
- **Stack:** HTML and SVG scenes · Chatterbox Multilingual pt-PT for the voice · Whisper to hear it back · Playwright and ffmpeg to render · an app on Cloudflare Workers · three.js for the 3D pages
- **Timeline:** First commit on 12 October 2026 · online at trilhar.app the next day
- **Status:** Early: not yet version 1. The content is still growing, and what is there is still being improved.

Trilhar started with something we heard. Someone wanted to go to university. For several reasons, they took a different route. Now they don't know where to start, and the material looks overwhelming.

[Trilhar](https://trilhar.app/) is our attempt to help with that. Recent AI tools let a small team make video explainers, interactive pages and quizzes. Trilhar uses them for Portugal's national exams, starting with Biologia e Geologia. A student follows a path through the subject: a video, then its questions, then the next step. It is free.

It is early. It is not yet at version 1. The content is still growing, and we keep improving what is there.

The content is made with AI from official sources: the curriculum, past national exams and their marking criteria, and certified textbooks. No teacher has reviewed it yet. The site says so, and says the content can contain errors. So the checks we rely on are automated, or done by separate reviewer agents. This note describes how a video and its questions are made and checked, and where the interactive pages stand.

## A video starts as a text file

Each video is one Markdown file. It holds the narration, line by line, and the questions. A build step turns it into a narration script and the data for the scenes. The scenes are an HTML page with animated SVG diagrams, timed to the narration. Playwright captures the page frame by frame, and ffmpeg joins the frames and the audio into a vertical MP4 for a phone. The page may not use random numbers or the clock, so a re-render gives the same frames.

*Diagram: Each video starts as one Markdown file. The build splits it into narration and scene data. Whisper hears every narration line back, and the best-scoring take is kept. The render runs in a staging folder, and the MP4 and its captions go live together. The questions also take a second route: they become cards after the video, with a still of any figure they need.*

## Four checks before a video is listed

The app lists a video only once it is marked as reviewed. To get there, it passes four checks, each recorded in the video's notes. The author lists a source for every claim. A second agent, which did not write the video, checks each claim against those sources. A third tries to break it: two defensible answers, a misconception, a wrong arrow in a diagram. A fourth reads it as a 15-year-old who never took the course, and looks for undefined terms and jumps.

These reviews find real problems. On 13 October the fourth one sent all eleven videos for the 10th year back to draft until they were fixed. They still miss things. Every video and question has a «Reportar erro» button for that.

## Questions inside the video

Every one to two minutes the video stops for a question. It is written like an exam item: a question and four options, one of them correct. The voice says only a short prompt, and the screen holds the question for six to eight seconds. Then the voice gives the answer and one sentence on why. The build warns when the right answers in a video lean too much on one letter.

The same questions appear again after the video, as cards in the path. A wrong answer offers a link back to the part of the video that teaches it.

## Every line is heard back

The narration is a synthetic pt-PT voice, Chatterbox Multilingual, run on our own machine. A synthetic voice can mispronounce a key term. We can't listen to every video by ear after every change. So a speech-to-text model, Whisper, listens to each line.

For each line, the script records a take and Whisper writes down what it hears. The script scores the take on the caption words heard in order, and on a list of hard terms that must be heard. If the take scores too low, it records more takes and keeps the best. Lines that still score low are marked for a closer look.

The checker had bugs of its own. It once said a correct «zero» was missing, because Whisper often wrote small numbers as words. Now it reads number words as values. In one video, the smaller Whisper model scored a wrong take as high as a right one. A line can now be pinned to a take that a larger Whisper model confirms.

A re-render works in a staging folder. The new MP4 and its captions replace the old ones as a pair, after the MP4 passes its checks.

## A question that needs the video

Some questions point at a graph or a table that the video shows. The first version of the cards after the video showed the text alone. «O gráfico representa…» with no graph reads as broken.

The build now finds these questions. It looks for a figure in the question's scene, and for words like gráfico, figura, tabela or esquema in the question. The first scan found 25, and four of them already described the figure in words. Now a still of the figure is cut from the video and shown above the question. A question without its still stays out of the cards until the still exists.

## The interactive pages

The newest part is six interactive pages, first built on 20 October 2026. They cover faults, cells, volcanoes, reading a rock section, a moving car with its graphs, and a parabola. A guide walks through the idea one step at a time, and each step asks the student to act on the object: drag the block, tap a part, turn the cell. A page may only state facts from the reviewed supporting sheet of the video it comes from.

Reviewers that did not build a page test it by touch on a phone-sized screen. They found real errors. The motion page accepted a movement with the wrong average velocity. On the faults page, one natural drag made a reverse fault while the text still said it was right. No page has passed review yet. All six say «protótipo», on the page and in the app.

## What we learned

- **Treat the checker as a suspect.** Some of our narration bugs were in the scoring code.
- **A question can travel without its figure.** It pays to check for that early.
- **Replace the video and its captions together.** Otherwise the student sees captions out of step with the voice.
- **Test with a finger on a small screen.** The interactive bugs above turned up when reviewers tested by touch on a phone-sized screen.
