Howdy, Stranger!

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

Supported by

[solved] Repeat Practice block if accuracy less than 80%

edited July 2016 in OpenSesame

I have a simple Stroop experiment with 4 different blocks which are counterbalanced across participants. It all works great. The experiment starts with a practice block of 8 trials. This work fine. However, I would like to repeat the block if accuracy is less than 80%.

I have tried the following in an inline script after the feedback item (which is placed at the end of a Practice block sequence)

if var.acc < 80:
run Practice_Loop
else:
run EndofPractice

I am a recent convert to OpenSesame and am a bit lost. Any pointers would be appreciated.

Deiniol

Comments

  • edited 5:53PM

    Hi Denial,

    Think you're almost there with your code. You can find a working example using the same principle here:
    http://forum.cogsci.nl/index.php?p=/discussion/comment/7616#Comment_7616

    Another option might be to put the practice block in a(nother) loop which you set to repeat something like 999 times for example. Then use a Break if like [acc] > 80 for that loop item. See also:

    http://osdoc.cogsci.nl/usage/variables-and-conditional-statements/#using-conditional-if-statements
    http://www.cogsci.nl/forum/index.php?p=/discussion/comment/4515#Comment_4515

    Best,
    Jarik

  • edited 5:53PM

    Now with correct name and clickable links:

    Hi Deiniol,

    Think you're almost there with your code. You can find a working example using the same principle here: http://forum.cogsci.nl/index.php?p=/discussion/comment/7616#Comment_7616

    Another option might be to put the practice block in a(nother) loop which you set to repeat something like 999 times for example. Then use a Break if like [acc] > 80 for that loop item. See also:

    http://osdoc.cogsci.nl/usage/variables-and-conditional-statements/#using-conditional-if-statements
    http://www.cogsci.nl/forum/index.php?p=/discussion/comment/4515#Comment_4515

    Best,
    Jarik

  • edited 5:53PM

    Jarik,

    Thank you for taking the time to reply.

    I looked up the example you posted
    http://forum.cogsci.nl/index.php?p=/discussion/comment/7616#Comment_7616

    and have used the following script in an inline script that occurs after the practice block feedback (i.e. at the end of the practice block)

    if var.acc < 80:
    exp.items["PracticeLoop"].prepare()
    exp.items["PracticeLoop"].run()
    else
    exp.items["EndofPractice"].prepare()
    exp.items["EndofPractice"].run()

    This works fine if accuracy is < 80%. Participants get feedback about their accuracy and instructed to re do the practice. The experiment then loops back to the beginning of the practice loop. However, when accuracy reaches 80% during the practice block then the experiment stops.

    I thought an inline script is only implemented at a specific point in an experiment. However, it seems to implement it during the practice block.

    Best wishes

    Deiniol

  • edited 5:53PM

    I've fixed it! used the following script

    if var.acc < 80:
    exp.items["PracticeLoop"].prepare()
    exp.items["PracticeLoop"].run()
    if var.acc > 80:
    exp.items["EndofPractice"].prepare()
    exp.items["EndofPractice"].run()

    Earlier problems were due to an error as I had the feedback item only running (in Run if)if acc < 80.

    Problem solved. Thanks fro you help.

    Deiniol

  • edited 5:53PM

    Hi Deiniol,

    Good to read it's solved!

    I thought an inline script is only implemented at a specific point in an experiment. However, it seems to implement it during the practice block.

    As far as I know an inline_script only runs when it's encountered in a sequence (assuming your not using parallel or coroutines plug-ins). Please see http://osdoc.cogsci.nl/usage/prepare-run/

    Also note that using this method is kind of a hack, so now more then ever:

    Always triple check whether your data has been correctly logged before running your experiment!

    Best,

    Jarik

  • Hello,


    I've gone back to this and am having problems.

    Here is my experiment sequence


    Participants complete a practice blcok of trials.

    CheckACC_practice inline script runs the following

    If accuracy is greater than or equal to 90 then the baseline instructions item is prsented and the expreriemnt moves onto a baseline loop. All works as it should

    If accuracy is less than 90 then the experiment replays the practice loop and keeps doing this if accuracy continues to be less than 90. All works as it should.

    However, if a particpant has less than 90 accuarcy, the practice loop is re-run but if accuracy during the re-run is greater than or equal to 90 then the baseline instructions is presented but when this item is ended with a button push, the experiment generates the following error for line 3 of the script.

    TypeError exception message: unsupported operand type(s) for +=: 'NoneType' and 'int'

    Is there a way to use script to tell the experiment not to run the practice loop if var.acc is greater then or equal to 90?


    many thanks

    Deiniol

  • I think I've fixed it.

    I have the CheckACC_practice inline script running using the runif in the practice sequence (run if [acc] < 90). the inline script only incudes the following code.

    exp.items["practice_sequence"].prepare()

    exp.items["practice_sequence"].run()


    If accuracy is less than 90 then the CheckACC_practice inline script runs and the practcie sequence starts again. if accuracy is grater than 90 then the CheckACC_practice inline script doesn't run and the experiment moves on.

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