Maze task

PennController for IBEX Forums Support Maze task

Tagged: 

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #5788
    suz
    Participant

    Dear all,

    Has anyone used the maze task with pcibex? I would like to run it on pcibex, because the ibex setup is completely beyond me for configuration and which pages to edit etc. (I have rudimentary, probably non-existing JS skills). While I’ve managed to get it running over at ibex with a few (non-essential) adjustments, I have no idea how to change instructions, adjust css, or include a completion link (for prolific).

    I’m talking about this repo and task:
    https://github.com/vboyce/Ibex-with-Maze

    I have managed to import the repo to pcibex, but from what I understand, it doesn’t call main.js, because I get the starting page for the original ibex-maze, not the one I specify in main.js with a different welcome page, where participants are asked to enter their ID/name (which works with this spr exp of mine).

    I’m only just starting with pcibex, and I’ve managed to tweak an spr, so I roughly know where I am going, but it might be a slow-moving process, so bear with me…

    There are also other questions that I foresee: would this roughly be what I had to put into main.js? What about the key selectors? I’d probably want to use left and right arrows as this works a charm in the spr above:

    Template("sentences.csv", row =>
        newTrial("maze",
            
            newController("Maze", {s: row.s, a: row.a})
                .css("font-size", "2em")
                .print()
                .log()
                .wait()
                .remove()
            ,
            newSelector()
                .keys(37, 39)
                .log()
                .once()
                .wait()
        )
    ) // defines template for the main experiment

    I hope I’m making sense here. Any help is much appreciated, thanks!

    Best
    Susanne

    • This topic was modified 3 years, 10 months ago by suz.
    #5790
    Jeremy
    Keymaster

    Hello Susanne,

    Unfortunately you cannot use a Selector element from PennController to modify the behavior of a controller like Maze that was designed for Ibex. The code you posted will execute the maze and, once the whole sentence has been read or a wrong word has been selected (ie once your first wait command has been released), the script will then reach the Selector element and wait for its completion. So as you can see they are two distinct elements. (you also shouldn’t use a Selector without adding any element to select, but that’s a different issue)

    I looked at the code for Maze (in Maze.js) and the e/i keys are hard-coded there, so if you want to use this controller you’ll need to edit the code. It’s not very complicated: replace the two occurrences of 69 with 37 and the two occurrences of 73 with 39. You’ll also want to replace

    this.larrow.html("e");
    this.rarrow.html("i");

    with

    this.larrow.html("←");
    this.rarrow.html("→");

    Oh and simply delete the file sample.js that comes with the repo, or overwrite its content with your own code.

    Let me know if you have questions

    Jeremy

    #5791
    suz
    Participant

    Hi Jeremy,

    Ha, it just occurred me this very second that the sample.js file was the issue, thanks a lot! Yeah, I had already changed the maze.js code as suggested, it was working over at ibex already with the arrows.

    Thanks again, major relief.

    –Susanne

    #5794
    suz
    Participant

    Hi Jeremy,

    All working fine now. One minor thing I’ve noticed is that the feedback message for (wrong) choices in the maze task doesn’t show. Does it require a particular setting in the Template? I think it’s what is called “errorMessage” / “error_message” and “normalMessage” / “normal_message” in MazeSeparator.js. In the ibex task, the participants press a key to continue from the feedback to the next trial. In my experiment, there is currently a 750ms/500ms ISI (which I actually like because they don’t have to click anything). Although a brief flash of “oops!” for incorrect responses might also be an option, possibly as a reminder of participants to be attentive. Would an if-statement in the Template do that trick? I tried to add .failure(newText("oops!")) to no avail:

    Template("training.csv", row =>
        newTrial("training",
    
            newController("Maze", {s: row.Sentence, a: row.Distractor})
                .print()
                .log()
                .wait()
                .failure(newText("oops!"))
                .remove()
            ,
            newTimer(500).start().wait()
        )
    )
    

    Thanks, it’s only minor. I’m quite happy!
    –Susanne

    #5795
    Jeremy
    Keymaster

    Hi Susanne,

    The Maze controller, being designed for native Ibex, handles feedback the native-Ibex way: it flags a value for the next controller to check. The command failure is a PennController command that is only defined in the context of a .test command, the only test command on a Controller element being the standard printed.

    The good news is that you can easily add a custom PennController test command. Add this to your script:

    _AddStandardCommands(function(PennEngine){
        this.test = {
            passed: function(){
                return !PennEngine.controllers.running.utils.valuesForNextElement ||
                        !PennEngine.controllers.running.utils.valuesForNextElement.failed
            }
        }
    });

    Then you can do this:

    Template("training.csv", row =>
        newTrial("training",
    
            newController("Maze", {s: row.Sentence, a: row.Distractor})
                .print()
                .log()
                .wait()
                .remove()
                .test.passed()
                .failure( newText("oops!").print() )
            ,
            newTimer(500).start().wait()
        )
    )

    Jeremy

    #5796
    suz
    Participant

    Hi Jeremy,

    Awesome! Thanks a lot, much appreciated! I guess future novice mazers will appreciate this, too. I’m getting the hang of it, I have even managed to include a break after every n trials from forum posts.

    –Susanne

    #10866
    JulianaNovo
    Participant

    Dear Susanne,

    Were you able to run the Maze Task on PCibex?
    Would you mind sharing your script with me?

    Many thanks,
    Juliana

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