Randmoize table rows

PennController for IBEX Forums Support Randmoize table rows

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6063
    carlap
    Participant

    Hi!

    I want to randomize my table rows and I can’t figure it out. I came across the code below in another support question (https://www.pcibex.net/forums/topic/randomize-dashedsentence/) but it’s unclear what the various labels refer to…

    I think that (in the example below) “dashed” is the template name and “mystimuli.csv: is the table name and “row.Sentence” is the column name within the table, but what is “DashedSentence”?

    Also, I have:

    Template("Practica_Espanol_ButtonNormal-1.csv" ,
    	row => newTrial( "practica_spanish" , ...

    And in the sample below there is no newTrial, do I take it out or do I leave my newTrial as it is and this code goes somewhere else?

    Thanks!

    Sample code from other support question follows:

        PennController.ResetPrefix(null);
        PennController.Sequence( randomize("dashed") , "send" );
        PennController.Template( PennController.GetTable("mystimuli.csv") ,
            row => [
                "dashed", "DashedSentence", {s: row.Sentence},
            ]
        );
        PennController.SendResults("send");
    #6064
    carlap
    Participant

    So, apparently I just put: randomize (“practica_spanish”) in the sequence section and it works…

    But, while I have your attention, I have my resource files loaded in Github and when I change a file in git and then sync it to my experiment, the new version of the file is not getting pulled. Even if I manually try to load the new file directly into PCIbex (using the add resource button) the file appears to load, but the old version is still in my resources. So, I can’t seem to change or update the files. I even tried deleting my experiment then reloading the entire thing from git and it’s still loading the old version of the file, which no longer exist in my git repository… Thoughts? Thanks!

    #6067
    Jeremy
    Keymaster

    Hi,

    1. Every trial has a label, whether explicitly assigned or not. The standard way of assigning a trial a label with PennController is to provide a string as the first argument of newTrial, but there are special cases (eg. SendResult can directly create a trial labeled after its own argument string). Labels then allow you to manipulate the order of execution of your trials by referencing them in the Sequence command.

    In your case, you label all the trials you generate from Practica_Espanol_ButtonNormal-1.csv "practica_spanish", because that’s the string you pass as the first argument of the newTrial command in your Template command. As a result, typing randomize("practica_spanish") somwhere in your Sequence command will insert all those trials, randomly ordered, at that point in the sequence of trials.

    The other topic is almost a year old now, and uses native-Ibex syntax to insert trials that use the DashedSentence controller. With the introduction of the Controller element in PennController 1.7, there no longer is a need to resort to native-Ibex syntax in such cases. For your information however, in "dashed", "DashedSentence", {s: row.Sentence}, "dashed" is the label of the trial and "DashedSentence" is the name of the controller leveraged to generate the trial. To get the same output using full-PCIbex syntax, you would do this: newTrial( "dashed" , newController("DashedSentence", row.Sentence).print().wait() )

    2. What file exactly is exhibiting this problem? If it’s a main script file, make sure you don’t have another script file in data_includes that takes precedence over the one you’re updating. If it’s a CSV file in chunk_includes, did you make sure you reference the proper filename in your Template command? If you don’t pass any filename to it, Template will automatically use the CSV file whose name comes first, alpha-numerically speaking.
    If deleting the experiment and reloading everything from git doesn’t fix things, it most likely means that the problem lies with the git repo, not with the farm.

    Jeremy

    #6069
    carlap
    Participant

    Hi Jeremy!

    Thanks. Issue 1 is all good.
    Issue 2, was with multiple jpg files and with loading the file both from git and manually, but it appears to have been resolved just by waiting, so maybe it was a problem with my local chrome cache or something. Thanks!

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