2017-04-04 4 views
0

9種類のセグメントと10種類のセンテンスの2種類の文からなる自己ペースのリスニングタスクを設定しようとしています(例:I/want/to/go//私/友人と私/欲しい/行く/行く/劇場/ with/my/friendsと/ the/theater/with/my/friendsと一緒に。セルフペースのリスニングタスク

私はクリティカルセグメントがどのように9つの部分の文をスキップしたが、10の部分を含む文のために利用できる。

これに加えて、おそらく同様に、私は参加者に、すべてではなく、いくつかの文に対する理解の質問を与えたい。それをするには?

何かアドバイスをいただければ幸いです。

答えて

0

ここでは、いくつかの文章を単語ごとに再生し、定期的に質問するスクリプトです。これは、スクリプトと同じフォルダ内に単語として名前が付けられたwaveサウンドファイルがあると想定します。 I.wavwant.wavなど。'.wav'を目的のサウンドフォーマットに置き換えるだけで他のサウンドフォーマットも使用できます。終了したら

full = 'I/want/to/go/to/the/theater/with/my/friends' 
partial = 'I/want/to/go/to/theater/with/my/friends' 
question_frequency = 5 # How often to ask questions 
ISI = 0.5 # Inter-word-interval 

import random 
from psychopy import visual, sound, event, core 
win = visual.Window() 
word_sound = sound.Sound() 
instruction = visual.TextStim(win) 

trials = [{ 
    'sentence': random.choice((full, partial)), 
    'ask_comprehension': int(i % question_frequency == 0), 
    'comprehension_answer': ''} for i in range(10)] 

print trials 

for trial in trials: 
    for word in trial['sentence'].split('/'): 
     #word_sound.setSound(word + '.wav') 
     word_sound.play() 
     core.wait(ISI) 

    if trial['ask_comprehension']: 
     instruction.text = 'Did you understand this sentence?' 
     instruction.draw() 
     win.flip() 
     trial['comprehension_answer'] = event.waitKeys()[0] 
     win.flip() # Blank screen 

、あなたはCSVファイルにtrialsを保存することができます。

関連する問題