Experiment freezes in the middle of trial sequence

PennController for IBEX Forums Support Experiment freezes in the middle of trial sequence

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #8659
    kew
    Participant

    I am trying to randomize the presentation order of experiment trials within groups which are specified in a table. I am running into an issue where the experiment freezes once a certain trial is reached, regardless of where it shows up in the overall ordering. In the table I have specified this particular trial is the last in the list of trials for that group, but I don’t know why that would cause execution of the script to stop.

    Demonstration link:
    https://farm.pcibex.net/r/crAIND/

    #8665
    Jeremy
    Keymaster

    Hi,

    This is because the TextInput element gets deleted once the trial is over, and the .log command on newTrial() is executed asynchronously, so this command will fail when it so happens that it is executed after the trial is over: .log("answer", getTextInput("answer_box"))

    Use a global Var element to make sure the element persists outside the trial and the log command never crashes:

                .wait( getTextInput("answer_box").testNot.text(""))
            ,
            newVar("answer").global().set( getTextInput("answer_box") )
        )
        .log("code", row.code)
        .log("context", row.context)
        .log("answer", getVar("answer"))
    )

    Jeremy

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