Skip to main content

Programming Exercise

In a programming exercise, students write code in a Git repository of their own and Artemis grades it automatically by running your test cases against every push. You provide three repositories — a template students start from, a solution, and the tests — and Artemis takes care of handing out repositories, running builds, and turning test results into scores and feedback.

Artemis supports a wide range of programming languages and is independent of any particular version control or continuous integration system, so you have a lot of freedom in how you set up the test environment.

Overview

Conducting a programming exercise consists of the following main steps:

  1. 1: Instructor prepares exercise: Set up repositories containing the exercise code and test cases, configure build instructions, and set up the exercise in Artemis
  2. 2-5: Students work on exercise: Students clone repositories, solve exercises, and submit solutions
  3. 6: Automated testing: The continuous integration server verifies submissions by executing test cases and provides feedback
  4. 7: Instructor reviews results: Review overall results of all students and react to common errors and problems
Exercise Workflow
Programming Exercise Workflow (detailed student perspective shown in diagram)

Setting Up an Exercise

Setting up a programming exercise takes you through these pages, roughly in this order:

PageWhat it covers
Create a Programming ExerciseThe creation form section by section, simple versus advanced mode, and importing an existing exercise instead
Write the Exercise Code and TestsFilling the template, solution and test repositories, writing the problem statement, and writing test cases that survive contact with students
Configure the BuildBuild phases, checkout paths, build duration, the container the build runs in, and static code analysis
Configure Grading and Verify the ExerciseTest case weights and visibility, code quality penalties, submission policies, checking the exercise works, and reviewing results afterwards
AI-Assisted Exercise AuthoringGenerating and refining the problem statement, generating code, and review comments between exercise authors

Two reference pages hold the lookup tables:

ReferenceWhat it covers
Static Code Analysis Default ConfigurationEvery rule active by default, per tool
Repository Access ConfigurationWho can read and write which repository, and when

Choose a Programming Language

Artemis ships a template for each supported language, so a new exercise starts from a working build rather than an empty repository. The template determines which features are available, and a few of them cannot be turned on later, so it is worth checking the tables below before creating the exercise.

Supported Programming Languages

No.Programming LanguageLocal CIJenkinsBuild System/NotesDocker Image
1JavaGradle, Maven, DejaGnuartemis-maven-docker
2Pythonpipartemis-python-docker
3CMakefile, FACT, GCCartemis-c-docker
4HaskellStackartemis-haskell
5KotlinMavenartemis-maven-docker
6VHDLMakefileartemis-vhdl-docker
7AssemblerMakefileartemis-assembler-docker
8SwiftSwiftPMartemis-swift-swiftlint-docker
9OCamlDuneartemis-ocaml-docker
10Rustcargoartemis-rust-docker
11JavaScriptnpmartemis-javascript-docker
12Rbuilt-inartemis-r-docker
13C++CMakeartemis-cpp-docker
14TypeScriptnpmartemis-javascript-docker
15C#dotnetartemis-csharp-docker
16Gobuilt-inartemis-go-docker
17Bashbuilt-inartemis-bash-docker
18MATLAB✅ *built-inmatlab
19RubyRakeartemis-ruby-docker
20Dartbuilt-inartemis-dart-docker

* MATLAB only appears in the language list if your administrators have configured a license server for it.

Using a Language Without a Template

The language list also offers Other, which creates the three repositories with no template content at all. Use it for a language Artemis has no template for, or when you want to define the whole build yourself. Artemis shows a checklist in the creation form; in full, the steps are:

  1. Specify a custom Docker image that already contains the compiler, test framework and any other dependencies your build needs. Publish it to a registry your Artemis instance can pull from, such as the GitHub Container Registry or Docker Hub. See Edit Container Configuration.
  2. Write the build script so that it installs any exercise-specific dependencies, runs all tests, and produces JUnit XML result files. Artemis reads results in that format regardless of the language that produced them.
  3. Move the XML result files into ./results/, which is where Artemis collects them. See Adapt Build Phases.
  4. Push the code to the template, solution and test repositories as usual. The template and test repositories are checked out during the build; the solution repository is not.

Feature Support by Language

Not all templates support the same feature set. L = Local CI, J = Jenkins.

No.LanguageSequential Test RunsStatic Code AnalysisPlagiarism CheckPackage NameProject TypeSolution Repository CheckoutAuxiliary Repositories
1JavaGradle, Maven, DejaGnuL: ✅
J: ❌
2PythonL: ✅
J: ❌
n/aL: ✅
J: ❌
3CL: ✅
J: ❌
FACT, GCCL: ✅
J: ❌
4HaskellL: ✅
J: ❌
n/aL: ✅
J: ❌
5KotlinL: ❌
J: ✅
n/aL: ✅
J: ❌
6VHDLn/aL: ✅
J: ❌
7Assemblern/aL: ✅
J: ❌
8SwiftL: ❌
J: ✅
PlainL: ✅
J: ❌
9OCamln/aL: ✅
J: ❌
10RustL: ✅
J: ❌
n/aL: ✅
J: ❌
11JavaScriptL: ✅
J: ❌
n/aL: ✅
J: ❌
12RL: ✅
J: ❌
n/aL: ✅
J: ❌
13C++L: ✅
J: ❌
n/aL: ✅
J: ❌
14TypeScriptL: ✅
J: ❌
n/aL: ✅
J: ❌
15C#n/aL: ✅
J: ❌
16Gon/aL: ✅
J: ❌
17Bashn/aL: ✅
J: ❌
18MATLABn/aL: ✅
J: ❌
19RubyL: ✅
J: ❌
n/aL: ✅
J: ❌
20DartL: ✅
J: ❌
n/aL: ✅
J: ❌

Feature Explanations

Sequential Test Runs

Artemis can generate a build plan which first executes structural and then behavioral tests. Structural tests check that the expected classes and method signatures exist; behavioral tests check that they do the right thing. Only if the structural tests pass do the behavioral ones run, so students are not buried under failures caused by something they have not written yet.

Cannot be combined with static code analysis, and cannot be changed after the exercise is created.

Package Name

For some languages — Java, Kotlin, Swift, Go and Dart — you can specify the package that the exercise template uses, which defines the package structure students must follow. This keeps submissions consistent, which matters when tests locate classes by their fully qualified name.

Solution Repository Checkout

Checks out the solution repository alongside the student's submission during the build, so tests can compare the two directly.

Currently supported for OCaml and Haskell only, with both continuous integration systems.

Auxiliary Repositories

Auxiliary repositories are additional repositories beyond the template, solution and test repositories. They are useful to:

  • provide additional resources needed during testing,
  • include libraries or dependencies,
  • overwrite template source code in testing scenarios.

Each has a name, a checkout directory and a description. If a checkout directory is set, the repository is checked out there during every build. Unlike most repository settings, auxiliary repositories can be added, edited and removed after the exercise exists. See Auxiliary Repositories for how to configure them.

Prevent Maven Central Rate Limits (Java and Kotlin)

Java and Kotlin builds can fail with HTTP 429 (Too Many Requests) when Maven Central rate-limits your Artemis instance, most often during exams when many students submit at once. Artemis emails the affected course's instructors when it detects such a build, and the fix is to configure a Maven repository mirror in the exercise's test repository.

The full instructions are on Write the Exercise Code and Tests.

Search documentation