Howdy, Stranger!

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

Supported by

[solved] Referring only to one column of a loop

edited May 2015 in OpenSesame

Hello!

I'm using nested loops, so that cells in the main loop contains variables that refers to specific column
in the nested loop:

image

The idea (and what I need to have) is that one picture of the column is chosen randomly and than I return to the main loop,
so something like this:
(every color represent one trial):

image

But in practice, every time the nested loop is referred to, it goes through all the columns before getting back to the main loop:

image

Is there any way to avoid it? I have 32 columns and I need to add even more...

Any insight will be really helpful! (-:

P.S here is a link to the file, if that helps:
https://www.dropbox.com/s/jpr9b0fesefyk83/Ordinalitysymbolic.opensesame?dl=0

Tali

Comments

  • edited 8:28AM

    Hi Tali,

    every loop item has a break ifargument. There you can add something like: [count_nested_loop] >0.

    OpenSesame has built in variables that count how often each item was called. If I remember right, the general shape is "count_NameOfItem", you can check the it in your logger.
    Does this help?

    Good luck,

    Eduard

    Buy Me A Coffee

  • edited 8:28AM

    Hi Eduard

    Thank you for your help!
    I tried what you suggested: in my nested practice loop (in break if)
    I wrote:[count_Nested_practice] >0
    Now, I get only 2 trials (the picture that was chosen from the nested and the picture from the column to the right), and then the practice ends...
    What am I doing wrong?

    Thanks again!

    Tali

  • edited 8:28AM

    Mh, I'm not sure about the exact sequence, in which these variables are written. I suppose if this happens in the end of an iteration, the first loop is 0th trial, so, the next trial will start, too. Now, the counter reaches 1, corresponding to the 2nd trial, so that no more trials are started.
    Anyway, the exact reasoning is not really important here, just set [count_Nested_practice] =0 and you should be fine ( I hope).

    Eduard

    Buy Me A Coffee

  • edited 8:28AM

    Hello again (-:

    I tried this too, and it doesn't get out of the practice after 2 trials,
    but with or without "break if" I get the same result:
    The nested loop is sampled twice (from tasted columns) and only then returns to the main list...

    Here is the experiment if you want to see how it looks...
    https://www.dropbox.com/s/jpr9b0fesefyk83/Ordinalitysymbolic.opensesame?dl=0

    Thank you!
    Tali

  • edited 8:28AM

    Hi Tali,

    In case you can't work around this problem, you could also simply put all the picture names in a list, and then use random.shuffle(list) and list.pop[0] to take one picture every time you go through your main loop.

    Good luck!

    Cheers,
    Josh

  • edited 8:28AM

    Hi Josh

    Thank you for your suggestion!
    The problem is that I will have to create 32 different lists and use shuffle for each one of them... and while doing it I can make mistakes... That's why I preferred to use loops

  • edited 8:28AM

    Hi Tali,

    If the strategy with using the built-in counters doesn't work, you can always create your own counters and make sure that they do work. So, in the beginning of your experiment (or in the outer loop), you set a trial_counter to 0. Later, when you're in the nested_loop, you can increment it to 1 or break it right away. This you should do from within an inline_script. Alternatively, you can also leave the loop item untouched and add this breakstatement as last element in the nested sequence. In doing so, it will also not run more than once.
    Do you understand what I mean?

    Btw. I think, you have a few nested sequences too much in your experiment. Maybe you should check, whether you can remove some of them to make the experiment less complicated.

    Good luck,

    Eduard

    Buy Me A Coffee

  • edited 8:28AM

    Thank you Eduard! I'll try that!

  • edited 8:28AM

    Hi!

    With the help of Yoni Melman we found a way to have a
    nested that is very similar to that of E-prime:

    In this example, in the main loop we wanted to define the font size as a variable.
    So we wrote the name of the variable within []:
    image

    Then, the nested table will have a column by that name:
    image

    To allow font size to change as variable, in the "Target" sketchpad we edit the script so the font size will be the variable [Fs]:
    image

    (This is only an example, but it is possible to use more columns for more variables)

    Some steps to make sure that the nested loop will only be sampled once:

    1. This is how the structure suppose to look like:

    image

    1. In the "run" section of "flag_down" write:
      self.experiment.set("flag",0)

    2. in the "run" section of "flag_up" write:
      self.experiment.set("flag",1)

    3. in the "nested-loop", check "show advanced options" (see picture above) and under "break if" write: [flag]=1

    Here is a link to the file:
    https://www.dropbox.com/s/wvenrkre52tmtpq/nested.opensesame?dl=0

  • edited 8:28AM

    Hi Tali,

    Thanks for sharing!

    Eduard

    Buy Me A Coffee

  • Hi all,

    I noticed that some of the images in this discussion appear to be gone. Is there any way to retrieve them, as I'm very interested in the solution Tali proposed.

    Kind regards,


    Kerwin

  • Hi @kolfers ,

    Unfortunately not 😕 Some images (and attachments) got permanently lost in some server issues some time ago. Unless, of course @labovich still has them.

    — Sebastiaan

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