Howdy, Stranger!

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

Supported by

[solved] How to reset the trial counter after the practice trials

edited June 2013 in OpenSesame

In a previous discussion I received instructions in how to present to the subjects an indicator of what trial they are on and how many trials remain. However, the experiment has a practice phase and then an identical experiment phase. The instructions resulted in the correct numbers being presented in the practice phase. The indication to the subject says "That was trial number [trial_count] of [total]. There are [total - trial_count] trials to go - Where the trial count incremented from 1 to 30, and the trials remaining decremented from 29 to 0. That was fine. But then at the beginning of the experiment phase, the indication to the subject continues incrementing the trials from 31 to 60, and decrementing the trials remaining from -1 to -30.

The instructions called for a script at the beginning of the experiment with:

total = 30
exp.set("total", total)

Than, at the beginning of the trial sequence (same for the practice loop and the experiment loop) the instructions call for a script with:

trial_count = self.get("count_trial_sequence")
trial_count = trial_count + 1
trials_remaining = self.get("total") - trial_count
exp.set("trial_count", trial_count)
exp.set("trials_remaining", trials_remaining)

I tried changing those scripts to the following (which did not work):

For the script at the beginning of the experiment I put:

total = 30
trial_count = 0
exp.set("total", total)
exp.set("trial_count", trial_count)

Then, for the scripts at the beginning of each trial sequence I put:

trial_count = trial_count + 1
trials_remaining = self.get("total") - trial_count
exp.set("trial_count", trial_count)
exp.set("trials_remaining", trials_remaining)

Also, at the end of the practice loop, and before the experiment loop, I added an in-line script with this:

self.get("trial_count")
trial_count = 0
exp.set("trial_count", trial_count) 

Of course, in the experiment loop, the identical script at the beginning of the trial sequence was the same as above:

trial_count = trial_count + 1
trials_remaining = self.get("total") - trial_count
exp.set("trial_count", trial_count)
exp.set("trials_remaining", trials_remaining)

I thought that would mean that trial_count would begin at 0, increment by 1 for the practice trial sequence, and then start back at 0 and increment by 1 for each experiment trial.

However, my changes resulted in no effect. The experiment still behaved as described in the first paragraph. Any idea what I'm doing wrong?

Thanks.

--- Bob

Comments

  • edited 7:40PM

    Dear Bob,

    The trial_sequence item maintains its own counter, which needs to be explicitly reset. In order to do so, you could append an inline_script item to the experiment sequence, right before your experimental loop, and put the following code in its Run phase tab:

    exp.items['trial_sequence'].count = 0
    

    The overview area should now look something like this:

    image

    For more info on resetting counters, see also this post:

    I hope this helps!

    Best wishes,

    Lotje

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • edited 7:40PM

    Hi Lotje,

    Yes, thanks. Your solution gave me the result I wanted. So this query is solved. I was very confused that the code referred to 'trial_sequence'. I expected it to refer to 'count_trial_sequence'. But after reading the link to more info, although I am still confused, I am less so, and I now realize I have a lot more to learn. What is a good way for someone with no programming/computer science experience or training to begin to learn more. Perhaps to actually understand programming in python?

  • edited 7:40PM

    Hi Bob,

    I understand the confusion, it's quite tricky that simply resetting 'count_trial_sequence' to zero does not give the desired result. I think this is more a (slightly inconvenient) side-product of the way the counters are kept track of, than anything else (meaning that even experienced OpenSesame users would be confused about it). Normally, OpenSesame functions are much more intuitive; you just stumbled upon a tricky one by coincidence.

    To start learning Python, we usually give the following two references:

    However, for OpenSesame users it would also be very convenient if there were (a) tutorial(s) describing how to use Python inline code in combination with OpenSesame's built-in functions, something that is definitely on my to-do list!

    Best,

    Lotje

    Did you like my answer? Feel free to Buy Me A Coffee :)

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