Reply To: does the Results file take awhile to update? a few other questions too!

PennController for IBEX Forums Support does the Results file take awhile to update? a few other questions too! Reply To: does the Results file take awhile to update? a few other questions too!


Hi Kavita,

If you haven’t already, I recommend that you read the Basic tutorial and then continue with the Advanced tutorial. The latter explains in section 9.5 that by default results are sent to the server after all trials have completed, and that you can use SendResults to send them earlier

If you look at the “Sequence” tab of the debugger when you test your experiment at the demonstration link, you’ll see that you have a total of three trials: the first is labeled “intro”, the second “end” and there is a third trial labeled “null” automatically inserted at the end of the sequence, which is of type “__SendResults__”. The code of the trial labeled “end” finishes with this line newButton().wait(), which makes the script wait for a click on the Button element before moving on, but since it is never printed on the page (in the absence of a print instruction) it will effectively just prevent the participant from moving on to the next trial. Because that last trial is never executed, and because there was no SendResults up to that point, the results are just never sent to the server

The results are sent to separate sets whether you take the experiment at the demonstration link or at the data-collection link. This way, you can test your experiment at the demonstration link, or share it with non-participants (eg. collaborators or reviewers) and not have the results of those runs “pollute” the results that you are actually interested in, the ones from real participants who take your experiment at the data-collection link

Also, I was wondering if there are any examples of trials containing simple untimed grammaticality judgment tests with buttons placed side by side for grammatical, ungrammatical and not sure and with the possibility of entering text indicating corrections below the buttons in one trial (displayed on one screen)?

I don’t think there currently is any publicly available example project of that sort, but this is something that the tutorials were written to help readers code themselves. Section 5.1.2 explains how to manipulate the visual layout so as to align items horizontally, for example (using a Canvas element), and Section 11.2 introduces the TextInput element, which lets the participant freely type in text. Section 9.1 illustrates how you can use a Selector element to keep track of which of several elements (eg. Button elements) was clicked on

If one has multiple questions on one screen (ex. a few textInput and button click items), like one would see in a questionnaire for example, and one simply has .log() under each newTextItem and newButton object in a given trial, would all that info be written to the results file as soon as the trial is over?

The command log will add one or several lines to the results file for each element on which it is called (button.log, textinput.log). The lines are added to the results as soon as the trial ends, but as explained above, the results are only sent when all the trials have completed, or when an early SendResults trial is executed

Lastly, what does this code I found on one of the documentation files do? what is the ID sent here?
.log( “ID” , GetURLParameter(“id”) ) // Append the “ID” URL parameter to each result line

When called after the closing parenthesis of newTrial(), the log command adds one column to every result line of that trial, where the first parameter of log is the new column’s name, and the second parameter is the value. The command GetURLParameter retrieves a value from the URL: GetURLParameter("id") will look for id=VALUE after ? in the URL and will return VALUE. So if the link to your experiment ends with ?id=JaneDoe then .log( "ID" , GetURLParameter("id") ) will add a column to every line of the corresponding trial containing JaneDoe

1. is the Sequence() command at the start necessary?

The two Sequence commands in your code are commented out (they are preceded by //) which means that, as far as the script is concerned, they are just not there. Yet, your experiment can run, which goes to show that it is not necessary to include a Sequence command to run an experiment. In its absence, trials are run in the order in which they are written in the script (top-down). However, inserting your first Sequence command back in (by removing the preceding //) would include a SendResults trial before the trial labeled “end”, which would effectively send the results to the server

if I want to update the progress bar after each trial, should I simply change the last line to the following: .setOption(“countsForProgressBar”, true)?

The progress bar is updated after each trial by default. Adding .setOption("countsForProgressBar", false) (as on the closing parenthesis of newTrial("end", /* ... */) in the code you posted) will make the corresponding trial not count for the progress bar. The code that you posted only defines two trials (the one labeled “intro” and the one labeled “end”) but the second one has that line, so there really is only one trial that counts for the progress bar. As a result, at the very beginning of the experiment, the progress bar is empty (no trial is over yet) and after the “intro” trial is over, all the trials that count for the progress bar have ended, so the progress bar is full. If you remove .setOption("countsForProgressBar", false) then the progress bar will be only half-full when you reach the trial labeled “end”, and will never be completely full, since there is no way for the participant to complete that last trial

NB: the Scripts folder of your project at contains many js and css files that should not be there (mostly duplicates of the files found in the Aesthetics and Modules folders). I recommend that you click the checkbox to the left of “filter…” under “Scripts” to select all the files, scroll down to main.js to uncheck its own checkbox, and proceed to delete all the selected files (ie. all the files except main.js) by clicking on the trash can icon to the right of “filter…”