Question about assigning conditions, groups + randomization

PennController for IBEX Forums Support Question about assigning conditions, groups + randomization

Viewing 9 posts - 16 through 24 (of 24 total)
  • Author
    Posts
  • #10752
    Jeremy
    Keymaster

    Hi Kate,

    This is the error message you get from the debugger: “Unrecognized expression ‘myCustomTrialFunction’ (line inside PennController.Template)”

    If you look at your code just above the definition of myCustomTrialFunction, you’ll notice a lone chunk of code:

    newText([t.context_adj,t.target_adj,t2[0],t2[1]].join("<br>")).print()
            .settings.css("font-size", "25px")
            .center()
            .print()
            .log()
    

    This prevents the code that comes after it from being interpreted properly. Just delete that extra chunk of code and your experiment will run again

    Jeremy

    #10760
    KateK
    Participant

    Thanks, Jeremy.

    Unfortunately I have encountered another problem – my code seems to be generating each fillers and MP item *two times*, oddly. So all of the target items are generating properly, but every single filler and MP item shows up twice.

    I’m wondering if it has to do with having “Template(“0718fillers.csv”, myCustomTrialFunction)
    Template(“0718minimumstandard.csv”, myCustomTrialFunction) in my code, but if I take that out, the items in the fillers and MS .csv’s don’t generate at all.

    I am also not sure why my experiment isn’t logging row data.

    Here is a link to the experiment: https://farm.pcibex.net/r/hyapLe/

    Any help would be appreciated as always. Thank you so much.

    #10767
    Jeremy
    Keymaster

    Hi Kate,

    Your Sequence contains rshuffle("experiment", startsWith("experiment")) and both your target and filler/MP trials have labels that start with “experiment” (it actually is the whole label for the latter) so the latter are included twice. Use startsWith("experiment_") instead

    The stack of .log commands starting with .log("adjectivenumber", row.adjectivenumber) are attached to the preceding .wait() command relative to the Scale element. You want to attach it to the closing parenthesis of newTrial() instead (the one before the comma you placed above Sequence)

    Jeremy

    #10788
    KateK
    Participant

    Dear Jeremy,

    Thanks for this!

    I keep getting a *ton* of errors, because the column names aren’t standard across the three .csv’s in Part 1. Do I *have* to standardize them/make them the same in order to run the study?

    #10789
    Jeremy
    Keymaster

    Hi,

    You don’t have to make them uniform, but one thing you can do is check for the presence of columns before logging them, eg:

    .log("adjectivenumber", "adjectivenumber" in row ? row.adjectivenumber : "")
    .log("adjectiveclass", "adjectiveclass" in row ? row.adjectiveclass : "")
    .log("pair", "pair" in row ? row.pair : "")
    .log("context_adjective", "context_adjective" in row ? row.context_adjective : "")
    .log("target_adjective", "target_adjective" in row ? row.target_adjective : "")
    .log("target_polarity", "target_polarity" in row ? row.target_polarity : "")
    .log("contextcomparative", "contextcomparative" in row ? row.contextcomparative : "")
    .log("comparativequestion", "comparativequestion" in row ? row.comparativequestion : "")
    .log("contextequative", "contextequative" in row ? row.contextequative : "")
    .log("equativequestion", "equativequestion" in row ? row.equativequestion : "")
    .log("questionquestion", "questionquestion" in row ? row.questionquestion : "")

    Jeremy

    #10794
    KateK
    Participant

    Thanks, Jeremy! This is so helpful. Right now, I’m using rshuffle in the latest iteration of this build, but am a little concerned about participants being able to receive up to 6 fillers in a row… I tried inserting a randomizeNoMoreThan file and then modifying the sequence, but whenever I did, I lost all filler items entirely.

    Do you have any tips on how to add a constraint on how many fillers can appear consecutively?

    #10796
    Jeremy
    Keymaster

    Hi,

    As per the IBEX documentation, rshuffle will evenly distribute the trials as identified by the labels you pass to the function. If you label your filler trials differently from the other ones, and one argument of rshuffle captures those labels, then it will try to separate any two filler trials by the same number of other trials. Using that method, as long as you don’t have 6 times as many filler trials as other trials, you shouldn’t end up with 6 fillers in a row

    If you don’t want the sort of even distribution you get from rshuffle, then randomizeNoMoreThan is the way to go. Just make sure you have proper references to your trials’ labels

    Jeremy

    #10822
    KateK
    Participant

    Hi Jeremy,

    Thanks for all your help! I’m encountering one last issue, still with the logging.

    I’m checking the results file and even using the logging method you suggested, where it checks agains the .csv, I’m still not logging all the information about the trial.

    It seems to only be logging information related to the minimum standard .csv, and none of the information from the target .csv is being appended to the results file. Do you know how I can make sure it logs the information from evaltarget1.csv too? Information related to contextquestion, equativequestion, etc is not present.

    Here is the build: https://farm.pcibex.net/r/IfMxOL/

    Thank you again.

    #10824
    Jeremy
    Keymaster

    Hi,

    This is because you don’t include the fields you want to log as part of the row that you pass to myCustomTrialFunction inside the “dummy” Template. You can simply append all the fields of the original rows along with contextsetter and targetsentence simply by referencing ...t, like this:

    [ {contextsetter: t['contextcomparative'], targetsentence: t['comparativequestion'], ...t},
      {contextsetter: t['contextequative'], targetsentence: t['equativequestion'], ...t},
      {contextsetter: t['contextquestion'], targetsentence: t['questionquestion'], ...t}
    ].map(row => ["experiment_"+t.pair,"PennController", myCustomTrialFunction(row)] )
    

    Jeremy

Viewing 9 posts - 16 through 24 (of 24 total)
  • You must be logged in to reply to this topic.