Howdy, Stranger!

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

Supported by

log.write_vars() does not log experimental variables from inline_scripts

I can see all variables in the variable inspector.

However, the experimental variables from the script do not appear in the logfile. Seems like a bug to me. I still could not find a nice workaround for this. Probably, it needs to be fixed.

Here some example code:

from random import shuffle

fixdot = canvas()

fixdot.image(pool['fixdot.tif'])


empty_screen = canvas()


A = canvas()

A.image(pool['Bild1.tif'])

B = canvas()

B.image(pool['Bild2.tif'])

C = canvas()

C.image(pool['Bild3.tif'])

D = canvas()

D.image(pool['Bild4.tif'])


stim_lst = [A,B,C,D]*20

shuffle(stim_lst)

targets = keyboard(keylist = ['x','m'])


for i in range(80):

var.TrialNr=i+1

var.RT=None

var.Resp=None

var.Correct=None

fixdot.show()

leer.flush() #workaround on mac

clock.sleep(400)

stim_time = stim_lst[i].show()

var.Correct = 1

var.Resp=0


while True: #collect responses that were actually not required/allowed

if clock.time() - stim_time > 750:

break

#elif var.Resp!=0:

# var.Correct = 0

# break

key, time = targets.get_key(timeout=10)

var.RT = time - stim_time

if key != None:

var.Resp=key

if stim_lst[i] == A:

if key != 'x':

var.Correct = 0

elif stim_lst[i] == B:

if key != 'm':

var.Correct = 0

elif stim_lst[i] in [C,D]:

if key != None:

var.Correct = 0

# break

log.write_vars()

empty_screen.show()

clock.sleep(1000)




I do get i and key. But I do net get e.g., RT and Resp in the logfile.

Comments

  • I am using 'automatically log all variables' in the logger to make sure that I am not missing anything.

  • Hi @DahmSF,

    Could you directly provide the experiment file you are using? Without the indentation, your code is hard to read/use.

    Thanks,

    Claire

  • Hi Claire,

    help would be greatly appreciated.

    Please find the experiment file here: https://fileshare.uibk.ac.at/d/752c3c1b78664b6c8948/

    Actually, there is one such variable that is logged in the logfile which is var.Phase.

    However, all the others are not.

    The VMIQ part worked in previous version, but does not work anymore. There should be some variables like IVI, EVI, KIN, modality in the logfile. They all appear in the variable inspector, but not in the logfile.

    Best,

    Stephan

  • edited January 23

    Hi @DahmSF,

    Thanks for providing your script. Is the var.title also logged in the logfile? If that's the case, I suspect this may be because all your other variables are not being initialized early enough in the experiment. Even though you use log.write_vars() in your inline scripts, these statements might not capture variables for the LOGGER item unless they were initialized early on.

    Therefore, you could try adding an inline_script at the very beginning of the experiment (before all the other ones in your sequence) and have something like:

    Also, it seems like you create the copy of the logfile, which I assume is the one you are using, before the LOGGER item. Maybe also try putting the LOGGER item first, and see if one or both of these two suggestions solve the issue?


    Let me know if it changes anything or if we should look for another solution!

    Claire

  • Placing the variables into the first inline_script worked.

    Thank you for this workaround!


    Still, I need to be careful that it logs everything which is not the idea of log.vars() , i.e., simply logging all variables. @sebastiaan : I guess this should be fixed in the next version :)

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