Howdy, Stranger!

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

Supported by

Button can't be pressed

edited January 2019 in Mousetrap

Hi,

I ran across your team's poster at Psychonomic Society and considering converting to your plugin. By the way, mousetrap is great! Thanks guys!

Anyway, I've been trying to make an experiment with the plugin and ran into a problem. That is, my design has four response alternatives, meaning four buttons. However, the fourth button can't be clicked and does not lead to the next trial. I've checked the code of it, but it does not seems to differ with codes associated with other buttons.

What am I doing wrong? I am attaching the code for the main display below.

Thank you in advance!

Hansol

  1. code for stimulus presentation
    set duration 0
    set description "Displays stimuli"
    draw rect color=black fill=0 h=128 name="[tar4]" penwidth=1 show_if=always w=-192 x=512 y=-288 z_index=0
    draw rect color=black fill=0 h=128 penwidth=1 show_if=always w=192 x=32 y=-384 z_index=0
    draw rect color=black fill=0 h=128 penwidth=1 show_if=always w=192 x=-224 y=-384 z_index=0
    draw rect color=black fill=0 h=128 penwidth=1 show_if=always w=192 x=-512 y=-288 z_index=0
    draw textline center=1 color=black font_bold=no font_family=sans font_italic=no font_size=18 html=yes show_if=always text="[tar1]" x=-416 y=-224 z_index=0
    draw textline center=1 color=black font_bold=no font_family=sans font_italic=no font_size=18 html=yes show_if=always text="[tar2]" x=-128 y=-320 z_index=0
    draw textline center=1 color=black font_bold=no font_family=sans font_italic=no font_size=18 html=yes show_if=always text="[tar3]" x=128 y=-320 z_index=0
    draw textline center=1 color=black font_bold=no font_family=sans font_italic=no font_size=18 html=yes show_if=always text="[tar4]" x=416 y=-224 z_index=0
    draw textline center=1 color=black font_bold=no font_family=sans font_italic=no font_size=70 html=yes show_if=always text="+" x=0 y=-32 z_index=0
    draw image center=1 file="[img1]" scale=0.7 show_if=always x=-192 y=288 z_index=0
    draw image center=1 file="[img2]" scale=0.7 show_if=always x=192 y=288 z_index=0

  1. code for "get_response"
    warning_message
    draw textline text="Please start moving" x=0 y=0
    end
    set update_feedback yes
    set timeout infinite
    set start_coordinates "0;280"
    set skip_item no
    set sketchpad present_stimulus
    set save_trajectories yes
    set reset_mouse yes
    set number_of_buttons 4
    set mouse_buttons_allowed "left_button;right_button"
    set max_initiation_time 1000
    set logging_resolution 10
    set description "Tracks mouse movements"
    set correct_button "[correct]"
    set click_required yes
    set check_initiation_time no
    set button4 "x=512 y=-288 w=192 h=128 name=[tar4]"
    set button3 "x=32 y=-384 w=192 h=128 name=[tar3]"
    set button2 "x=-224 y=-384 w=192 h=128 name=[tar2]"
    set button1 "x=-512 y=-288 w=192 h=128 name=[tar1]"
    set boundaries "upper=no lower=no left=no right=no"

Comments

  • Hi Hansol,

    thanks, great to hear you like it :).

    In the development version of mousetrap that you are using, there are two ways how to define buttons and you are kind of mixing the two of them. I would suggest to use the first variant (defining buttons using button names ).

    For this, you would have to give a name tag to all four rect elements on the sketchpad:

    draw rect color=black fill=0 h=128 name="[tar4]" penwidth=1 show_if=always w=-192 x=512 y=-288 z_index=0
    draw rect color=black fill=0 h=128 name="[tar3]" penwidth=1 show_if=always w=192 x=32 y=-384 z_index=0
    draw rect color=black fill=0 h=128 name="[tar2]" penwidth=1 show_if=always w=192 x=-224 y=-384 z_index=0
    draw rect color=black fill=0 h=128 name="[tar1]" penwidth=1 show_if=always w=192 x=-512 y=-288 z_index=0
    

    Then you can simpliy the definition of the buttons in the mousetrap response item to:

    set button4 "[tar4]"
    set button3 "[tar3]"
    set button2 "[tar2]"
    set button1 "[tar1]"
    

    Now it should work.

    By the way: I would suggest to change the name for correct variable from correct to something else, e.g., correct_answer, as correct is an OpenSesame variable that is created automatically to code whether the actual response matches the correct response.

    Hope that helps!

    Best,

    Pascal

  • Hi Pascal,

    Thank you for your quick feedback. I did as you advised, but error occurs with this message
    "The experiment did not finish normally for the following reason: Button1 is not specified correctly."

    This was the first reason why I entered set button4 "x=512 y=-288 w=192 h=128 name=[tar4]" instead of just entering set button4 "[tar4]"..
    Any ideas on why this might be happening?

    Hansol

  • Just adding something here.

    I tried defining buttons by their coordinates too. And it still wouldn't allow the fourth button to be clicked.

  • Hi Pascal,

    I figured out the issue here. It seems that there is a glitch in the program (either in the OpenSesame or the plugin).

    from the code I initially posted, you can see that the width of the fourth button is "-192"

    draw rect color=black fill=0 h=128 name="[tar4]" penwidth=1 show_if=always w=-192 x=512 y=-288

    This was what made the button unclickable. This is weird, and I called it a glitch because the fourth button looks normal in the GUI display.

    Anyway, thank you for your help!

    Hansol

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