Statement editor
How to write a problem statement – text, the block menu, equations, code, images, links, sample tests and the preview.
When you open a problem from the archive, the statement editor is on the left and the settings pane on the right. The address is /library/problems/<problem>/edit. Only the problem’s editors can change the statement; everyone else sees it as students do.
Wiki pages use the same editor, without sample tests, hints and checks.
staff/library/statement-editorWriting
Section titled “Writing”- The problem title is at the top. Enter or ↓ moves the caret into the text.
- An empty line shows the hint Type / for blocks, [[ for a wiki link, or $ for an equation.
- The Write / Preview as student switch at the top shows the statement as a student will see it.
The toolbar has Heading, Bold, Italic, Inline code, Bulleted list, Numbered list, Link, Image, Equation, Sample test and Note.
Markdown-style input works while you type:
| Type | You get |
|---|---|
# or ## and a space at the start of a line |
A heading |
### and a space |
A subheading |
- or * and a space |
A bulleted list |
1. and a space |
A numbered list |
``` |
A code block |
**text**, *text*, `code` |
Bold, italic, inline code |
$ … $ |
An inline equation |
$$ and a space on an empty line |
An equation block |
The “/” block menu
Section titled “The “/” block menu”Type / to open Insert block:
| Block | For |
|---|---|
| Sample test | An input and output pair shown to students. |
| Equation block | A display equation. |
| Code block | Program code. |
| Hint (collapsed) | Text students open themselves when they need it. |
| Image | An image with a description. |
| Note, Warning | A highlighted block with an icon. |
| Heading, Subheading, Bulleted list, Numbered list | Text. |
Keep typing to filter: Lithuanian and English words both work, and diacritics are optional (uzuomina finds “Užuomina”). Choose with ↑ ↓ and insert with Enter or Tab.
Block handles
Section titled “Block handles”Hovering a block shows, on its left:
- + (Add a block below) – opens the block menu on a new line;
- ⋮⋮ – drag to move the block, or click for Move up, Move down, Duplicate and Delete.
From the keyboard, Alt Shift ↑ / ↓ moves the current block. Handles are hidden on narrow screens.
Equations
Section titled “Equations”You can write equations without knowing LaTeX:
- Click Equation (Ctrl Shift E) or type
$…$. For a display equation, use Equation block. - In the popover, click the symbol buttons (Insert symbol): ≤, ≥, ≠, power, subscript, square root, fraction, sum, floor, multiplication sign and ellipsis. Each is inserted with a selected placeholder you can type over.
- If you know LaTeX, type it in LaTeX, optional.
<=,>=and!=become ≤, ≥ and ≠. - The formula, or an error (Check the formula: …), appears below as you type.
- Click Done. An empty equation is removed when the popover closes; Remove equation deletes it.
Enter opens a selected equation. In the equation field, Enter finishes editing (in an equation block, Ctrl Enter). Equations are rendered with KaTeX.
Code, notes and hints
Section titled “Code, notes and hints”- Code block: pick the Programming language in the top-right corner – Plain text, C++, Python, Java, C#, Pascal or JavaScript. Tab indents inside the block.
- Note and Warning: the icon button switches the kind (Change to a warning / Change to a note).
- Hint: shown open in the editor, collapsed for students.
- Enter on an empty last line of a note or hint leaves it; Backspace in an empty one removes it.
Links and wiki pages
Section titled “Links and wiki pages”- Select text and click Link (Ctrl K).
- Choose Where the link goes: Web address (only
https://…,http://…andmailto:…) or Wiki page. - Click Apply. Remove link removes it.
Typing [[ is a faster way to link a wiki page: a page search opens (diacritics optional), and Enter or Tab inserts the page’s title as a link. The link points to the page, not its title, so renaming the page doesn’t break it. Only pages you can read are offered. Pasting a wiki page’s address also links the page, and resting the pointer or the caret on a wiki link shows the page’s preview (wiki links). Students see the linked pages and the related wiki pages under the statement (see the Wiki card in Problem settings and wiki links).
Images
Section titled “Images”Insert an image with the Image button, from the block menu, or by pasting or dropping a file into the text. PNG, JPEG, GIF and WebP up to 5 MB are accepted. Under the image, fill in the Image description, which students who can’t see the image read instead.
Sample tests
Section titled “Sample tests”Sample tests are part of the statement: students see their input and output, and they run first when a submission is judged.
- Click Sample test (in the toolbar or the block menu). If the statement already has a sample test block, the new example goes into it; otherwise a new block is inserted.
- Fill in Input and Output. In a file I/O problem the fields are labelled with the file names.
- Add more with Add sample test.
Remove example N removes an example; if it has text, the app asks Remove this sample test?. The remaining examples are renumbered. Changes to examples are not part of Ctrl Z undo.
Set the points and limits of sample tests on the Tests page. New sample tests are worth 0 points.
“Before publishing” checks
Section titled ““Before publishing” checks”Below the text, the editor keeps checking the statement and lists what is missing:
- an Input section (headings such as “Input”, “Input data” or the Lithuanian “Pradiniai duomenys” count) or an Output section (“Output”, “Rezultatai”…);
- at least one sample test;
- empty equations;
- images without a description;
- shown sample tests that no longer exist, and samples without output;
- sample tests the statement doesn’t show.
They are advice: you can publish without meeting them.
The browser draft
Section titled “The browser draft”Statement changes are kept only in this browser until you publish. The status line shows Saving draft… and Draft saved HH:MM.
- When you reopen the problem, an unsaved draft is restored (Unsaved draft restored). Discard draft goes back to the statement as it was when the page opened.
- Couldn’t save the draft in this browser means browser storage is full or blocked – don’t leave the page before publishing.
- Part of the statement can’t be saved. Undo the last change. – undo your last step (Ctrl Z).
Other computers and other editors don’t see these changes. To publish them, see Drafts and publishing.
Keyboard
Section titled “Keyboard”While you type in the editor, the general shortcuts are off: Ctrl K creates a link here. Every editor key is on the keyboard shortcuts page.