Set a coding project with folders and many files, in the browser
Real programs are not one file. A Python package with a helpers module, a Java project split into classes and packages, a Node app with a lib folder and a data folder beside it: a coding task can be any of those, written and run entirely in the browser, with nothing installed on the school computer.
Every student gets their own copy of the whole project, sees the same tree of files you wrote, and runs it with the same Run button as a one-file exercise. Hidden tests, marking, hand-in and the rest work exactly as they do for a single file.
The file tree
A coding task’s files are a tree beside the editor. New file and New folder make one, Upload brings text files from your computer, and Rename or move takes a whole path, so typing lib/helpers.py puts a file in a folder called lib. Each file opens in its own language: README.md is Markdown, a .csv is plain text and helpers.py is Python.
Remove takes a file away at once, with Undo beside it for a few seconds. A folder exists while a file is in it, so a new folder starts with its first file. In the tree the arrow keys move between files and open and close folders, Enter opens a file, F2 renames it and Delete removes it.
- Open the task in its editor. Any coding task: Python, Java, Go, JavaScript or TypeScript on Node, Bash and the other program languages.
- Add files and folders. Press New file and type a path such as lib/helpers.py, or New folder, or Upload to bring in text files you already have.
- Check which file runs. The program is the file marked Run starts here.
- Hand it out. Each student gets their own copy of every file, in the same tree.
It runs the way the project would on your own computer
The program is the file marked Run starts here, and it can be renamed or moved into a folder like any other. Its extension stays the language’s own, and a Java, C#, Haskell or Kotlin program keeps its name wherever it goes.
The files are laid out as they are in the tree, so the code finds them where you put them: a Python program imports from its folders, a Java project’s classes can sit in packages under src/main/java, a Go module builds its own sub-packages, and JavaScript and TypeScript on Node import across folders. A program can open any of its files by its path, so a data folder of CSVs is read as data/readings.csv.
What a project may hold
Up to 50 files beside the program, each up to 64 KB and 1 MB in all, in folders up to 7 deep. Only text: an upload is checked by reading it rather than by its name, so a picture renamed data.csv is refused and a text file with no extension is taken.
A name starts with a letter, a digit or an underscore and then uses letters, digits, underscores, dots and dashes. There are no spaces, deliberately: a space is the commonest way a command line in a student’s own program goes wrong.
What students get
Handing the task out copies every file to each student, who sees the same tree and can edit every file on their own copy. They can add files of their own only if the task allows more than one file, and the files you gave them keep their names. Practice files and the playgrounds have the same tree, so a student can try a project of their own outside any module.
There is still exactly one Tests file and one package list. The package list is a real file at the top of the tree, such as requirements.txt or pom.xml, and has a page of its own in this manual. Hidden tests stay hidden however many files the task has.
When the exercise must stay one file
Untick More than one file on the task’s settings tab. The files it already has stay, and can still be renamed and moved, but nobody can add another. A web page and a SQL task never take extra files, because their panes are what they are made of.
Questions people ask
- Can I bring in a project I already have?
- Yes. Upload takes text files from your computer into the tree. A project that is in a Git repository can be loaded whole, with its folders, by Load from Git, which has its own page in this manual.
- Can students add their own files?
- Yes, if the task allows more than one file, which a new coding task does. The files you gave them keep their names, so the tests always find them.
- Does a Java project need to be one class?
- No. Put each class in its own file, in packages if you like; the program is the file marked Run starts here.
- Do students need an IDE installed?
- No. The tree, the editor and Run are all in the browser, and the code runs on our machines in a fresh container each time.