Unpredictably stuck in preloading

PennController for IBEX Forums Support Unpredictably stuck in preloading

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6185
    rbieber
    Participant

    I have a fairly straightforward experiment (hear a sentence, enter text) that has been working successfully. I’m trying to modify the experiment to add a feedback portion (hear a sentence, enter text, hear the sentence again), and I can’t figure out what’s causing my problem.

    I’m currently using a template for my trials, and using a sample .csv of just 5 stimulus items to test the experiment as I make changes. I think I’ve successfully put in all the elements that I want, and they seem to be working, but I am unpredictably getting the ‘please wait while resources are pre-loading’ text as I test the experiment. Sometimes it happens after 1 successful trial, sometimes not until after all 5 trials, and anywhere in between. I have yet to make it through the sample experiment successfully; have not seen results sent to server yet. Pasting in my (inelegant) template code below, as it’s the only part of the experiment code that I have modified in adding in my feedback. Thanks for the help!!

    Template( "sample.csv" , 
        row => newTrial( "experiment" ,
            newText("attend", "Ready...")
            .center()
            .print()
            ,
            
            newTimer(750)
            .start()
            .wait()
            ,
            
            getText("attend")
            .remove()
            ,
            
            newAudio("Sentence", row.Filename)
            .play()
            .wait()
            ,
            
            newText("instruct", "Type what you heard in the box below")
            .center()
            .print()
            ,
            
            newTextInput("response", "")
            .center()
            .print()
            .log()
            .log("final")
            ,
            
            newButton("Submit button", "Submit")
            .center()
                .print()
                .wait(getTextInput("response").testNot.text(""))
                
            ,
            
            getText("instruct")
            .remove()
            ,
            
            getTextInput("response")
            .remove()
            ,
            
            getButton("Submit button")
            .remove()
            ,
            
            newTimer(750)
            .start()
            .wait()
            ,
            
            newText("intended", "The intended sentence was:")
            .center()
            .print()
            ,
            
            newText("sentence", row.Sentence)
            .center()
            .print()
            .bold()
            ,
            
            newTimer(250)
            .start()
            .wait()
            ,
            
            newButton("Repeat", "Click to hear the sentence again")
            .center()
                .print()
                .wait()
                
            ,
            
            getText("intended")
            .remove()
            ,
            
            getButton("Repeat")
            .remove()
            ,
            
            getAudio("Sentence")
                .play()
                .wait()
            ,
            
            newTimer(250)
            .start()
            .wait()
            ,
            
            getText("intended")
            .remove()
            ,
            
            getText("sentence")
            .remove()
            ,
            
            newButton("next trial", "Next trial")
            .center()
                .print()
                .wait()        
            
        )
        .log( "Sentence" , row.Sentence )
        .log( "TalkerID" , row.TalkerID )
        .log( "TalkerL1" , row.TalkerL1 )
        .log( "SentenceID" , row.SentenceID)
    
    )
    #6188
    Jeremy
    Keymaster

    Hi,

    Do you have a Sequence command containing randomize("experiment")? From what you describe, I suspect that there’s a typo in one of the rows’ Filename column, which results in your experiment failing to preload that resource, and that the randomize function shows the corresponding trial sometimes at the beginning of the experiment, sometimes later in the sequence of trials. Make sure you double-check Filename for each row in your table, and each filename in your project’s Resources folder

    Jeremy

    #6194
    rbieber
    Participant

    Thanks for the quick response, Jeremy! That was my first guess as well, but I don’t think that’s it (had checked them previously, had used a .csv from a different experiment and just deleted everything but the first 5 lines). I just tried taking out randomize() and running it without the randomization, and it did the same thing – took me through all 5 trials and then got stuck. I just looked back again at the .csv file, and realized the problem: there were 2 “blank” lines included at the end. No text was present, but the line numbers were showing up, so I’m guessing it was trying to read in those lines. Just deleted them out and the line numbers disappeared and the problem is resolved.

    Thanks for the help!

    #6195
    Jeremy
    Keymaster

    Good catch! It was also listed on the troubleshooting help page, actually, I guess I should’ve applied my own medicine before posting my message

    Jeremy

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.