How to link Inquisit script and demographic script


Author
Message
Andrea Deme
Andrea Deme
Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)
Group: Forum Members
Posts: 16, Visits: 34
Thanks for the quick reply!! i am already relieved:)

one more question: would it be possible to simple include the elements of the survey in the IAT without using the inlcude element? (I know it is more complicated in a way, but still... )

I'll do the modification in the script as well.

thanks again! 
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 109K
Look at your launch page's source code. The subject number is generated / returned by

function GetSubjectNumber()
{
    return "3";
}

As it stands, your function simply returns a constant value -- 3. If you wanted sequential IDs, you cannot simply do this in JavaScript -- you'd need a database running in the backend to keep track of which IDs have already been passed out, etc.

What you can do in JavaScript, is return a *random* ID. While it is possible that such a function could return the same ID for two different participants over the course of time, it is exceedingly unlikely (because the sampling space is so huge).

function GetSubjectNumber()
{
   return (Math.floor(Math.random() * 1000000000));
}

You can alternatively (or in addition) merge your two scripts. <survey> elements are special types of <block>s and <surveypage> elements are special types of <trial>. You simply integrate those into your IAT script as you would with any other additional block etc. See the "How to Combine Multiple Scripts" topic in the documentation.

Tags
Andrea Deme
Andrea Deme
Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)
Group: Forum Members
Posts: 16, Visits: 34
Dear All,

I have problem that is connected to the batch files and running 2 scripts (IAT and demographic survey) as well.
The probem is that I use a custom launch page and it seems that just because of that all the participants get the same id (the same number basically).

As I use a batch file and I get data in 2 separate dat files, it would be of - so to speak - vital importnace to be able to pair them up unambigously. Cold you help me, how I could make Inquisit to use "sequential id" mode with my custom launch page (attached)?

Or else (if this is not possible) could you please clarify how I could include the survey pages as trials into the IAT to get just one simple output (dat) file? That previous answer was unfortunately too brief for my limited experience with Inquisit.

thanks a lot!!
Andi 
Attachments
IATintroV2.txt (1.2K views, 40.00 KB)
Maria
Maria
Partner Member (631 reputation)Partner Member (631 reputation)Partner Member (631 reputation)Partner Member (631 reputation)Partner Member (631 reputation)Partner Member (631 reputation)Partner Member (631 reputation)Partner Member (631 reputation)Partner Member (631 reputation)
Group: Forum Members
Posts: 5, Visits: 1

Hi Sean,


thanks a lot for your quick reply, this works out perfectly. Now the batch file is running without any problem.


Maria


seandr
seandr
Supreme Being (144K reputation)Supreme Being (144K reputation)Supreme Being (144K reputation)Supreme Being (144K reputation)Supreme Being (144K reputation)Supreme Being (144K reputation)Supreme Being (144K reputation)Supreme Being (144K reputation)Supreme Being (144K reputation)
Group: Administrators
Posts: 1.3K, Visits: 6K

Hi Maria,


To remove the "The experiment has ended." message, just delete the "/endlock=true" command from the <defaults> element.


Sounds like you've otherwise gotten the <batch> option to work. Let me know if you need anything else.


-Sean



Maria
Maria
Partner Member (631 reputation)Partner Member (631 reputation)Partner Member (631 reputation)Partner Member (631 reputation)Partner Member (631 reputation)Partner Member (631 reputation)Partner Member (631 reputation)Partner Member (631 reputation)Partner Member (631 reputation)
Group: Forum Members
Posts: 5, Visits: 1

Hi Sean,


I've used a batch file to combine an IAT with a survey. However, at the end of the IAT, there appears a page saying "The experiment has ended". Only when you press CTRL + b, you are led to the survey part. Is it possible to avoid the page in between?


I tried to put the survey part into the IAT file, changing "surveypage" into block, "questions" into "trials" and "survey" into "expt". Do I have to change for example the "textbox" into "trial" as well? How does the programme know then what format the question is supposed to have?


