Skip to main content

Working on an Exercise in VS Code

Once an exercise is started, the extension takes care of Git for you. It clones your repository, commits and pushes your changes when you select Submit, and shows the result of the build Artemis runs on every push. You can still use Git yourself, since the extension works on the same repository.

Getting the Repository​

On the exercise page, Clone Repository copies your repository to your computer. The first time, the extension asks where exercise repositories should go: Set Default Folder uses one folder for all of them, Choose Each Time asks again for every clone. You can change the folder later with Artemis: Set Default Exercise Folder in the command palette.

After cloning, the extension offers to open the repository as your workspace; select Open Folder. It only submits from the repository that is open in VS Code, and until then the exercise page says Repository not in your workspace.

In EduIDE you do not clone anything, because the workspace already contains the repository of its exercise.

Submitting​

Below Repository Ready, the exercise page says whether there is anything to submit: Up to date or Uncommitted changes ready to submit. Submit becomes available once you save a change. It commits every change in the repository and pushes it to Artemis, which then builds and tests it.

The commit message is Solution submission via Iris extension unless you write your own: the envelope button beside Submit opens a field for it, and the setting artemis.defaultCommitMessage changes the default.

If auto-save is off and a file has unsaved changes, the page says Unsaved files. Save before submitting., because an unsaved change is not part of the commit. Configure auto-save opens the VS Code setting that saves files for you.

If Git does not know your name and email yet, submitting stops and offers Configure Git Identity. If Artemis refuses access to the repository, it offers Open Submission Setup. Both are described under Submission Setup.

Test Results​

While Artemis builds your submission, the page shows the progress. When the build finishes, it shows how many tests passed and the points you get.

See test results lists every test, the failed ones first, each with the feedback the test produced. Close the list with the cross or with Escape.

The test results of a submission, with 5 of 13 tests passed and the failed tests listed with their feedback
Test results, failed tests first

If you scroll the page while a build runs, a bar at the top keeps the build status in view and shows the result once the build finishes.

When the Build Fails​

A submission that does not compile has no test results, only Build failed.

The exercise page after a failed build, with Go to source and Open log
A failed build

Go to source opens the file at the first compiler error. Open log opens the full build log in an editor tab; read it when the error is not in your code.

The build log in an editor tab, showing a compiler error in BubbleSort.java
The build log, with the compiler error

In the editor, each compiler error is marked directly above its line with Artemis Build Error and the compiler's message. The mark moves with the line while you edit, and selecting it jumps to the error.

A Java file with an Artemis Build Error annotation above the line that is missing a semicolon
The compiler error, marked above the line in the editor

More Actions​

More on the exercise page holds the actions you need less often:

  • Check workspace status looks again for uncommitted changes.
  • Pull Changes brings changes from Artemis into your repository, such as edits you made in the online code editor. It is there when the exercise's repository is your workspace. If your own changes touch the same files, or you have commits that are not on Artemis yet, it changes nothing and tells you what to do instead.
  • Open Repository shows the repository in the Explorer when it is your workspace.
  • Copy Clone URL copies the repository address, optionally with your access token in it. Do not share the address with the token: it gives access to your repository.
  • Open in browser opens the exercise in Artemis.

Submission Setup​

Submission Setup on the dashboard checks everything Git needs before you can submit. Each row is marked as in order, as needing a fix, or as unknown, and the banner at the top summarizes the result.

The Submission Setup checklist with Git installed, the Git identity, the exercise repository and Artemis access, all in order
Everything in order for submitting
RowWhat it checksHow to fix it
Git installedGit is installed and foundInstall Git from git-scm.com, then reload the window
Your identityGit has a name and email to record on your commitsChange opens a form; the values apply to every repository on this computer
Exercise repositoryThe open folder is the repository of an Artemis exerciseOpen the exercise folder, or clone the exercise first
Artemis accessArtemis accepts the access token in the repositoryRenew gets a new token from Artemis and puts it into the repository

Recheck runs the access check again, for example after you were offline. Under Prefer the terminal? you find the Git commands that set your name and email by hand.

Search documentation