Howdy, Stranger!

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

Supported by

Invalid value in correct_response: None

Hi all,

I am attempting to define "correct_response" on every trial, dependent on whether a target is present and, if it is, which way it is rotated. I have the following in an inline script at the top of my trial sequence:

if var.target_present == "No":
	var.correct_response = None
elif var.T1_rotation < 0:
	var.correct_response = '1'
	var.correct_response = '4'

But every time a trial with no target comes up (target_present == "No"), the experiment crashes with the following error message:

Invalid value in correct_response: None

I think I'm following the instructions outlined here:

I've also tried putting 'None' in single quotes, and making 1 and 4 integers instead of strings. I get the same error.

What am I missing?

Many thanks in advance for any help anyone can provide!




  • Hi Jon,

    I think correct_response is not allowed to be none. There is likely a check if the value you enter for correct response can be mapped to a key on the keyboard or to a button on the mouse.

    Alternatively, these errors are often related to placing the code in the wrong phase of a script. Note this section of the page that you linked:

    Defining a correct response is a clear example of something that should be done in the Prepare phase.

    There is a run and prepare phase (indicated by tabs in an inline script item). Where is your code currently located?

    Buy Me A Coffee

  • Thanks so much, Daniel!

    I'm fairly certain that it should be possible. I found another reference to setting correct_response to None in the documentation, and a couple of forum posts in which it worked for others, although they are a bit older, from 2015 and 2016.

    And I did place the code in the prepare phase, so I must be doing something else wrong 😅

    I'm attaching my experiment file. I don't expect anyone to look at it, but am providing it in case it could be helpful in pinpointing the issue. The code in question starts on line 43 of the inline script 'prepare_rand_variables':



  • I checked your experiment, and found the code you refer to in the run phase, and not in the prepare phase. That is, I find it in the prepare phase of prepare_rand_variables but in the run phase of set_response_code . So maybe the second entry causes these problems. I actually ran the experiment without troubles (although I didn't get past the practice trials), so maybe updating your version of OpenSesame also fixes the problem, if you aren't using the latest release.

    Buy Me A Coffee

  • Hi Daniel!

    So sorry for the very, very late reply.

    Thanks for your suggestions! I just updated to the latest version of OpenSesame (3.3.1 Lentiform Loewenfeld), and that did not fix the problem. However, replacing the joystick item with a keyboard_response item did!

    So maybe there's some discrepancy between the keyboard_response and joystick plugins? I really wanted to use the gamepad that we have, but I might consider getting a standalone keypad or something like that instead (a full keyboard isn't practical for our physical setup).

    All best,


    P.S. - I should have mentioned in my last post that the experiment version I was uploading had replaced

    var.correct_response = None


    var.correct_response = ''

    so that the experiment would not crash.

    P.P.S. - I appreciate your suggestion about putting the other code in the prepare phase. Unfortunately, I need to keep the code of set_response_code in the run phase, as it depends on the response that was made during that trial.

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