Make different tests available in the editor and the submission

AutoTest v2 enables the Run button in the CodeGrade editor. This allows students to run their code against your AutoTest before making a submission. However, there are a few reasons why you may not want students to run all of your tests in the editor:

  • Not giving away too much You may not want your students to see all of the tests before they have created their submission so that they are truly challenged by the graded AutoTests.

  • Speed Running all of your tests may take some time and this defeats the purpose of having a Run button to quickly check that you're on the right track and that your code runs without errors.

  • Output window The run feature in the editor is designed to give students a peak at a few key tests to check that their code is working properly. Narrowing down the tests you show makes the output clearer and highlights the most important issues.

To choose which tests you run or don't run in the editor you can use the Run Only In block. This wrapper block allows you to specify in which environment the nested tests should be run. The options are:

  • Every environment This means that tests will run in both the editor and in the submission.

  • Editor This will mean the tests only run in the editor.

  • Submission This will mean the tests only run in the AutoTest once a submission is made.

How to use a Run only in block in your AutoTest configuration:

  1. Navigate to the Tests portion of the AutoTest settings.

  2. Click the Run Only In block to add it to the bottom of your AutoTest configuration or click-and-drag the block to the desired location.

  3. Nest your test blocks inside the Run Only In block.

  4. Select the environment you want your tests to run in using the drop-down menu.

Last updated