Howdy, Stranger!

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

Supported by

Doubt with loops and sequences

Hi all,

I have a question related to the loops. I’m a beginner using OpenSesame so, to make this clear, I firstly explain what I want to see once the experiment is running. I have short stories divided into different sentences. I want each sentence to appear on a separate screen. The experimental subject will read each sentence and press space bar once the sentence has been read. Finally, the stories will be followed by a comprehension question. Importantly, the stories contain different number of sentences (min. 2 sentences and max. 5 sentences), but I will always have the first sentence (context sentence) and the target sentence. However, if the story contains more than two sentences,I will add more context sentence in the middle.

Therefore, I created an excel file with several columns. These columns are called: Context_1; Context_2; Context_3; Context_4; Target. The thing is that the columns Context_1 and Target always contain sentences, but the other columns are filled or not depending on the length of the story. When I was creating the experiment, I had the intention of creating a loop with a sequence containing several sketchpads + keyboard responses corresponding to the different columns (i.e., Context_1, Context_2, etc). The problem is that when I’m running the experiment, a black screen appears for cells that do not contain information and I have to press space bar to continue up to the comprehension question. My question is: Is there a way to say that cells in the excel file which do not contain information should be skipped? Or maybe should I reconsider the way I wanted to build my experiment?

Thank you so much!


  • Hi @T_Q,

    Based on your description, it sounds as if your did not set the "Run if" property of the appropriate sketchpads and keyboard objects to the content of Context_2, Context_3 and Context_4. As a result, your task runs them all, even if the sentence to be displayed is empty.

    There are several ways of achieving what you're after. I'm describing here the easiest.

    Here's how to do it, based on an example I just programmed. Let's imagine that this is the structure of task, and some dummy stimuli, just for the illustration:

    As you can see, we have Context1 to Context4 and Target as the variables containing the sentences. Notice that some cells are empty. These correspond to sentences that should not be displayed and for which no response should be taken.

    The trick is to condition the appearance of certain object to the content of the sentence. I understand that the first sentence and the target sentence are always to be shown, so the corresponding sketchpads and keyboard objects should always be executed. In contrast, the sketchpads and keyboard objects for the other sentences should only be executed if the content of these sentence is not empty.

    To condition the presentation of any object in a sequence, use the "Run if" property:

    An object will always be executed if its default "always" state is used. Here, I've conditioned the execution of the sketchpads and keyboard objects for sentences 2 to 4 to the content of these respective sentences (as featured in the loop). So for example, we only want C2 and R2 to be presented is the [Context2] is not empty, hence we can write the following condition: [Context2]!="". The operator "!=" means "different from". Just apply the same method to the other objects as required and the task will now only show non-empty sentences and only take keyboard responses for those.

    Note that the data log will provide you with the responses and RTs for all sentences. They will be contained in the following columns in the data log:











    There would be other ways to achieve the same thing that I'd describe as more elegant or efficient, but this method has the advantage of being easy and simple and it should be suitable to you if you're beginning with Open Sesame.

    I attach my example so that you can explore it:

    Hope this helps!


    Buy Me A Coffee

  • Hi Fabrice!

    Thank you so much for your detailled explanation. I tried it and it works! It runs what I exactly need. I am very grateful for your help, you were so kind!


  • @T_Q

    Hi Teresa,

    You're welcome! Glad I could help and that your experiment is now working! Thank you very much for the coffee!, that was very nice of you! 🙂

    Good luck with your research!


    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