Fix: multiple correct answers issue #24

Merged
olli merged 3 commits from dev into main 2026-10-15 14:09:33 +03:00
Owner

The quiz randomly had multiple correct answers but only recognized one.

The quiz randomly had multiple correct answers but only recognized one.
Add a daily glossary quiz with a Go backend and high scores
All checks were successful
CI / lint (push) Successful in 2s
CI / server (push) Successful in 56s
CI / image (push) Successful in 3s
CI / verify-staging (push) Successful in 50s
ffc1615235
A quiz makes the glossary something a team comes back to: ten questions
a day, dealt from graph.json, the same for everyone, with today's and
this week's high scores under public nicknames. It needs state the static
site cannot keep, so this brings in ROADMAP's phases 2 and 3 together:
a Go server beside Caddy, which proxies /api/ to it, and PostgreSQL.

The server deals and scores. It sends one question at a time without its
answer, times each from when the page asks for it, and allows one daily
round per player, so the tables cannot be posted to from a browser
console. Questions only use facts about one term or a counterpart-of
edge, since a missing edge does not prove an answer wrong; the tests
build every question every term can give, so a glossary edit that would
make a question with two right answers fails CI.

Players are a random token in a SameSite=Strict cookie, stored hashed.
Rounds go after two weeks and idle players after sixty days; addresses
are only counted in memory for the rate limits, which are set for a
whole office playing from one address.

CI tests against a PostgreSQL it starts in the job and pushes a second,
distroless image for the same commit. The runner needs Go and PostgreSQL's
server binaries, and the server's compose file the backend and its
database; both live in the kulpsin repository.
Keep terms linked to the answer out of a question's wrong answers
Some checks failed
CI / lint (push) Successful in 2s
CI / server (push) Failing after 29s
CI / image (push) Successful in 3s
CI / verify-staging (push) Has been skipped
27c87b4de4
A player answered OpenBao to "An app asks ▁▁▁ for database credentials at
start-up" and was marked wrong. The example is Vault's, but OpenBao is
Vault's API-compatible fork, so it was just as right.

With the name blanked out, an example or a summary can fit a fork, an
alternative or a managed version of the answer as well as the answer
itself. Questions of those two kinds now never offer a term the glossary
links to the answer, by any edge, as a wrong one. The test that builds
every question checks for it: before this, 466 of them across its seeds
offered a linked term, Argo CD for an example of Flux among them.
Definition questions are unchanged, since each summary describes only
its own term.
Keep CI's Go module cache deletable, and use the runner's sqlc
Some checks failed
CI / lint (push) Successful in 2s
CI / server (push) Successful in 24s
CI / image (push) Successful in 3s
CI / verify-staging (push) Successful in 51s
Release / find-image (push) Failing after 0s
Release / verify-production (push) Has been skipped
5770fee426
Go makes its module cache read-only, so the runner could not delete a
server job's workspace afterwards, and each run left its modules, some
800M with sqlc's, on the runner's tmpfs until it filled. -modcacherw
keeps the cache writable and the workspace removable.

sqlc now comes from the runner's image instead of being built from
tools/go.mod on every run, which was most of those modules. The job
first checks the runner's sqlc is the release tools/go.mod pins, so the
two cannot drift apart unnoticed.
olli merged commit 5770fee426 into main 2026-10-15 14:09:33 +03:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
olli/olli.puhakka.dev!24
No description provided.