Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

feedback

Dear all

For my experiment I created a stop signal task and the participants receive a feedback after every block. This feedback is an overview that shows them their results of the current block and their results of the preceding block as a comparison (accuracy and reaction time). For the reaction time I only want to include the correct go trials (incorrect trials and stop trials should not be included). For this reason I created this code:

 
var.accuracy_block1 = var.accuracy

if var.stop_signal == 1 and var.correct == 1: #stop_signal == 1 -> 0 = stop trial; 1 = go trial
    var.total_responses += 1
    var.total_response_time += var.response_time
    var.reaction_block1 = var.total_response_time/var.total_responses

Somehow this code doesn't work - although I specified

 if var.stop_signal == 1 and var.correct == 1: 

it still counts every response time and every response (no matter if the answer was correct or incorrect and whether it was a go or a stop trial). Did I overlook something?

As I mentioned above I want to show the participants an overview and a comparison between the successive blocks. I created this code:

 
var.difference_accuracy_block2 = abs(var.accuracy_block2 - var.accuracy_block1)

var.difference_reaction_block2 = abs(var.reaction_block2 - var.reaction_block1)

if var.accuracy_block2 < var.accuracy_block1: 
    exp.acc_performance = acc_schl
else:
    exp.acc_performance = acc_bes

if var.accuracy_block2 == var.accuracy_block1:  
    exp.acc_performance = acc_gl

if var.reaction_block2 < var.reaction_block1:
    exp.rt_performance = rt_schn
else:
    exp.rt_performance = rt_langs

if var.reaction_block2 == var.reaction_block1:
    exp.rt_performance = rt_gl

The two codes I posted above are connected. The first code calculates the reaction time and the second code compares the successive blocks which results in a costumized feedback. When the first trial of a block starts with a stop signal I get an error messages stating that there is no reaction_block. In the first code I only define what should happen if the variable "stop_signal" = 1 and the answer is correct. Could it be that I get the error message when the first trial of a block starts with a stop signal because there is no result yet (i.e. 0) so the program can't calculate anything?

Thanks for your help!
Cheers

Comments

  • Hi

    Could you attach your code, would make it easier. Also what does the error message say.

    Gary

  • Dear Gary

    Thanks for your answer. I actually attached the codes I'm using (3 different codes), are they not visible? Or do you mean something else? The error message says: "The variable 'reaction_block2' does not exist".

    Cheers

  • Hi

    I meant the whole experiment.

  • Hi Zsc,

    Seeing the experiment would definitely help. Just because there are not information around to know what the problem is. If I had to take a guess, I would say, something is happening with the prepare/run phase of your code. But again, without the entire code, we can't really help.

    Eduard

    Buy Me A Coffee

  • Dear Eduard, dear Gary

    Thanks for your answer. I attached my experiment, it is a little bit chaotic because this version is only temporary. As I mentioned above I'm trying to give the participants a costumized feedback. The feedback should only include correct answers in the go trials (i.e. without stop trials or incorrect trials). You will see that the results in the excel file include all trials (even though I specified in my code that it should only add the correct go trials). This problem occurs in all 4 blocks (experiment_loop_SSTF_block1, experiment_loop_SSTF_block2, experiment_loop_SSTF_block3, experiment_loop_SSTF_block4).

    The second problem occurs in experiment_loop_SSTF_block2, experiment_loop_SSTF_block3 and experiment_loop_SSTF_block4. When the first trial of a block starts with a stop signal I get an error message stating that there is no reaction_block.
    I hope I managed to explain my problem, if not please do ask!

    Cheers
    Zsc

  • Hi Zsc,

    First of all, in your code you do things like clock = timer2clock(timer), even though syntactically correct, that is sort of a problem, as you are overwriting one of Opensesame's functions (i.e. clock.time(), clock.sleep). If you don't use them, it shouldn't matter, but still I'd recommend, giving your clock a different name.

    The second problem occurs in experiment_loop_SSTF_block2, experiment_loop_SSTF_block3 and experiment_loop_SSTF_block4. When the first trial of a block starts with a stop signal I get an error message stating that there is no reaction_block.

    This problem is because you always run the feedback inline_script in which you take the difference betweent he response times of block 2 and block 1, but you only define the response_time of block 2, on stop trials. Therefore, if the first trial is a go trial, the experiment crashes. Makes sense?

    TO fix it, you either need to initiliaze a your var.reaction_block2 earlier, or you run the feedback script, only contingent on whether or not a stop trial occurred (preferred option).

    You will see that the results in the excel file include all trials (even though I specified in my code that it should only add the correct go trials).

    That problem occurs due to 2 reasons. One, you use a variable that Opensesame is also using in the background (var.total_responses), so that even though you do not increment it on every trial, Opensesame does, so that your average response times, change on a trial basis (btw. that's a similar problem as I mentioned above, with the clock). Just use a different variable name and you are set. Second, you reset the variable on every trial to be 0 again (in the prepare phase of results_block1), which does not make much sense. What you want is resetting it to 0 once, before the block starts, but then keep on incrementing it without resetting it in the loop itself.

    I attach your experiment, where the issue of block 1 should be fixed. The later issues, I haven't implemented as that depends a little more on how you want your experiment to behave, and it is also not very difficult to do.

    Good luck,

    Eduard

    Buy Me A Coffee

  • Dear Eduard

    Thank you so much for your help!!
    I didn't know that the variable var.total_responses already exists so that makes totally sense! And it was a stupid mistake that I reset the variable on every trial to be 0 again (I tried to integrate everything into 1 inline script :)).
    Just to be sure that I understand your solution for my second problem: for the feedback inline script I defined run if [stop_signal]= 1 in the trial sequence (stop_signal = 1 means that there is no stop signal) and it seems to work (it doesn't show the error message anymore if the first trial is a stop trial). Is that what you meant?

    Again, thanks for your help!
    Cheers

  • I suppose. It sounds reasonable at least. But test your script and check your data before you start collecting. You were absolutely right when you said your script is a little messy ;-). I would not be surprised if some variables change in ways in which you don't intend them to change.

    Good luck,

    Eduard

    Buy Me A Coffee

  • Great, thanks! Yes, I will definitely check everything before I start collecting data :)

    Cheers
    Zsc

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games