Howdy, Stranger!

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

Supported by

Is it possible to record the distance between stimuli and where participant clicked?

Hi,

I've already posted this question on MouseTracking forum but I have a feeling my problem may be solved with a simple solution than the complex MouseTracking plug-in. (I tried to take down my question in the other forum but I am not sure how. Please feel free to instruct on that too, haha).

Anyhow, I am trying to build a relative size judgement task where participants will be asked to estimate the height of the goalkeeper (example image attached).

https://forum.cogsci.nl/uploads/005/YRQD9KPL8XC3.png There was an error displaying this embed.


Participants will be asked to click on the pole where they believe the goalkeeper's height would be relative to the soccer ball. With classic mouse function, it records the coordinate (x,y) relative to the whole screen rather than the distance from the bottom bar to the point they clicked. If the bar stayed in that position, I can simply calculate the distance by subtraction clicked-coordinate and position of the bar. However, I am planning to change the position of the pole for each trial.

If anyone knows how I can record distance between a fixed point (i.e., bottom bar) that changes every trial and where the participant clicked, I would greatly appreciate your help.

Thank you very much for your time.

Cheers,

So So

Comments

  • Hi @SoSo ,

    To change the position of the pole on each trial, you need to specify its position, right? So there will probably be two variables, say pole_x and pole_y , that indicate the center of the pole. And you will have two variables, cursor_x and cursor_y , that indicate where the participant clicked. And that's all you need!

    You can use this to determine afterwards, for example in LibreOffice Calc, what the distance between the pole and the click was (using Pythagoras). Or if you want to be fancy, you can do it in the run phase of a simple inline_script after the response has been collected, like so:

    var.distance_to_pole = xy_distance(var.pole_x, var.pole_y, var.cursor_x, var.cursor_y)
    

    — Sebastiaan

  • Hello @sebastiaan

    Yes! That's what I was looking to do.

    So, you mean I can assign the pole at different coordinates (pole_x, pole_y) for every trial on sketchpad? So the (pole_x, pole_y) value is already defined even before participant respond. I am not super familiar with how to write inline script so I will have to educate myself and try it out.

    On another note, I have another question. I hope you don't mind me asking on the same thread. First image shows the experiment that is running and the second image shows the inline script ("process_team").

    1) Why am I able to write numbers but not letters on the experimental screen? How do I edit the script so that it accepts letters?

    2) Why am I able to write numbers that were not specified on the script? On the keyboard response, I did allow all numbers to be accepted (0 to 9) but on the script I only included 0,1,2,3,4,5. So why is it still being shown on experimental screen although not specified on script?

    Note, this is the inline script that is inserted before the block ("constant_4"). And the inline script above is called "process_team".

    Cheers, So So

  • Hi So So,

    So, you mean I can assign the pole at different coordinates (pole_x, pole_y) for every trial on sketchpad? So the (pole_x, pole_y) value is already defined even before participant respond.

    If you want the pole to have a different position on every trial, then yes, you can make it variable. The way to do so is what Sebastiaan described, that is, having 2 variables that code the x and y coordinate of the pole. In the beginner's tutorial step 6, it is explained how to use variables in sketchpads. Let us know if this is not enough to clear things up.

    I am not super familiar with how to write inline script so I will have to educate myself and try it out.

    Always a good idea :)

    On another note, I have another question. I hope you don't mind me asking on the same thread.

    Can you share the experiment here? That will make it easier to find out what is happening in your code.

    Best,

    Eduard

    Buy Me A Coffee

  • Dear Eduard,

    I have attached only the part where I was having trouble. Basically, I want to ask "What is your favourite football team?" and to accept answers in letters. And I would like to ask the question at the end of the experiment.


    Thank you so much!

    So So

  • Hi Soso,


    I removed the parts of your script that dealt with specifying which input to accept, and that works (see attached). I don't think you need to implement any restrictions.


    Did you solve the other issue, that is, did you manage to make the location of the pole variable?


    Cheers,


    Lotje





    Did you like my answer? Feel free to Buy Me A Coffee :)

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