Adding a Y/N response with feedback a la IAT, and if/then clauses


Author
Message
briancjo
briancjo
Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)
Group: Forum Members
Posts: 25, Visits: 167
Dear Divine Intervention,
I have 3 hopefully simple questions (for you)

1. I have script that I have been doing this in person but I have to transition it to the web.
It basically presents a jpeg, and on the next frame, asks a question.
Similar to the IAT, I want subjects to input 'Y' or 'N' and then I want the script to give a green checkmark for correct and red X for incorrect.
Can you point me to the part of the IAT script that does this so I can edit it or give me a quick run down?

2. At the end of my trial, subjects have to choose 1 of 8 answer choices. I also want to add a box with an input and enter button at the end of my script. Afterwards, the script will provide feedback. Green/red marks like above. It can either be on the final screen or the following screen. whatever is easiest. It seems like this part needs an if/then clause.

3. Similarly to 3, I need to input a if/then clause at the end of the practice trial that will have the same screen as #2. If the subject answers correctly, the actual trials will begin. If the subject answers incorrectly, I want to present explanations. 

Hope all those are clear and simple.

Any help is much appreciated for the unworthy underdweller of your rule.

Brian
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: 12K, Visits: 98K
Re. #1: You'll need to set up <text> or <picture> elements for your correct / incorrect feeback stimuli (red x, green checkmark). Then display them via the <trial>'s /correctmessage and /errormessage attributes respectively. Of course, you need to specify the /correctresponse.

<trial sometrial>
...
/ validrespone = ("y", "n")
/ correctresponse = ("y")
/ correctmessage = true(greencheckmark, 500)
/ errormessage = true(redx, 500)
</trial>

You'll find elementary syntax constructs like this covered in the tutorials in the documentation. These are worth going through if you haven't done so already.

Re. #2: Your eight answer choices work the same way as the yes / no trial above. It's completely unclear to me why an if/then clause would be needed or for what. Give an concrete example, please.

Re. #2 & #3: You'll want to set up an <openended> element for the text input. Here, too, the need for or purpose of any if/then logic is unclear.

Edited 8 Years Ago by Dave
briancjo
briancjo
Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)
Group: Forum Members
Posts: 25, Visits: 167
Hi Superion,

Your responses make sense. the if/then clauses are unnecessary. Next Problems.
My basic script is such that for each block, I have 10 figures that are presented and the order is fixed in the code.
After each figure, the subject has to input 'y' or 'n' to a question. 
Problem 1: each figure has its own independent answer so i am not sure that I can setup the correctresponse like the IAT does. 
Would I have to setup have correct answers for each figure and if so, how would I do that?

Problem 2: for the previous block, after the subject gives a response, and they receive feedback, i will insert a posttrialpause like the IAT.
However, for a different condition will be such that the subject has only 5 seconds to respond 'y' or 'n'. If they respond, then they will get the 'correct' or 'wrong' message.
If they do not respond, I want the script to move onto the next trial. do i add in  a
/ timeout = 5000

thanks, brian
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: 12K, Visits: 98K
Re. #1: You can use the <trial>'s /iscorrectresponse attribute to do this. See e.g.

https://www.millisecond.com/forums/FindPost15355.aspx

or

https://www.millisecond.com/forums/FindPost11991.aspx

Re. #2: Yes, you can use a /timeout. But they'll still receive the error message in case of a non-response; not responding is also an error. See the "How to Control Trial Duration and Inter-Trial Intervals" topic in the documentation regarding the relationship of the various timing components involved in a trial: http://www.millisecond.com/support/docs/v4/html/howto/howtocontroltiming.htm



briancjo
briancjo
Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)
Group: Forum Members
Posts: 25, Visits: 167
Dave you are truly supreme,

All previous suggestions have worked beautifully. Next question.

I want my subjects to repeat a practice block 0 (or do a new practice block) if they get it wrong. 
If they get it right, they move on to the next block 1.
After completing the repeat practice block, they always go to block 1.
I looked at conditional statements, ontrialend, but all the examples seem tied to counters or values. I did not see any that began a new trial.
Would this be the if/then clauses?

Any thoughts would be helpful.
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: 12K, Visits: 98K
It's unclear what "if they get it wrong" means specifically, i.e., what is the criterion here for "getting it wrong"? In any case, you'll want to look into using the <block>'s /branch attribute or using the /correcttarget attribute.

https://www.millisecond.com/support/docs/v4/html/language/attributes/correcttarget.htm

briancjo
briancjo
Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)
Group: Forum Members
Posts: 25, Visits: 167
Dave,
Here is the code first of the blocks and trials. After, I set out my questions.

