Forum Replies Created
-
AuthorPosts
-
daniela
ParticipantHi Jeremy,
great, thanks again! It’s logging correctly now 🙂
Best,
Danieladaniela
ParticipantHi Jeremy,
I’m having an issue logging shuffle selector responses when there are multiple within a trial. Basically, I have 3 shuffled prompts which all require ‘F’ or ‘J’ for the response. Whichever key is selected for the final prompt is logged as the input for all responses within the trial. I’m certain I had seen somewhere how to handle this issue, but I can’t find it now unfortunately. Here’s the trial template:
PennController. Template( PennController.GetTable( "stimuli.csv")// change this line for the appropriate experimental list .filter("type" , "critical") .filter("lifetime" , /^(dead|alive)$/) , variable => ["post_task", "PennController", PennController( defaultText .settings.css("font-family","courier") // NEW TEXT , newText("post_name", variable.name) .settings.css("font-size", "25px") .settings.center() , newText("occupation_correct", variable.occupation) .settings.css("font-size", "25px") .settings.center() , newText("occupation_incorrect", variable.occupation_distractor) .settings.css("font-size", "25px") .settings.center() , newText("nationality_correct", variable.nationality) .settings.css("font-size", "25px") .settings.center() , newText("nationality_incorrect", variable.nationality_distractor) .settings.css("font-size", "25px") .settings.center() , newText("lifetime_correct", variable.lifetime) .settings.css("font-size", "25px") .settings.center() , newText("lifetime_incorrect", variable.lifetime_distractor) .settings.css("font-size", "25px") .settings.center() , newImage("checkmark", "https://amor.cms.hu-berlin.de/~pallesid/dfg_pretests/pictures/checkmark.jpeg") .size(30,30) , newImage("crossmark", "https://amor.cms.hu-berlin.de/~pallesid/dfg_pretests/pictures/crossmark.png") .size(30,30) , // NAME newCanvas("name", "100vw" , "100vh") .add("center at 50%", "center at 20%", getText("post_name")) .add("center at 25%", "center at 20%", getImage("checkmark") ) .add("center at 75%", "center at 20%", getImage("crossmark") ) .center() .print() .log() , newSelector("post_name") .add(getImage("checkmark"), getImage("crossmark")) .keys("F", "J") .wait() .log() , getCanvas("name") .remove() , // LIFETIME newCanvas("lifetime", "100vw" , "100vh") .add( "center at 30%", "center at 20%", getText("lifetime_correct")) .add( "center at 70%", "center at 20%", getText("lifetime_incorrect")) .center() .print() .log() , newSelector("post_lifetime") .add(getText("lifetime_correct"), getText("lifetime_incorrect")) .shuffle() .keys("F", "J") .wait() .log() , getCanvas("lifetime") .remove() , // NATIONALITY newCanvas("nationality", "100vw" , "100vh") .add( "center at 30%", "center at 20%", getText("nationality_correct")) .add( "center at 70%", "center at 20%", getText("nationality_incorrect")) .center() .print() .log() , newSelector("post_nationality") .add(getText("nationality_correct"), getText("nationality_incorrect")) .shuffle() .keys("F", "J") .wait() .log() , getCanvas("nationality") .remove() , // OCCUPATIION newCanvas("occupation", "100vw" , "100vh") .add( "center at 30%", "center at 20%", getText("occupation_correct")) .add("center at 70%", "center at 20%", getText("occupation_incorrect")) .center() .print() .log() , newSelector("post_occupation") .add(getText("occupation_correct"), getText("occupation_incorrect")) .shuffle() .keys("F", "J") .wait() .log() , getCanvas("occupation") .remove() , // WAIT newCanvas("dots", "100vw" , "100vh") .add("center at 50%", "center at 20%", newText("pleasewait_post2", "...").settings.css("font-size", "25px").settings.bold()) .center() .print() .log() , newTimer("wait_post2", 1000) .start() .wait() , getCanvas("dots") .remove() ) .log("type", variable.type) .log("lifetime" , variable.lifetime) .log("tense", variable.tense) .log("mm", variable.mm) .log("match", variable.match) .log("rating", getVar("rating")) .log("item" , variable.item_id) .log("name" , variable.name) .log("list", variable.list) .log( "withsquare", PennController.GetURLParameter("withsquare") ) .log("bare_verb", variable.bare) ]);
Thanks in advance!
Best,
Danieladaniela
ParticipantHi Jeremy,
I’m jumping in for Aliona (collaborator), as she’s done for the day. Our problem is that we do want to have a line break, but our ‘cumulative’ function seems to not respect the sentence chunk boundaries once the sentence chunks are revealed. In other words, when ‘dashed’, a sentence chunk will not be split across two lines. However, once the chunk is revealed, one word that might be able to fit on the first line jumps up there, and so the sentence chunk is split (and the boundaries are not consistent between ‘dashed’ and revealed).
So basically, we want to tell ‘cumulative’ to not allow a revealed chunk to be spilt across two lines (I hope that’s clear…?). An alternative could be to force a line break after x number of sentence chunks, although this wouldn’t be ideal, as there’s likely lots of variability between participants’ screen dimensions.
If it helps, I can e-mail you a link to our current set-up.
Best,
Danieladaniela
ParticipantPerfect, thank you!!
daniela
ParticipantHi Jeremy,
I’ve had some successful Ibex experiments using the dashed function you wrote for me some months ago, and am now trying to adapt it for cumulative presentation. I’ve been playing with the
getText()
line in the function but haven’t been able to get it to work. Do you have a fix for this?// create dashed function dashed = (sentence, remove) => { let words = sentence.split('*'), blanks = words.map(w=>w.split('').map(c=>'_').join('') ); // 'sentence.spilot('*')' = '*' defines the chunk boundaries (in the .csv) let textName = 'dashed'+words.join(''); // We'll return cmds: the first command consists in creating (and printing) a Text element with dashes let cmds = [ newText(textName, blanks.join(' ')).print() .settings.css("font-family","courier") .settings.css("font-size", "20px") .settings.center()]; // COURIER as font // We'll go through each word, and add two command blocks per word for (let i = 0; i <= words.length; i++) cmds = cmds.concat([ newKey('dashed'+i+words[i], " ").log().wait() , // Wait for (and log) a press on Space getText(textName).text(blanks.map((w,n)=>(n==i?words[n]:w)).join(' ')) ]); // Show word if (remove) // Remove the text after the last key.wait() is parameter specified cmds.push(getText(textName).remove()); return cmds; };
Many thanks!
Danieladaniela
ParticipantHi Jeremy,
worked like a charm, thanks!
For anybody who finds this post and wants to see how I implemented Jeremy’s response, here’s my code:
newButton("consent", "Continue") .settings.center() .print() .wait(getDropDown("age") .testNot.selected("17 or younger") .and( getDropDown("age") .testNot.selected("32 or older") ) .and(getDropDown("language") .test.selected("no") ) .success() // if '17 or younger' or '32 or older' are NOT selected, and 'no' IS selected, continue as normal .failure( // otherwise, remove all canvases and display the "bye" text getCanvas("democanvas") .remove() , getCanvas("agecanvas") .remove() , getCanvas("sexcanvas") .remove() , getCanvas("languagecanvas") .remove() , getCanvas("infocanvastwo") .remove() , getCanvas("infocanvasthree") .remove() , getText("consent") .remove() , getButton("consent") .remove() , newText("bye", "You are ineligible for this study, as you have provided information which is inconsistent with your Prolific prescreening responses. " + "<p>Please return your submission on Prolific by selecting the 'Stop without completing' button." ) .print() ) )
Thanks, Jeremy!
Best,
Danieladaniela
ParticipantHi Jeremy,
that’s great, thank you again!
– Daniela
daniela
ParticipantHi Jeremy,
is there a way to adapt test.text() to test whether or not the textInput element isn’t empty? It seems like the most standard test for a textInput element, but I can’t seem to find the solution anywhere!
Best,
Danieladaniela
ParticipantGreat, thanks again!
daniela
ParticipantHi Jeremy,
thanks for your answer. We decided to go with a 2-option scale (yes/no), but now have the following problem: there are multiple selections participants need to make on the same screen, and so to avoid cluttering the screen with multiple ‘yes/no’ options, we have a label at the top of the page indicated left = yes, right = no. However, the newest PennController update seems to not give the option of not presenting the labels.
Basically, the following does not automatically print the scale numbers in the previous PC 1.7 (which is what we want):
newScale("rating", 7) .print() .wait()
But in PC 1.8 it does print them. Is there then a way in PC 1.8 to remove the scale labels?
Best,
Danieladaniela
ParticipantHi Jeremy,
wow, thank you so much, that’s exactly what we were looking for. You’ve worked your magic yet again!!! Very much appreciated 🙂
Best,
Daniela (and Philipp)daniela
ParticipantHi Jeremy,
thank you for your replies, the
handleNames
function worked great!To clarify Philipp’s third question (we’re working on the same project together): we have 50 names we want presented during this post-experiment task. We would ideally present the names simultaneously in separate columns, rather than in one long list, so that participants don’t need to scroll. I imagine we could do this somehow using
newCanvas
and creating separate functions (e.g.,handleNames1
,handleNames2
, etc.) in whichif (row.name=="__")
could be changed to only access the first 17 names (forhandleNames1
), then the next 17 (handleNames2
), and so on. Would this be the best course of action?We also noticed that the randomisation doesn’t seem to work in Chrome (but does in Chrome mobile, and Firefox). Is there a way to get the randomisation to also work with Chrome?
Thanks again for your help so far!
Best,
Danieladaniela
ParticipantHi Jeremy,
I’ve got a similar issue at the moment, in that we want to present a post-experiment memory task in which 50 names are presented as a list. We want to log which names are selected (presumably along a scale with radio buttons), but we also want to log other variables related to each name (from other columns in the .csv. E.g., indicating whether the name was presented in the experiment or not). We’d also like to be able to randomise the presentation of these names.
Our question is basically: is it at all possible to present multiple values of a single column as a list, and to also be able to log whether each value was selected, while also logging variables related to each value (e.g., experimental or decoy item)?
Best,
Danieladaniela
ParticipantHi Jeremy,
thanks for your reply. What I didn’t like about DashedSentence was the format of the results file output (it printed new column header labels for each trial–I know that would be fixed once I get my data into R, but I wanted to tidy things up for my test runs). I figured out
newController
based on your comment, but decided to just use Option 2 (recreatedDashedSentence
based on your code), and it worked great.I had arrays of
variable
in thes
parameter because I wanted to present the sentence in chunks, rather than word-by-word (each variable contained one chunk). In case anybody else stumbles upon this thread wanting to do something similar, I was able to adapt your reproduction of DashedSentence (from Option 2) by changinglet words = sentence.split(' ')
tolet words = sentence.split('*')
. Then I added an asterisk (*) to my .csv file to indicate where the chunk boundaries should be.Here’s my adaptation (including setting the font to Courier):
dashed = (sentence, remove) => { let words = sentence.split('*'), blanks = words.map(w=>w.split('').map(c=>'_').join('') ); let textName = 'dashed'+words.join(''); // We'll return cmds: the first command consists in creating (and printing) a Text element with dashes let cmds = [ newText(textName, blanks.join(' ')).print() .settings.css("font-family","courier")]; // COURIER as font // We'll go through each word, and add two command blocks per word for (let i = 0; i <= words.length; i++) cmds = cmds.concat([ newKey('dashed'+i+words[i], " ").log().wait() , // Wait for (and log) a press on Space getText(textName).text(blanks.map((w,n)=>(n==i?words[n]:w)).join(' ')) ]); // Show word if (remove) // Remove the text after the last key.wait() is parameter specified cmds.push(getText(textName).remove()); return cmds; }
and then later inside a PennController.Tempalte() I called on ‘dashed’:
...dashed(variable.critical, "remove")
Worked great, thanks!
Best,
Danieladaniela
Participant*Edit: I’m missing the closing ] bracket, but this was just a mistake in shortening it for the forum
-
AuthorPosts