Howdy, Stranger!

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

Supported by

Correct vs Incorrect Button Responses

edited June 2016 in OpenSesame

I'm hoping someone can help me figure out how to create an experiment where a participant is shown a left and a right button containing different words on a screen (e.g., "done" and "ton", respectively).

In order to move onto the next set of words, the participant must click on the correct word (e.g., "done"). If they click on the wrong word (e.g., "ton"), nothing will happen, and they will stay on the same screen.

Here's what I have so far:

I've created two variables containing different lists of words, one list for the words that will appear on the left button (labeled "Left") and one list for the words that will appear on the right button (labeled "Right").

I've also included two variables indicated whether the word on the left or the right is correct. In this case if the word appearing on the left side of the screen is the correct response (e.g., "done"), the variable "LeftCorrect" says "yes" and "RightCorrect" says "no".

Here's what my variable lists look like for reference:

image

Now, I've been able to render the buttons to look how I want, but I can't figure out how to disable the left or right buttons according to the correct response lists.

The way it's running now, it doesn't matter if a participant clicks on "done" (the correct response) or "ton" (the incorrect response) the screen will move onto the next trial.

I want it so that the experiment only moves onto the next trial if the participant selects the correct button according to the "LeftCorrect" and "RightCorrect" lists. In the case of my example, the experiment would only move forward if the participant selects "done", whereas, nothing would happen if they select "ton".

Here's what the participant would see on the screen.

image

Here's the code I used to make the experiment in a form base:

set timeout infinite
set spacing 1
set rows "1;1;1;1;1"
set only_render no
set margins "25;25;25;25"
set description ""
set cols "1;1;1;1;1;1;1;1"
set _theme gray
widget 1 2 2 1 button center=yes frame=yes text="[Left]"
widget 5 2 2 1 button center=yes frame=yes text="[Right]"

What do I need to add to the code or to my experiment to make it so that the screen only moves forward when the participant clicks on the correct word?

Comments

  • edited 10:48AM

    Hi TifBiro,

    If I'm not mistaking forms don't have this functionality. What you could do is use the code below (you can save it as an .opensesame file) to basically check the response and keep re-showing the form until the response meets your demands. In the example
    below it will only continue when clicking next if checkbox is checked.

    # Generated by OpenSesame 2.9.7 (Hesitant Heisenberg)
    # Mon Jun 20 10:47:52 2016 (nt)
    # <http://www.cogsci.nl/opensesame>
    
    set background "black"
    set canvas_backend "xpyriment"
    set compensation "0"
    set coordinates "relative"
    set description "Default description"
    set foreground "white"
    set height "768"
    set keyboard_backend "legacy"
    set mouse_backend "xpyriment"
    set sampler_backend "legacy"
    set start "experiment"
    set subject_nr "0"
    set subject_parity "even"
    set synth_backend "legacy"
    set title "New experiment"
    set width "1024"
    
    define inline_script check_resp_script
        set _prepare ""
        ___run__
        #################################################################
        # Check if an checkbox is checked when clicking next; otherwise rerun rating_scale
        #################################################################
        while True:
            # If the response has the value 'None':
            if self.get('rating') == 'None':
                # Rerun the item (after preparing it):
                exp.items['rating_scale'].prepare()
                exp.items['rating_scale'].run()
    
            # Else, the experiment advances normally.
            else:
                break
        __end__
        set description "Executes Python code"
    
    define sequence experiment
        run rating_scale "always"
        run check_resp_script "always"
    
    define form_base rating_scale
        set cols "1;1;1;1;1;1;1"
        set rows "1;1;1;1;1;1;1;1;1;1;1;1"
        widget 0 1 7 1 label text="How attractive do you find:"
        widget 0 2 7 1 label text="activity_text"
        widget 1 4 5 1 rating_scale var="rating" nodes="not attractive;;;;;|;;;;;very attractive"
        widget 5 10 1 1 button text="next"
    

    Best,
    Jarik

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