Created by Ekaterina Zayats, Modified on Thu, 11 Aug 2022 at 05:15 AM by Boris Chekaev

As a course author, you can use special scripts that automate checking the implementation of learning tasks by students. For example, with a script you can check that a file was created by the student, or a user added, and so on.

To add a script to automatically assess that a student has implemented a task step:

2. Click Labs.

3. Open the lab for which you need to add assessment criteria.

4. Open a task and a step you need to add the assessment criteria to.

5. Click Add pass criteria manually and then click Script based.

6. Click the top facing arrow to expand new_script and click Edit.

7. Specify the following parameters:

• Script name — enter a short descriptive name for the script.

• Script type — select the type of script (bash, powershell, or python).

• Command-line arguments — command-line arguments to pass to the script.

• Virtual machine — select the VM the script to run on.

8. Paste the script text into the code field and specify the file name.

9. Click Save changes.

Example

To check that a file exists in the environment (for example, when a student needs to download an application file at one of the lab steps), you might use the following script:

$path = "path\to\file"if ([System.IO.File]::Exists($path)) {    exit(0)} else {    exit(1)}