Prepare VPS handover: bootstrap, doctor, DB backup, systemd unit, backend deploy, operations guide; commit docs sources previously ignored

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
denis
2026-10-16 23:15:14 +02:00
parent fb3c539eee
commit a4df92a7c6
43 changed files with 2369 additions and 8 deletions
+45
View File
@@ -0,0 +1,45 @@
# Accessibility and settings
PyQuest aims at **WCAG 2.2 AA**. The **Settings** button opens the following panel.
## Settings
| Setting | Effect |
|---|---|
| Language | French or English; the current level restarts in the new language |
| Text size | from 80% to 200% |
| Theme | automatic (follows your system), light or dark |
| Guide character | shows or hides the encouragement bubbles |
| Sound effects / Volume | success and error sounds, can be turned off; "Test the sound" |
| Voice / Speed | the "Listen" button of explanations, can be turned off; "Test the voice" |
| Author mode | shows the link to the [level editor](../contribute/author-editor.md) |
Sound and voice **never** start on their own. No information is conveyed by sound or colour alone: every result is
also written ("Well done, that's correct!", "Not yet.").
## Keyboard
Everything works without a mouse.
| Key | Action |
|---|---|
| `Tab` / `Shift + Tab` | move between controls |
| `Ctrl + Enter` (`Cmd + Enter`) | run the cell |
| `Esc` | close the "Levels" or "Settings" panel (focus returns to the button that opened it) |
| `Tab` in the code editor | indent; `Esc` then `Tab` to leave the editor |
While a panel is open, the rest of the page is set aside and focus stays inside.
## Screen readers
Controls have explicit names, results and errors are announced (`role="status"` regions), the progress map and
badges have their states in text, and the canvas drawing has a description and a list of lines.
!!! note "Feedback welcome"
The app is tested automatically, but a try with a real screen reader (Orca, NVDA, VoiceOver) remains the best
check. If something is not announced or is confusing, report it: it is a defect to fix.
## Offline
PyQuest is an installable web app (PWA). After a first complete load it works without a connection; your browser
may offer to install it.
+65
View File
@@ -0,0 +1,65 @@
# Writing and running code
## Cells
Each exercise has a **cell**: a code area, and below it the output and the validation result.
| Action | How |
|---|---|
| Run | **Run** button or `Ctrl + Enter` (`Cmd + Enter` on Mac) |
| Stop a running program | **Stop** button (useful against an infinite loop) |
| Start over | **Reset** button: restores the starting code |
| Hint | **Hint** button: one more hint at each click |
| Solution | "Show the solution", below the cell |
Between runs, **variables are kept** from one cell to the next within a level, like in a notebook.
## Indenting with the Tab key
Python is structured by indentation. In the editor:
- **Tab** inserts spaces (4, aligned to the next column); with several lines selected, it indents them all.
- **Shift + Tab** dedents.
- **Esc then Tab** **leaves** the code field, so keyboard navigation never gets stuck. As soon as you type in the
editor again, Tab indents again.
## Errors
When your code crashes, PyQuest shows:
- the translated error **type** ("Python does not know this name");
- a plain-language **explanation** and a **tip**;
- the **line** concerned;
- Python's real technical message, under "Technical details", so you learn to read it.
## Reading data with `input()`
When your program calls `input("Your name? ")`, an input field appears under the output: type your answer and
validate with **Enter** or the **Send** button. The question is shown as in a real terminal.
!!! note
Interactive input needs the page to be served with the isolation headers (see
[Deployment](../host/deploy.md)). Without them, `input()` raises `EOFError`: that is a hosting issue, not a
problem with your code.
## Files
Python can read and write files. In the browser, **only the `data/` folder is kept** when you close the page (for
example `open("data/agenda.txt", "w")`). Any file written elsewhere disappears on reload.
## Drawing with `canvas`
From level 13 you have a drawing sheet:
```python
import canvas
canvas.line(0, 0, 100, 0, "red") # a red line from (0, 0) to (100, 0)
canvas.line(0, 0, 0, 100, "blue")
```
- The point `(0, 0)` is at the **centre**; positive numbers go **right** and **up**, up to 200.
- Colours: `black`, `red`, `green`, `blue`, `orange`, `purple`, `gray`.
- `canvas.clear()` wipes the sheet. **Each run starts from a blank sheet.**
- The drawing appears under the cell with a **written description** and the **list of all lines** ("See the list
of lines"): nothing is conveyed by the image alone.
+40
View File
@@ -0,0 +1,40 @@
# Getting started
## Open PyQuest
Open your PyQuest instance in a recent browser (Firefox, Chrome, Edge). The Python engine loads on first start
(a few seconds); after that the app remembers everything and works **offline**.
You land on your **first unfinished level**. To open a specific level, use the **Levels** button (see below) or a
direct link like `https://…/#/levels/05-decide`.
## A level, step by step
A level is a series of steps shown one after the other:
1. **Explanation**: a short text. When a **Listen** button is present, a voice reads the text (never
automatically: you click).
2. **Code exercise**: an instruction and a pre-filled code cell. You edit, run, and see the result and the
validation.
3. **Final mission**: a small program that brings together what you just learned. Completing it finishes the level.
The **Continue** button moves to the next step. The **Previous level** and **Next level** buttons at the top
change level.
!!! tip "Don't panic"
Mistakes are normal: the error is explained, and you can ask for **hints** (from vague to precise) or, as a
last resort, show the **solution**.
## The "Levels" button
It opens a panel with:
- the **path map**: each level is a dot, with its state written out in words ("Done", "In progress", "To do");
- the **badge shelf**: badges you earned (with the date) and those still to unlock.
Choosing a level on the map opens it directly: nothing is locked.
## The guide character
A little character encourages you after a success, offers a hint when you are stuck, and welcomes you back after a
break. It never judges. You can hide it in the [settings](accessibility.md).
+47
View File
@@ -0,0 +1,47 @@
# Progress and backup
## XP, badges, streak
- **XP (experience points)**: each level is worth some points, granted **only once**, when you complete its **final
mission**. Redoing a level earns nothing more.
- **Badges**: rewards for milestones (first level, three levels, 100 XP, 3-day and 7-day streaks).
- **Day streak**: the number of consecutive days you practised. Missing a day resets it to 1, without blame.
Nothing is locked: points and badges only measure your progress.
## Where is my progress saved?
**In your browser**, on your device (local storage). You do nothing. Beware: clearing the site's data, or switching
browser or device, makes it disappear. Two solutions below.
## Back up to a file (no server)
**Settings → Progress backup**
- **Export my progress** downloads a `pyquest-progress-YYYY-MM-DD.json` file.
- **Import progress** reads such a file and **merges** it with your current progress: all levels and badges are
kept, nothing is ever lost. The app tells you how many levels are new.
Keep the file or copy it to another device. An invalid file is refused without changing anything.
## Sync between devices (optional)
If your PyQuest instance offers sync (a server with the sync module), you can find your progress everywhere,
**without creating an account**.
**Settings → Sync between devices**
1. On the first device: **Turn on sync**. A **secret token** is created and shown.
2. On the second device: paste that token into "Or paste the token from another device", then **Link this device**.
The two progresses are merged.
3. After that it is automatic: at startup, when the network returns, and shortly after each completed level.
**Sync now** forces an exchange.
!!! warning "The token is like a password"
It gives access to your progress. Do not share it. **If lost, it cannot be recovered**: the server only keeps a
fingerprint of it. Also make a file backup.
- **Turn off (keep the server data)** stops syncing on this device.
- **Turn off and erase the server data** permanently deletes what is stored for this token.
- **Offline** or server unavailable: a message says so, your local progress stays intact and syncing resumes by
itself.