Millisecond Forums

Multiple sets of items and instructions within set

https://forums.millisecond.com/Topic7922.aspx

By jmwotw - 4/27/2012

Hello Inquisiters.  I have a set of items that I want to administer in a random order.  However, there are two sets of rules that I am having difficulty implementing.  


First, depending on the age of the participants, I want to administer different sets of items.  For example, if a kindergartner is taking the test, I want to administer all items that I believe are kindergarten-level (based on theory), but I also want to administer some of the late-pre-kindergarten items and some of the first-grade items.  


Second, regardless of the set of items, I am also considering administering the first X items in the set with some additional prompts in order to help the child understand the task.  Specifically, the first X items will contain an additional audio file with instructions to the task.  I have figured out how to "hard-code" this by identifying certain items to serve as these practice items, but I can't figure out how to have Inquisit automatically add the additional prompts for those initial items.  From looking at the forums and a couple of the examples from the task library, I think I need to use a counter and expressions to track the progress, but I'm new to Inquisit and am not sure.


Could somebody point me to an example or examples that might set me on the right path?  I'm very comfortable coding in some languages, but I don't know the keywords to effectively search the Inquisit forums for assistance.



Thanks in advance,


Jeff

By Dave - 4/27/2012

First, depending on the age of the participants, I want to administer different sets of items.  For example, if a kindergartner is taking the test, I want to administer all items that I believe are kindergarten-level (based on theory), but I also want to administer some of the late-pre-kindergarten items and some of the first-grade items.  


Work through the 'Multilanguage IAT' script available at the Task Library, which does exactly that based on choice of language (instead of choice of age group).


Second, regardless of the set of items, I am also considering administering the first X items in the set with some additional prompts in order to help the child understand the task.  Specifically, the first X items will contain an additional audio file with instructions to the task.  I have figured out how to "hard-code" this by identifying certain items to serve as these practice items, but I can't figure out how to have Inquisit automatically add the additional prompts for those initial items.  From looking at the forums and a couple of the examples from the task library, I think I need to use a counter and expressions to track the progress, but I'm new to Inquisit and am not sure.


Depends on what exactly you want to do, but sounds like you should simply set up separate practice <block>s and <trials>, which display those additional prompts, i.e. behave differently than your experimental trials. There is no need whatsoever for any hard-coding.


Regards,


~Dave

By jmwotw - 4/27/2012

Thanks, Dave.  I will look at the Multilanguage IAT example.  For the practice trials, I have different blocks now, but I can't get the two blocks to draw from the same item pool without replacement.  So my practice blocks always use items 1-5, and my experiment blocks always use 6-30, instead of a random set of 5 items being used as the practice items. So that's why I was wondering if I could use the counter syntax to keep track of all of my items.  I would then draw 5 items during the practice blocks, then when a counter expression reached #6, move to the experiment blocks, using the same counter to draw items so that they wouldn't be reused.  I guess this is sort of similar to the strategy employed in the blackjack example.

By Dave - 4/27/2012

I have different blocks now, but I can't get the two blocks to draw from the same item pool without replacement.


You need to make use of the /resetinterval attribute. See the documentation for details.

By jmwotw - 4/28/2012


Thanks for your help!  I think I have it all figured out now, but I just have a few clarification/confirmation questions.




  1. In my item counter section, I list all of the items (reduced here to 4 for brevity).  Should the reset interval equal the total number of items, or if I am only administering a subset of the items, should I set it to the total number of items in the subset?

  2. Since I am randomly selecting items from the item counter using the ontrialbegin attribute (I think this is coded correctly), should every other select statement reference the item counter (other counters, picture and sound elements)?  Before I had to create a chain, where the first picture was selected randomly, the second was chained to the first, the third to the second, and so on.

  3. This is a 4-item multiple choice task. In order to dynamically assign the correct response, I used another counter variable, tied to the first one, that indicated the correct response with a numeric value between 1-4.  However, since the response is text-based, I had to translate the numeric values to text using an expression before evaluating the response using the iscorrectresponse attribute in the trial section.  Is this a good strategy?



Thanks again everyone...even though it's confusing sometimes, I love the flexibility of this program!  These latest changes have reduced my code by about 75%!  Boo-yah!



