Jeremy

Forum Replies Created

Viewing 15 posts - 181 through 195 (of 1,522 total)
  • Author
    Posts
  • in reply to: Can’t locate an item in my code #9980
    Jeremy
    Keymaster

    Hi 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 message

    Jeremy

    in reply to: Not logging timestamps #9979
    Jeremy
    Keymaster

    Hello,

    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

    Jeremy
    Keymaster

    Hi,

    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 substitue row.acceptability.replace(/\\n/g,"\n"): newController("DashedSentence", {s: row.acceptability.replace(/\\n/g,"\n")})

    Jeremy

    in reply to: Can’t locate an item in my code #9970
    Jeremy
    Keymaster

    Hello,

    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

    Jeremy
    Keymaster

    Hi 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= in https://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 guide

    The file at your link contains the compressed data. You need to use the PHP script to decompress it

    Jeremy

    in reply to: Resources not loading with attention checks #9955
    Jeremy
    Keymaster

    Hi,

    Use the javascript ternary conditional operator instead of a PennController Var element so that you don’t create an Audio element for rows that miss a valid value in the attentionCheckWord cell:

    ...(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

    in reply to: Backtracking Latin square/finding the right seed #9954
    Jeremy
    Keymaster

    Hi 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 a newTrial, 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 setup

    Jeremy

    in reply to: Loss of data from one participant #9951
    Jeremy
    Keymaster

    Hi 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

    in reply to: Backtracking Latin square/finding the right seed #9950
    Jeremy
    Keymaster

    Hi 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 your Template command inside a custom function that you can call from within both Template("acdcd4.csv", myCustomTrialFunction) and Template("fillers.csv", myCustomTrialFunction) so you don’t have to write it twice

    Jeremy

    in reply to: Troubleshooting #9949
    Jeremy
    Keymaster

    Dear 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.mp3

    Jeremy

    in reply to: Dot-memory test #9948
    Jeremy
    Keymaster

    Hi Ebru,

    When you place a test command inside a wait command, the latter is only validated when the test succeeds. If you’d rather always validate the wait 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

    in reply to: PCIbex down? Impossible to start new project #9938
    Jeremy
    Keymaster

    Hi 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

    Jeremy
    Keymaster

    Hi 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

    in reply to: Display issues, overlapping text and textinput #9933
    Jeremy
    Keymaster

    Hi 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

    Jeremy
    Keymaster

    Hi 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 at https://my.server.xyz/myproject/ but your PHP file is at https://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 in EyeTrackerURL to use the https path I just reported here: EyeTrackerURL("https://mondo1.dreamhosters.com/script.php")

    Jeremy

Viewing 15 posts - 181 through 195 (of 1,522 total)