Skip to content

Adding an assessment script to a lab task

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:

  1. In the LMS authoring interface, go to Authoring > Labs menu.

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

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

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

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

  6. 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.
  7. Paste the script text into the code field and specify the file name.

  8. 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 PowerShell script:

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