Best regards,


Jeff



**************************************************************************************************************


COUNTER


**************************************************************************************************************


<counter items>


/ select = noreplace


/ selectionrate = always


/ items = (1, 2, 3, 4)


/ resetinterval = 4


</counter>



<counter items_correct>


 /items = (4, 4, 1, 3)


/ select = current(items)


</counter>



**************************************************************************************************************


VALUES


**************************************************************************************************************


<values>


/items=0


/correct=0


/correctt = " "


</values>



**************************************************************************************************************


EXPRESSIONS


**************************************************************************************************************


<expressions>


/correct_exp = 


    if (values.correct == 1) values.correctt = "PK2_1_UL_pic";


    if (values.correct == 2) values.correctt = "PK2_1_UR_pic";


    if (values.correct == 3) values.correctt = "PK2_1_LL_pic";


    if (values.correct == 4) values.correctt = "PK2_1_LR_pic";



</expressions>


******************************************************************************************************************


PICTURE  &  SOUND  SECTIONS   


Each Trial type has a set of four pictures in different positions to specify below.


****************************************************************************************************************** 



<picture PK2_1_LL_pic>


/ items = PK2_1_LL


/ select = current(items)


/ position = (25, 75)


/ size = (40%, 40%)


</picture>



<picture PK2_1_LR_pic>


/ items = PK2_1_LR


/ select = current(items)


/ position = (75, 75)


/ size = (40%, 40%)


</picture>



<picture PK2_1_UL_pic>


/ items = PK2_1_UL


/ select = current(items)


/ position = (25, 25)


/ size = (40%, 40%)


</picture>



<picture PK2_1_UR_pic>


/ items = PK2_1_UR


/ select = current(items)


/ position = (75, 25)


/ size = (40%, 40%)


</picture>



<sound PK2_1_point_to_the_letter>


/ items = PK2_1_point_to_the_letters


/ select = current(items)


</sound>



<sound PK2_1_LN>


/ items = PK2_1_LNs


/ select = current(items)


</sound>



******************************************************************************************************


         PICTURE ITEM SECTIONS   


****************************************************************************************************** 



 <item PK2_1_UL>


  / 1="ELNMC008D.jpg"


  / 2="ELNMC010C.jpg"


  / 3="ELNMC012A.jpg"


  / 4="ELNMC013D.jpg"


   </item>



 <item PK2_1_UR>


  / 1="ELNMC008B.jpg"


  / 2="ELNMC010D.jpg"


  / 3="ELNMC012D.jpg"


  / 4="ELNMC013B.jpg"


   </item>



 <item PK2_1_LL>


  / 1="ELNMC008C.jpg"


  / 2="ELNMC010B.jpg"


  / 3="ELNMC012C.jpg"


  / 4="ELNMC013A.jpg"


   </item>



 <item PK2_1_LR>


  / 1="ELNMC008A.jpg"


  / 2="ELNMC010A.jpg"


  / 3="ELNMC012B.jpg"


  / 4="ELNMC013C.jpg"


  </item>



 ******************************************************************************************************


               AUDIO ITEM SECTIONS.  


******************************************************************************************************


 <item PK2_1_point_to_the_letters>


  / 1="point_to_the_letter_female1.wav"


  / 2="point_to_the_letter_female1.wav"


  / 3="point_to_the_letter_male2.wav"


  / 4="point_to_the_letter_female1.wav"


   </item>



 <item PK2_1_LNs>


  / 1="ELNMC008A1_F.wav"


  / 2="ELNMC010A2_F.wav"


  / 3="ELNMC012A2_M.wav"


  / 4="ELNMC013A2_F.wav"


</item>



********************************  TRIAL SECTIONS   *************************************



 <trial PK2_1_Prac_trials>


/ ontrialbegin = [values.items = counter.items.selectedvalue; values.correct = counter.items_correct.selectedvalue]


/ ontrialbegin = [expressions.correct_exp]


/ inputdevice = mouse


/ iscorrectresponse = [trial.PK2_1_Prac_trials.response == values.correctt]


/ pretrialpause = 250


/ posttrialpause = 250


