Howdy, Stranger!

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

Supported by

experience python

hey, i write a experience with python, inline script, and when i want to do the experience, my stimulus item and my target items are mixed and not relied. also some of my items are inversed

in prepare i have :

mycanvas = Canvas()

mycanvas.text('######')


texte = Canvas()

texte.text(var.stimulus)

texte.set_font=("[font_family]", 12)


text = Canvas()

text.text(var.target)

text.set_font=('Arial',12)


and in run i have :

mycanvas.show()

clock.sleep(200)


texte.show()

clock.sleep(100)


text.show()

clock.sleep(1000)


interTrial.show()


keyboard = Keyboard(keylist=["left","right"], timeout=3000)


start_time = clock.time()


key, end_time = keyboard.get_key()


resp_key = key

resp_time= end_time - start_time + 200

if resp_key == var.correct_response:

resp_correct=1

else:

resp_correct=0


exp.set("resp_key", resp_key)

exp.set("resp_time", resp_time)

exp.set("resp_correct", resp_correct)


log.write_vars()

Comments

  • Hi Saosa,

    Was this problem already solved in one of your other questions on the forum? If not, could you please specify what exactly your problem is here? What is the code supposed to do, and what does it do? Do you get error messages?

    Thanks,

    Eduard

    Buy Me A Coffee

Sign In or Register to comment.