WebExp2 Experimenter's Manual - School of Informatics - University ...
WebExp2 Experimenter's Manual - School of Informatics - University ...
WebExp2 Experimenter's Manual - School of Informatics - University ...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Figure 17: Available component types and their unique properties.<br />
Type name Property Content<br />
text content the text to show<br />
button content the text for the button<br />
image content the name <strong>of</strong> a preloaded image resource from the preamble<br />
(see section 5.3 on loading individual images)<br />
input lines how many lines to show in the input — any value greater than 1<br />
will provide a scrollable text box<br />
content<br />
not used; may be implemented later<br />
maxchars<br />
the maximum number <strong>of</strong> characters which can be typed into the<br />
box<br />
allowed<br />
a list <strong>of</strong> the characters accepted by the input<br />
restrict<br />
a combination <strong>of</strong> words representing sets <strong>of</strong> allowed characters:<br />
digits, letters, symbols<br />
Figure 18: Property tags for visual components. All are optional.<br />
Tag name<br />
width<br />
height<br />
fgcolor<br />
bgcolor<br />
font<br />
Description<br />
the width <strong>of</strong> the component in pixels<br />
the height <strong>of</strong> the component in pixels<br />
foreground colour to use for the component<br />
background colour to use for the component<br />
the font in which to display the component’s text<br />
5.8.4 Restricting input<br />
The input response component allows the user to use the arrow keys to navigate, the delete and backspace keys<br />
to edit, the tab key to move between components, and the return key to advance the slide. Any other character<br />
key can be used to provide input, unless you restrict what the subject is allowed to type.<br />
Figure 19 shows the definition for an input component suitable for collecting an age from the participant. It<br />
will not allow the user to advance to the next slide unless it has some input, and will only accept numbers, to a<br />
maximum <strong>of</strong> three digits. Thus effectively the user has to enter a number between 0 − 999 in order to continue.<br />
Limiting input length You can limit the length <strong>of</strong> your participant’s input by including the <br />
element. Its content should be an integer defining the maximum number <strong>of</strong> characters that can be typed into<br />
the input box.<br />
Restriction sets One way <strong>of</strong> restricting input is to include a restriction set, which defines a set <strong>of</strong> allowable<br />
characters. Add the element, and as its content include one or more <strong>of</strong> the following:<br />
• letters – allow alphabetical keys<br />
• digits – allow number keys<br />
• symbols – allow symbols to be typed<br />
39