Howdy, Stranger!

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

Supported by

[solved] Calling and logging of variables by identical items within different loops

edited July 2013 in OpenSesame

Hello together, I´m not sure if I understand the way OpenSesame calls (A) and logs (B) variables when using identical items within different loops.

(A)
INLINESCRIPT-Item: represents (together with a logger-Item) my TrialSequence; by using 'exp.get('numberOfSquares') I call a parameter that I typed in for each cycle/trial (of that block) in the table within my LOOP-Item.
This INLINESCRIPT is appended to two loops that contain the identical variables ('numberOfSquares' and others), but different values. So the two loops represent different blocks with different values for the same parameters, and both loops contain the identical InlineScript.
When my InlineScript is called by my second loop, can I be sure that the 'exp.get'-Command also accesses the values of the variable 'numberOfSquares' from the second loop - its parent item - and not from the first loop? What´s the difference to the 'self.get'-Command?

(B)
My experiment works runs without error, but I´m in doubt because the following observation - my second (probably related) problem:
My trialsequence consists not only of the above mentioned InlinceScript but also of a logger-Item. So I use the identical InlineScript and logger-Item within two different loops.
When I click on the logger-Item within my second loop I can only select to log the 'numberOfSquares'-Variable in the list that belongs to the first loop (so called source item).
I mean on the one hand it´s obvious that my selection within the one loop will be my selection within the other loop, because the logger-Item is identical. BUT: Why is only shown that version of the 'numberOfSquares'-Variable which corresponds to the table of the first loop, but not that version with my second loop as its parent item?

(IN SHORT)
I would like to keep my trialsequence (InlineScript + logger-Item) as a re-useable object which I can append to different loops (with the same variables, but different values), taking the values from the respective parent item...

Comments

  • edited June 2013

    Hi,

    Welcome to the forum!

    I'm assuming that your experimental overview looks something like this:

    image

    is that right?

    What´s the difference (between the exp.get() and ) the 'self.get'-Command?

    Variables can exist on two levels: in an item (local) or in the experiment (global). The function exp.get() only looks for the desired variable at the highest (global, experimental, level), whereas self.get() looks first at the item level and then at the experiment level. In most situations this boils down to the same thing (like in your experiment, since a loop item, where you declared your variable, saves variables at the experimental level). Still, I would advise you to always use self.get(). For more information, please see:

    When my InlineScript is called by my second loop, can I be sure that the 'exp.get'-Command also accesses the values of the variable 'numberOfSquares' from the second loop - its parent item - and not from the first loop?

    As said above, I would advise you to use self.get(), but yes, you can be sure about that! For more information about the order in which items in OpenSesame are run, see this article:

    Why is only shown that version of the 'numberOfSquares'-Variable which corresponds to the table of the first loop, but not that version with my second loop as its parent item?

    You're right, the 'source item(s)' column is not always complete. Thanks for pointing this out! We marked it as an issue.
    Yet, the important point is that under the hood everything works as desired: A variable, once defined, is logged appropriately.

    Three easy ways to verify things like this yourself while programming your experiment:

    1.) Use print statements in your inline_script item (which will appear in the debug window):

    print 'self.get', self.get('numberOfSquares')
    

    2.) Temporarily append a feedback item to your trial sequence, where you use the square-bracket method to display the trial variables:

    image

    Finally, with regard to question B, you can verify in your output file whether everything went fine:

    image

    I hope this helps!
    Best wishes,

    Lotje

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

  • edited July 2013

    Hey Lotje,

    thank you for your extensive reply to my questions! I find out that my experiments works well, but now when I read your post I more convinced ;-)
    That issue with not showing the correct source item in the logging list confused me - thanks that it will be considered.

  • edited 10:32PM

    Good to hear that your experiment works! :)
    Let us know if you have any more questions!

    Did you like my answer? Feel free to 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 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