/ recorddata = true


/ correctmessage = true(PK2_1_right,1500)


/ errormessage = true(PK2_1_wrong,1500)


/ responsetrial = (diamond, pause)


/ validresponse = (diamond,


   PK2_1_LL_pic,


   PK2_1_LR_pic,


   PK2_1_UL_pic,


   PK2_1_UR_pic)


/ stimulustimes = [1=diamond, line_LF, line_RT, line_Top, line_Bottom;


   500 =        PK2_1_LL_pic,


            PK2_1_LR_pic,


            PK2_1_UL_pic,


            PK2_1_UR_pic;


   550 =       tones;


   600=      PK2_1_item_name;


   1750 =     PK2_1_point_to_the_letter;


   3400 =     PK2_1_LN]


</trial>



<trial PK2_1_Test_trials>


/ ontrialbegin = [values.items = counter.items.selectedvalue; values.correct = counter.items_correct.selectedvalue]


/ ontrialbegin = [expressions.correct_exp]


/ inputdevice = mouse


/ iscorrectresponse = [trial.PK2_1_Test_trials.response == values.correctt]


/ pretrialpause = 250


/ posttrialpause = 250


/ recorddata = true


/ correctmessage = true(PK2_1_right,1500)


/ errormessage = true(PK2_1_wrong,1500)


/ responsetrial = (diamond, pause)


/ validresponse = (diamond,


   PK2_1_LL_pic,


   PK2_1_LR_pic,   


   PK2_1_UL_pic,


   PK2_1_UR_pic)


/ stimulustimes = [1=diamond, line_LF, line_RT, line_Top, line_Bottom;


   500 =


      PK2_1_LL_pic,


      PK2_1_LR_pic,


      PK2_1_UL_pic,


      PK2_1_UR_pic;


   550 =       tones;


   600=      PK2_1_item_name;


   1900 =     PK2_1_LN]


</trial>



<trial pause>


   / inputdevice = mouse


   / validresponse = (continue)


   / correctmessage = false


   / errormessage = false


   / correctresponse = (continue)


   / pretrialpause = 0


   / posttrialpause = 0


   / recorddata = true


   / stimulustimes = [1=continue]


   </trial>



*************************************************************************


  BLOCK SECTION. 


*************************************************************************


<block PK2_1_Prac_block>


   / trials = [1 - 4=noreplace(PK2_1_Prac_trials)]


   </block>



<block PK2_1_Test_block>


   / trials = [1 - 7=noreplace(PK2_1_Test_trials)]


   </block>




By Dave - 4/28/2012

In my item counter section, I list all of the items (reduced here to 4 for brevity).  Should the reset interval equal the total number of items, or if I am only administering a subset of the items, should I set it to the total number of items in the subset?


Inquisit will automatically (have to) reset a counter (or other item pool) when it runs out of unsampled items. That's not what resetinterval is for. Here's what it's for: By default, Inquisit will reset all selection pools at the beginning of a new <block>. /resetinterval lets you override this, so you can e.g. draw from the *same* pool without replacement across multiple blocks without replacement (which is what you asked for -- draw from the same set of items in practice and test blocks, without replacement).


Since I am randomly selecting items from the item counter using the ontrialbegin attribute (I think this is coded correctly), should every other select statement reference the item counter (other counters, picture and sound elements)?  Before I had to create a chain, where the first picture was selected randomly, the second was chained to the first, the third to the second, and so on.


I don't see for what purpose you'd need values.items anyway. You're not using it anywhere.


This is a 4-item multiple choice task. In order to dynamically assign the correct response, I used another counter variable, tied to the first one, that indicated the correct response with a numeric value between 1-4.  However, since the response is text-based, I had to translate the numeric values to text using an expression before evaluating the response using the iscorrectresponse attribute in the trial section.  Is this a good strategy?


You also could have the <counter> return the strings directly. Counters aren't limited to numeric values.


Regards,


~Dave


P.S.: Please consider using the forum's file attachment facility (-> 'Options' tab) instead of pasting lengthy scripts into the message body (doing so does not serve readability well). Thanks.

By jmwotw - 4/28/2012



 jmwotw:

