Howdy, Stranger!

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

Supported by

[solved] Is it possible to go back while running an experiment?

edited January 2014 in OpenSesame

Hi Sebastiaan, I am running an fMRI experiment where the timing of the stimuli have to be synched with the scanner. However, if a participants needs a break in the middle of a run, the only way to synch back again is by restarting the experiment completely. Is there a way to go back to the beginning of a block without having to restart?

Thanks

Comments

  • edited 7:49AM

    Hi Frank,

    A good point, which I hadn't really considered.

    There's no straight-forward way to do this, but it can be done with clever use of inline scripting and some conditional statements. I'm away from office at the moment, but when I get back I'll whip together a demo experiment to show what I mean.

    Regards,
    Sebastiaan

  • edited November 2011

    Hi Frank,

    Sorry for the delay! I attached a demo experiment that shows how to skip the first couple of blocks. Hopefully you'll be able to apply the general idea to your own experiment. Please note that this only makes sense if the order of the blocks is fixed!

    http://files.cogsci.nl/software/opensesame/examples/misc/skip_demo.opensesame

    I also filed a feature request, since this is probably a useful feature for many users.

    Regards,
    Sebastiaan

  • edited 7:49AM

    Hi Sebastiaan,

    I hadn't picked up on this for a while...

    I tried a simple thing like this:

    if self.get('response') == (my_response):
    self.experiment.set('count_Trial_sequence', (number for first trial of block))

    However, since this is done during the run phase it doesn't seem to affect the trial ordering that was created during the prepare phase.

    Do you have any insights?

  • edited 7:49AM

    Hi Frank,

    If you want to reset the counter of an item, please see this discussion: http://forum.cogsci.nl/index.php?p=/discussion/147/solved-resetting-counters

    But I'm guessing that this is not actually what you want to do? Are you still trying to skip the first couple of blocks? If so, you might like to know that an option to skip the first X cycles had been added to the loop as of OpenSesame 0.26.

    Please let me know if this doesn't answer your question.

    Cheers,
    Sebastiaan

  • edited 7:49AM

    Hi Sebastiaan,

    your suggestion kind of did the trick and I could reset the trial number to the first trial of the block. However what I really want is to start the block sequence from the begining.

    What I did was:
    if self.get('response') == '9':
    self.experiment.items['Trial_sequence'].count = block_index * 57

    which corresponds to the first trial of a block, since each block has 57 trials. However, I want to start with the instruction screen for the block but I am not sure what counter corresponds to this screen.

    I tried
    self.experiment.items['block_sequence'].count = 0

    but it didn't work...

  • edited 7:49AM

    Ok... I finally got your skip suggestion. I think it is the simpler way to solve the problem but it doesn't quite work for my code because I randomly generate the order of conditions inside the script so if I restart the experiment and skip blocks the program will generate a new set of conditions.

    best

  • edited 7:49AM

    Right, changing the counter doesn't affect the actual trial progression, only the counter itself. So that might be convenient if you want the counter to start at 0 with each new block (for example to facilitate analysis) but you cannot use the counter to skip trials etc.

    If I understand correctly you want to be able to resume an experiment, but the trial progression is randomly generated for each experimental session? In that case, you would have to save the conditions to a file, and read them from disk when you want to resume the experiment later on. I don't see any other way, although it might become a bit messy. The pickle module might come in handy though: http://docs.python.org/library/pickle.html

  • edited 7:49AM

    So why did
    self.experiment.items['Trial_sequence'].count = block_index * 57

    did the work of bringing me back to the first trial of the block, but I can't go back to the instructions of that block? My question is how come I can go to the first trial on my trial sequence but I can't go back to the first sketchpad of the block_sequence?

  • edited 7:49AM

    If changing the trial sequence has an effect in your experiment, that must be because of the custom structure that you use to set the loop variables. Does this involve an inline_script that uses the counter?

    There is no very simple way to break out of a loop, although suggestions have been offered to improve this. But if I understand your question correctly, it is very similar to the one discussed here: http://forum.cogsci.nl/index.php?p=/discussion/149/open-breaking-from-a-staircase-loop

    In that post there is a piece of inline code that shows how you can repeat an item (a trial_sequence, for example) until some criterion is satisfied. That might do, or be a starting point for, what you want to do. If not, perhaps you can describe exactly how your experiment works at the moment and exactly what you want to do.

    Cheers!

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