Howdy, Stranger!

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

Supported by

[solved] logging problems using forms

edited July 2014 in OpenSesame

I'm using OpenSesame for my experiment. Everything is working fine now, but the respones are not logged.
I need the text response on an open question. Even when I select all in the logger (which I put at the very end of the experiment) the text on te open question is not logging. The problem might be elsewhere in the experiment, does anyone know where to look for the problem? The experiment has three sequences, one using sketchpad and two using form base.

please help :)

Comments

  • edited May 2013

    If you out a logger at the very end of your experiment, it will only store the values that are available at the very end of your experiment.

    Let's say your experiment consists of four trials. In each of these, a participant gives a response that is stored in the [response] variable (see here). For trial one, this is fine. But in trial two, the [response] variable's value is overwritten* by the response given in trial two. In trial three, the response of trial three will overwrite the response from trial two and so on. Therefore, only your response given in the final trial (trial four in this example) will be available when the logger item is run, resulting in a very short logfile (a header and one row of values) that only contains data from the final trial.

    The solution is easy: place the logger at the end of your trial, not at the end of your experiment. Another wise thing to do, would be to follow the tutorial.

    *actually it's reassigned: the old value still exists somewhere, but it isn't linked to a variable any longer

    PS: if you're from the same group of students that posted this thread: in the future, please keep any discussion on the same topic within the same thread.

  • edited June 2014

    Hello,

    I am also having some troubles with logging and forms. In my program, I use the form to ask 1 question with a 3 option answer (defined as rating scale) at a certain point of the experiment, and then again at the end of the experiment.

    Both questions are created independently, in different inline scripts with different variable names and so on. However, they both are based in the first code (I copy-pasted the code from the first script to the second, and adapted it accordingly).

    The trouble is, the first scripts log the answer just fine, but the second only logs the time-stamp and the counter, not the answer. I have tried to custom-define the variables in advance, but I still have the same problem.

    here are the pieces of code
    Script 1 - Contingency check:

    #Import form widgets
    from libopensesame import widgets
    
    #Create base form & needed variables
    ContCheck_Form = widgets.form(self.experiment, cols=[1,1,1,1,1,1], rows=[1,1,1], margins=(100,100,100,100), spacing=25)
    ContCheck_Title = widgets.label(ContCheck_Form, text="Which of the faces is more likely to predict a shock?")
    
    #Define buttons & Images
    Male_pic = widgets.image(ContCheck_Form, path=exp.get_file("Dist_Male_GS.png"), adjust=True)
    Fem_pic = widgets.image(ContCheck_Form, path=exp.get_file("Dist_Fem_GS.png"), adjust=True)
    ContCheck_RatingScale = widgets.rating_scale(ContCheck_Form, nodes=['Male', 'No idea', 'Female'], var='Cont_Check', click_accepts=True)
    
    #Run questionnaire
    ContCheck_Form.set_widget(ContCheck_Title, (1,0), colspan=4)
    ContCheck_Form.set_widget(ContCheck_RatingScale, (1,1), colspan=4)
    ContCheck_Form.set_widget(Male_pic, (1,2))
    ContCheck_Form.set_widget(Fem_pic, (4,2))
    ContCheck_Form._exec()
    

    Script 2 - Contingenct Recheck

    #Import form widgets
    from libopensesame import widgets
    
    #Create base form & needed variables
    ContRecheck_Form = widgets.form(self.experiment, cols=[1,1,1,1,1,1], rows=[1,1,1], margins=(100,100,100,100), spacing=25)
    ContRecheck_Title = widgets.label(ContRecheck_Form, text="Do you still remember which of the faces is more likely to predict a shock?")
    
    #Define buttons & Images
    Male_pic = widgets.image(ContRecheck_Form, path=exp.get_file("Dist_Male_GS.png"), adjust=True)
    Fem_pic = widgets.image(ContRecheck_Form, path=exp.get_file("Dist_Fem_GS.png"), adjust=True)
    ContRecheck_RatingScale = widgets.rating_scale(ContRecheck_Form, nodes=['Male', 'No idea', 'Female'], click_accepts=True, var='Cont_Recheck')
    #Run questionnaire
    
    ContRecheck_Form.set_widget(ContRecheck_Title, (1,0), colspan=4)
    ContRecheck_Form.set_widget(ContRecheck_RatingScale, (1,1), colspan=4)
    ContRecheck_Form.set_widget(Male_pic, (1,2))
    ContRecheck_Form.set_widget(Fem_pic, (4,2))
    ContRecheck_Form._exec()' 
    

    Thanks in advance for any advise!
    Daniel

  • edited 12:44PM

    Hi Daniel,

    The scripts look fine, I suspect there's a problem with the way that you are logging variables. What's the structure of the experiment? Is there a logger item after the second inline_script?

    Cheers,
    Sebastiaan

  • edited 12:44PM

    Hi Sebastiaan,

    Well, the experiment itself is divided in 3 stages,each one with its own loop/sequence (Conditioning phase; attentional capture-training phase; and attentional capture - experimental phase). I uploaded a screenshot of the experimental sequence so that you can see where the different loggers are and how the phases are organized, but in general they are loggers at the end of each one of the phases. Indeed, do I have a logger after the recheck (at the very end of the experiment).

    Cheers, and looking forward to your comments!
    Daniel

    image

  • edited 12:44PM

    Hi Daniel,

    Well, you clearly do have a logger at the end, so that's fine. Did you maybe de-select the 'Include variables with missing values' option in the logger? If you deselect this option, the logger will only log variables that exist the first time that it is executed.

    See also:

    Cheers,
    Sebastiaan

  • edited 12:44PM

    Hi Sebastiaan,

    As for your question, yes, it had the check on "Include variables with missing values". Also went through the logger Anyway, to make sure that I did not mixed up anything with the logger (creating variables and so on) I deleted it and replaced it with a new one.

    But when I tested it, something strange happened. For a quick first test, I blocked all other objects in the sequence (run if=never) so that I could see if it the logger was working for both checker and re-checker without having to go through the entire thing, and they both worked fine, I got both variables logged. Then, to make sure, I ran the entire experiment again, this time without blocking anything in the sequence, but then only the first check is logged, not the recheck.

    I can't really imagine what might be going wrong, It seems there is something in the events between the first and second check might be keeping it from logging the second check, but I can't really imagine what (Checks are independent and located outside the trial loops, and no reference to them or the variables they use is made anywhere else in the program). Do you have any ideas?

    Thank you very much for your support!

    Best,

    Daniel

  • edited 12:44PM

    Hi Daniel,

    This is very puzzling. So if I understand correctly, you can log both variables Cont_Check and Cont_Recheck in the same experimental run, but only if you skip the middle part of the experiment. Is that correct?

    You also mentioned that adding Cont_Recheck as a custom variable didn't help. What happens if you do that? Do you see the variable in the logfile with 'NA' as value, or do you not see the variable at all?

    One thing that you could try is to explicitly define the variable in the general script editor of the experiment. You can simply add the following line to the very top of the script:

    set Cont_Recheck dummy
    

    Maybe this works, but even if it does, it doesn't clarify the problem. Would you be able to reproduce the problem in a 'minimal setting', i.e. a very simple experiment that triggers the issue? I'd like to know if it's a bug in OpenSesame, or if it's some oddity in your experiment.

    Cheers!
    Sebastiaan

  • edited 12:44PM

    Hi Sebastiaan,

    Very puzzling indeed! That is correct, if I skip the middle part of the experiment it logs both variables just fine, but if I run it complete the Cont_Recheck variable is missing from the log (That is, altogether missing, not even 'NA').

    Same happens if I add Cont_Recheck as a custom variable directly on the log. On a hunch, I tried setting the click_accepts argument in the rating scale as 'False' and adding a button to move on, but I still got the same results. I also tried moving the object around a bit, in order to make sure that there is at least some object after the inline and logger objects in the sequence, but I still got the same results.

    I have just tried setting Cont_Recheck as dummy at the general script, and that did the trick! Both variables are logged now, so thank you very much for your help fix that. But I agree, it is still a bit of a mystery. I have prepared a short version of the experiment (is actually the same experiment, except that the longer loops run only a minimum amount of trials, so that a full run won't take more than a few of minutes). And that is the one I have been using to test different solutions. If you want to take a look let me know, I will e-mail it to you
    All the best, and thanks once more!
    Daniel

  • edited 12:44PM

    I have prepared a short version of the experiment (is actually the same experiment, except that the longer loops run only a minimum amount of trials, so that a full run won't take more than a few of minutes). And that is the one I have been using to test different solutions. If you want to take a look let me know, I will e-mail it to you

    Yes, thank you, please send it to me! Or better yet, if there's no reason to keep it confidential, upload the script to something like pastebin.com and post a link here.

    Cheers!
    Sebastiaan

  • edited 12:44PM

    Hello again,

    Here is the pastebin link.
    I hope it helps! Also, could you please let me know when you figure out what the issue was? Just out of curiosity (and especially in case it was something odd about the code I can learn from, and keep in mind for future experiments).

    Best,

    Daniel

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