Howdy, Stranger!

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

Supported by

How to end experiment after certain number of incorrect trials


Participants in my experiment need to perform a headphone check, which consists of 6 trials. They're allowed to pass if they get at least 4 correct, but if it is less, I want to end the experiment. I added a Javascript inline item at the end of the headphone check sequence but it doesn't actually end the experiment.

I suppose there is an issue with exp.end(); ?



  • Hi @sflu ,

    The exp.end() function is for internal use. It's not a way to end the experiment.

    In your case, to end the experiment, you probably want to use a run-if expression. The details depend on the structure of your experiment, but you can probably use a run-if expression such as acc > threshold for the part of the experiment that you only want to run if the accuracy reaches this threshold. Do you see the logic?

    (Note that the run-if expression above is simply a Python expression, which is possible in OpenSesame 4.0, but not 3.3 and earlier.)

    — Sebastiaan

    Buy Me A Coffee

  • Hi @sebastiaan

    Thanks for your response! I haven't upgraded to 4.0 yet, so what I tried was putting [acc] > 67 in the Run if field of the parts of the experiment I want to run. This works in the sense that if you fall below 67 you are taken to the end of the experiment, and if you are above 67 you move on to the practice sequence.

    However, then I think the acc value from the headphone check is overridden by that of the practice sequence, and you don't reach the experimental sequence if your answers are all incorrect in the practice, for example. I tried to define a separate accuracy variable in a javascript_inline like this var acc_check = (vars.correct_response / vars.count_headphone_sequence_1) * 100; and adjust the Run if fields accordingly, but that didn't seem to help either. Any idea what else I could try? I've never used OSWeb before.

    Thank you!

  • Hi @sflu ,

    In that case, you will need to 'save' the accuracy before the practice sequence by assigning it to a different variable so that it's not overwritten. You can do that in an inline_javascript item as shown below. This should be in the run phase and the script should come right after the headphone check.

    vars.headphone_check_acc = vars.acc  // OSWeb 1.4
    var headphone_check_acc = acc  // OSWeb 2.0

    And then you can use the heaphone_check_acc variable in the run-if statements.

    — Sebastiaan

    Buy Me A Coffee

  • That worked, thank you very much, @sebastiaan !

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 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