18.11.2014 Views

WebExp2 Experimenter's Manual - School of Informatics - University ...

WebExp2 Experimenter's Manual - School of Informatics - University ...

WebExp2 Experimenter's Manual - School of Informatics - University ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Experiment information Although information can be displayed within the title bar <strong>of</strong> the applet, you<br />

may wish to provide more detailed information describing the experiment, within the webpage. To aid this<br />

endeavour, it is possible to get certain details from the applet itself, using javascript. This is described in section<br />

7.5.<br />

7.4.3 Controlling the participant’s environment<br />

The best way to control the environment in which the experiment is performed is to explicitly explain your<br />

requirements to the participant. It is particularly important in web-based experimentation to try and control<br />

the context in which the experiment is administered, as there are a lot <strong>of</strong> factors which can affect your results,<br />

especially if you are recording reaction times. There are also ways to control the environment from the applet,<br />

but these are not 100% effective.<br />

Advice to the participant<br />

your results:<br />

You might want to provide some general instructions to ensure the veracity <strong>of</strong><br />

• make sure the applet is fully visible in the browser window before starting<br />

• maximise the browser window so there is no background distraction<br />

• close down other applications to enable timing accuracy – it is no good unfortunately to have e.g. other<br />

programs downloading in the background while a subject is doing the experiment<br />

• ensure the mouse pointer is within the applet window – if you are using key advance in your experiment<br />

and your participant is using a Mozilla browser in Linux (for example), the focus follows the mouse pointer,<br />

and the applet will not receive key presses unless it is focused<br />

Programmatic control Two main features will aid the control <strong>of</strong> your experiment; these are not yet implemented<br />

but are high priority for future development:<br />

• full screen display – Java allows you, in many cases, to make the applet take up the whole screen and<br />

exclude other windows, so there is no distraction; this is not 100% reliable however<br />

• window monitoring – it is possible to be notified when the participant switches to another window, and<br />

to therefore invalidate or suspend the experiment<br />

7.5 Javascript access to applet information<br />

If you are familiar with Javascript, you can embed script elements in your applet webpage which can actually<br />

query the applet for information. You access public methods <strong>of</strong> the applet with code <strong>of</strong> the form<br />

document.appletName.method , where appletName is the name you defined in the name attribute <strong>of</strong> the applet,<br />

and method is the name <strong>of</strong> the method you wish to access.<br />

Figure 25 lists the applet methods which are available to javascript. Note that all <strong>of</strong> these methods return a<br />

string. For example document.we2app.getTitle() will supply a string representing the title <strong>of</strong> the applet.<br />

Unfortunately any method which returns dynamic information that changes as the experiment progresses (such<br />

as the stage name), are <strong>of</strong> limited use, as there is no way or the applet to notify javascript when such information<br />

changes.<br />

49

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!