JSJX

Self-Paced Reading Task

Instructions

This is a free program to run linguistic experiments online through a browser. This program is specifically programmed to run online sentence processing experiments called self-paced reading tasks. I only ask that you credit me as the creator of this program if you use it. The program is called JSJX as an alternative to DMDX for self-paced reading tasks. My inspiration for building this program was to make a program that would be relatively easy and quick for a linguist to create an experiment and conduct it with several participants over the web through a web browser. This program can be run over a static web server, so no dynamic web servers are necessary. Github makes an excellent choice for a free static web server to run self-paced reading tasks.

Create the Google Spreadsheet and Google Script

Step 1

Create a new Google spreadsheet. You will need a Google email account to do so.

Hopefully, you will have a spreadsheet that will look similar to that in the picture below after participants finish participating in your experiment.

Step 2

Next, click on tools and then script editor.

Step 3

That should open what looks like in the picture below. Then click on file, new, and Script file.

Step 4

Paste the code from the self_paced_reading_task_data.js file from HERE just as shown below in the picture.

Just as a note, you can name the script anything. I just chose self_paced_reading_task_data so that it is intuitive what the script is because you can have more than one script pertaining to one spreadsheet.

Step 5

Then click file and, thereafter, save.

Step 6

Then click file and, thereafter, Manage versions.

A box will appear as in the picture below. Click on save new version and, thereafter, ok.

Step 7

Then click Publish and, thereafter, Deploy as web app.

Step 8

A box will appear. Copy API code it gives you under Current web app URL. It should be a short link. You will use and paste this in run_experiment.js so that the experiment links up with this Google spreadsheet to store the data. Select project version (the one you just created). Then under Who has access to the app, you will change it to Anyone, even anonymous. Lastly, click Update.

Setting Up the Experiment

If you are just creating a csv file, enter your stimuli just as that in the picture. Every new line is a new block. You can have any number of sentences of any length on each line.

Each stimulus item is a sentence, and every sentence as an item is separated by a comma.

On every new line is a block. You must have more than one block, so that means that you must have at least two lines of stimuli; however, you can have at minimum one sentence for each block, or line in any text editor or notepad of your choice.

Lastly, do not have empty spaces at the beginning or ending of a sentence, or the particpant might have to press the spacebar more than once where there are empty spaces at the beginning or ending of sentences.

Then you will need a second csv with your questions just as shown below. Again, the same thing applies here.

Do not have empty spaces at the beginning or ending of a sentence (i.e., no white space), or the particpant might have to press the spacebar more than once where there are empty spaces at the beginning or ending of sentences.

However, unlike the stimuli, questions are not required, but there should be the same number of commas for each line just as you have in the csv with the stimuli.

example of a csv for questions

Then you will need a third csv with your answers just as shown below, being yes or no. Again, the same thing applies here.

Do not have empty spaces at the beginning or ending of a sentence (i.e., no white space), or the particpant might have to press the spacebar more than once where there are empty spaces at the beginning or ending of sentences.

There must be an answer between commas corresponding to the same order as the questions. There should be the same number of commas for each line just as you have in the csv with the stimuli.

example of a csv for answers

Lastly, the fourth csv should have your Google App Script API key just as shown below.

example of a csv for Google App Script API key

When a participant is finished with the experiment, you have the results downloaded in a csv, which will appear as that below when opened as a spreadsheet. You can open a csv with a text editor, too.

example of results

The id for each item will have a digit(s) before the letter b for block, another digit(s) before the letter s for sentence, and a last digit(s) before the letter w for word. One way that you can implement filler items is to have them follow your stimuli on a line, and, then, you can use regex or spreadsheet functions to select the first digit through however many digits your list of stimulus items end on that line for that block, thus excluding the filler items in your analysis.

If you see items in the results showing as ?#NAME, this is something to do with Excel. The item is still there and will show bar where inner content of cells are shown, just maybe not showing in the cell within the spreadsheet. An alternative to viewing the results in a csv is to open it within Notepad or any text editor for better viewing of the results if Excel is showing ?#NAME.

Your screen might show the text overlapping and running into each other as that shown below. This only means that you need to zoom out a little.

font size is too large

To prevent the text from overlapping and running into each other, adjust the screen setting of browser window by zooming out just as in the pictures below. Usually, the way to the settings for zooming in and out can be found by clicking on something that shows ··· or something similar from the top-right hand corner of the browser.

zoom out


Watch this video for a quick demonstration of the program below.

Self-Paced Reading Tasks Using JSJX