PennController for IBEX › Forums › Support › Question about assigning conditions, groups + randomization
- This topic has 23 replies, 2 voices, and was last updated 1 year ago by
Jeremy.
-
AuthorPosts
-
July 18, 2023 at 2:32 am #10752
Jeremy
KeymasterHi 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
July 19, 2023 at 3:14 pm #10760KateK
ParticipantThanks, 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.
July 20, 2023 at 3:40 am #10767Jeremy
KeymasterHi Kate,
Your
Sequence
containsrshuffle("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. UsestartsWith("experiment_")
insteadThe 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 ofnewTrial()
instead (the one before the comma you placed aboveSequence
)Jeremy
July 24, 2023 at 10:21 am #10788KateK
ParticipantDear 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?
July 24, 2023 at 10:27 am #10789Jeremy
KeymasterHi,
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
July 28, 2023 at 12:53 pm #10794KateK
ParticipantThanks, 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?
August 2, 2023 at 2:30 am #10796Jeremy
KeymasterHi,
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 ofrshuffle
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 rowIf you don’t want the sort of even distribution you get from
rshuffle
, thenrandomizeNoMoreThan
is the way to go. Just make sure you have proper references to your trials’ labelsJeremy
August 16, 2023 at 9:41 am #10822KateK
ParticipantHi 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.
August 21, 2023 at 3:22 am #10824Jeremy
KeymasterHi,
This is because you don’t include the fields you want to log as part of the
row
that you pass tomyCustomTrialFunction
inside the “dummy”Template
. You can simply append all the fields of the original rows along withcontextsetter
andtargetsentence
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
-
AuthorPosts
- You must be logged in to reply to this topic.