PennController.DebugGlobal Commands

PennController.Debug() (since PennController 1.2)

Runs your experiment in Debug mode.

A pop-in console appears at the bottom-left corner of the page when your experiment runs in Debug mode. The Debug console gives you information on the experiment’s structure and on the current trial. Buttons in the Sequence and Log tabs let you force the experiment to move on to the next steps/trials. The Tables tab lists the tables available to your script, which you can click to explore.

Each time you try to quit/refresh the experiment page while in Debug mode, you will be prompted a confirmation message.

In Debug mode, the items variable containing the content of all your trials is publicly accessible. This means that, for example, you can open your browser Javascript’s console and type items to take a look at how each of your trials is defined.

Make sure to delete any PennController.Debug() command before running the final version of your experiment (the items variable will be undefined during runtime).

Example:

PennController.Debug()

PennController(
    newButton("hello", "Hello world")
        .print()
        .wait()
)

PennController.AddTable( "Words" ,
    "item,Word\n"  +
       "1,Hello\n" +
       "2,World"
)

PennController.Template( "Words" ,
    row => PennController(
        newButton(row.Word)
            .print()
            .wait()
    )
)