網頁

2019年5月29日 星期三

[Presentation] 如何在 log file 增加按鍵反應欄位?

這次撰寫完一遍實驗流程,收到第一位pilot受試者之後,
發現忘記在log file裡頭紀錄下受試者的反應了。

趕緊加入一段程式碼,紀錄下參與者按下的按鍵是1或3,以及按下按鍵的時間點
並不需要比對參與者的反應對或錯。


以下截取一段官方網站的manual裡頭,一段SDL程式碼,講解一下。

#-- SDL excerpt --#

response_matching = simple_matching;
begin;
...
trial {
    picture pic1;
    time = 1000;
    target_button = 2;    # subject should press button 2
    code = "stim1";
};
trial {
    picture pic2;
    target_button = 0;    # Oops! No button 0
    time = 1000;
    code = "stim2";
};
trial {
    picture pic3;
    target_button = 1, 2; # subject should press either button 1 or button 2
    code = "stim3";
};
#-- End excerpt --#

1. 在begin;之前寫 response_matching = simple_matching;
   begin之前通常寫一些標頭檔,檔案說明等,
   begin之後,才是SDL程式語法開始執行的部分。
   表明 response_matching = simple_matching; 之後,
   log file 裡頭,就會多一個欄位,會紀錄下每次按下按鍵的按鍵內容與時間點。(如下圖)

2. 此範例有3個trial。
   第一個trial,秀pic1,在trial開始之後1000ms時呈現,目標按鈕是第二個按鍵,
   此trial在logfile的編碼是"stim1"。

3. 下圖是logfile的檔案,一個trial流程有點複雜,所以我用pcl語法控制流程。

   依照Code欄位,依序紀錄下來。
   按按鍵[100]之後,
   出現ding一聲,
   然後出現凝視點,
   RSVP,
   隨後出現目標刺激,
   加上mask,
   再來等待反應,
   直到受試者按按鍵反應[1]

   在time欄位,則紀錄該事件發生的時間點。


以上做個紀錄。


沒有留言:

張貼留言