VERA Sandbox Demo: “Cheat-Sheet” Quick Reference Guide

The VERA Sandbox Demo is a sample “mock experiment” designed to demonstrate the core features of VERA. This page is a “cheat-sheet” quick reference guide for the demo, meant as supplemental material to guide you along the way.

If you’d like to start the demo from scratch, following along with the installation and setup process, see the VERA Sandbox Demo: Intro section to get started.

Sandbox Cheat-Sheet: Installation and Setup
  1. Install Unity 6000.3.9f1 with Web Build Support.

  2. Either clone the VERA Sandbox repository from GitHub (git clone https://github.com/CoreyClements1/VERASandbox.git), or install the sample from the VERA package in the Unity package manager.

  3. Open the cloned project in Unity, and open the “SandboxScene” scene (Assets/Scenes/SandboxScene.unity).

  4. Install the VERA Unity package from the Unity Package Manager (Window > Package Manager > + > Add package from Git URL):

    https://github.com/ucf-research/vera-package.git
    
  5. Open the VERA Settings menu (menu bar > VERA > Settings), and click “Authenticate” to link the Unity project to your VERA account.

  6. Create your experiment on the VERA web client, following the instructions in the VERA Sandbox Demo: Web Setup section.

  7. Return to Unity, and select your experiment from the “Your Experiment” dropdown in the VERA Settings menu.

  8. Open the ExperimentManager.cs script (Assets/Scripts/ExperimentManager.cs) to see how the experiment is set up in Unity.

  9. Retrofit the ExperimentManager.cs script according to the VERA SANDBOX NOTE comments labelled throughout.

Sandbox Cheat-Sheet: managing conditions with VERA
  • Each independent variable you define on the web interface has its own auto-generated VERA C# class in Unity.

  • These classes are named exactly the same as your variables on the web portal, prefixed with “VERAIV_”. For example, “VERAIV_Environment” and “VERAIV_AimType”.

  • Using this class, you can:

    // Get the current selected level of the "Environment" independent variable
    VERAIV_Environment.IVValue currentValue = VERAIV_Environment.GetSelectedValue();
    
    // Set the current selected level of the "Environment" independent variable
    VERAIV_Environment.SetSelectedValue(VERAIV_Environment.IVValue.V_Snow);
    
  • Any data you log with VERA will automatically be associated with the experimental conditions the participant is currently under.

Sandbox Cheat-Sheet: logging data with VERA
  • Each file type you define on the web interface has its own auto-generated VERA C# class in Unity.

  • These classes are named exactly the same as your file types on the web portal, prefixed with “VERAFile_”. For example, “VERAFile_LaserLogs” and “VERAFile_RoundSummaries”.

  • Using this class, you can:

    // Create a new CSV log entry for the LaserLogs.csv file type
    VERAFile_LaserLogs.CreateCsvEntry(currentEnvironmentalBlock, currentRound, hitTarget);
    
  • Any data you log with VERA will automatically sync to the VERA web client in real-time.

  • All data will also be recorded locally as a backup (Assets/VERA/data).

  • Results can be found on the VERA web client.

Sandbox Cheat-Sheet: managing questionnaires with VERA
  • Each questionnaire you define on the web interface will be accessible from the VERASurveyHelper Unity C# class.

  • There will always be a single VERASurveyReference in this class, named exactly the same as your questionnaire is named

    on the VERA web client, prefixed with an “S_”. For example, “S_ConfidenceRatingQuestionnaire”.

  • Using the VERASurveyHelper, you can start any questionnaire via its VERASurveyReference:

    // Display the "Confidence Rating Questionnaire" survey to the participant
    VERASurveyHelper.StartSurvey(VERASurveyHelper.VERASurveyReference.S_ConfidenceRatingQuestionnaire);
    
  • VERA will automatically handle the display, UI interaction, and response recording.

  • Provide a variety of optional parameters to control the display of the questionnaire.

  • Use the onSurveyComplete optional UnityEvent parameter to run code automatically once the questionnaire is completed.

  • Questionnaire results can be found on the VERA web client.

Sandbox Cheat-Sheet: session management

Use the VERASessionManager class to manage participant sessions in Unity. By doing so, you can:

  • Get and use the VERA participant ID:

    // Get the current session's participant ID
    int participantID = VERASessionManager.participantID;
    
  • Run VERA-related code only after VERA has finished initializing:

    // Call MyFunction only after VERA has finished initializing
    VERASessionManager.onInitialized.AddListener(MyFunction);
    
  • Finalize a participant’s session when the experiment ends and mark them as concluded:

    // Safely conclude the participant's session using VERA
    VERASessionManager.FinalizeSession();