How to link Inquisit script and demographic script


Author
Message
Maria
Maria
Partner Member (543 reputation)Partner Member (543 reputation)Partner Member (543 reputation)Partner Member (543 reputation)Partner Member (543 reputation)Partner Member (543 reputation)Partner Member (543 reputation)Partner Member (543 reputation)Partner Member (543 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


Andrea Deme
Andrea Deme
Distinguished Member (3.7K reputation)Distinguished Member (3.7K reputation)Distinguished Member (3.7K reputation)Distinguished Member (3.7K reputation)Distinguished Member (3.7K reputation)Distinguished Member (3.7K reputation)Distinguished Member (3.7K reputation)Distinguished Member (3.7K reputation)Distinguished Member (3.7K 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 (455 views, 40.00 KB)
Dave
Dave
Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)
Group: Administrators
Posts: 10K, Visits: 59K
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 (3.7K reputation)Distinguished Member (3.7K reputation)Distinguished Member (3.7K reputation)Distinguished Member (3.7K reputation)Distinguished Member (3.7K reputation)Distinguished Member (3.7K reputation)Distinguished Member (3.7K reputation)Distinguished Member (3.7K reputation)Distinguished Member (3.7K 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 (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)
Group: Administrators
Posts: 10K, Visits: 59K
You don't need to use <include>. In fact, putting the elements directly into a single "main" script is probably easier -- all <include> does is paste the contents of one file into another, so it amounts to the same thing anyway.

Dave
Dave
Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)
Group: Administrators
Posts: 10K, Visits: 59K
One more thing: If you want to end up with all the data in a single file per subject, you must avoid using <survey> elements (those will always generate a separate output file). Instead, run any surveypages via <block> elements.

Andrea Deme
Andrea Deme
Distinguished Member (3.7K reputation)Distinguished Member (3.7K reputation)Distinguished Member (3.7K reputation)Distinguished Member (3.7K reputation)Distinguished Member (3.7K reputation)Distinguished Member (3.7K reputation)Distinguished Member (3.7K reputation)Distinguished Member (3.7K reputation)Distinguished Member (3.7K reputation)
Group: Forum Members
Posts: 16, Visits: 34
I did include all the blocks and trials in the main script (attached) but the problem is that he options on the survey pages appear in black (on black background) so they are invisible. On which level could/should I change the font color?

The second comment is also great, thanks! But I am afraid that I am not sure what you mean by running surveypages via block elements. Should every surveypage be included/embedded in a block element or should I reconstruct the <surveypage> elemnts to trials and the <survey> to <block> by transforming the synatx of these? 
Attachments
IATjorossz.exp (565 views, 26.00 KB)
Dave
Dave
Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)
Group: Administrators
Posts: 10K, Visits: 59K
Instead of

<survey mysurvey>
/ pages = [1=page1; 2=page2; ...]
....
</survey>

you do

<block mysurvey>
/ trials = [1=page1; page2; ...]
...
</block>

In the <block> that runs the <surveypage>s, set the /screencolor attribute to what you want / need.

Andrea Deme
Andrea Deme
Distinguished Member (3.7K reputation)Distinguished Member (3.7K reputation)Distinguished Member (3.7K reputation)Distinguished Member (3.7K reputation)Distinguished Member (3.7K reputation)Distinguished Member (3.7K reputation)Distinguished Member (3.7K reputation)Distinguished Member (3.7K reputation)Distinguished Member (3.7K reputation)
Group: Forum Members
Posts: 16, Visits: 34
You are great, thanks a lot!!!

And now I faced another problem :)
My script, as it is usual, should give compatible-incompatible and incompatible-compatible block orders for different participants (based on their IDs), but the way I introduced random ID selection in the jawa script keeps giving them even numbers all the time, so I don't have a balanced distribution of the 2 differemt orders above. I run 12 tests and I got incompatible-compatible order all the time (and even numbers as subj ID).
Is there a way I could affect the distribution of odd and even numbers?

Dave
Dave
Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)Supreme Being (853K reputation)
Group: Administrators
Posts: 10K, Visits: 59K
Either the condition assignment in your script is faulty, or you have not properly replaced the GetSubjectNumber() in the launch page's source or you're not refreshing the launch page between runs (which you need to do to get a new id).

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search