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, Table, 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. |
| Slides | A PDF or PowerPoint presentation as wide as the text (see Slides). |
| Table | A table with a header row (see Tables). |
| 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 (for a table also Header row and Header column).
From the keyboard, Alt Shift ↑ / ↓ moves the current block. Handles are hidden on narrow screens.
Tables
Section titled “Tables”Insert a table with Table in the toolbar or the block menu: 3 × 3, the first row a header row. Cells hold text – bold, italic, code, links and equations, but no lists, code blocks or images; type / in a cell and it stays a slash.
- Hovering a cell (or putting the caret in it) shows a handle on the row’s left edge (Row actions) and one on the column’s top edge (Column actions). They open Insert row above / below (or Insert column left / right), Duplicate row (column), Delete row (column), the Header row and Header column switches, and Delete table.
- The + bars below and right of the table add a row (Add a row) or a column (Add a column).
- The header row and header column belong to the table: a row inserted above the header row becomes the header row, and deleting the header row makes the next row the header.
- Drag a column’s edge to change its width; students see the same widths. A table wider than the page scrolls sideways.
- Tab and Shift Tab move between cells; Tab in the last cell adds a row. The arrow keys leave the table at its edges. Drag across cells to select several; Backspace on a whole selected table deletes it.
- Pasting cells copied from Excel, Google Sheets or a web page makes a table (merged cells are split). A Markdown table (
| a | b |rows with a| --- | --- |line) pasted as text becomes a table too.
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.
The image is uploaded and added to the problem’s draft at once (metadata such as where a photo was taken is removed); the statement that shows it, as always, when you publish. Students see it once the problem is published.
Slides
Section titled “Slides”Show a presentation in the statement with the Slides button, from the block menu, or by pasting or dropping a file into the text. Students see it as wide as the text, one slide at a time, with ‹ › to move, the slide number and a full-screen button.
- PDF or PowerPoint (.pptx) up to 40 MB. A PowerPoint file is converted to PDF on the server while the editor shows Converting the PowerPoint deck to slides… (it can take up to a minute). If a deck can’t be converted, save it as a PDF in PowerPoint and upload that.
- Under the slides, the Slides title (the file’s name at first) is what students see below them and what screen readers announce. Give each deck a title: “Before publishing” lists decks without one.
- The slides file is added to the problem’s draft at once; the statement itself, as always, only when you publish. Students see the slides once the problem is published.
- Animations, transitions, videos and speaker notes are not shown, and links inside slides can’t be clicked.
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, and slides without a title;
- 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.