-
Notifications
You must be signed in to change notification settings - Fork 3
Teaching Assistant Handbook
- 1. Introduction
- 2. Gitlab Setup
- 3. Moodle Setup
- 4. Test your assignment
- 5. Grading an assignment
- 6. VMChecker block
To set up an assignment, you must create a private repository on Gitlab where the submissions will be checked and a public one from where the students can fork their own private repositories. Also, a special block must be added at the course page level on Moodle that will handle the pulling of data from Gitlab.
The private and public repositories must have the following structure:
├── checker/
│ ├── checker.sh
│ ├── input/
│ │ ├── test0
│ └── output/
│ ├── test0.ref
├── Dockerfile
├── .gitlab-ci.yml
├── local.sh
└── src/
└── skel.c
It is recommended to fork https://gitlab.cs.pub.ro/vmchecker/vmchecker-next-assignment for a faster start.
A typical assignment will have the above structure with the following files and folders of interest to teaching assistants:
- src/ - Here the student will develop their solution according to the assignment's specification. Here, you can add a skeleton for the assignment.
- local.sh - A utility script used to check the assignment locally. It simulates a Gitlab pipeline.
- Dockerfile - Used to build the docker image for the Gitlab pipeline. The following is an example that should satisfy most cases:
FROM jokeswar/base-ctl
COPY ./checker ${CHECKER_DATA_DIRECTORY}
NOTE: The base-ctl image is based on the ubuntu:20.04 image and has the following additional packages installed: build-essential and python3.
NOTE: When the image is built the entire checker is copied into the docker image, to prevent the user from changing tests.
- .gitlab-ci.yml - The definition of the pipeline. You must change the image used to the one you built.
- checker/ - The checker directory.
- checker/checker.sh - The entry point of the checker. When execution is passed to this script, the current working directory is set to the checker/ folder.
NOTE: In order for VMChecker Next to be able to grade the assignment it will look for the last string that matches the following regex: Total:\ *([0-9]+) (the grade must be an integer).
Valid format:
Total:100/100
Total: 0/100
Total:50/100
Invalid format:
Total: 55.37/100 # the grade will be set as 55, not 55.37 on Moodle
NOTE: You will need to generate an access token that will allow VMChecker to access Gitlab's API. Also, the project ID for the private repository is needed.
To avoid the possibility of students accidentally sharing their solution, Merge Requests for the public repository must be disabled. To do that:
- Go to your public project page
- On the left panel under Settings select General
- Under the Visibility, project features, permissions disable Merge Requests.

In .gitlab-ci.yml set the image name for the checker step to registry.gitlab.cs.pub.ro/<group-name>/<project-name>:<tag> (e.g: registry.gitlab.cs.pub.ro/ASC/TEMA-3-Public:latest).
Set up the BUILD_DOCKER_IMAGE pipeline environment variable to true for your public repository. Each time a new commit is made to the repository a new Docker image build will be triggered. The image will be uploaded to Gitlab's own Docker registry.
./local.sh docker build
./local.sh docker push --user "$GITLAB_USERNAME" --token "$GITLAB_ACCESS_TOKEN"To create a GITLAB_ACCESS_TOKEN access token follow the documentation on Gitlab.
For more information on local.sh run ./local.sh -h.
- Go to your project page
- The ID is found under the project name

First, set up a Moodle assignment with the following additional settings:
- Submission types → Submission types → File submissions
- Submission types → Maximum number of uploaded files → 1
- Submission types → Maximum submission size → 50kb (The maximum submission size of VMChecker Next is 10 MB)
- Submission types → Accepted file types → zip
- Feedback types → Offline grading worksheet → true (enables feedback download)
Next, add a new VMChecker block on the current page by clicking on Add a block and selecting VMChecker block from the list.

Click on the gear and select Configure VMChecker block. Here you must fill in a couple of options for the VMChecker settings header:
- Enable autograding of submissions - If you want the assignment to be automatically graded with the mark from the checker
- Gitlab repository ID - The project ID of your private repository
- Gitlab private token - The previously generated private access token
- Assignment - From the list select the assignment you want VMChecker to manage
WARNING: There is a one-to-one relationship between an assignment and a VMChecker block. Make sure there is only one VMChecker block per assignment.
Save!
After the setup is done, switch to the student test account and upload your submission. After a couple of minutes, your submission will run on the Gitlab CI. You can check your private repository. When the pipeline is finished the trace will be set as feedback for your assignment. If autograding is enabled, your submission will also be marked.
NOTE: On Moodle, the feeback string will be computed from the trace found on Gitlab pipeline, and will be the content between the start of the checker string mark (i.e. VMCHECKER_TRACE_CLEANUP) and the string that gardes the assignment.
<Pipeline output>
VMCHECKER_TRACE_CLEANUP
Test 1....0 ---|
. |
. |
. | This will be the feedback for the student assignemnt.
Test n...0 |
|
Total 0/100 ---|
<some more Pipeline output>
- Go to the course page on Moodle
- Click on the assignment
- Click on the gear and from the drop-down select Download all submissions

NOTE: If you do not have permissions, the assignment page will show the upload form only.
- Go to the course page on Moodle
- Click on the assignment
- Click on View all submissions
- From grading action select Download grading worksheet

NOTE: You can grade submissions and give feedback in the downloaded CSV.
To check the pipeline of a certain student, go to the assignment's private repository on Gitlab. From the menu on the left select Repository → Branches. Every student submission has a separate branch of the following format ${username}-${year}-${month}-${day}-${hour}-${minute}-${second}-${uuid}. Using the search bar, look for the desired submission.

To check the user code click on the branch name and check the src folder.
If you want to see the pipeline output, click on the pipeline status icon.

Next, click on Jobs and select the first job ID.

- Go to the course page on Moodle
- Click on the assignment
- Click on View all submissions
- From grading action select Upload grading worksheet

- Upload the worksheet downloaded previously
- After you preview the changes click Confirm
In the VMChecker block for the desired assignment select Recheck submission for ..., as action. Search in the list for the student, you can use the search bar for a faster lookup. Finally press Run action.
NOTE: Only students that have submitted their assignments will be found on the list.

In the VMChecker block for the desired assignment select Recheck all submissions, as action, and press Run action. All students that have submitted their homework will have their last submission rechecked.