Since I am randomly selecting items from the item counter using the ontrialbegin attribute (I think this is coded correctly), should every other select statement reference the item counter (other counters, picture and sound elements)?  Before I had to create a chain, where the first picture was selected randomly, the second was chained to the first, the third to the second, and so on.



I don't see for what purpose you'd need values.items anyway. You're not using it anywhere.




Sorry about the posting script in the message body.  I didn't see the forum option to post a file.  Thanks for the info.  Anyway, I used values.items because I didn't know what else to use to select the next item from the item counter.  When I used


/ ontrialbegin[picture.PK2_1_LL_pic.item.1 = counter.items.selectedvalue] (the first picture),


I kept getting "Unable to initialize picture PK2_1_LL_pic" message.  When I removed the ontrialbegin attribute altogether, it never iterated to the next item.

By Dave - 4/28/2012

/ ontrialbegin[picture.PK2_1_LL_pic.item.1 = counter.items.selectedvalue] (the first picture),


Well, that's completely broken syntax.

By Dave - 4/28/2012

/ ontrialbegin[picture.PK2_1_LL_pic.item.1 = counter.items.selectedvalue] (the first picture),


Is also broken. It means you try to set a numerical value pulled from the counter as the first item in the picture element.

By jmwotw - 4/28/2012

Well, I guess I don't know how to fix it the correct way.  Using values.items fixed the issue so I went with that.  If there's a better way, I would love to hear it.

By Dave - 4/28/2012

Depends on what you want the code to do -- which is not obvious from your script. For the record:


/ ontrialbegin = [values.item=counter.items.selectedvalue; ...]


will sample a value from the counter and store it in values.item. values.item, though, is never actually used for anything in the script. The respective counter is set to '/ selectionrate = always' for reasons unclear to me. You'd need that setting if you wanted to pull several *different* values from said counter in a single trial. The various <picture> elements reference the counter as a dependency via '/select = current(items)', the intention of which also remains unclear to me.


Regards,


~Dave

By jmwotw - 4/28/2012

First of all, Dave, you are awesome. Thanks for your help.



My goals:




  1. Randomly select a question for each trial (currently, via the item counter.  I just looked at the help, and I think I should be using selectionrate=trial instead of always)

  2. Call all of the relevant stimuli related to this question (4 pictures, 2 sounds, currently via the current(items) mechanism), plus the correct response (currently via the second counter).  This is the part that I am most unclear about.  After Inquisit randomly selects a question from the item counter, how do I call all of the relevant stimuli from the picture/sound elements?  What I've done works, but you seem to be indicating that my strategy is misguided.

  3. If the question is one of the first X questions, use more audio instructions to help the children understand the task.  After that, eliminate those additional instructions.


Best regards, 


Jeff



By Dave - 4/28/2012



  1. Randomly select a question for each trial (currently, via the item counter.  I just looked at the help, and I think I should be using selectionrate=trial instead of always)



Yes. Note that '/selectionrate = trial' is what a counter defaults to.



  • Call all of the relevant stimuli related to this question (4 pictures, 2 sounds, currently via the current(items) mechanism), plus the correct response (currently via the second counter).  This is the part that I am most unclear about.  After Inquisit randomly selects a question from the item counter, how do I call all of the relevant stimuli from the picture/sound elements?  What I've done works, but you seem to be indicating that my strategy is misguided.


  • Yes, what you've done works (at least looks like it), but it does so by accident rather than by good design (no offense). Several more straightforward / clearer strategies:


    - Simply have all of the various stimulus elements (<picture>, <sound>, etc.) reference the counter directly in their /select attributes (/select = items). The counter will supply one value (i.e., here: item index #) per trial (see above), all elements will thus retrieve the correct item set.


    - Alternatively keep your /ontrialbegin statement and use values.item in /select (/select = values.item)



  • If the question is one of the first X questions, use more audio instructions to help the children understand the task.  After that, eliminate those additional instructions.


  • Your different trial elements take care of that. The practice trials display those sounds, etc., the test trials don't.


    Regards,


    ~Dave

    By jmwotw - 4/28/2012

    No offense taken.  "I'd rather be lucky than good".  [:D]