Howdy, Stranger!

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

Supported by

[solved] Custom Feedback

edited March 2015 in OpenSesame

Hi all!

I am very new to both OpenSesame and Phyton, so sorry in advance if the question is either silly or already solved.

I've successfully created the variable X via in-line script. The variable X does everything I need, and the experiment works fine - all the variables are well logged and so on... Variable X changes at every trial accordingly to the performance of the subject. X is an integer, not a float or string type.

But you know, sometimes you may want to add 'classy' details.

Once in a while I let the participants take a break. During breaks I would like to show them a lot of text, just to keep in mind the instructions, but also the value of the variable X. I use a text_display object.

Putting [X] in the text does not work.

Despite X is continuosly setted and changed during the procedure ( exp.set('X', X) ), the only value [X] gives is 0, namely the initial value of X. I tried Phyton language into the text but it is read as a string.

Variable X, in the log file, is fine instead.

What am I missing?

Thanks a lot for your work and attention!

Comments

  • edited 9:57PM

    Hi Elvio,

    It seems that you're doing things correctly. If you have Python variable x, which lives in your inline_script items, you need to use exp.set('x', x) to create an experimental variable that has the same name and value. Once you've done that you can refer to this variable throughout OpenSesame, using the square-bracket notation ([x]). See also:

    One thing that comes to mind is that you may be exp.setting the variable too late. For example, if you set the variable during the run phase, it won't be available in sketchpads, because these are prepared in advance, during the prepare phase. For more information, see:

    Also, it won't hurt to print a little information to the debug window, to make sure that x really has the correct value. Like so:

    print('X = %s' % x)
    exp.set('x', x)
    

    Cheers!
    Sebastiaan

  • edited 9:57PM

    I see... Thanks for your hint, I will try with a feedback object instead of a sketchpad one. :D

  • edited 9:57PM

    It works!

    Indeed, now that i look at the script I see that sketchpads, also the ones outside a sequence, are prepared in advance; at the beginning the value of X was 0, so it all makes sense.

    The feedback object works fine and reads the last value of X.

    Thanks a lot!

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