Jeremy

Forum Replies Created

Viewing 15 posts - 1,291 through 1,305 (of 1,522 total)
  • Author
    Posts
  • in reply to: DashedSentence in a PennController trial #5292
    Jeremy
    Keymaster

    Hello Matheus,

    You can copy the code defining the showWord and dashed functions from my message above, just replace " " with "*" in the line starting with ...words. Then use showWord as illustrated in that message, inserting a * instead of a space character in the text wherever you want to mark a chunk separation.

    Jeremy

    in reply to: Preload Zip and Invalid URL #5288
    Jeremy
    Keymaster

    Hi Nickolas,

    You can only preload ZIP archives, whose filenames should end with .zip. You can try changing the extension of your RAR file, but if the compression algorithm was different, chances are PennController won’t be able to read it.

    Jeremy

    in reply to: Multiple Mouse Clicks #5286
    Jeremy
    Keymaster

    Hello Farzaneh,

    What exactly do you mean by “multiple clicks on the same stimuli”? What should happen if your participant clicks on the exact same element again?

    As far as I can tell, there is nothing wrong with your script: it will wait for a click on one of the images before moving on from your last wait command, but your participant should still be able to modify their choice (ie. keep clicking on the images) until the end of the trial (that is, unless your script explicitly does something against that). You just need to add "all" in your log command to have all the clicks reported in the results file. Here is a version of your script edited for concision, where I added a “Finish” button to demonstrate that you can modify your choice at will before clicking the button:

    newTrial(
        defaultImage
            .size(200, 180)
            .css("border", "solid 1px black")
        ,
        newTimer("show", 1000),
        newTimer("between", 900)
        ,
        newCanvas("base",1000,410).print()
        ,
        newImage("one", "Blue.png").print( 370 , 180 , getCanvas("base") ),
        getTimer("show").start().wait(),
        getImage("one").remove(),
        getTimer("between").start().wait()
        ,
        newImage("two", "Green.png").print( 370 , 180 , getCanvas("base") ),
        getTimer("show").start().wait(),
        getImage("two").remove(),
        getTimer("between").start().wait()
        ,
        newImage("three", "Yellow.png").print( 370 , 180 , getCanvas("base") ),
        getTimer("show").start().wait(),
        getImage("three").remove(),
        getTimer("between").start().wait()
        ,
        newImage("four", "Red.png").print( 370 , 180 , getCanvas("base") ),
        getTimer("show").start().wait(),
        getImage("four").remove(),
        getTimer("between").start().wait()
        ,
        getCanvas("base")
            .add( 240 , 0 , getImage("one") )
            .add( 560 , 0 , getImage("two") )
            .add( 240 , 230 , getImage("three") )
            .add( 560 , 230 , getImage("four") )
        ,
        newSelector()
            .add( getImage("one") , getImage("two") , getImage("three") , getImage("four") )
            .log("all")
        ,
        newButton("Finish").center().print().wait()
    )

    Jeremy

    in reply to: Page loading problems #5283
    Jeremy
    Keymaster

    Hi,

    Strange indeed. It probably has something to do with your server’s response: I suspect that it is fine with accepting and processing the upload request, but for some reason it probably does not send the OK back to your experiment. Did you copy the full script from this page to your setup.php?

    Jeremy

    Jeremy
    Keymaster

    Hi Nickolas,

    You currently can only send results once per participant, so chances are you are seeing this message because your experiment attempts to send the results more than once.

    I might implement an option in the future to regularly send results to the server over the course of the experiment, as you suggest, but that would require revising how the server handles result-saving requests, which I can do on the PCIbex Farm but not on the original Ibex Farm, of course, and for now I am trying to keep PennController as compatible with the original farm as possible.

    Jeremy

    in reply to: Page loading problems #5280
    Jeremy
    Keymaster

    You can use support@pcibex.net, your message will only be forwarded to me and Florian

    EDIT: problem solved, there was a typo in the URL to the ZIP file

    Jeremy

    in reply to: Page loading problems #5277
    Jeremy
    Keymaster

    Hi,

    The two problems are related: if PennController succeeds in fetching the zip archive, it should rapidly preload all the resources it contains in the cache and thus no longer need to look for them at the beginning of each trial.

    It’s possible that you don’t have the privileges to use .htaccess to configure CORS settings on your server, or maybe it’s doesn’t run apache. Would you mind sharing the link to your experiment with me (you can email it to me if you don’t want to post it here)? Just make sure to re-enable the Debug feature in case you turned it off before

    Jeremy

    in reply to: Yes/No Question Spacing #5273
    Jeremy
    Keymaster

    Hi Cindy,

    PennController displays scale buttons as cells in an HTML <table> element, which are a pain to handle in CSS… Maybe I’ll revise this in the next release of PennController. In the meantime, one CSS solution would be to add this to PennController.css:

    .Scale-scaleButton {
        padding-right: 5em;
    }

    EDIT: actually, if you are using radio buttons the CSS solution is not too bad, just use .Scale-label instead of .Scale-scaleButton

    That solution is not ideal though, as it will effectively expand the width of each button by 5em. Another solution would be to print the answer options as Text elements on a Canvas and group them in a Selector:

    newTrial(
        newText("Will you dance with me?").print()
        ,
        newCanvas(200,30)
            .add( 0 , 5 , newText("Yes") )
            .add( "right at 100%" , 5 , newText("No") )
            .print()
        ,
        newSelector("answer")
            .add( getText("Yes") , getText("No") )
            .wait()
            .test.selected( getText("Yes") )
            .success( newText("Hurray!").print() )
            .failure( newText("Too bad...").print() )
        ,
        newButton("Next").print().wait()
    )

    Jeremy

    in reply to: response while reproducing video #5272
    Jeremy
    Keymaster

    I’m not sure a while loop would be the way to go, but maybe you’d want to use the callback command. It really depends on what design you have in mind. But again, there’s nothing special about playing back a video, really. Just code your trial the way you would code any other trial. Here’s another example:

    newTrial(
        newText("Press Space whenever you see a second boat in the video").print()
        ,
        newButton("Watch video").print().wait().remove()
        ,
        newVideo("video", "https://upload.wikimedia.org/wikipedia/commons/4/4f/CanoeTacking.webm")
            .size("auto","60vh")
            .print()
            .play()
            .log()
        ,
        newText("Number of presses on the Spacebar...")
            .after( newText("times", "0") )
            .print()
        ,
        newVar("presses", 0)
        ,
        newKey(" ")
            .log("all")
            .callback( 
                getVar("presses").set(v=>v+1),
                getText("times").text( getVar("presses") )
            )
        ,
        getVideo("video").wait()
        ,
        getVar("presses").test.is(2)
            .success( newText("Indeed, there were exactly two other boats").print() )
            .failure( newText("Did you miss something, or did you see ghost boats?").print() )
        ,
        newButton("Next").print().wait()
    )

    Jeremy

    in reply to: response while reproducing video #5269
    Jeremy
    Keymaster

    Hello Sílvia,

    Yes, you can use Key elements as usual. Just remember that the script runs top-down and pauses on every wait command. Here’s an example:

    newTrial(
        newText("Press Space when you see another boat in the video").print()
        ,
        newButton("Watch video").print().wait().remove()
        ,
        newVideo("video", "https://upload.wikimedia.org/wikipedia/commons/4/4f/CanoeTacking.webm")
            .size("auto","60vh")
            .print()
            .play()
        ,
        newTimer("tooearly", 2500).start(),
        newTimer("toolate", 3500).start()
        ,
        newKey(" ").wait()
        ,
        getVideo("video").pause()
        ,
        getTimer("tooearly").test.ended()
            .and( getTimer("toolate").test.running() )
            .success( newText("Good job!").print() )
            .failure( newText("Too early, or too late!").print() )
        ,
        newButton("Next").print().wait()
    )

    Jeremy

    in reply to: resize video #5266
    Jeremy
    Keymaster

    The rule is simple: lighter files will load faster. Both formats (WebM and MP4) tend to produce files on the lighter end, but only MP4 (H.264) is supported by most major browsers, so I’d go with that.

    Jeremy

    in reply to: resize video #5264
    Jeremy
    Keymaster

    Hi Sílvia,

    I hope you don’t mind, I moved your question to the Support section of the forums, as I think it’s more appropriate

    How about using the .size and .play commands, like this?

    newTrial(
        newButton("Watch video").print().wait().remove()
        ,
        newVideo("https://upload.wikimedia.org/wikipedia/commons/4/4f/CanoeTacking.webm")
            .size("80vw","auto")
            .print()
            .play()
            .wait()
    )

    Note that most browsers will require a user interaction to happen on the page for play to automatically start the video, hence my Watch video button (but any prior interaction in your experiment will do)

    Jeremy

    in reply to: Behavioural task score #5261
    Jeremy
    Keymaster

    Hello,

    The PennController counterparts of the if-else statements are the .test commands and their associated .success and .failure subcommands. You’ll also want to keep track of the score across trials, so you’ll need to use a global Var element:

    Template("presentedWords.csv",
        row => 
        newTrial("recall",
        newVar("score", 0).global() // Will initialize with 0 if Var doesn't exist yet
        ,
        newText(row.item)
            .print()
        ,
        newText("In which condition of the experiment did you encounter this word?")
        ,
        newText("Press the F KEY for INNER, the J KEY for OUTER, and the SPACEBAR for NEW WORD")
        ,
        newKey("question1", "FJ ")
            .log()
            .wait()
            .test.pressed( row.correctKey ) // Set value to v+1
            .success( getVar("score").set(v=>v+1) )
        ,
        newText("Your current score is: ")
            .after( newText("").text(getVar("score")) )
            .print()
        ,
        newButton("Next").print().wait()
        )
        .log(row.item)
        .log(row.list)
        .log(row.condition)
    )

    Jeremy

    in reply to: Pseudo-randomising stimulus presentation #5257
    Jeremy
    Keymaster

    could it possibly happen that the function accidentally doesn’t use a particularly category at the beginning of the Block/trial set, and is therefore ‘forced’ to use them at the end and crash itself?

    When this happens, the function simply generates a new order. This is precisely why it could get stuck into an infinite loop: its a brute-force method, it keeps generating random orders until one matches the specified pattern. As long as your items make it possible to generate a matching pattern, the function will eventually return one.

    Jeremy

    in reply to: Page loading problems #5254
    Jeremy
    Keymaster

    At the moment, the original Ibex servers are probably faster than the PCIbex ones, and migrating from one to the other is straightforward if you make your experiment on a git project on GitLab or GitHub: just hit Sync on either Farm and you’ll have your project up and running there.

    Compressing all the multimedia files into one zip archive and hosting it on an external server (with a secure domain, which you should already have since you collect audio recordings, but see this page) will definitely help, regardless of where your experiment itself is hosted.

    I can’t give an estimate for the server reset because I haven’t scheduled one yet. The whole process usually takes less than an hour. I will post a message on the forums once I schedule the reset.

    Jeremy

Viewing 15 posts - 1,291 through 1,305 (of 1,522 total)