Howdy, Stranger!

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

Supported by

[open] Problem Accessing Global Variables

edited May 2014 in OpenSesame

Hi there,

I'm currently designing an IAT experiment for an android tablet, but I'm having a couple of issues at the moment that I've been searching for answers too since last night so I thought I'd ask on here. I'm currently in the process of building an Implicit Association Task with Open Sesame, and I'm wanting to record the average reaction time of only answers for which the correct answer was '1', per block of trials. I then want to store that in a new global variable that can be called later and displayed / used to work out a ratio at the end.

The first problem with doing this is that I haven't got any idea of how you would only select certain cases(' reaction times), without waiting until the data has been outputted to a CSV and doing it manually, which would be very time consuming for the purposes of the one measure I'm taking from this study (a ratio of first block to second block answers), so I was hoping it could be automated in code?

The second problem I'm having (also variable related) is that my variable is semi-working (passes along the value - although seemingly as the variable name) but crashing the experiment with an error.
In an in-line script tag just after the first block of trials, I have:

practiceIdRt = exp.set('practiceIdRt', [avg_rt])

Immediately after the inline script there is a feedback form where I tried displaying it:

draw textline 0 128 "[practiceIdRt]" center=1 color=white font_family="mono" font_size=18 font_italic=no font_bold=no show_if="always" html="yes"

I also tried displaying it with self.get('practiceIdRt'), and several other variations which the programme didn't like either. At present it will run until the feedback page, when the experiment will crash, serving the error:

"Variable '787' is not set in item 'idFeedback'.
You are trying to use a variable that does not exist. Make sure that you have spelled and capitalized the variable name correctly. You may wish to use the variable inspector (Control + I) to find the intended variable."

The variable name it's giving is obviously the average reaction time, but I don't understand why or how to fix it. I've tried several variations on the syntax, and of all of them this is the only one that shows any sign of passing along the value of the variable. I've also tried it in the Prepare and Run sections, I've also tried calling it within a feedback or sketchpad item, but nothing seems to work.

EDIT: Having fiddled further with it, it appears that it works perfectly fine using psychopy for the backend, but crashes using all the others. Is there a difference in the way the back ends handle variables that I'm missing?

Thank you,
Nick

Comments

  • edited May 2014

    Hi Nick,

    On you first problem: there is nothing you ever have to do manually, if you know how to program well enough. The CSV output can indeed be analysed using a spreadsheet editor like Excel, which offers you functions like IF and SUMIF that seem perfectly fit for what you want to do. Another option is to read the files using a custom script, written in a programming language like Matlab or Python (e.g. using NumPy).

    Your second problem originates from a bit of confusion between Python inline scripting, and OpenSesame syntax. In an inline_script, the language to use is Python. To access an OpenSesame variable in Python, use the following: my_var = exp.get("avg_rt"). To use the exact same variable within all other bits of OpenSesame, use the square bracket notation used in OpenSesame syntax: [avg_rt].

    For the full explanation, see this page.

    Good luck!

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