| Reference | Downloads | Github

Get the response of Korean word (reaction time and letter missing)

I’m suffering from some problems and couldn’t know how to deal with it.
Could you please help me?

1. experiment design

object: the screen presents the initial consonant of Korean. For example, ‘ㄱㅅ’.
and the subject has to write one word with that initial consonant, for example, ‘감사’. And when the subject press the ‘enter key’, the screen presents the other consonant, for example, ‘ㅅㅇ’. And the subject writes one word, ‘사이’. This routine repeats.
But I’m now just want to test that ‘can I get reaction time correct?’ and ‘can I get Korean letter correctly?’. So in this test, I just use word of fruit in Korean. (ex : 자두, 사과, 바나나…)

problem :
1) I cannot get reaction time. I fixed my code several times,
but I don’t know how to get reaction time yet.
I want to get the time between the initial consonant representation( in the example, ‘ㄱㅅ’) and the timing when the subject press the keyboard for the first time after he see the consonant representation.

2) The Korean letter was deleted. I cannot get the last syllable.
Korean syllable is divided like this: 가방 -> 가/방, 바나나 -> 바/나/나

I cannot get my last syllable. If I type 바나나, Excel file gets only 바나.
It could be a harder problem than problem 1), but it’s also an important issue.

2. Codes are shown,

Begin routine

modify = False
text.text = ‘’
timer = core.Clock()

each frame

keys = event.getKeys()

#if len(keys) == 0:

timer = core.Clock()

if len(keys) > 0:
RT = timer.getTime()
thisExp.addData(‘RT in ms’, RT*1000)

if keys:
if ‘enter’ in keys:
text.text = text.text + keys[0]

if len(keys):
if ‘space’ in keys:
text.text = text.text + ’ ’
elif ‘backspace’ in keys:
text.text = text.text[:-1]
elif ‘lshift’ in keys or ‘rshift’ in keys:
modify = True
elif ‘return’ in keys:
continueRoutine = False
if modify:
text.text = text.text + keys[0].upper()
modify = False
text.text = text.text + keys[0]

thisExp.addData(“typedWord”, text.text)

3. Result

When I type ‘마스크’. The last word is mising for every trial.
(I wanna show the screen, but new user can use media only 2)

Also reaction time is little bit strange. too short.

I hope somebody could help me deal with this problem. Thank you!

Could you post the code snippets encased in triple backticks? Like this:```

Otherwise it doesn’t preserve the indentation so this bug becomes difficult to replicate

1 Like

You are restarting the timer every frame. This line should be in Begin Routine.

1 Like

This section of code seems unnecessary but I’m not sure why the routine might be ending too early for you.

1 Like

Thank you for both TParsons and wakecarter!
Now maybe I deal with the reaction time problem