If-then statement for error messages and for right and wrong answers


Author
Message
uni-student92084
uni-student92084
Partner Member (608 reputation)Partner Member (608 reputation)Partner Member (608 reputation)Partner Member (608 reputation)Partner Member (608 reputation)Partner Member (608 reputation)Partner Member (608 reputation)Partner Member (608 reputation)Partner Member (608 reputation)
Group: Forum Members
Posts: 57, Visits: 172
Hello!!!!
I am writing a script that will have political honesty scores moving across the screen. The scores will either be one where the Republican party is more honest or the Democratic party is more honest. The participants will have to guess from the numbers seen on the screen which party is more honest. If they are wrong about what party scores are running across the screen, an error will appear. 

So for example, if numbers run across the screen mean that the  Rep party is more honest and the participant says that they are Rep then a correct signal would appear. However, if they assess wrong, an incorrect signal would appear. 

For this correct and incorrect function, I want to create an if-then function where: if the scores are Democrat and the participants press the correct key then a correct signal will appear. 

I did some research on the forums and found that an if-then statement can be done like this:
 
trial mytrial>
/ ontrialbegin = [if (true) {trial.mytrial.setstimulustime(text.a, list.fixationduration.nextvalue);
  trial.mytrial.insertstimulustime(text.b, list.fixationduration.nextvalue); }]
/ ontrialend = [trial.mytrial.resetstimulusframes()]
/ stimulustimes = [0=fixation]
/ validresponse = (57)
</trial>

However, I don't know if it will work for what I am trying to do. Could someone help me in forming an If-then statement when it pertains to error messages?

Thank you in advance!

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
uni-student92084 - 3/10/2020
Hello!!!!
I am writing a script that will have political honesty scores moving across the screen. The scores will either be one where the Republican party is more honest or the Democratic party is more honest. The participants will have to guess from the numbers seen on the screen which party is more honest. If they are wrong about what party scores are running across the screen, an error will appear. 

So for example, if numbers run across the screen mean that the  Rep party is more honest and the participant says that they are Rep then a correct signal would appear. However, if they assess wrong, an incorrect signal would appear. 

For this correct and incorrect function, I want to create an if-then function where: if the scores are Democrat and the participants press the correct key then a correct signal will appear. 

I did some research on the forums and found that an if-then statement can be done like this:
 
trial mytrial>
/ ontrialbegin = [if (true) {trial.mytrial.setstimulustime(text.a, list.fixationduration.nextvalue);
  trial.mytrial.insertstimulustime(text.b, list.fixationduration.nextvalue); }]
/ ontrialend = [trial.mytrial.resetstimulusframes()]
/ stimulustimes = [0=fixation]
/ validresponse = (57)
</trial>

However, I don't know if it will work for what I am trying to do. Could someone help me in forming an If-then statement when it pertains to error messages?

Thank you in advance!

You don't need any if-else statement. You need to properly define /validresponse and /correctresponse in your <trial> elements and specify /correctmessage and /errormessage attributes.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search