Jeremy

Forum Replies Created

Viewing 15 posts - 961 through 975 (of 1,522 total)
  • Author
    Posts
  • in reply to: HTML labels #6595
    Jeremy
    Keymaster

    Hi Brianna,

    Thank you for pointing this out, I must admit that PennController is bad on the accessibility front. I will work on improving this, but there are non-trivial decisions to be made. In this case, how should the label element be integrated in the document? Should it be visible, and if so, should it come before or after the element?

    Here is a suggestion: whenever any element is printed, create a label element that you add before it, whose content will be that element’s id. I decided to make the label not take any space and have its text fully transparent: my reasoning is that people who do not use a screen reader should not see the label element (unless they select text on the page, maybe) but that configuration should still allow screen readers to appropriately detect it. Here’s the code you can add to your script to make that happen (no need to modify any core js file):

    _AddStandardCommands(function(PennEngine){
        const oldPrint = PennEngine.elements.standardCommands.actions.print;
        PennEngine.elements.standardCommands.actions.print = async function(...args){
            const r = await oldPrint.apply(this, args);
            this.jQueryElement.attr({id: this.id, name: this.id});
            const label = $("<label for='"+this.id+"'>"+this.id+"</label>");
            label.css({position: "absolute", color: "transparent", "pointer-events": "none"})
            this.jQueryElement.before(label);
            return r;
        }
    });

    This should add a label to any element you print, not only TextInput elements. Let me know if this solution works for you

    Jeremy

    in reply to: Having trouble with uploading .csv files #6594
    Jeremy
    Keymaster

    Dear Ana,

    Did you leave the Debug window open, and if so, does it report any error message?

    Does your script refer to that CSV file in a Template command? If so, does commenting out the Template command make the problem go away, or does it persist regardless as long as the CSV file is in your Resources/chunk_includes folder?

    Feel free to let me know (here or at support@pcibex.net) what account/experiment you’re experiencing this issue with, and I’ll take a look

    Best,
    Jeremy

    in reply to: Preloading resources by experiment list #6589
    Jeremy
    Keymaster

    Hi,

    I understand you are talking about preloading resources for different groups from a zip file. To be clear, when not part of a zip file, only the resources used in the trials effectively presented to the current group are fetched.

    If you need to preload different zip files depending on group, you can use the variable __counter_value_from_server__. Say you have a total of 4 groups:

    EDIT: this code will not immediately work on https://expt.pcibex.net or https://ibex.spellout.net/ — see this message if you’re running your study at one of those two domains

    switch (__counter_value_from_server__ % 4) {
      case 0:
        PreloadZip("https://my.server/path/to/zip_a.zip");
        break;
      case 1:
        PreloadZip("https://my.server/path/to/zip_b.zip");
        break;
      case 2:
        PreloadZip("https://my.server/path/to/zip_c.zip")
        break;
      case 3:
      default:
        PreloadZip("https://my.server/path/to/zip_d.zip")
        break;
    }

    Let me know if you have any questions

    Jeremy

    in reply to: Come back later #6586
    Jeremy
    Keymaster

    Hi,

    I checked the server and your account does not appear on the exceed-quota list. In fact you still have a good amount of space available (~60MB). If things are becoming too unstable at expt.pcibex.net, I suggest you start moving to the new farm. We will release a public announcement about it soon, but you can already check out https://farm.pcibex.net

    Note that you’ll need to create a new account, and your experiments will not be automatically transferred to the new farm, but you can easily drag-and-drop zip archive versions of your projects

    Jeremy

    in reply to: Slider: position and randomisation of labels #6584
    Jeremy
    Keymaster

    Hi Susanne,

    You are right, the best solution is to use a Canvas element. The Selector element being the only PennControllement element that will let you easily shuffle the position of elements on the screen, you are also right to use it for that purpose. With that in mind, the following code will generate what you’re looking for:

    newTrial("training",
        newCanvas("container", "500px","5em")
            .print("center at 50vw","middle at 50vh")
        ,
        newText("Item", row.CARRIER)
            .print("center at 50%", "top at 0%", getCanvas("container"))
            .log()
        ,
        defaultText.css("white-space","nowrap")
        ,
        newText("Alt1", row.SENTENCE1).print("center at 0%", "top at 2em", getCanvas("container"))
        ,
        newText("Alt2", row.SENTENCE2).print("center at 100%", "top at 2em", getCanvas("container"))
        ,
        newSelector("choice")
            .disable()
            .add(getText("Alt1"), getText("Alt2"))
            .shuffle()
            .log()
        ,
        newScale("slider", 100)
            .slider()
            .size("500px", "1em")
            .css("max-width", "unset")
            .print(0, "bottom at 100%", getCanvas("container"))
            .log()
            .wait()
        ,
        newTimer(500).start().wait()
    )

    The idea is to create a Canvas element 500px wide, and print the Scale element onto it. Then we can print the Text elements onto that Canvas element, and center their positions to 0% and 100%. For a reason I cannot quite explain, the text on the right seemed to want to use two lines before I added .css("white-space","nowrap"), which forces the text to use a single line.

    There is a bug in PennController 1.9 where the Selector element fails to report the position of the elements in the absence of a selection, and sometimes gets it wrong otherwise anyway. So until I release PennController 2.0, you will have to randomize using javascript instead: delete the whole Selector bit and replace your newText lines with this

    alts=[row.SENTENCE1,row.SENTENCE2].sort(()=>Math.random()-Math.random())
    ,
    newText("Alt1", alts[0]).print("center at 0%", "top at 2em", getCanvas("container"))
    ,
    newText("Alt2", alts[1]).print("center at 100%", "top at 2em", getCanvas("container"))

    And add this to the closing parenthesis of your newTrial command:

    .log("Alt1", alts[0])
    .log("Alt2", alts[1])

    Regarding the server, we are moving to a new farm. We will release an announcement soon, but if the farm at expt.pcibex.net is becoming too unstable, feel free to move to https://farm.pcibex.net — note that you’ll need to create a new account, and your experiments will not be automatically transferred to the new farm, but you can easily drag-and-drop zip archive versions of your projects

    Let me know if you have any questions

    Jeremy

    in reply to: (Pre)Loading Resources #6582
    Jeremy
    Keymaster

    Issue resolved by email

    The solution consisted in:
    – moving some images used early on in the experiment, from a zip file on the S3 bucket directly into the Resources folder of the project, so that they could be fetched independently from the requests to the S3 bucket
    – splitting a big zip file (~400MB) in two smaller zip files
    – optionally moving the CheckPreloaded trial later in the experiment, in order to give PennController more time to download the zip files and preloading the resources in the background before reaching that screen

    Jeremy

    in reply to: Eye-tracking with an external webcam #6580
    Jeremy
    Keymaster

    Hi,

    I would have to look into how the webgazer library handles access to the webcam. Handling access to multiple input devices across web browsers is known to be surprisingly difficult. Maybe you can try with another browser (Firefox) to see whether it accesses the right webcam

    Thank you for pointing this to my attention, I’ll let you know if I identify the cause of this behavior

    Jeremy

    in reply to: webinar video #6577
    Jeremy
    Keymaster

    Hi,

    Thank you for catching this. I have updated the link to point to a copy on Dropbox, let me know if you still have trouble accessing the video

    Jeremy

    in reply to: (Pre)Loading Resources #6570
    Jeremy
    Keymaster

    Hi Andreas,

    Just to be clear, let me reiterate that CheckPreloaded will check that the resources have preloaded: it will not initiate or force any preloading. So resource preloading is unaffected by how many CheckPreloaded commands you use in your script. All resources start preloading as soon as your experiment page opens.

    You say that “Other times, they are downloaded but then the necessary files are not preloaded”: if the zip files containing all the resource files for a trial were successfully downloaded, there should be no reason for that trial to insert a preloading screen at all.

    Would you mind sharing the link to your experiment with me, either here or at support@pcibex.net?

    Jeremy

    in reply to: Problem Editing the Experiment #6567
    Jeremy
    Keymaster

    I cannot seem to reproduce or identify the cause for this bug. Does it persist if you create another project and/or if you name your project differently (for example, using only letter characters, no digits or underscores)?

    in reply to: Problem Editing the Experiment #6565
    Jeremy
    Keymaster

    Hello Danil,

    Your account does not appear on the exceed-quota list, and you’re currently using a total of only ~5MB of storage space.

    I am surprised that you would need to change the name of the experiment to make the save functionality work again. This finicky save behavior is a known problem with the current farm, but we’re moving to a new one very soon, where the problem should no longer happen. Can you confirm that the “Please, try again later” message won’t go away even after clicking the “Save” button many times?

    Jeremy

    in reply to: Randomly get item from certain conditions #6562
    Jeremy
    Keymaster

    Hi Rick,

    The rshuffle function will output a sequence or randomly picked, evenly spaced trials of each label, but the order of the labels is indeed random. So for rshuffle("A","filler","B") you can get six sequence types: [A,filler,B,A,filler,B,etc.], [A,B,filler,A,B,filler,etc.], [filler,B,A,filler,B,A,etc.], [filler,A,B,filler,A,B,etc.], [B,A,filler,B,A,filler,etc.] or [B,filler,A,B,filler,A,etc.].

    What do the (i)s refer to in your message?

    In any case, it sounds like you could make use of the custom subsequence function defined on this thread. Then you can do this: Sequence( subsequence(randomize("A"),randomize("filler"),randomize("B")) )

    Let me know if you have questions

    Jeremy

    in reply to: Embedding HTML #6560
    Jeremy
    Keymaster

    Hi Dawson,

    I am unclear on what you are using the Palette element for, especially since there’s no documentation for this element. Also, this is not how test commands work: they are PennController commands, not boolean javascript functions.

    I suspect that some element inside your HTML document turns white at some point, and you are trying to capture that change by using the Palette and Canvas elements, which are PennController elements. PennController elements are not HTML elements, and more particularly, creating a Canvas (PennController) element will not give you access to a <canvas> HTML element, even less so if the latter is embedded inside an iframe embedded in an HTML document.

    If the task you are currently injecting through the Html element is the first screen of your experiment, I suggest you simply direct your participants to that page first, and insert a link at the end of your task that will direct them to your PCIbex experiment then. If it takes place in the middle of your experiment, I suggest you just insert a new-tab link pointing to your task’s page at that point, and maybe have your participants retrieve a code at the end of it that they will need to enter back into your PCIbex experiment in order to proceed.

    Jeremy

    in reply to: Randomization #6557
    Jeremy
    Keymaster

    It doesn’t matter how many CSV files you have, just label your trials differently. Say you have a Condition column in your table that alternates between Practice and Critical:

    Sequence( randomize("Experiment-Practice") , randomize("Experiment-Critical") )
    
    Template( row => newTrial( "Experiment-"+row.Condition , // ...

    Jeremy

    in reply to: Randomization #6554
    Jeremy
    Keymaster

    Hi,

    Did you label your trials appropriately so you could do something like Sequence( randomize("practice") , randomize("critical") )?

    Jeremy

Viewing 15 posts - 961 through 975 (of 1,522 total)