PIP's SPF

Tags:

Is current?: 
Yes

How to use SPF's extension for PIP

Under /user/yba/pipexample/spf are a few examples how to use PIP's SPF extension on Project Implicit. 

Here is what to do in order to understand it all:

First, Open the file spffull.expt.xml. The important line in that file is the one that defines the SPF task. It explains how to run SPF's extension: we run spfjs using a jsp file under our study's folder. Usually, when we run a PIP script, we create the script and run it using a general jsp file under common. Here, instead of doing that, we created our own jsp file, set the task's settings to the script's global object, and then run the spf.js script.

Next, open the file spfindexfull.jsp. It includes all the settings that you can use to modify the task. Read it through (and the comments) to understand what you can modify in the task. 

Usually, you won't want to change all the settings. If you want to keep a setting in its default value, simply don't include it in your jsp script. The exceptions to that rule are properties that are objects (canvas, attribute1, attribute2, objectCat1, objectCat2). If you don't want to change anything about the canvas or the attributes, then you can indeed not include them at all in your jsp file. However, if you want to change even one of their properties (e.g., maxWidth in the canvas), then you must also define the other properties (i.e., proportions and all other properties).

Hopefully, your jsp will look more like the file spfindexshort.jsp. That file only sets the categories and leaves all the other settings without modifying them at all.

Wait, explain to me again: how do I create my own SPF?

Copy spfindexshort.jsp to your own folder. Enter the details of your own stimuli. If you have images, also change the base_url property. To add the SPF to your task, copy the relevant line from spfshort.expt.xml. That's it. If you want to change anything else in the task, have a look at the full settings in /user/yba/pipexample/spf/spfindexfull.jsp or in /common/all/js/pip/piscripts/spf/spf.js

Advanced: modify the spf.js script

You can copy the spf.js script and run it as a usual PIP script. THen you can modify the settings at the beginning of the file, and also change anything you want in the code.

Good luck