﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Millisecond Forums » Millisecond Forums » Inquisit 3  » How to link Inquisit script and demographic script</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Fri, 25 Sep 2026 10:16:54 GMT</lastBuildDate><ttl>20</ttl><item><title>How to link Inquisit script and demographic script</title><link>https://forums.millisecond.com/Topic1258.aspx</link><description>&lt;p&gt;Dear all,&lt;/p&gt;
&lt;p&gt;I designed an IAT (Implicit Association Test) script to compare students' response towards two universities. I also designed the demographic scripts for further sub-group analysis (thanks for the wonderful functions of Inquisit 3). Now I do not know how to link these two scripts, and let it run from the IAT to the demographic questions without interruption or transfer. &lt;/p&gt;
&lt;p&gt;Here is the beginning of IAT Inquisit:&lt;/p&gt;
&lt;p&gt;&amp;lt;expt&amp;gt;&lt;br&gt;/ subjects = (1 of 2)&lt;br&gt;/ preinstructions = (overview1, overview2, overview4, overview5, consent, begin1, begin2)&lt;br&gt;/ postinstructions = (end)&lt;br&gt;/ blocks = [1=Target1_practice;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2=ATTRIB_practice; &lt;br&gt;&amp;nbsp;&amp;nbsp;3=Pairing1_practice; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4=Pairing1_test;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5=Target2_practice_Pairing1_1st; &lt;br&gt;&amp;nbsp;&amp;nbsp;6=Pairing2_practice;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7=Pairing2_test]&lt;br&gt;&amp;lt;/expt&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;expt&amp;gt;&lt;br&gt;/ subjects = (2 of 2)&lt;br&gt;/ preinstructions = (overview1, overview2, overview4, overview5, consent, begin1, begin2)&lt;br&gt;/ postinstructions = (end)&lt;br&gt;/ blocks = [1=Target2_practice;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2=ATTRIB_practice;&lt;br&gt;&amp;nbsp;&amp;nbsp;3=Pairing2_practice; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4=Pairing2_test;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5=Target1_practice_Pairing2_1st; &lt;br&gt;&amp;nbsp;&amp;nbsp;6=Pairing1_practice;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7=Pairing1_test]&lt;br&gt;&amp;lt;/expt&amp;gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;Here is part of the demographic script:&lt;/p&gt;
&lt;p&gt;&amp;lt;dropdown gender&amp;gt;&lt;br&gt;/ caption = "Gender"&lt;br&gt;/ options = ("female", "male")&lt;br&gt;&amp;lt;/dropdown&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;textbox age&amp;gt;&lt;br&gt;/ caption = "Age"&lt;br&gt;/ mask = positiveinteger&lt;br&gt;/ range = (7, 110)&lt;br&gt;&amp;lt;/textbox&amp;gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;surveypage demographics1&amp;gt;&lt;br&gt;/ caption = "Please answer the following demographic questions"&lt;br&gt;/ fontstyle = ("Verdana", -16, true, false, false, false, 5, 0)&lt;br&gt;/ questions = [1=gender; 2=age; 3=degree; 4=living; 5=alumni; 6=relationship] &lt;br&gt;&amp;lt;/surveypage&amp;gt;&lt;/p&gt;
&lt;p&gt;Your help is highly appreciated!&lt;/p&gt;
&lt;p&gt;Penny&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&amp;nbsp;&lt;/p&gt;</description><pubDate>Tue, 14 Oct 2014 07:32:35 GMT</pubDate><dc:creator>Penny</dc:creator></item><item><title>RE: How to link Inquisit script and demographic script</title><link>https://forums.millisecond.com/Topic14607.aspx</link><description>I tried in Chrome and Mozilla, works well in both!</description><pubDate>Tue, 14 Oct 2014 07:32:35 GMT</pubDate><dc:creator>Andrea Deme</dc:creator></item><item><title>RE: How to link Inquisit script and demographic script</title><link>https://forums.millisecond.com/Topic14606.aspx</link><description>wow.. and now it's working again!!! great! thank you so much.&lt;br/&gt;how did you get to that conclusion?!</description><pubDate>Tue, 14 Oct 2014 07:29:24 GMT</pubDate><dc:creator>Andrea Deme</dc:creator></item><item><title>RE: How to link Inquisit script and demographic script</title><link>https://forums.millisecond.com/Topic14605.aspx</link><description>Did some more quick digging and testing. Try changing the GetSubjectNumber() function in the HTML source to&lt;br/&gt;&lt;br/&gt;function GetSubjectNumber()&lt;br/&gt;{&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return (Math.ceil(Math.random() * 1000000000))&lt;strong&gt;.toString()&lt;/strong&gt;;&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;and let me know if that resolves the issue in Firefox. (I have no idea why the original code suddenly stopped working there.)&lt;br/&gt;</description><pubDate>Tue, 14 Oct 2014 06:48:27 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: How to link Inquisit script and demographic script</title><link>https://forums.millisecond.com/Topic14604.aspx</link><description>Oh, I've just noticed the PS, sorry. It's probably a useful piece of additional info: I use a page created by simply modifying the standard launch page (so that I can format the text and instructions displayed on the first screen and translate some small instructions as well regarding the plugins), so this problem might be due to the fact that normally the standard page is more "flexible" and by simply copying and editing it I made something be fixed that should not be so...</description><pubDate>Tue, 14 Oct 2014 06:37:36 GMT</pubDate><dc:creator>Andrea Deme</dc:creator></item><item><title>RE: How to link Inquisit script and demographic script</title><link>https://forums.millisecond.com/Topic14603.aspx</link><description>Uhh, oh my... I tried explorer as well and it did work... thank you very much, you saved my day again. And yes, I'll put some pressure on the head of department and ask for the upgrade to Inquisit 4. So you say simply changing the html would not solve the problem, right?&amp;nbsp;</description><pubDate>Tue, 14 Oct 2014 06:22:42 GMT</pubDate><dc:creator>Andrea Deme</dc:creator></item><item><title>RE: How to link Inquisit script and demographic script</title><link>https://forums.millisecond.com/Topic14602.aspx</link><description>Thanks for the link. There is nothing obviously "wrong" with the launch page code. That said, I am able to reproduce the error using the latest Firefox version / the NPAPI plugin, but not using Internet Explorer / ActiveX or ClickOnce.&lt;br/&gt;&lt;br/&gt;My guess would thus be that Mozilla changed their plugin handling (again) recently, essentially breaking the way the subject id and other information is passed from the launch page to the plugin via. The only quick "fix" I can think of is to direct your participants to complete the study using Internet Explorer (which is fortunately present on every Windows system by default).&lt;br/&gt;&lt;br/&gt;Over the long run, I would recommend at least considering upgrading to Inquisit 4, which provides support for modern platforms and browsers.&lt;br/&gt;&lt;br/&gt;P.S.: I'll be looking into this more deeply, but that'll take some time. Oddly enough, the issue does not seem to occur with standard 3.0.6.0 launch pages generated via the Web Script Wizard, which suggests there is some (non-obvious) factor relating to the "custom" launch page you're using involved.&lt;br/&gt;</description><pubDate>Tue, 14 Oct 2014 06:08:01 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: How to link Inquisit script and demographic script</title><link>https://forums.millisecond.com/Topic14601.aspx</link><description>Oh, okay, it's here:&amp;nbsp;&lt;a href="http://www.millisecond.com/myaccount/scripts/bencekas/batchIATdemog/IATintroV2.html"&gt;http://www.millisecond.com/myaccount/scripts/bencekas/batchIATdemog/IATintroV2.html&lt;/a&gt;</description><pubDate>Tue, 14 Oct 2014 05:08:33 GMT</pubDate><dc:creator>Andrea Deme</dc:creator></item><item><title>RE: How to link Inquisit script and demographic script</title><link>https://forums.millisecond.com/Topic14600.aspx</link><description>The error message indicates no subject id was passed to the script. In case of the IAT that's fatal as the counterbalancing of conditions (cf. the &amp;lt;variables&amp;gt; element) relies on it.&lt;br/&gt;&lt;br/&gt;As to why that is, I cannot tell you based on the materials you provided. I would need the live link to the actual launch page.&lt;br/&gt;</description><pubDate>Tue, 14 Oct 2014 05:03:27 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: How to link Inquisit script and demographic script</title><link>https://forums.millisecond.com/Topic14599.aspx</link><description>dear Dave, sorry, itts me again... the very same scripts and html that run perfectly a week ago just went rong and I cannopt find the reason why... I did not modify any important parts in the script. it's probably a typical issue, please see the error messagge and the scripts and html attached. could you help me out again?</description><pubDate>Tue, 14 Oct 2014 04:29:27 GMT</pubDate><dc:creator>Andrea Deme</dc:creator></item><item><title>RE: How to link Inquisit script and demographic script</title><link>https://forums.millisecond.com/Topic14525.aspx</link><description>No problem. Note that I would generally recommend sticking with Math.floor(), which -- in theory -- should get you closest to a uniform odd/even distribution.&lt;br/&gt;</description><pubDate>Fri, 03 Oct 2014 07:29:44 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: How to link Inquisit script and demographic script</title><link>https://forums.millisecond.com/Topic14522.aspx</link><description>oh, you looked it up! great!!! thanks a lot!! :)</description><pubDate>Fri, 03 Oct 2014 07:14:02 GMT</pubDate><dc:creator>Andrea Deme</dc:creator></item><item><title>RE: How to link Inquisit script and demographic script</title><link>https://forums.millisecond.com/Topic14521.aspx</link><description>yes, you are absolutely right about the multiple heads and tails, and that I shouldn't worry about this... I tried math.floor implementation again and multiple (5 or 6)&amp;nbsp;odd numbers in a raw also occurred. than i tried ceil and seemed a tiny bit more balanced (but still, it was just 6 or 7 trials that is very impressionistic), &lt;br/&gt;anyway, i'll &amp;nbsp;stick to that and thank you again for your time and effort! it was a huge help you just gave me!! :)</description><pubDate>Fri, 03 Oct 2014 07:12:53 GMT</pubDate><dc:creator>Andrea Deme</dc:creator></item><item><title>RE: How to link Inquisit script and demographic script</title><link>https://forums.millisecond.com/Topic14519.aspx</link><description>Hmm, weird. (1) It is, of course, perfectly possible to receive multiple even ids in a row. Same thing as tossing a coin -- nothing prevents in from landing heads multiple times in a row. Over the long run, though, the expectation is approx. 50% heads and 50% tails, or as here: 50% odd and 50% even numbers. (2) It might be that your browser's JavaScript engine has a bug or bias in its Math.random() or Math.floor() implementation. Would be interesting to know if the same happens across different browsers or if changing the function to e.g.&lt;br/&gt;&lt;br/&gt;function GetSubjectNumber()&lt;br/&gt;{&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return (Math.&lt;strong&gt;round&lt;/strong&gt;(Math.random() * 1000000000));&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;or&lt;br/&gt;&lt;br/&gt;function GetSubjectNumber()&lt;br/&gt;{&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return (Math.&lt;strong&gt;ceil&lt;/strong&gt;(Math.random() * 1000000000));&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;makes any (systematic) difference.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;EDITED TO ADD: It is usually not advisable to use Math.round() because it will lead to the resulting distribution being non-uniform.&lt;br/&gt;</description><pubDate>Fri, 03 Oct 2014 06:55:30 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: How to link Inquisit script and demographic script</title><link>https://forums.millisecond.com/Topic14518.aspx</link><description>The puzzling thing is that I do get different numbers as IDs, but all of them just seems to be even numbers (see attached), and&amp;nbsp;I have no idea, why :(&lt;br/&gt;The script must be okay, I think, as if I run it on the PC with odd and even numbers as IDs it changes the block order...&lt;br/&gt;(And I &amp;nbsp;modified the launch page just as you instructed me to, but according to the huge numbers, it is working properly, i think...)</description><pubDate>Fri, 03 Oct 2014 06:33:52 GMT</pubDate><dc:creator>Andrea Deme</dc:creator></item><item><title>RE: How to link Inquisit script and demographic script</title><link>https://forums.millisecond.com/Topic14517.aspx</link><description>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).&lt;br/&gt;</description><pubDate>Fri, 03 Oct 2014 06:20:05 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: How to link Inquisit script and demographic script</title><link>https://forums.millisecond.com/Topic14516.aspx</link><description>You are great, thanks a lot!!!&lt;br/&gt;&lt;br/&gt;And now I faced another problem :) &lt;br/&gt;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).&lt;br/&gt;Is there a way I could affect the distribution of odd and even numbers?&lt;br/&gt;</description><pubDate>Fri, 03 Oct 2014 06:16:47 GMT</pubDate><dc:creator>Andrea Deme</dc:creator></item><item><title>RE: How to link Inquisit script and demographic script</title><link>https://forums.millisecond.com/Topic14513.aspx</link><description>Instead of &lt;br/&gt;&lt;br/&gt;&amp;lt;survey mysurvey&amp;gt;&lt;br/&gt;/ pages = [1=page1; 2=page2; ...]&lt;br/&gt;....&lt;br/&gt;&amp;lt;/survey&amp;gt;&lt;br/&gt;&lt;br/&gt;you do &lt;br/&gt;&lt;br/&gt;&amp;lt;block mysurvey&amp;gt;&lt;br/&gt;/ trials = [1=page1; page2; ...]&lt;br/&gt;...&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;In the &amp;lt;block&amp;gt; that runs the &amp;lt;surveypage&amp;gt;s, set the /screencolor attribute to what you want / need.&lt;br/&gt;</description><pubDate>Fri, 03 Oct 2014 05:24:53 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: How to link Inquisit script and demographic script</title><link>https://forums.millisecond.com/Topic14512.aspx</link><description>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?&lt;br/&gt;&lt;br/&gt;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 &amp;lt;surveypage&amp;gt; elemnts to trials and the &amp;lt;survey&amp;gt; to &amp;lt;block&amp;gt; by transforming the synatx of these?&amp;nbsp;</description><pubDate>Fri, 03 Oct 2014 05:19:38 GMT</pubDate><dc:creator>Andrea Deme</dc:creator></item><item><title>RE: How to link Inquisit script and demographic script</title><link>https://forums.millisecond.com/Topic14511.aspx</link><description>One more thing: If you want to end up with all the data in a single file per subject, you must avoid using &amp;lt;survey&amp;gt; elements (those will always generate a separate output file). Instead, run any surveypages via &amp;lt;block&amp;gt; elements.&lt;br/&gt;</description><pubDate>Fri, 03 Oct 2014 05:06:04 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: How to link Inquisit script and demographic script</title><link>https://forums.millisecond.com/Topic14510.aspx</link><description>You don't need to use &amp;lt;include&amp;gt;. In fact, putting the elements directly into a single "main" script is probably easier -- all &amp;lt;include&amp;gt; does is paste the contents of one file into another, so it amounts to the same thing anyway.&lt;br/&gt;</description><pubDate>Fri, 03 Oct 2014 05:04:36 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: How to link Inquisit script and demographic script</title><link>https://forums.millisecond.com/Topic14508.aspx</link><description>Thanks for the quick reply!! i am already relieved:)&lt;br/&gt;&lt;br/&gt;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... )&lt;br/&gt;&lt;br/&gt;I'll do the modification in the script as well.&lt;br/&gt;&lt;br/&gt;thanks again!&amp;nbsp;</description><pubDate>Fri, 03 Oct 2014 04:59:00 GMT</pubDate><dc:creator>Andrea Deme</dc:creator></item><item><title>RE: How to link Inquisit script and demographic script</title><link>https://forums.millisecond.com/Topic14505.aspx</link><description>Look at your launch page's source code. The subject number is generated / returned by &lt;br/&gt;&lt;br/&gt;function GetSubjectNumber()&lt;br/&gt;{&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "3";&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;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.&lt;br/&gt;&lt;br/&gt;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).&lt;br/&gt;&lt;br/&gt;function GetSubjectNumber() &lt;br/&gt;{ &lt;br/&gt;&amp;nbsp;&amp;nbsp; return (Math.floor(Math.random() * 1000000000)); &lt;br/&gt;} &lt;br/&gt;&lt;br/&gt;You can alternatively (or in addition) merge your two scripts. &amp;lt;survey&amp;gt; elements are special types of &amp;lt;block&amp;gt;s and &amp;lt;surveypage&amp;gt; elements are special types of &amp;lt;trial&amp;gt;. You simply integrate those into your IAT script as you would with any other additional block etc. See the "&lt;span class="header1"&gt;How to Combine Multiple Scripts" topic in the documentation.&lt;br/&gt;&lt;/span&gt;</description><pubDate>Fri, 03 Oct 2014 04:25:07 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: How to link Inquisit script and demographic script</title><link>https://forums.millisecond.com/Topic14504.aspx</link><description>Dear All,&lt;br/&gt;&lt;br/&gt;I have problem that is connected to the batch files and running 2 scripts (IAT and demographic survey) as well. &lt;br/&gt;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). &lt;br/&gt;&lt;br/&gt;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)?&lt;br/&gt;&lt;br/&gt;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.&lt;br/&gt;&lt;br/&gt;thanks a lot!!&lt;br/&gt;Andi&amp;nbsp;</description><pubDate>Fri, 03 Oct 2014 04:07:27 GMT</pubDate><dc:creator>Andrea Deme</dc:creator></item><item><title>RE: How to link Inquisit script and demographic script</title><link>https://forums.millisecond.com/Topic3408.aspx</link><description>&lt;p&gt;Hi Sean,&lt;/p&gt;
&lt;p&gt;thanks a lot for your quick reply, this works out perfectly. Now the batch file is running without any problem.&lt;/p&gt;
&lt;p&gt;Maria&lt;/p&gt;</description><pubDate>Tue, 22 Sep 2009 04:14:49 GMT</pubDate><dc:creator>Maria</dc:creator></item></channel></rss>