Jeremy

Forum Replies Created

Viewing 15 posts - 1,096 through 1,110 (of 1,522 total)
  • Author
    Posts
  • in reply to: Unpredictably stuck in preloading #6188
    Jeremy
    Keymaster

    Hi,

    Do you have a Sequence command containing randomize("experiment")? From what you describe, I suspect that there’s a typo in one of the rows’ Filename column, which results in your experiment failing to preload that resource, and that the randomize function shows the corresponding trial sometimes at the beginning of the experiment, sometimes later in the sequence of trials. Make sure you double-check Filename for each row in your table, and each filename in your project’s Resources folder

    Jeremy

    in reply to: Saving results #6186
    Jeremy
    Keymaster

    Hello,

    You can click on the eye icon just under the results file (the rightmost icon). It will open a new tab, just save it as a .csv file (File > Save) and you can then load the file you saved it in R (there’s a useful read.pcibex function defined on this page)

    Jeremy

    in reply to: Multiple tasks in one trial with randominizer #6182
    Jeremy
    Keymaster

    Hi August,

    I imagine the code you posted is a trimmed-down version of some other code, because as is, it contains multiple problems: it never prints any element onto the page, there is no newButton commands corresponding to the getButton commands, and the TextInput and Button elements share the same IDs.

    From what you describe, there’s probably still an element printed onto the page, possibly a transparent Canvas. Try using the clear command between the two tasks, it should remove all elements on the page at that point

    Jeremy

    in reply to: Can counterOverride be used instead of URL parameter? #6181
    Jeremy
    Keymaster

    Hi,

    Yes: PennController is a module added on top of native-Ibex, so you can use native-Ibex methods in PCIbex.

    Let me know if things are not working as they should

    Jeremy

    in reply to: adding collaborators on a study #6175
    Jeremy
    Keymaster

    Hi,

    Thanks for the suggestion. The new farm (which is almost ready to be released) will have a one-click clone option, which will make it straightforward to share an experiment’s code. This is still different from multiple accounts working on a single project though, I’ll see about adding that feature at some point, but it raises issues about edit requests sent at the same time by different users.

    What we’ve been doing in the meantime is create a general account for the lab and share the password with the different members. It’s not ideal but it’s been working well enough, especially if you maintain a git repo in parallel

    Jeremy

    in reply to: Slow loading of audio files #6173
    Jeremy
    Keymaster

    Hello Aymeric,

    More than 100 audio files sounds like a lot for the PCIbex Farm’s capacity. Your experiment will have to send one request per audio file to the servers, and since the PCIbex Farm servers are doing poorly these days, it’s not much of a surprise that preloading is slow. Some of your requests probably take time to be accepted, some of them maybe even never succeed.

    If you can do it, I highly recommend that you package your audio files into a single zip file that you upload to your servers/s3 bucket. The procedure is described on this page: https://www.pcibex.net/wiki/zipped-resources/

    Another thing to be aware of is that, at the moment, Safari doubles up on the many-request issue, it just doesn’t like handling many requests at once.

    Jeremy

    in reply to: Applying styles to select variables in a string #6172
    Jeremy
    Keymaster

    Hi,

    You can use the <strong> HTML tag to surround the part that you want to print in bold. Here’s what it would look like with the code you give (updated to use PennController’s more modern syntax)

    Template( "my_table.csv" ,
      variable => newTrial( "my_trials",
        newText("example_sentence", variable.subject+" "+variable.verb+" "+variable.adjective+" <strong>"+variable.object+"</strong>")
          .css("font-size", "25px")
          .center()
          .print()

    Let me know if you have questions

    Jeremy

    in reply to: Speeded acceptability judgement task #6168
    Jeremy
    Keymaster

    Hi August,

    This is what the DashedSentence Ibex controller was written for. You can integrate it into a PennController trial using the Controller element.

    Here’s a basic example:

    newTrial(
        newController("DashedSentence", {
            s: "This is an example sentence",
            mode: "speeded acceptability",
            display: "in place",
            wordTime: 500
        })
        .print()
        .wait()
    )

    Let me know if you have questions

    Best,
    Jeremy

    in reply to: Conditionals/display logic #6167
    Jeremy
    Keymaster

    Hi August,

    Yes, it is possible. You’ll have to use a global Var element to store and retrieve the participant’s answer to the previous trial. Then depending on its value you either run the full next trial, or you skip over it. Here’s a basic example:

    newTrial(
        newText("How many inches in a foot?").print()
        ,
        newScale("answer", '10','11','12','13','14').button().print().wait()
        ,
        newVar("inches").global().set(getScale("answer"))
    )
    
    newTrial(
        getVar("inches").test.is(12).failure(
            newText("How many centimeters in a meter?").print()
            ,
            newScale("answer", '10','100','1000').button().print().wait()
                .test.selected(100).success( newText("Good job!").print() )
                .failure( newText("Oh well, better luck next time").print() )
            ,
            newButton("Next").print().wait()
        )
    )
    
    newTrial(
        newText("This test is over!").print()
        ,
        newButton().wait()
    )

    Let me know if you have questions

    Best,
    Jeremy

    in reply to: test.selected() for multiple options #6163
    Jeremy
    Keymaster

    Hi,

    As you can see in the documentation the test.selected command only accepts single arguments, so yo cannot simply pass it a series of arguments in order to express a disjunctive test.

    What you can do however is use the or and and commands (which I don’t think are documented at the moment). As you said, excluding the two invalid options is more economical, so let’s do that:

    .wait( getDropDown("age")
      .testNot.selected("17 or younger")
      .and( getDropDown("age").testNot.selected("32 or older") )

    If you want to add the requirement that they not speak another language, simply stack .and( getDropDown("language").selected("no") )

    Let me know if you have questions

    Jeremy

    in reply to: Re-requesting loading of an element #6161
    Jeremy
    Keymaster

    Hi Irene,

    You are correct that currently PennController only tries to download the ZIP archives once. Duplicating packages seems the simplest way to go, and it shouldn’t make the program crash: it will just use whatever resource it finds first, so if two resources from two zip archives share the same filename, it won’t matter as long as they’re exact copies of each other.

    Splitting your resources in multiple zip packages involves a subtle tradeoff, since the more packages you have, the more requests to the server, hence the more opportunities for a request to fail. Besides, some browsers (eg Safari) and some servers don’t like processing a high number of requests at once, so if you are requesting many zip archives this can also cause problems. Actually one of the arguments in favor of zipping your resources is to avoid a proliferation of requests for every single resource.

    I’ll see if I can improve things on that front for future releases of PennController

    Jeremy

    in reply to: Enabling a button after text is entered without pressing Enter #6158
    Jeremy
    Keymaster

    Hi,

    Since there is no checkbox element natively implemented in PennController yet, you’ll need to code the checkbox element yourself, for example as part of an HTML document. Make sure you give it a unique ID or class, and use the method above. Here’s an example:

    newTrial(
        newHtml("form", `<div>
        <input name='consent' id='consent' type='checkbox'><label for='consent'>I consent</label>
        </div>`).print()
        ,
        newFunction( () => $("#consent").change( e=>{
            if (e.target.checked) getButton("Next").enable()._runPromises();
            else getButton("Next").disable()._runPromises();
        }) ).call()
        ,
        newButton("Next")
            .disable()
            .print()
            .wait()
    )

    Jeremy

    in reply to: Change audio recording from stereo to mono #6156
    Jeremy
    Keymaster

    An optimal solution would require that your participant provide a unique ID code, and that the server not serve the rest of the experiment if the unique ID code has already been submitted. Unfortunately this goes beyond the scope of PCIbex, which is a client-based javascript engine.

    You could try to use the browser’s cookies, or local storage, but your participants could always clear their cache and/or use other browsers to take the experiment again.

    Your best shot is probably to tell your participants that only their first submission will be taken into account. This is what I do: if I find more than one submission for a participant, I only grant them credits for the first one and leave the subsequent ones out of my analyses.

    Jeremy

    in reply to: Change audio recording from stereo to mono #6153
    Jeremy
    Keymaster

    Hi Giorgio,

    There is no PennController command to change the recording settings at the moment, unfortunately. What I can suggest, if you’re not already doing so, is uploading the samples asynchronously using UploadRecordings

    Let me know if you have questions

    Jeremy

    in reply to: Enabling a button after text is entered without pressing Enter #6149
    Jeremy
    Keymaster

    I made a few typos after I copy-pasted my code (eg. I had getTextInput("test_input")—gotten rid of _) —things should work now. Sorry about that

    Jeremy

Viewing 15 posts - 1,096 through 1,110 (of 1,522 total)