Stops script execution and opens the Debugger Watch Window.
<script>
none
Name | Type | Description |
---|---|---|
condition | boolean | Optional. The execution stops if true, otherwise the script continues running. |
This function is intended for debugging purposes only and should never be included in a script used for data collection. The function stops execution and opens the Debugger Watch Window so that property values can be inspected at particular points in the script logic. It can also be used to determine whether particular bits of logic are ever executed. When the Debugger Watch Window is closed, script execution resumes.
The following stops the script if the user responds with the space bar (Note: 'this' represents 'trial.consent' in this context):
<trial consent>
/ onTrialEnd= {if ( this.response == 57 ) script.debugBbreak();}
</trial>
The following stops the script if performance dips below threshold (Note: 'this' represents 'trial.myTrial' in this context):
<trial myTrial>
/ onTrialEnd= {if ( this.percentCorrect <= 50% ) script.debugBbreak();}\n</trial>
The following stops the script if the number of items in a list is 0:
<trial myTrial>
/ onTrialEnd= {script.debugBbreak(list.probabilities.itemCount == 0);}
</trial>