CSV activation in shuffleSequence

PennController for IBEX Forums Support CSV activation in shuffleSequence

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #4151
    snederve
    Participant

    Hi, I’m trying to build an experiment with an imported CSV. I have tried to improvise in the shuffleSequence, but however I put it, the real experiment fails to show up. This is how I have it now, without any mention of the CSV (which explains that the experiment won’t show). What exactly do I need to insert into the shuffleSequence to activate the items in the CSV?

    var manualSendResults = true;
    var showProgressBar = true;
    var shuffleSequence = seq(“setcounter”,”consent”,”instructions”,”scaleinstr”,”distract”, “debrief”,”send”, “thanks”);
    PennController.ResetPrefix(null);

    This is how I embedded the CSV:

    PennController.FeedItems( PennController.GetTable( “CSV_ITEMS_Diff.csv” ).setGroup(“Group”),
    (item) => PennController(
    newTimer(“blank”, 1000)
    .start()
    .wait()
    ,

    This is followed by specific commands on how to show context sentence in a separate canvas from the target + scale. (Could there be a bug there, even though I don’t get an error message?)

    Thanks,

    Sander

    #4152
    Jeremy
    Keymaster

    Hi Sander,

    First, I see from your code that you are using a mix of native-Ibex and PennController code, and some obsolete function names (e.g. FeedItems). This is fine and functional, but you might want to consider updating your code (see the documentation and in particular the tutorial for pointers):

    // No need for manualSendResults = true if you use PennController.SendResults (see below)
    
    // No need for showProgressBar = true (it's a default)
    
    // No need for shuffleSequence = seq() when using PennController.Sequence 
    PennController.Sequence("setcounter","consent","instructions","scaleinstr","distract", "debrief","send","thanks");
    
    PennController.ResetPrefix(null);
    
    // ...
    
    // Template now replaces FeedItems
    PennController.Template( "CSV_ITEMS_Diff.csv" , // No need to setGroup: columns named "Group" are automatically detected as such
      item => PennController( // You might want to consider having a label here, e.g. "scaleinstr" or "distract"?
        newTimer("blank", 1000)
            .start()
            .wait()
        , 
        // ...
    
    
    PennController.SendResults("send"); // No need for setting manualSendResults
    

    As you see from the code above, you are probably not seeing your items because their labels do not match the ones listed in your sequence. Take a look at the first example of the documentation page for PennController.Template to see how you can label table-generated trials.

    Let me know if you have any questions

    Jeremy

    #4155
    snederve
    Participant

    Thanks! I started from scratch, using only PennController code and it works now.

    In terms of aesthetics, I can’t find anywhere how I can put boxes around a canvas. Do I need to add a separate script for that into the chunk_includes/resources? Or is there a way I can write that in my main script in such a way that all canvases are boxed?
    Thanks.

    #4156
    Jeremy
    Keymaster

    In terms of aesthetics, I can’t find anywhere how I can put boxes around a canvas. Do I need to add a separate script for that into the chunk_includes/resources? Or is there a way I can write that in my main script in such a way that all canvases are boxed?

    You can use the standard .settings.css or .settings.cssContainer commands. To make it a default on every Canvas element in your current trial, use defaultCanvas in the script of your current trial. If you want to make it a default on everyCanvas element for every trial in your script, place the command in PennController.Header:

    PennController.Header(
        defaultCanvas
            .settings.cssContainer("outline", "solid 2px black")
    );

    Or you can have a PennController.css file in your Aesthetics folder (css_includes on Ibex Farm) with the following script:

    .Canvas-container {
        outline: solid 2x black;
    }

    Note: I use outline rather than border because the latter can mess with the actual size of the element (outline adds inner borders).

    See the Aesthetics documentation page for more details.

    Jeremy

    • This reply was modified 5 years, 1 month ago by Jeremy. Reason: misspelled Ibex Farm's aesthetics folder's name
    #4160
    snederve
    Participant

    Thanks, it all works now. 🙂

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