Howdy, Stranger!

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

Supported by

[solved] why the sketchpad last longer than I set?

edited December 2014 in OpenSesame

In my experiment, I set the sketchpad to show stimulus for 600ms, and the keyboard_response has a timeout of 2000ms. I put the keyboard_response next to the sketchpad. However, the sketchpad last obviously longer than 600ms, probably for 2600ms if I does not press any key. While if I press one key after 600ms, the sketchpad disappears at once; but if I press the key within 600ms, the stimulus last for about 2600ms again. I intended to let the stimulus display with a constant period and disappear regardless the response time. So what's the problem here? How could I do that? The codes are as follows. Thanks.

# Generated by OpenSesame 0.27.3 (Frisky Freud)
# Tue Mar 04 14:43:25 2014 (nt)
# <http://www.cogsci.nl/opensesame>

set mouse_backend "xpyriment"
set subject_parity "even"
set height "800"
set sound_buf_size "512"
set font_italic "no"
set custom_cursor "no"
set canvas_backend "xpyriment"
set synth_backend "legacy"
set sound_channels "2"
set title "Attentional capture for Android"
set psychopy_waitblanking "yes"
set coordinates "relative"
set start "experiment"
set sampler_backend "legacy"
set sound_sample_size "-16"
set font_family "sans"
set foreground "white"
set font_bold "no"
set sound_freq "48000"
set description "An attention capture paradigm, modified for the Android runtime"
set psychopy_monitor "testMonitor"
set background "black"
set font_size "18"
set enable_escape "no"
set keyboard_backend "legacy"
set transparent_variables "no"
set compensation "0"
set subject_nr "0"
set width "1280"

define sequence sequence
    run reset_feedback "always"
    run _loop "always"
    run _feedback "always"

define sequence _sequence
    run fixation_dot "always"
    run sketchpad "always"
    run keyboard_response "always"
    run logger "always"

define feedback _feedback
    set duration "keypress"
    set reset_variables "yes"
    set description "Provides feedback to the participant"
    draw textline 0 -128 "本部分结束" center=1 color=white font_family="sans" font_size=18 font_italic=no font_bold=no show_if="always"
    draw textline 0 -64 "你的反应时为[avg_rt]ms" center=1 color=white font_family="sans" font_size=18 font_italic=no font_bold=no show_if="always"
    draw textline 0 0 "你的正确率为[acc]%" center=1 color=white font_family="sans" font_size=18 font_italic=no font_bold=no show_if="always"
    draw textline 0 64 "按空格键继续..." center=1 color=white font_family="sans" font_size=18 font_italic=no font_bold=no show_if="always"

define loop _loop
    set repeat "2"
    set description "Repeatedly runs another item"
    set item "_sequence"
    set column_order "stimulus;correct_response"
    set cycles "2"
    set order "random"
    setcycle 0 stimulus "上"
    setcycle 0 correct_response "f"
    setcycle 1 stimulus "下"
    setcycle 1 correct_response "j"
    run _sequence

define sketchpad end_of_practice
    set duration "keypress"
    set description "Tell the participant that the practice phase is finished"
    set start_response_interval "no"
    draw textline 0 -64 "The practice phase is finished" center=1 color=white font_family="sans" font_size=18 font_italic=no font_bold=no show_if="always"
    draw textline 0 64 "Tap the screen to start the real experiment ..." center=1 color=white font_family="sans" font_size=18 font_italic=no font_bold=no show_if="always"

define sequence experiment
    set description "The main experimental sequence"
    run text_display "always"
    run _text_display "always"
    run loop "always"
    run end_of_practice "always"

define fixation_dot fixation_dot
    set foreground "white"
    set style "cross"
    set description "Presents a central fixation dot with a choice of various styles"
    set duration "1700"
    set background "black"
    set y "0"
    set x "0"
    set penwidth "4"

define logger logger
    set description "Logs experimental data"
    log "display_size"
    log "distractor"
    log "practice"
    log "condition"
    log "response"
    log "correct"
    log "response_time"

define text_display text_display
    set foreground "white"
    set font_size "36"
    set description "Presents a display consisting of text"
    set maxchar "50"
    set align "center"
    __content__

    欢迎参加实验!

    请仔细阅读接下来的实验说明。
    如有任何疑问,请及时联系主试人员。


    按空格键继续
    __end__
    set background "black"
    set duration "keypress"
    set font_family "sans"

define text_display _text_display
    set foreground "white"
    set font_size "36"
    set description "Presents a display consisting of text"
    set maxchar "50"
    set align "center"
    __content__

    练习一

    请对屏幕中央的文字做按键反应。

    如果看到了“上”,请左手食指按“F”键;
    如果看到了“下”,请右手食指按“J”键。

    请做到又快又准确的按键。

    明确了按空格键继续。
    __end__
    set background "black"
    set duration "keypress"
    set font_family "sans"

define sketchpad sketchpad
    set duration "600"
    set description "Displays stimuli"
    draw rect -100 -100 200 200 fill=1 penwidth=1 color=grey show_if="always"
    draw textline 0 0 "[stimulus]" center=1 color=red font_family="sans" font_size=54 font_italic=no font_bold=yes show_if="always"

define keyboard_response keyboard_response
    set description "Collects keyboard responses"
    set timeout "2000"
    set flush "yes"

define reset_feedback reset_feedback

define loop loop
    set repeat "1"
    set description "Repeatedly runs another item"
    set item "sequence"
    set column_order "practice"
    set cycles "1"
    set order "random"
    setcycle 0 practice "yes"
    run sequence

Comments

  • edited 4:01AM

    The key point to note here is that OpenSesame works purely serially. So what you've done is tell OpenSesame to present a sketchpad for 600 ms, and then (after these 600 ms have passed) start collecting a keyboard response with a timeout of 2000 ms. Since a keyboard_response does not change what's on the display, you'll see the sketchpad for 600 ms + response time. See also the 'Draw the target' of the step-by-step tutorial:

    In your case, what you could is the following.

    1. An inline_script with the following code: exp.set('response', 'None'). This will reset the response variable.
    2. Your target sketchpad with a duration of 0 ms
    3. A keyboard_response with a timeout of 600 ms
    4. A blank sketchpad with a duration of 0 ms
    5. Another keyboard_response with a timeout of 1400 ms and the following run-if statement: [response] = None

    What you basically do here is divide your response interval into two parts. The first part is while the target sketchpad is visible and lasts for 600 ms. The second part is while the target sketchpad is no longer visible and lasts for 1400 ms. Crucially, the run-if statement makes sure that the second part is only executed if no response was given during the first part.

    Does this make sense? Take some time to figure out the logic here, and you'll find that run-if statements give you a lot of flexibility!

    Cheers,
    Sebastiaan

  • edited 4:01AM

    Sorry for my forgetting to reply. Thanks so much for your answer. I have resolved that problem.

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