Using the Filesystem

After installation, the CodeGrade Filesystem can be used with the cgfs command. Before mounting, an empty folder (mnt) to mount in has to be created, this can be done by mkdir mnt.

Now CodeGrade Filesystem can mount to this created folder (e.g. mnt) with cgfs -p PASSWORD -u CODEGRADE_URL USERNAME mnt/. In which PASSWORD and USERNAME should be replaced with valid CodeGrade account details for the CodeGrade instance found at the CODEGRADE_URL.

Note

The CodeGrade URL given at the -u flag should direct to the API and should thus end with api/v1/ (i.e. https://codegra.de will become https://codegra.de/api/v1/).

Note

The CGFS_PASSWORD and CGAPI_BASE_URL environment variables can be set to respectively pass the password or CodeGrade URL. Additionally, leaving out the -p flag will force cgfs to prompt for your password.

After mounting the filesystem, navigate to the specified mount folder to find an overview of all visible courses to the logged in user. Navigate to a course folder to find an overview of all assignment folders that hold all submissions. This results in the default format of /course/assignment/submission - submission_time. All files and folders in the filesystem can be opened as if they were real local files on your system. Editing these files as a teacher results in a new teacher revision, visible to the student. Editing these files as a student enables automatic synchronisation to CodeGrade with each save.

Warning

Adding or modifying files as teacher when not mounted with --fixed flag makes changes public to the student if the student has the View teacher revision permission.

Note

For more information about the Filesystem and different flags, consult the help menu using the cgfs --help command.

Filesystem GUI

The Filesystem offers a simple graphical user interface in addition to the command line commands for easier usage. The Filesystem GUI is still in alpha stage but can be used already. The GUI can be opened using the cgfs-qt command. Usage is very straightforward: fill in the required fields and press Mount!. For more information on specific fields, please consult the general documentation above or press the question mark button next to the field.

After confirming the mount, you will see an output field stating Mounting... and a bit later Mounted.... You can now use the file system as normal. To unmount simply click Stop!.

Warning

Shutting down the filesystem using the GUI might take up to a couple of minutes depending on your configuration, this might temporarily freeze the Filesystem GUI. This is normal behaviour.

Special Files

The filesystem contains a few special files, these are files that are not submitted by students but can be used to control CodeGrade instead.

Note

Special files are only editable with the right permissions.

These files are validated on a close, which fails if the file format is not correct. In the case the exact format of a special file is not followed and it cannot be easily recovered, the __RESET__ string can be written to any writable special file to reset it to its server state.

Name Editable Location Use Format
.api.socket Root Location of the api socket Single line with file location
.cg-mode Root Mode file system FIXED or NOT_FIXED
.cg-assignment-id Assignment Id of this assignment Single line with id
.cg-assignment-settings.ini Assignment Settings for this assignment Ini file with settings
.cg-edit-rubric.md Assignment Rubric for this assignment, editing changes the rubric See .cd-edit-rubric.help
.cg-edit-rubric.help Assignment Help file for the rubric file Plain text file
.cg-feedback Submission The general feedback for this submission Plain text file
.cg-grade Submission The grade for this submission Single float or empty to delete or reset the grade
.cg-rubric.md Submission The rubric for this submission Markdown file where a ticked box means the item is selected.
.cg-submission-id Submission Id of this submission Single line with id

Warning

Only the markdown checkboxes in the .cg-rubric.md file should be changed to fill in the rubric.

Automatic Grading

The filesystem is especially useful for assignments with automatic grading scripts. Automatically generated grades and feedback can be written to respectively the .cg-grade and .cg-feedback file to submit automatically.