Jeremy

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 101 total)
  • Author
    Posts
  • in reply to: Feedback after selecting an image #4696
    Jeremy
    Jeremy
    Keymaster

    Hi Elise,

    There must be something else going on in your script, because when I try the script above, neither “wrong” nor “correct” appears on the screen until I press the corresponding key. Do you have any print command elsewhere, maybe called on defaultText? Do you use the print command on the wrong-feedback element somewhere ahead of the key test?

    Jeremy

    in reply to: Feedback after selecting an image #4694
    Jeremy
    Jeremy
    Keymaster

    The problem is coming from the Canvas elements: PennController doesn’t understand that you specified the dimension of an anonymous element, instead it takes the first number to be the element’s id (in your case, 700 for the first Canvas, 500 for the second one). As a result the second number is interpreted as the Canvas’ width instead of its height, and so its height is null, making the feedback and button appear behind the Canvas (= under a 0px tall element). Give a name to each of you Canvas and the problem should go away (I would also suggest resizing your Canvas, they are very big right now)

    Jeremy

    in reply to: Feedback after selecting an image #4692
    Jeremy
    Jeremy
    Keymaster

    Hi Elise,

    The problem is coming from the PennController command that you call from inside another PennController command, just before your getKey("answer"). It simply shouldn’t be there. Try again with the fixed script below:

    PennController.Template("Materials_Practice.csv",
        row => ["dashed_practice",
        "DashedSentence", {s: row.Sentence},
        "PennController", PennController(
        newImage("CoveredPicture", "covered.png")
            .settings.size(500,500)
            ,  
        newImage("1", row.Picture)
            .settings.size(500,500)
            ,
        newText("leftLabel","(F)")
            ,
        newText("rightLabel","(J)")
            ,
        newCanvas(700,500)
            .settings.add(   350 , 0 , getImage("CoveredPicture"))
            .settings.add( -250, 0 , getImage("1") )
            .print()
            ,
        newCanvas(500,500)
            .settings.add(0,500, getText("leftLabel"))
            .settings.add(600,500, getText("rightLabel"))
            .print()
            ,
        newKey("answer","FJ")
            .wait()
        ,
        newText("positive feedback", "Correct!")    
        ,
        newText("negative feedback", "Wrong...")
        ,
        getKey("answer")    
            .test.pressed("F")
            .success( 
                getText("positive feedback")
                    .print()
            )
            .failure(
                getText("negative feedback")
                    .print()
            )
        ,
        newButton("continue", "Next")
            .print()
            .wait()  // You need to wait before going to the next trial
        )]
    )

    Jeremy

    in reply to: Trouble loading a batch of images into the experiment #4690
    Jeremy
    Jeremy
    Keymaster

    Hi!

    If all the pictures fail to show up (and you only have their contour) the problem is probably bad URLs. Do you get the filenames from a table? Sometimes there’s a problem with that and you end up with the wrong link (e.g. missing a / somewhere) Did you check the Debug window’s logs?
    Feel free to share the link to your experiment so we can get a better idea of what’s going on

    When you need to load many files the best solution from the participant’s perspective is to use a ZIP file: this way, there’s only one request and you’re certain that when they get the file, no resource is missing (as long as you included them all in the file). But it’s true that the setup can be challenging depending on your hosting platform.

    Best
    Jeremy

    in reply to: Umlaut, opening link in new tab, select option key or click #4685
    Jeremy
    Jeremy
    Keymaster

    Hi Akira,

    Giving the option to click anywhere on the screen is a little tricky in PennController: you need to create a Canvas that covers the entire surface o the window. Note that this will likely prevent any interactions with elements on the page until the Canvas is removed (which you should be fine with, in your case). Here’s an example:

    newText("instructions", "Please click anywhere on the screen or press the spacebar")
        .print()
    ,
    newCanvas("screen", "100vw", "100vh")
        .print("center at 50vw", "center at 50vh")
    ,
    newSelector("continue")
        .settings.add(getCanvas("screen"))
        .settings.keys( " " )
        .wait()
    ,
    getText("instructions").remove(),
    getCanvas("screen").remove()
    ,
    newText("thanks", "Thank you!")
        .print()

    Let me know if you have questions

    Jeremy

    in reply to: SetCounter("label", *number*) doesn't seem to work #4681
    Jeremy
    Jeremy
    Keymaster

    Thank you Umesh, I have updated the wiki page accordingly.

    I had meant SetCounter to increment (or decrement) the counter by default, but it appears I got lost somewhere along the way… I will change the behavior of the command in the next version of PennController (1.7)

    Jeremy

    in reply to: Umlaut, opening link in new tab, select option key or click #4677
    Jeremy
    Jeremy
    Keymaster

    Hi,

    1. Using HTML codes, as you mention, is probably the solution that is best in terms of cross-browser compatibility. You can find a useful table here: https://www.starr.net/is/type/htmlcodes.html
    An example of a script:

    PennController(
      newButton("grüßen")
        .print()
        .wait()
    )

    This is of course not ideal in terms of readability from the experimenter’s end. Another solution is to save your script using an UTF8 encoding. In order to do that, you need to edit your script file on your local device (using your own text editor) and make sure to save it with a UTF8 encoding, and then upload your script file back to your project. Note that opening the online editor and clicking “Save” will fall back to the old, non-UTF8 format, so you need to keep editing the file locally and uploading it later.

    2. You want to use the target attribute with the value '_blank', like this: <a href='https://expt.pcibex.net/' target='_blank'>Open the PCIbex Farm</a>

    3. You are right, you need to use a Selector element, but then you no longer need a Key element:

    newButton("continue", "Continue")
        .print()
    ,
    newSelector("next")
        .settings.add( getButton("continue") )
        .settings.keys( " " )
        .wait()

    Let me know if you still have questions

    Jeremy

    in reply to: Optional question after DashedSentence #4670
    Jeremy
    Jeremy
    Keymaster

    Hi Adam,

    You were almost there: the problem indeed comes from your inserting a second label inside a single Ibex-item array, which is an illegal syntax. Your code works perfectly well if you get rid of "qst", before "Question"—if your sentences and questions are paired, they represent a single item and so you shouldn’t need a second label.

    You say that using spr only wouldn’t account for the questions: what exactly are you trying to do? If you don’t want the Question controllers (when they exist) to be paired with a respective DashedSentence controller, you should simply called Template twice on your table, first to generate the DashedSentence items, and then to generate the Question ones.

    Jeremy

    in reply to: Commas in results #4666
    Jeremy
    Jeremy
    Keymaster

    Hi Leo,

    Thanks for reporting this problem, and sorry for the late reply. I was supposed to fix this issue some time ago, I’m sorry I haven’t taken care of it yet.

    The only solution I can see at the moment is to identify the list of sentences and perform a search&replace for each of them in your results file, to delete or replace the target commas with something else (e.g. %2C).

    Best,
    Jeremy

    in reply to: SetCounter("label", *number*) doesn't seem to work #4665
    Jeremy
    Jeremy
    Keymaster

    Hi Umesh,

    Thank you for reporting this, and sorry for the late reply. There is a bug in how I coded the parser for the parameters of SetCounter—I just fixed it for the next release. In the meantime, you can do this instead:

    PennController.SetCounter("Setcounter", "inc", 4);

    and of course you can always use the native Ibex syntax, though it’s deprecated:

    var items = [
      ["Setcounter", "__SetCounter__", {inc: 4}]
    ];

    Note though that the intended meaning of SetCounter("label", 4) (and the way it will work in the next release) is to set the counter to 4, not increment it by 4.

    Best,
    Jeremy

    in reply to: Elements only appearing when called in certain order #4660
    Jeremy
    Jeremy
    Keymaster

    The problem seems to be related to the way PennController handles cross-trial references to Var elements. In this case, a newVar command with .settings.global() inside a Header was causing an “undefined” error the first time the trials were run only—the second time, the Var element having already been created the first time seemed to “fix” the error, in a way.

    This bug, and other bugs related to Var elements, should be fixed in the next (and upcoming) release of PennController, version 1.7.

    Jeremy

    in reply to: Elements only appearing when called in certain order #4658
    Jeremy
    Jeremy
    Keymaster

    I cannot seem to find it, did you send it to admin@pcibex.net?

    Jeremy

    in reply to: Elements only appearing when called in certain order #4656
    Jeremy
    Jeremy
    Keymaster

    Hi!

    What you’re describing definitely sounds like a bug to me. Unfortunately I haven’t experienced or heard of anything similar before, so it’s a little hard to diagnose as such. Would you mind giving me a link to your experiment? Thank you.

    Jeremy

    in reply to: Ability to modify default ibex files #4654
    Jeremy
    Jeremy
    Keymaster

    Hi Leo,

    Not entirely sure why it is so, maybe Alex would provide a better-informed answer on the original Ibex’s Google Groups:
    https://groups.google.com/forum/#!forum/ibexexperiments

    I think you should be able to overwrite files if you sync them from a git repository though. Might be worth a try.

    Jeremy

    in reply to: Data not getting saved #4651
    Jeremy
    Jeremy
    Keymaster

    Hi Leo,

    How were your participants supposed to access the code? By reaching the last screen of the experiment? If so, does the last screen come after the results are sent to the servers?

    The whole experiment is run on the client-side, which means the servers could be down and the participants could still be running the experiment (as long as they started it when the servers were still up). But sending the results requires a functional connection, so if your screen with the confirmation code comes after that, it can’t be that the servers were down.

    If you include your confirmation code raw in your scripts though, maybe some tech-savvy participants accessed it by directly looking at the source code of your experiment. There exist methods for making (parts of) your source code less readable, but it will always be impossible to completely encrypt javascript code. Let me know if you’d like pointers on how to pseudo-encrypt your code.

    Jeremy

Viewing 15 posts - 1 through 15 (of 101 total)