The Coding Machine
Behind every coding block, and the code editor in every student's Workspace, is a Linux machine of its own that runs in Classla's data centre and shows up in the browser as an editor, a file list, a terminal and an optional graphical desktop. Nothing is installed on the student's computer, so it works the same on a Chromebook. This page covers what is installed, how students work in it, and its limits.
What Is Installed
Every machine is the same Ubuntu 22.04 image, with:
- Python
- Python 3.10, with tkinter and turtle,
pygame,pydraw,numpy,pandas,matplotlibandscikit-learn. - Java
- OpenJDK 11 with Swing and AWT, and JUnit 4 for tests.
- C#
- .NET 8. Console programs need
using System;at the top, because implicit usings are off. Unity scripts compile against a stand-in for the Unity library, so students can write and check them here; they run in Unity itself, and a script with noMainsays so instead of failing. - JavaScript
- Node 18.
- C and C++
- GCC 11, compiling C as C17 and C++ as C++17, with warnings on.
- Tools in the terminal
git,vim,gdb,make,cmakeandsqlite3.
Text is UTF-8 throughout, so accented letters, Chinese, Japanese, Korean and emoji show correctly in the editor, the terminal and the desktop.
Starting and Stopping
A machine starts when the student first presses Run, Run Tests or Start Virtual Codespace. Classla keeps a few spare machines waiting, so a single student is usually ready in a few seconds. When a whole class starts at once the spares can run out, and a fresh machine takes from about 15 seconds to a minute or two. The editor keeps waiting for it. Only if a start takes more than five minutes does the student see "Container took too long to start. Please try again."
A machine nobody has used for five minutes shuts down. A minute before, the student sees Machine shutting down soon with an I'm still here button. Typing in the editor or the terminal, clicking Run or clicking I'm still here all count as use. A running program that keeps printing or animating keeps the machine up only while its tab is open, and for at most an hour after the student last typed; then the same warning appears. Their files are kept; the terminal then reads Machine stopped with a Restart machine button.
- Reset Instance (the red refresh icon on the terminal panel) throws away the running machine and starts a fresh one on the same files. Use it when a program has hung the machine or the terminal is in a bad state. It asks for no confirmation and deletes nothing.
- Reset to Template is different: it deletes the student's changes and puts the block back to your starter files, after a confirmation that says it cannot be undone. It is on graded coding blocks only.
Files
The Files list on the left shows the workspace. Its buttons upload files (Upload a file, up to 20 at a time, 50 MB each), download everything as Download as zip, and create a file (Create file). To make a folder, type a path when you create a file, such as shapes/circle.py. Each file's menu has Download, Rename and Delete.
The gear above the list opens Settings, with Show hidden files (files and folders starting with a dot, and Java's compiled .class files) and Run file.
Click an image in the list (PNG, JPEG, GIF, WebP and others your browser can draw) to see it in place of the editor. A program on the machine can open an uploaded image right away. PDFs, archives and compiled files are binary too: they sit in the list and download, but the editor says it cannot display them. A file a program writes, such as a saved plot or a text file of results, is copied back into the workspace and kept. Hidden files, node_modules, .git and __pycache__ are not copied back, so they disappear when the machine stops.
The Editor
Open files appear as tabs. The dot on each tab is its save state: Saving..., Saved, Save error, or Not syncing yet while the connection is set up. There is no Save button; work is saved as it is typed.
Two buttons move the whole coding area: Open in Side Panel docks it beside the assignment so the instructions stay visible, and Open in New Tab gives it a browser tab of its own. Both are hidden while a lockdown is watching the tab.
Several people can be in the same files at once: the same student in two tabs, or you and the student while you help. Each person's cursor shows with their name, and edits merge as they are typed. If the connection drops, the editor stops taking keystrokes and says "Reconnecting. Editing is paused so your work is not lost." rather than accepting typing it cannot deliver. Work that is submitted, out of time or in an archived course opens read only. So does work past its due date, unless Allow late submissions is on for the assignment. Once an assignment is past its Closes date, students can still open it and see their work, but they cannot start the machine or change anything.
Blocks such as if statements and functions fold: click the arrow beside the line number to hide the lines inside, and click it again to show them. To fold any lines, select them, right-click and choose Group lines. The lines are wrapped in two comments, for example #region group and #endregion in Python, or // region group and // endregion in Java and JavaScript. The group then folds like any other block. The word group is selected, so you can type a name for the group straight away. Because a group is two comments in the file, it is saved with the file, a partner or teacher sees it too, and it does not change what the program does. To ungroup, delete the two comment lines. Typing the same comments by hand makes a group too.
Run and the Terminal
Run runs the file named under it; the arrow beside it (Choose file to run) picks another. The keyboard shortcut is ⌘ Enter on a Mac and Ctrl Enter elsewhere, and it also works with the terminal or the desktop focused. Run clears the terminal and the program's output and input happen there, so a program that asks for input waits for the student to type it.
How Each Language Runs
- Python and JavaScript
- Run the chosen file.
- Java
- Compiles every
.javafile in the folder, then runs the class named by the chosen file. - C#
- Compiles every
.csfile; when several have aMain, the chosen file decides which one runs. There is no project file to manage. - C and C++
- C compiles the chosen file with every other
.cfile that has nomain. C++ does the same with.cpp,.ccand.cxxfiles. A file with nomainreports that it compiled and has nothing to run.
Scrolling Back
The terminal keeps the last 10,000 lines. Scrolling up with the mouse wheel puts it into a scrolling mode, shown only by a small line counter in the top corner, in which typing does nothing. Press Enter, q or Esc, or scroll back to the bottom, to return to the prompt. Pressing Run also leaves it. This is the usual answer to "my terminal stopped responding".
If the terminal cannot connect after a minute and a half, it says "Couldn't connect to the terminal." with Try again.
The Graphical Desktop
Programs that open a window draw on the machine's desktop: tkinter, turtle, pygame and pydraw in Python, and Swing or AWT in Java. The Desktop button on the terminal panel shows or hides it (it is hidden until the student opens it), and Open Desktop in New Tab gives it a tab of its own. The desktop is 1920 by 1080, scaled to fit the panel. Keyboard and mouse input reach the program, so games and drawing programs work.
In a coding block opened with Open in New Tab, and in the code editor of a student's Workspace, the Desktop beside the code button on the terminal panel moves the desktop out of the panel into a full-height column to the right of the editor, with the terminal staying underneath the code. Drag its edge to resize it; press the button again to put it back. The choice and width are remembered on that computer. The code keeps at least 400 pixels and the desktop at least 320; in a narrower space (a small window, or the Workspace's Split view beside notes) the desktop stays under the code and the button is greyed out.
Common Questions
What Does Our School Network Need to Allow?
Three addresses: app.classla.org (the site), api.classla.org (saving and live editing) and cloud-ide.classla.org (the machines, for the terminal and the desktop). All three need live connections, which some school filters block even when ordinary pages load. If one is blocked, the editor stays on "Reconnecting" or the terminal says "Couldn't connect to the terminal."
Will Students Lose Work If They Close the Tab or the Wifi Drops?
Edits are sent to Classla as they are typed and saved within a few seconds. If the connection drops, the editor pauses so nothing is typed into the void and carries on when it comes back. Closing the tab does not stop the machine; it shuts down by itself after ten idle minutes, even if a program is still running, and the files stay.
Can the Whole Class Run Code at Once?
Yes. Each student gets their own machine. If Classla is very busy, a start can be turned away with a "try again" message, and pressing Run again works. Machines that start together take the longer start time described above.
Does Coding Work in a Lockdown Test?
Yes. Typing in the editor, the terminal or the desktop does not count as leaving the tab. While the tab is watched, Open in Side Panel, Open in New Tab and Open Desktop in New Tab are hidden so the work stays on the page. To stop students running code at all, turn on Disable running code for the block.
Can Two Students Code in the Same File?
Only as a partner group. A group shares one workspace per coding block and sees each other's cursors live; Reset to Template resets it for everyone in the group. See Partner work. Students who are not in a group cannot see each other's code.
What It Does Not Do
- Group lines is in the right-click menu for Python, Java, JavaScript, TypeScript, Kotlin and C# files, but not for C or C++. A folded group or block stays folded when you switch to another file and back, and opens again when you close its tab or reload the page.
- Each machine has one shared CPU core and 2 GB of memory. It is built for class programs, not for training large models or crunching big datasets.
- A program started with Run has no time limit, so an infinite loop keeps going until the student stops it or presses Reset Instance. Autograder tests do have limits: 30 seconds per Input/Output test, with compile time counted inside it for C, C++ and C#. Those are on Coding blocks.
- A machine shuts down after five minutes without use. A program that keeps running counts as use only while the tab is open, and for at most an hour after the last typing. Files are kept, but anything running stops and hidden files are lost.
- Isolation is the machine boundary. Each student's code runs in its own machine, which cannot reach other students' machines. The only part of Classla it can reach is that student's own saved files for that assignment, so it can keep them in sync. Inside their machine the student has full control, including sudo.
- Uploads are limited to 50 MB a file and 20 files at a time.
- There is no button to create an empty folder; a folder appears when you create a file inside it.
- Machines are not kept running between visits. Each start is a fresh machine with the student's files copied in, so anything installed with sudo has to be installed again.