Here is the practice block code
<block DISC0>
/trials = [1-10 = sequence(picture0, Combo0); 11 = ComboFinal; 12 = Practice]
</block>
Trials 1-10 = subjects see 1 figure and then answer a Y/N question, for 10 total figures. 
Trial 11 = Combofinal is a final question asking participants to choose 1 of 8 answer choices. 
Trial 12 = Practice is an explanation of the previous Trial.
---------------
Here are my main issues.
If subjects get trial 11 incorrect, I want to run the trial 12 (practice) and then have them re-run the entire block (Disc0).
If subjects get trial 11 correct, I want to run trial 12 and then run the next block (Disc1).
--------------------
Here are the trial/texts for Combofinal and Practice
<trial ComboFinal>
/ stimulusframes = [1=ComboFinal]
/ validresponse = ("1", "2", "3", "4", "5", "6", "7", "8")
/ iscorrectresponse = [trial.combofinal.response == list.combofinal.nextvalue]
/ errormessage = true(errormsg, 1000)
/ correctmessage = true(correctmsg, 1000)
/ posttrialpause = 250
</trial>
<text ComboFinal>
/ items = ("Below are the 8 possible variables. Which variable was CHOSEN for this puzzle?
Press '1' for 'Letter Type A'
Press '2' for 'Letter Type T'
Press '3' for 'Letter Size Big'
Press '4' for 'Letter Size Small'
Press '5' for 'Figure Type 'Circle'
Press '6' for 'Figure Type 'Square'
Press '7' for 'Line Type 'Solid'
Press '8' for 'Line Type 'Dotted'")
/ halign = center
/ size = (90%, 80%)
/ position = (50%, 85%)
/ valign = bottom
</text>
<trial Practice>
/ stimulusframes = [1 = Practice, break, spacebar]
/ correctresponse = (" ")
/ errormessage = false
/ recorddata = false
</trial>
<text Practice>
/ items = ("For this puzzle, the CHOSEN variable was 'LETTER TYPE A.' 
This means that for every figure that had 'LETTER TYPE A', 'Y' was the correct answer.
For every figure that did not have 'LETTER TYPE A', 'N' was the correct answer.")
/ size = (90%, 80%)
/ halign = center
</text>
-------
I reviewed both branch and correct target. branch would seem to work better. Does inquisit have values for correct responses and incorrect responses such as 1 (cor) and 0 (inc), respectively, or does inquisit have code like trial.combofinal.correct, trial.combofinal.incorrect?
any help is grateful.

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: 12K, Visits: 98K
> Does inquisit have values for correct responses and incorrect responses such as 1 (cor) and 0 (inc), respectively, or does inquisit have
> code like trial.combofinal.correct, trial.combofinal.incorrect?

Yes, and you will find those documented in the language reference for the <trial> element.

trial.sometrial.correct returns 1 (true) in case of a correct response, 0 (false) otherwise

Conversely, trial.sometrial.error returns 1 (true) in case of an incorrect response, 0 (false) otherwise.

Thus:

<block DISC0>
/trials = [1-10 = sequence(picture0, Combo0); 11 = ComboFinal; 12 = Practice]
/ branch = [if (trial.combofinal.error) block.disc0]
</block>

with

<expt>
/ blocks = [1=disc0; 2=disc1; ...]
...
</expt>

should give you exactly the behavior you want.

briancjo
briancjo
Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)
Group: Forum Members
Posts: 25, Visits: 167
that worked, excellent work as usual, but it brought up a new question, of course...

<block DISC0>
/trials = [1 = combopractice; 2 = practice]
/ branch = [if (trial.combopractice.error) block.disc0]
</block>

what i discovered is that the practice block Disc0 will repeat until it gets the correct response. is there a way to limit the number of repeated blocks? i would like 3 max.
I added "branch [if block.disc0.currentblocknumber == 3] block.disc1] after the above branch to limit the total to 3 blocks, but it did not work. it still kept repeating until the correct response


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: 12K, Visits: 98K
> what i discovered is that the practice block Disc0 will repeat until it gets the correct response.

That is the behavior your initial question implied.

> is there a way to limit the number of repeated blocks? i would like 3 max.

Yes, there of course is. (See below.)

> I added "branch [if block.disc0.currentblocknumber == 3] block.disc1] after the above branch to limit the total to 3 blocks, but it did not
> work. it still kept repeating until the correct response

When you have several /branch attributes, they are evaluated in the order given, from top to bottom. The first /branch that evaluates to true is executed. I.e., you're seeing the intended behavior. Switch the order of the two /branch attributes and you'd see different behavior.

Anyway, in a nutshell, I suggest you do:
<expt>
/ blocks = [1=disc0; 2=disc1]
</expt>

<block DISC0>
/trials = [1 = combopractice]
/ branch = [if (trial.combopractice.error && block.disc0.totalcount < 2) block.disc0]
</block>

<trial combopractice>
/ stimulusframes = [1=sometext]
/ validresponse = ("Y", "N")
/ correctresponse = ("Y")
</trial>

<block DISC1>
/ trials = [1=sometrial]
</block>

<trial sometrial>
/ stimulusframes = [1=sometext]
/ validresponse = (57)
</trial>

<text sometext>
/ items = ("Block is <%script.currentblock%>. Number of DISC0 blocks completed <%block.disc0.totalcount%>.")
</text>

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search