Psychstudio comes with some very powerful and expressive text manipulation tools built in, perfect for use in psycholinguistic experiments and linguistics studies.
Variables allow for complex manipulation of text items and can be used in the following ways:
Variable notation is of the form:
WARNING: Deleting variables will remove:
Injecting text into a text item is referred to as variable substitution. To inject text into an item, we first need to specify a variable in the text item where we wish the injection to take place. As shown in the example below (Figure 1) we have some text items, three of which have a variable called
person and two which have a variable called
place. The notation for text injection is simply
In the variable manager (Figure 2), we have created some variables with values to inject into their corresponding text items, for example, a text item containing
$(place) will be randomly allocated a value from the
place variable. For example, when composed, the text item and variable together might produce:
It's busy and crowded in the town of Kimpy. I call it ...
Variables can be used to selectively format parts of text items. The notation for text formatting is:
Variables can also be nested like so:
$(variable-name some text $(variable-name2 some more text)). Specificity of application of nested variables is:
variable-name2will take precedence over
The following formatting variable types are available:
Let's take a look at a classic, yet simple example, the Stroop task. As shown below (Figure 3), we have five text items and a single variable
ink-color (of the type Font color) with five values.
The first text item is
$(ink-color Brown), which can be described as: the variable
ink-color applied to the text
Brown. For example, when composed, the text item and variable together might produce: Brown, which can be described as the word
Brown with the variable
ink-color and (random) value
Finally, let's look at a little more complex and completely contrived example:
The $(strike? quick) $(italic? brown $(ink-color $(animal))) jumps $(bold? ($(background over)) the) lazy $(animal).
When composed, we might end up with something like: The quick brown dog jumps (over) the lazy fox.
Note: strike? italic? and bold? are all boolean type values (i.e. either true or false).
TIP: for weighted booleans you can add uneven numbers of true and false values to the variable (e.g. three true and one false).