Howdy, Stranger!

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

Supported by

Assigning correct response to form base buttons

Hello, I'm trying to conduct face recognition test. I have created 4 button with form base for each trial and put the faces above them. I want participant to click the one of the button(A,B,C,D like multiple choice questions). How can assign the correct response, which button is correct. Can anyone help? Thanks.

My trials look like this. When I click on one of the button it don't record any response time or correct response

Comments

  • There are multiple ways, you can for example add a column to your loop table and set the correct_response to the button that you need. As far as I know, a button returns the text on it when it is clicked. So if you capture execute your form, you can capture its return value in a variable. Compare that value you to the one that you defined in your loop table and you know whether participants responded correctly.
    See here: http://osdoc.cogsci.nl/3.1/manual/forms/custom/

    hope this helps,

    Eduard

    Buy Me A Coffee

  • @eduard

    I am posting on this forum as I am hoping to create a search array with a similar design, to be ran on JATOS. I have attempted to create buttons using the form_base function, following the examples posted on the form widgets and keywords forum. However, when I attempt to use the form_base function, my task does not pass the compatibility check to be ran on an external browser. Similarly, I have followed the examples on the form widgets and keywords written in Python, which is also not passing external browser compatibility.

    I have attempted to use the cursor_roi functionality as well, but the effort is redundant unless I can make buttons appear. I could not indicate the region of interest without using the form_base function to create the buttons I need. Additionally, I have found that the mouse_plugin is not compatible with an external browser.

    The attached version of my task is currently running with answer selections to be indicated through the use of a keyboard numerical response. However, I would really like to create button responses (1-9) to be provided underneath of the symbol item, while also incorporating JavaScript language that positions the mouse to return to a set position for each trial.

    In summary, I am in need of advice on how to include the Digit-Symbol key, symbol probe, and 9 button responses on the screen (as a sketchpad item?), while also adhering to a language (JavaScript) that is compatible with JATOS. I am also concerned that the mouse_response functionality is not compatible with JATOS as well.

    Please let me know of advice or feedback anyone may have. Thank you!

  • Hi @mhilliard2 ,


    Unfortunately, form_base items nor linking sketchpad items to mouse_response items are supported in OSWeb. See:


    The following video explains how to use regions of interest in OSWeb:


    And this thread might also be of help:

    Cheers,


    Lotje

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

  • @lvanderlinden

    Hello Lotje,

    Thank you for letting me know these functions are not supported in OSWeb! I thought it might have just been user error, so I appreciate it.

    The questionnaire thread is very helpful as well. I think with some slight manipulation, I will still be able to accomplish a design with all of the elements I am in need of.

    I created this task using the multiple_choice template you posted, as I like the idea of a participant being able to fill a response box. However, after making some changes, my task does not appear to be showing the response box as filled when I indicate a response. Could you please let me know what part of your script calls on button to appear as filled when a response is indicated? I am not sure where my error is coming from.

    Additionally, I have one more question about your task design. The first loop in my task is essentially a practice block, therefore, I would ideally like to include correct/incorrect feedback. Where in my task would I include this, & what function do the feedback items in your task serve? Could I potentially implement the correct/incorrect feedback in their place?

    Again, thank you very much for the resources and advice.

  • Hi @mhilliard2 ,

    Depends on what kind of feedback you want. If you want feedback directly after every response, it must be placed in the trial loop after the response item. If you want to present blocked feedback after a number of responses (e.g. after every block), you have to keep track of the correct responses and the total responses. And present the ratio of them, after the trial loop in a feedback item. If you use standard settings and you have defined a var.correct_response , then Opensesame does the work for you. Just present [acc]% in a feedback item, and your participants will have their score.

    Eduard

    Buy Me A Coffee

  • @eduard

    I am hoping to incorporate per trial feedback for the practice block. I have figured out where in my task to present the feedback items so that it appears per trial, however, the feedback is not correct. I believe my problem is that I have not been able to successfully identify what the response item is called. In my task there are nine response options, which I have referred to as "box 1-9". Running the task while looking at the variable inspector has not been successful, as whenever the correct_response is selected, the variable appears as "undefined" despite this being defined in my block loop table.

    My other problem is that I would like to make the only allowed response for the guided practice at the start of my task to be "box 1". I believe I will be able to make this happen, once I determine what the box response items (1-9) are called.

    Please let me know if you have any thoughts,

    Thanks.

  • Hi,


    You are talking about the 2 items correct_feedback and incorrect_feedback , right? It seems that you never define the correct response variable, or am I missing something?

    You need to either have a vars.correct = ... definition somewhere, or if another of your variables codes accuracy, you have to use that in the run if field of those 2 items. Alternatively, you can define a vars.correct_response variable and a vars.response variable, then vars.correct is generated automatically (they must be called like that, otherwise it won't work).

    This response is somewhat general, because I don't know what exactly the relevant variables in your script are (and also I dont know much about javascript to suggest a fix without much of a fuss).


    Eduard

    Buy Me A Coffee

  • @eduard

    Hello,

    Yes, I am talking about the correct and incorrect feedback items. The reason I have not defined the correct response variable is because I am having difficulty determining what to identify it as, in order to get the feedback to run correctly. In my response post on this discussion to @lvanderlinden, I mentioned that I am incorporating aspects of the multiple choice template that Lotje posted. Specifically, I incorporated the multiple-choice boxes into my sketchpad items. The language used in the java_inline is beyond my understanding, so I reached out to Lotje in the hopes that someone may be able to help me determine what to name the response variable.

    In my task, each number has a corresponding symbol. I would like the correct_feedback item to run when the participant identifies the correct number box that corresponds to the symbol presented at the center of the sketchpad item. For example, if the symbol '+' is presented at the center of the sketchpad, the participant would select box 9 to receive correct feedback. Numbers 1-8 would be incorrect responses and should receive incorrect feedback. I wish to understand what to name boxes 1-9 so that the corresponding feedback is called upon.

    My apologies if this post leads you to more questions than answers. Unfortunately, I am in a similar situation as you are, as I am having difficulties determining the relevant variables as well.

  • Hi @mhilliard2 ,


    Good job adapting the example script to your own design!


    The box that the participant clicked is stored in the variable 'clicked_response'. To determine whether a response was correct or not:


    • At the beginning of the trial, define the correct response in an `inline_javascript` item like so:
    if (vars.question === "-") {
        vars.correct_response = 1}
    else if (vars.question === "T") {
        vars.correct_response = 2}
    else if (vars.question === ")") {
        vars.correct_response = 3}
    else if (vars.question === "L") {
        vars.correct_response = 4}
    else if (vars.question === "U") {
        vars.correct_response = 5}
    else if (vars.question === "O") {
        vars.correct_response = 6}
    else if (vars.question === "^") {
        vars.correct_response = 7}
    else if (vars.question === "X") {
        vars.correct_response = 8}
    else if (vars.question === "+") {
        vars.correct_response = 9}
    
    • Next, at the end of the trial, but before the feedback, determine response accuracy like so:
    if (vars.correct_response === vars.clicked_response) {
        vars.correct = 1}
    else {
        vars.correct = 0}
    

    The overview area should then look something like this:

    By doing so, your `Run-if statements` for showing the feedback should work as desired.


    I attached a modified script, but please double check everything carefully.


    Just let us know whether you need help for setting a single allowed box for the guided practice.


    Cheers,


    Lotje


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

  • @lvanderlinden

    Thank you so much for this thorough response! Everything is running as I was hoping, and I was also able to implement the single allowed box response for the guided practice by following your advice regarding the clicked_response variable. Very exciting!

    The only aspect my task is missing now is an accuracy_loop for the practice block, which for some reason is not running correctly. I added the accuracy element that I have successfully incorporated into my previous tasks, but for some reason the loop does not repeat when the accuracy threshold is not met ([acc] =>70) My guess is I need to incorporate another repeat_cycle element within the block, but I could be wrong.

    Please let me know if you have any thoughts, & thank you again for your advice! I greatly appreciate it.


  • Hi @mhilliard2,

    Nice task and script...

    I was intrigued by this thread and so I had a look at your task. I think that the reason the condition on ACC isn't working is twofold:

    (1) ACC remains at zero in your task as it stands (you can check by printing its value to the console as the task runs). This is probably because ACC requires that you specify a correct response in the mouse object before the sequence runs. You used code to compute the correct variable manually for that reason. So you'd need to implement a manual calculation of ACC as well.

    This can be done by initializing some counter for the number of responses and for the number of correct responses at the onset of the practice loop:

    ... and then incrementing these counters and calculating ACC manually:


    (2) Your acc_loop had only one cycle, so even if ACC was lower than 70, that loop would not get repeated. Simply increase it to some reasonable value (e.g., 10).


    Incidentally, I noticed that you used Javascript code instead of Python, so I assume you're planning to run the task through a browser. Note that you'll need to disable "evaluate on first cycle" in several of your loops (see the OSWeb check).

    Here's the modified task:

    Hope this helps,

    Fabrice.

    Buy Me A Coffee

  • @Fab

    Thank you for taking a look at my task! I have reviewed your revisions and I have a couple follow-up questions. After a quick run through of your the revised task in your response on an external browser, I realized the practice loop did not terminate, even with 100% acc performed. I assumed that the task you attached required 100% accuracy, as indicated by the determine_accuracy JavaInline item.

    After reading through your response more thoroughly, I realized that I may have been neglecting to add acc items to init_respcounter. I added numerical counters for both the vars.respcounter & vars.ncorrect. However, after much trial and error, I have not been able to determine how to incorporate these items so that the practice loop terminates once the 9 practice trials are performed with 70% accuracy.

    The practice loop terminates once 100% acc is performed when I run the task in quick-run. Unfortunately, when the task runs in an external browser the practice-loop does not terminate. I am assuming I am missing some language in the determine_accuracy JavaInline item so that the practice will terminate when running in an external browser.

    Please let me know if you have any ideas regarding how to terminate the practice_loop when running the task on an external browser, or if any of my questions were unclear.

    Thanks again!

  • Hi @mhilliard2,

    I revised the task again and can confirm that there is indeed a problem when the task is running in the browser. I had not tested it in the browser (there were some unresolved issues flagged by the OSWeb compatibility check). I've now addressed thee in order to check the task inside the browser.

    I get the same results as you do: the task repeats the practice loop until the accuracy is at least 70% when the task runs in OS, but the very same task fails to implement that condition in the browser. there only reason I could think of is that, somehow, when the task runs through Javascript code, the acc variable is not processed properly. My guess is that system variables (i.e., variables automatically defined by OS, such as acc) may ne handled in a slightly different way when handled within a browser. To check this, I replaced acc variable by a new one I called threshold (which is not a variable name existing by default within OS). After doing that, the task works fine in both OS and the browser.

    I attach my modified version:

    The task now repeats the practice block until the accuracy in its 9 trials is equal or superior to 70%.

    Hope this helps,

    Fabrice.

    Buy Me A Coffee

  • @Fab

    Thank you for walking me through your steps to solve this issue. The task is running how I intended on Jatos & external browsers.

    I greatly appreciate it!

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