Howdy, Stranger!

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

Supported by

Counterbalancing & Showing selected response


I have two questions regarding counterbalancing and making some adjustment to my online experiment. I would really, really appreciate any help.

1) I wonder if it is possible to group my questions into two blocks and then randomize the order of questions within each block, as shown below. I watched the YouTube video on counterbalancing on OpenSesame (, but I think it requires a different approach in my case. 

2) In a part of my experiment, participants are supposed to choose either O or X in step 1, and then respond to survey questions in steps 2 and 3. In steps 2 and 3, I want to make it so that the response selected in step 1 (this should be different for each question and participant) appears in steps 2 and 3, just like the red letters in the diagram below. Is there a way to do this?

Thank you so much in advance.



  • Hi @ypark133,

    Yes, both things are possible.

    Regarding issue (1) which is not strictly counterbalancing but more randomization of subsets of your trials, the simplest method is to place your Q1-Q4 trials in a first loop, and your Q5-Q8 trials in a subsequent loop. If you use the same sequence of events for all, you can simply used linked copies of all the events in the trial sequence, such that the course of event is actually identical for both groups of trials but yoy ever have one sequence to create/edit. Simply set the order of the trials in each of the two loops to random.

    Regarding issue (2), you'd need to use a little coding to derive, from the response produced ("D" or "K"), what needs to be presented on the next screens. Something along the line of : If the key pressed is "D", then answer is the stimulus presented on the left. If the key pressed is "K", then the asnwer is the stimulus presented on the right. The exact implementation depends on how you go about setting up wjat appears on your first screen. From then, make sure that your subsequent screens are feedback screens and not sketchpads (this is because the content of sketchpad is prepared before the trial is executed, so it cannot display anything that changes on the fly, if you use a sketchpad, its content would only be updated on the next trial, not the currenbt trial). If you defined the text to be displayed in a variable called "answer", then simply wite {answer} on your feedback screens, and the content of that variable will be displayed.

    Hope this helps,


    Buy Me A Coffee

  • Hi Fabrice,

    Thank you so much for your answers. I sincerely appreciate it. Can I please ask some follow-up questions?

    1) As you suggested, I first tried to group my questions into two loops (ultimately to randomize the order of questions within each loop), but encountered a problem. As you can see in my screenshot (Figure 1 below), the structure of my experiment is currently messed up: Trial 1 is the only thing contained in the first loop, and I want the other trials to follow trial 1 under the first loop. So here's what I did and failed to solve the problem.

    - When I clicked "Insert after trial 1" (Figure 1 below), nothing happened.

    - When I clicked "Insert into First_loop" (Figure 2 below), trial 2 did go under First_loop, but it replaced trial 1 (I didn't want trial 1 to disappear). 

    Could you advise me on what I should have done?

    2) I slightly changed what I want to do now, so I tried something different but ran into an error. As in Figure 3 below, I want to present a different screen depending on the participant's answer on the response screen.

    To do this, I created two sketchpads following the response screen and tried editing run-if statement on the sequence page (Figure 4).

    But I see an error message saying that the script is wrong when I test run the experiment. Do you see what I did wrong on the sequence page?

    Thank you again,


  • Hi @ypark133,

    I saw your reply by chance. Best is to use user handles (e.g., @Fab), that way, I get notified of the arrival of a message where I'm mentionned.

    I'm a little puzzled by your message and your use of a unique sequence for each trial. Is there a reason why you're defining a separate sequence per trial? You can use a single loop and a single sequence, with each row in your loop coding for a trial. I recommend you first check the various tutorials for beginners to understand how the loop functions (my impression is that you haven't grasped how loops work; so I recommend going through the basics first). You simply need two loops, the first with 4 rows, and the same in the second. You need only one sequence, the same within each of the two loops.

    As for the second issue, please check the documentation about the "Run if" function. You must specify a condition. The program cannot understand "D" or "K", as it does not mean anything per se (the program cannot guess that you are referring to the keys pressed by the participant in response to a speicifc sketchpad. Unless you express the condition by referring to a specific variable and its potential value, the program has nothing to work on. If you pay attention to the specific error message, this usually gives you a good hint about what is going wrong.

    Note that the method you chose implies presenting one sketchpad and keyboard object or another sketchpad and keyboard object depending on the subject's response to an earlier sketchpad. This means that the responses in these two cases will be stores in separate columns in your log. It seems redundant to do it this way rather than using a feedback object and some code (in Javascript if you intend to run this in a browser) to customize what appears on that feedback object (your two sketchpads are actually identical except for presenting "O" or "X"; this level of redundancy can be avoided; same with the duplication of keyboard objects).

    I recommend you start with a more basic version of your task where you use a single loop to store the contents to be used in your 8 trials. Once you master that basic step, then you can try separting them into two loops, and then when that is working you can try displaying contents conditioned by the participant's response.

    Hope this helps,


    Buy Me A Coffee

  • Hi @Fab,

    Thank you so much for the answers! I took plenty of time trying to really understand your answers as well as the related tutorials, and I came back with a few questions.

    1) I'm actually defining a separate sequence for every 55 trials (not per single trial). I aim to have two sequences containing 55 trials each (so totaling 110 trials in my experiment). I did watch the YouTube tutorials and read documentations again, but I think the examples shown are hard to apply in my case. In the examples presented in the tutorials, a single trial is contained in a single sequence, and that trial is repeated multiple times in different conditions. But in my experiment, none of the 110 trials repeats itself. Each trial has a different trivia question (so I will have 110 different trivia questions to be solved). 

    Another reason why I try to create 55 different trials within each loop is that I want to name each trial (trial 1, trial 2, trial 3...) so that I can later analyze the participants' responses on the trial-by-trial basis. For example, once all my participants are done with the experiment, I want to see the average response for trial 1 (e.g., a Shakespeare question). But if I created just a single trial under a loop and repeat the trial in different conditions multiple times in random orders, "trial 1" or the first question should be different for every participant (e.g., it will be a Shakespeare question for one participant, a Hemingway question for another, and some other question for another) and I won't know how to compute the average response for the Shakespeare question. By creating an individual trial per trivia question, I'll be able to do analyses per trial. 

    These are ultimately why I'm trying to put multiple different trials under a loop, and I wonder if there is a way to do so (for now it seems to me that OpenSesame only allows me to create a single trial under a loop and repeat that trial in different conditions). 

    2) I finally managed to present different stimuli depending on the participant's previous response, by creating two sketchpads that will show only under certain responses. I understand that it's redundant to do it this way as you said, but I didn't quite understand what you said about how to do it the other way. So rather than bothering you to explain again, I wonder if it's possible to replicate what I did (red boxes in the screenshot below) to all 110 trials (i.e., trivia questions) simultaneously or easily, rather than manually copying and pasting each of the elements in the red boxes one by one to each trial.

    Thank you so much again,


  • Hi @ypark133,

    So, you're using two loops with 55 trials in each loop? This doesn't match pictures you showed earlier where you had at least 6 distimct sequences (one called Trial1, another called Trial2 etc.).

    I think you haven't grasped the concept of the loop and sequence. If you have a loop with 55 rows, you can easily use the columns to store whatever you want to appear on the screen (in your case you can have a different piece of text). You only need one sequence describing what must happen in a trial, and that sequence will be used 55 times but showing different content every time. If you have 55 rows and the number of cycles of the loop is set to 1, none of the trials will actually repeated.

    I think that what you mean by trial number is simple a variable that identifies each trial. You can call it whatever you chose, for example Trial_id. If you run your loop in a random order (in most designs this is the best option unless you havce specific reasons to keep it in the same, sequential, order for all participants).

    As for the rating, again, you don't need to create two different sketchpads and keyboard objects and use the "Run if" parameter to selectively present some and others. You simply need to use code to create the text to be displayed on the feedback screen based on the key pressed by the participant. The methd you're trying to implement is making the task heavier and, most importantly, you won't have the rating registered into a unique variable in your output but in two different variables, depending on whether one keyboard object or another was presented.

    In sum, you don't need to create lots of sequences, you only one sequence trial. You need two loops, and you don't need multiple screens for the feedback/rating part either.

    I'm attaching the illustration of what I'm talking about:

    The structure is a lot simpler than what you're trying to do:

    You can see that I'm using a single sequence trial, which is used in both loops.

    I recommend that you take the time to look at the example to make sure you understand the different parts. I believe that it does what you need, but in a much simpler way than what you initially described.

    Hope this helps,


    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 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