Create, manage and use snippets

Tip

CodeGrade has a Help Center, with better guides, more videos and updated documentation. The documentation and guides on this website are deprecated and will not be updated in the future. Please click here to go to this page on the Help Center!

Snippets allow you to easily re-use inline feedback messages when grading in CodeGrade. Follow the guide below to learn how to create, manage and use snippets.

Snippets in CodeGrade are both available on a course-wide level and a personal level. Personal snippets are linked to your CodeGrade account and are available to you for any assignment from any course you grade. Course-wide snippets are specific to a course and can only be used when grading assignments in that course, these are however shared by all graders grading in the course.

Note

Course snippets can be set up by anyone with the Manage course snippets permission, this is enabled for Teacher roles only by default.

Personal Snippets

Creating snippets

There are two ways to create personal snippets: in the Code Viewer in the inline feedback field and on the profile page.

Code Viewer

  1. Click anywhere to add inline feedback.

  2. Type your snippet message in the inline feedback field.

  3. Press the icon.

  4. In the field that will appear above the inline feedback field, type your snippet shortcut.

  5. Press the icon or press Ctrl+Enter to save your snippet.

  6. Your snippet is now ready to use anywhere.

Profile page

  1. Navigate to the profile () page.

  2. Scroll to the bottom, where you find your list with personal snippets.

  3. Press the icon to add a new snippet.

  4. In the dialog, type your snippet name (shortcut) and snippet replacement text (content of feedback).

  5. Press the Save button or press Ctrl+Enter to save your snippet.

  6. Your snippet is now ready to use anywhere.

Managing snippets

Code Viewer

  1. Autocomplete your snippet like you would do usually.

  2. If you press the icon, the shortcut name of the snippet will be displayed.

  3. If you change the contents of the inline feedback field and press the icon next to the shortcut, the snippet will be edited.

Profile page

Use the or icons to edit or delete the snippet.

Course Snippets

Creating snippets

  1. Navigate to the Course Management page of the course you want to add course snippets to by clicking the button.

  2. Navigate to the Snippets tab to find an overview of existing course snippets and options to add them.

  3. To create a new course snippet, that will be available to all graders grading in this course, press the icon.

  4. In the dialog, type your snippet name (shortcut) and snippet replacement text (content of feedback).

  5. Press the Save button or press Ctrl+Enter to save your snippet.

  6. Your snippet is now ready to use by all graders of the course.

Managing snippets

Managing course snippets is also done on the Course Management page, under the Snippets tab a list of course snippets can be found.Use the icon next to a snippet to permanently delete this snippet. Use the icon to edit the snippet.

Using snippets

  1. Click anywhere to add an inline feedback comment.

  2. Start typing your snippet shortcut.

  3. Your snippet will appear in the autocomplete list below. Snippets indicated by are personal snippets, indicates course snippets.

  4. Press Tab to cycle through this list and select the snippet.

  5. Press Ctrl+Enter to save the inline feedback.