Thanks in advance.


Maria 


seandr
seandr
Supreme Being (144K reputation)Supreme Being (144K reputation)Supreme Being (144K reputation)Supreme Being (144K reputation)Supreme Being (144K reputation)Supreme Being (144K reputation)Supreme Being (144K reputation)Supreme Being (144K reputation)Supreme Being (144K reputation)
Group: Administrators
Posts: 1.3K, Visits: 6K

By default, survey data is saved in a different file than reaction time data because the kinds of analyses done on these types of data are typically very different.


With surveys, it's usually much more convenient to have 1 row of data per subject, with responses from each survey item in a separate column.


With reaction time data, you are typically computing metrics such as means, medians, Cohen's D, d prime, etc. based on very large sets of trials grouped by various treatment conditions. You may often want to discard particular trials with excessively high or low latencies. These kinds of analyses would be extremely cumbersome (dare I say impossible) if all of the data from each trials (response, latency, treatment conditions) were somehow put into a single enormous row for each subject.


You can record your survey data in the same file as your reaction time data, however. Each <surveypage> is a specialized kind of <trial>, so you can insert survey pages in your /trials list of your <block> elements. When a surveypage is run as a trial in a <block> (as opposed to a page in a <survey>), its data are recorded in the the main data file (i.e., IAT.dat in your case), with each survey item appearing as a separate row.


If you want separate files, and you are recycling the same subject numbers across different subjects, then you'll need to rely on some additional cues to correlate the two data files. Specifically, you should be able to match up most of the files using the subject number, date, and time columns. In the event those values are the same for multiple participants, you could disambiguate them using the ip address, which is saved in the name of the data file.


-Sean


Rickardcarlsson
Rickardcarlsson
Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)
Group: Forum Members
Posts: 58, Visits: 1

Ok, thanks good guide. As of now I have already integrated my survey with my IAT script, simply by adding the elements. It works just fine with one exception. The data I collect from the IAT (the rest of the script) is stored in a .dat file called iat.dat (which is the name of my script) but the data from the survey is stored in a .dat file named surv.dat (which is the name of the survey included in the script). Why is this? Is there some work around? Would using the include strategy solves this problem?


The problem right now is that I will sometimes get 50 .dat files with IAT-data and 50 .dat files with survey data to download from millisecond.com. Since they all use one of two subject  IDs (1, 2) I cannot be sure which IAT.dat goes with which surv.dat. Or will they always come up in pairs in the web file manager? If that is the case then there is no big problem.



seandr
seandr
Supreme Being (144K reputation)Supreme Being (144K reputation)Supreme Being (144K reputation)Supreme Being (144K reputation)Supreme Being (144K reputation)Supreme Being (144K reputation)Supreme Being (144K reputation)Supreme Being (144K reputation)Supreme Being (144K reputation)
Group: Administrators
Posts: 1.3K, Visits: 6K

Yes, it's certainly possible to include the demographic survey in the same script as the IAT. I just wrote the article at this link, which explains how to do this:


http://www.millisecond.com/support/docs/v3/html/howto/multiplescripts.htm


The article uses the example of combining two IATs, but the same strategy applies to combining an IAT with a survey, or any two measures.


If anything in the article is unclear, let me know.


Regards,


Sean


Rickardcarlsson
Rickardcarlsson
Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)
Group: Forum Members
Posts: 58, Visits: 1

That's great! But I wonder how I should go about so that I can easily identify and pair up the two .dat-files that are produced.  I will sometimes for ease of admininstration let many people use the same subject number (instead i use subject number to counter-balance to certain conditions). However then it is impossible to tell which demographic data file that goes with which IAT data file.


Often I can be fairly certain because of IP number and minute and seconds it was done. However sometimes 30 people with same external IP will perform the test and be done just about at the same time.


Is there a work around for this? Or is it possible to incorporate survey-pages in the same script as the IAT so to produce a single data file?



GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search