Forum Replies Created
-
AuthorPosts
-
Jeremy
KeymasterHi Eleni,
I’m not sure I understand. When I add
,continueMessage: "My custom message"
to the parameters of all the Message controllers in your code, I never see “-> Click here to continue.” but instead “-> My custom message”Do you want to make the message disappear altogether, no matter what it says? If so, how do you expect the participant to move on to the next screen? If you’d rather them press a key, you could set
transfer
to"keypress"
, as explained in the documentation I linked to in my previous messageJeremy
Jeremy
KeymasterHello,
This is not possible. You can, however, log time differences as additional columns by using global Var elements, eg:
newTrial( newButton("Click me").print().wait() , newVar("clickDelay",0).global().set(v=>Date.now()) , getButton("Click me").wait() , getVar("clickDelay").set(v=>Date.now()-v) ) .log("Delay", getVar("clickDelay")
This will add a column reporting how much time separates the two clicks on the Button element. Note, though, that because commands take time to be executed, it is always optimal to use the EventTime column during the analyses to get as close to actual time differences as possible
Jeremy
March 1, 2023 at 9:41 am in reply to: Pre-determined line breaks in self-paced reading experiment #9971Jeremy
KeymasterHi,
If you look at the code of https://farm.pcibex.net/r/bOIUXY/ in main.js, you’ll see this line:
newController("DashedSentence", {s: row.acceptability})
. This is where to substituerow.acceptability.replace(/\\n/g,"\n")
:newController("DashedSentence", {s: row.acceptability.replace(/\\n/g,"\n")})
Jeremy
Jeremy
KeymasterHello,
Specify the
continueMessage
parameter of the Message controller, as in["intro", "Message", {html: ["div", ["p", ["h1", "Hello"]], ["p", ["strong", "word"]] ] , continueMessage: "My custom message" }]
Jeremy
March 1, 2023 at 8:44 am in reply to: Eyetracking experiment: Uploading and downloading material to server #9969Jeremy
KeymasterHi Sanghee,
You are supposed to either visit the PHP script in your browser (at https://mondo1.dreamhosters.com/script.php) and enter the key corresponding to a participant’s eye-tracking data that is reported in the results file (eg. something like
httpsfarmpcibexnetrgpKGCm/840b47d0-c7e2-5d6a-bcdb-e0084731f25f
) in the input box to the right of “Experiment’s URL:”, or pass that key after?experiment=
inhttps://mondo1.dreamhosters.com/script.php?experiment=httpsfarmpcibexnetrgpKGCm/840b47d0-c7e2-5d6a-bcdb-e0084731f25f
, which is the method illustrated in the R script in the how-to guideThe file at your link contains the compressed data. You need to use the PHP script to decompress it
Jeremy
Jeremy
KeymasterHi,
...(row.attentionCheckWord ? [ newAudio("attentionCheckWord", row.attentionCheckWord) .play() .log() , newText("Did you hear this word on the previous screen?") .print("center") , newText("Yes (F)") .print("center at 35vw", "middle at 60vh") , newText("No (J)") .print("center at 65vw", "middle at 60vh") , newKey("AttChAnswerW", "FJ") .log() .wait() ] : [])
Jeremy
Jeremy
KeymasterHi Kate,
1) You could define the function at the top of your script, for example. It just needs to take a
row
parameter and return anewTrial
, e.g:myCustomTrialFunction = row => newTrial( "experiment"+row.catg , newController("DashedSentence", {s: row.acceptability}) // etc. ) .log("catg", row.catg")
2) The function is just a handy way to not write the same code twice. The same trials that are now created for group A will be created for all groups, with the same current labels. Because
Sequence
operates over labels, you don’t have to change anything to your current setupJeremy
Jeremy
KeymasterHi Chengjie,
I checked the database, and there is indeed one submission dated February 21 2023 19:13UTC that is missing data. I double-checked the different queues and buffers, but the result lines for that submission are unfortunately nowhere to be found
I apologize for the inconvenience, please let me know if you experience this issue again
Jeremy
Jeremy
KeymasterHi Kate,
Are you trying to balance out the number of participants in the A through F groups from your CSV table? This section of the advanced tutorial touches on group assignment. There is no automatic way of ensuring you have a properly balanced distribution; the best solution is to run your first batches of participants, check the distribution, and run more participants in each group if needed, until you reach a distribution you are satisfied with
By the way, all the filler trials in your table are defined exclusively for group A. If you’d like to include them for all the groups, create another CSV table where you paste those filler lines, but take out the “group” column; you’ll also want to place the
newTrial
currently in yourTemplate
command inside a custom function that you can call from within bothTemplate("acdcd4.csv", myCustomTrialFunction)
andTemplate("fillers.csv", myCustomTrialFunction)
so you don’t have to write it twiceJeremy
Jeremy
KeymasterDear Philip,
Only the first two rows of your CSV file reference valid filenames for your Audio elements in the audio column. Most other rows simply have an extension-less word (eg. “cucumber” or “chocolate”) and some have an empty audio cell. Some rows have an extra (unnamed) column saying “both”. You should rework your CSV table and make sure it is properly formatted
When I run your experiment in the first group I can successfully run trial #1, although I need to add another
wait
command somewhere in the trial’s structure otherwise it only lasts ~750ms (the duration of the two Timer elements in the trial) which is not enough for me to interact with the elements on the page; once I do, however, I am able to play vegetables1.mp3Jeremy
Jeremy
KeymasterHi Ebru,
When you place a
test
command inside await
command, the latter is only validated when the test succeeds. If you’d rather always validate thewait
command, just leave its parentheses blank (ie..wait()
) and move the test below it if you’d like to show some feedback once the participant clicks the button. The question then is how to move from printing the feedback to the next trial; for example, you could simply wait 2s:newButton("press") .center() .print() .wait() , newFunction( ()=>[...document.querySelectorAll(".PennController-Scale input")].map(c=>Number(c.checked)).join('') ) .test.is([row.r1c1,row.r1c2,row.r1c3,row.r2c1,row.r2c2,row.r2c3,row.r3c1,row.r3c2,row.r3c3].join('') ) .success( newText("Good job!").print() ) .failure( newText("Incorrect! Better luck next time").print() ) , newTimer(2000).start().wait()
Jeremy
Jeremy
KeymasterHi Kate,
Do you still experience this problem? The farm occasionally goes down when traffic is too high, but when that happens, downtime should never last more than a couple seconds. I haven’t experienced or heard of any persistent downtime these past few days
Jeremy
February 19, 2023 at 11:21 am in reply to: Eyetracking experiment: Uploading and downloading material to server #9937Jeremy
KeymasterHi Sanghee,
Do you mean that the data still appear compressed even after using the PHP script? The files themselves, stored on your server, contain compressed data, and the PHP script contains a decompression function, so the data should be readable once parsed by the PHP function
Jeremy
Jeremy
KeymasterHi Amelie,
You place your TextInput element named AlterDeutschIn 520px to the right of your Text element named AlterDeutsch, but because the latter is over 520px wide, the former ends up appearing on top of the latter’s last words
I think what you want is to have all three elements (Text, TextInput, Text) belong to same line flow, in a way that if there’s not enough width to print everything on a single line, a second line will be inserted and as much as possible of the remaining content will be placed on that second line, and so on. To do that, all the corresponding HTML elements need to be inline elements inside a
span
element. You’ll need to use Javascript to move the HTML elements corresponding to the PennController elements appropriately:// include placeholder span elements inside the Text element (which is itself a span) newText("AlterDeutsch", "In welchem Alter hast du angefangen, Deutsch zu lernen? <span id='ipt'></span><span id='err'></span>") .center() .css("font-size", "18px") .size(1000,60) .bold() .print() , // add the TextInput to the page but don't show it just yet newTextInput("AlterDeutschIn") .hidden() .size (200,20) .log() .print() , // add the error Text element to the page but don't show it just yet newText("errorAlter","Bitte ausfüllen") .color("red") .css("font-size","14px") .hidden() .print() , // use a javascript function to replace the placeholder elements with the TextInput and the error Text elements newFunction( ()=>{ document.querySelector("#ipt").replaceWith(document.querySelector("textarea.PennController-AlterDeutschIn")); document.querySelector("#err").replaceWith(document.querySelector("span.PennController-errorAlter")); } ).call() , // reveal the TextInput element now that it's at the right location getTextInput("AlterDeutschIn").visible()
Jeremy
February 15, 2023 at 1:24 pm in reply to: Eyetracking experiment: Uploading and downloading material to server #9932Jeremy
KeymasterHi Sanghee,
You don’t need to edit the PHP script. The lines you posted here just create an input field for when you visit the PHP page in your browser, in which you can enter the value that will be reported in the experiment’s results file to retrieve the eye-tracking data of the corresponding participant
The PHP script will create a subfolder named after the URL of the eye-tracking experiment, and will place one file containing compressed data per participant in that subfolder; the PHP script will uncompress the data for you, either when you visit the page in your browser, or when you directly fetch the URL by passing a parameter as illustrated in the R script
You need to replace
http://files.lab.florianschwarz.net/ibexfiles/RecordingsFromIbex/EyeTracker.php
with the URL that points to your PHP script, not necessarily the experiment‘s URL: if your experiment is athttps://my.server.xyz/myproject/
but your PHP file is athttps://my.server.xyz/myscripts/EyeTracker.php
, then you should use the latter (ie.ETURL = "https://my.server.xyz/myscripts/EyeTracker.php?experiment="
)In your case, after I looked up your project’s script, you should use
ETURL = "https://mondo1.dreamhosters.com/script.php?experiment="
— also, make sure to replace the sftp path you reference inEyeTrackerURL
to use the https path I just reported here:EyeTrackerURL("https://mondo1.dreamhosters.com/script.php")
Jeremy
-
AuthorPosts