Jeremy

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 407 total)
  • Author
    Posts
  • in reply to: Many audio stimuli in Safari #6128
    Jeremy
    Jeremy
    Keymaster

    Hello,

    Unfortunately this is a known problem with Safari, which consecutive releases of PennController try to address with more or less (emphasis on less) success…

    I’ll try to rethink the preloading method again for the next release, but in the meantime you should definitely package your audio files in one or several zip archives—you shouldn’t have any problem with that since you’re already hosting your resources on a dedicated server. Follow this guide for instructions, and don’t hesitate to ask any questions you might have

    Jeremy

    in reply to: Priming in reading-aloud experiment #6125
    Jeremy
    Jeremy
    Keymaster

    Hi Sam,

    There is no difference between newVoiceRecorder("recorder") and newMediaRecorder("recorder", "audio"), so unfortunately MediaRecorder won’t provide you with a way to detect speech any more than VoiceRecorder.

    You could probably listen for a sharp rise in the signal’s volume using the AudioContext javascript API, but it’s a little advanced (it also turns out to be quite unreliable on Safari, which no one on the Internet–except me–seems to have complained about so far…) and it doesn’t necessarily indicate speech, for example it could correspond to a mug spilling on a desk (though that would most likely be accompanied with vocal complaints too).

    Not sure I’d have the time to implement that function, but if you’re comfortable with javascript or know someone who is, I’d be happy to help

    Jeremy

    in reply to: Best way to transfer HTML-based experiment to pcIBEX? #6121
    Jeremy
    Jeremy
    Keymaster

    Hello,

    Re-coding everything from scratch is probably still the fastest and easiest way, indeed. The integration of HTML documents in a (PC)Ibex experiment is rather limited, basically you can report data from input fields to the results file using log but here you’re talking about controlling the flow of the trial/experiment by waiting for a click on a particular element included in the HTML content.

    I guess one workaround would be to do something like this:

    newTrial(
        newHtml("test.html").print().log()
        ,
        newFunction( ()=>new Promise(r=>$("input[type=submit]").bind('click', e=>{
            e.preventDefault();
            e.stopPropagation();
            r();
            return false;
        })) ).call( )
    )

    The call command on the Function element will pause the execution of the script until a submit button is clicked

    Jeremy

    in reply to: Computer mouse-tracking #6119
    Jeremy
    Jeremy
    Keymaster

    The MouseTracker element is now documented here.

    Jeremy

    in reply to: Filled TextInput #6080
    Jeremy
    Jeremy
    Keymaster

    Hi Daniela,

    You can take two approaches: either use a negative test testNot.text("") or a positive test using a regex test.text(/[^\s]+/). The latter is more powerful, as it will only validate non-empty text, whereas the former would succeed even if the text only consists of spaces, for example

    Jeremy

    in reply to: Computer mouse-tracking #6076
    Jeremy
    Jeremy
    Keymaster

    Then you might also be interested in the EyeTracker element, although it’s important to note that it’s still very much an experimental feature and I don’t know that anyone has collected actual data with it yet (as noted on the linked page, one problem is cross-browser compatibility, which seriously compromises the recruitment of paid participants).

    I’ll try to get to the documentation in the coming days, but you can already use the MouseTracker element: it is included in PennController, there’s just no documentation entry for it at the moment. Here’s an example of how to use it in one trial:

    newTrial(
      newButton("Start").print("center at 50vw", "middle at 50vh").wait().remove()
      ,
      newMouseTracker("mouse").log().start()
      ,
      newCanvas("left", "40vw", "40vh").css("background","red").print("center at 25vw", "middle at 50vh"),
      newCanvas("right", "40vw", "40vh").css("background","blue").print("center at 75vw", "middle at 50vh"),
      newSelector("choice").add( getCanvas("left") , getCanvas("right") ).log().wait()
      ,
      getMouseTracker("mouse").stop()
    )

    Jeremy

    in reply to: Computer mouse-tracking #6074
    Jeremy
    Jeremy
    Keymaster

    Dear Ana-Maria,

    There actually is a MouseTracker element in PCIbex, but it is not documented yet. Let me know if you’re interested and I’ll start writing the documentation. The only caveat is that it can quickly produce massive results files (because it stores coordinates every tens of milliseconds) so you want to make sure you only track during informative periods.

    I’m not aware of studies comparing RTs online vs in-lab (not to say there aren’t, see reference in your own message!), but since (PC)Ibex is based on javascript, it will come with the same lag that is described in the paper you cite. Depending on the nature of your investigation, a 25ms lag may or may not be a serious concern. Florian Schwarz and I for example have conducted online visual-world experiments where participants select one of two images after listening to a sentence; RTs were of the order of seconds, and we found significant differences across conditions, in the order of hundreds of milliseconds. You can also check this message by Florian on the forums for references about work from David Embick’s lab on lexical priming.

    Jeremy

    in reply to: Recorded zip files are empty #6071
    Jeremy
    Jeremy
    Keymaster

    Hello,

    EDIT: sorry, I misunderstood what you were trying to do. You want to record during the Pic1 trials, not during the praPic1 trials. Just adapt the code below to the content of the Template command that you already have in your script (the one on "PicList1.csv"), changes should be minimal.

    So you only have one practice trial that tries to record anything at the moment, the last one, and it doesn’t have time to do so because it reaches the end of the trial immediately after starting to record. Since you seem to want to use the same template for all your practice trials, let’s embed them in a Template command too:

    AddTable("practice", `Image
    feather.png
    vacuum.png
    bat.b.png`)
    
    Template( "practice" , row =>
      newTrial( "pracPic1" ,
        newImage( row.Image )
            .print()
        ,
        newMediaRecorder("recorder", "audio")
            .record()
            .log()
        ,
        newKey(" ")
            .wait()
        ,
        getMediaRecorder("recorder")
            .stop()
      )
      .log( "Image" , row.Image )
    )

    Of course I’m just using AddTable here because I can’t upload a CSV file to your project myself, but you should use an external CSV file rather than directly writing your table in the main script like that.

    As a general rule of thumb, it’s a bad idea to try to record audio/video across trials (I’m not even sure it will work anyway) that’s why you should call stop before the trial ends, as in this example. This way, you’ll have one audio file per trial in your zip file. Take a look at UploadRecordings if you want more control over when the files are sent to the server

    Let me know if you have questions

    Jeremy

    in reply to: Format of table is invalid (PennController: 4) #6068
    Jeremy
    Jeremy
    Keymaster

    Hello,

    An invalid-format message does not mean that the extension is wrong, but that the content of the file is not formatted in a way that PennController can parse. What separators do you use in your CSV file? Ideally you want to use commas, but tabs would work too. I think any other separator character (eg. simple space) will fail. Also, double-check how you handle quotes and escaping characters: if you have text cells containing the same character as your separator character (eg. typically a comma) you want to make sure that when you save your file as CSV, those cells are surrounded by quotes, to indicate that the character (eg. the comma) is not actually separating two columns in those cases.

    Jeremy

    in reply to: Randmoize table rows #6067
    Jeremy
    Jeremy
    Keymaster

    Hi,

    1. Every trial has a label, whether explicitly assigned or not. The standard way of assigning a trial a label with PennController is to provide a string as the first argument of newTrial, but there are special cases (eg. SendResult can directly create a trial labeled after its own argument string). Labels then allow you to manipulate the order of execution of your trials by referencing them in the Sequence command.

    In your case, you label all the trials you generate from Practica_Espanol_ButtonNormal-1.csv "practica_spanish", because that’s the string you pass as the first argument of the newTrial command in your Template command. As a result, typing randomize("practica_spanish") somwhere in your Sequence command will insert all those trials, randomly ordered, at that point in the sequence of trials.

    The other topic is almost a year old now, and uses native-Ibex syntax to insert trials that use the DashedSentence controller. With the introduction of the Controller element in PennController 1.7, there no longer is a need to resort to native-Ibex syntax in such cases. For your information however, in "dashed", "DashedSentence", {s: row.Sentence}, "dashed" is the label of the trial and "DashedSentence" is the name of the controller leveraged to generate the trial. To get the same output using full-PCIbex syntax, you would do this: newTrial( "dashed" , newController("DashedSentence", row.Sentence).print().wait() )

    2. What file exactly is exhibiting this problem? If it’s a main script file, make sure you don’t have another script file in data_includes that takes precedence over the one you’re updating. If it’s a CSV file in chunk_includes, did you make sure you reference the proper filename in your Template command? If you don’t pass any filename to it, Template will automatically use the CSV file whose name comes first, alpha-numerically speaking.
    If deleting the experiment and reloading everything from git doesn’t fix things, it most likely means that the problem lies with the git repo, not with the farm.

    Jeremy

    in reply to: Problems updating the table file #6061
    Jeremy
    Jeremy
    Keymaster

    Hi Noe,

    Your account was on the exceed-quota list. You’re currently using very little storage space, but maybe you exceeded the 64MB limit before freeing up some space?

    Anyway, I took your account off the list, you should be good to go now

    Jeremy

    in reply to: RegExp Help #6060
    Jeremy
    Jeremy
    Keymaster

    Hi Sam,

    You cannot use the || operator inside a PennController test command like that. The TextInput text test command accepts either a string or a regex as its argument—what you’re doing here is passing the first non-null disjunct, which will necessarily be new RegExp(variable.Option1) because this constructor will never return null (or undefined, etc).

    Long story short, you want to build a single regex object that will match both Option1 and Option2, like this: new RegExp(variable.Option1+"|"+variable.Option2)

    Jeremy

    in reply to: Setting accuracy and RT thresholds for practice block #6057
    Jeremy
    Jeremy
    Keymaster

    Hi Agnes,

    The partial code you posted will launch the timewindow timer and wait that it has elapsed entirely before proceeding past its wait command, at which point it will reach the LD Key block containing the callback command, which will be ineffective since the timer will have already ended at that point. That’s why the callback that makes it possible to end the timer prematurely must come before the wait command on the timer, as in my code above.

    I presume that you declare newVar("RT") before the timewindow timer and set it to Date.now() at that point. Because your getVar("RT") comes after the wait on your timer (and because, as we saw, the Key element cannot end it early) the value of your Var element will be at least as big as row.Time.

    The second question, however, should always appear and never be skipped, given the code you posted (unless there is an end command elsewhere).

    Here is a code that, I think, will do what you want. It should be embedded in Template of course:

    newTrial( "practice" ,
        newVar( "responses" , [] ).global(),
        newVar("grandaverage", 0).global()
            .test.is( v => v>=0.5 ).success( end() )
        ,
        newText( "fix2" , row.Word ).print()
        ,
        newKey( "choice" , "FJ" ).log().callback( getTimer("timewindow").stop() )
        ,
        newVar("RT").set( v=>Date.now() )
        ,
        newTimer( "timewindow" , row.Time ).start().wait()
        ,
        getKey("choice").disable().test.pressed( row.Correct )
            .success(  getVar("responses").set(v=>[true,...v]) )
            .failure(  getVar("responses").set(v=>[false,...v]) )
        ,
        getText("fix2").remove()
        ,
        getVar("RT").set( v=>Date.now()-v )
            .test.is( v => v < 2000 )
            .failure(
                newText("Too slow...please respond faster").print()
                ,
                newTimer(1500).start().wait()
                ,
                end()
            )
        ,
        newTimer("wait", 500) 
            .start()
            .wait()
        ,
        newText("pred","Did you predict the word?").print()
        ,
        newKey("answer", "ZM")
            .wait() // This waits for a key press
            .log("first")
    )

    Note that if row.Time is lower than 2000, then consequently RT will never reach 2000 either (ie. row.Time is the max limit of RT). I chose to print the “Too slow” message for 1.5s before if RT is over 2000, and end the trial immediately after that. If RT is below 2000, the end command is not executed and so the script continues to print the pred Text and wait for a keypress on Z or M before reaching the end of the trial

    Let me know if you have questions

    Jeremy

    in reply to: Setting up eye-tracking experiment #6049
    Jeremy
    Jeremy
    Keymaster

    Hi Jesse,

    PennController downloads the eyetracking library directly from webgazer’s website, and unfortunately they don’t seem to make newer releases retro-compatible, which is why some scripts that used to work can break with webgazer updates. Anyway, just follow the first note of the documentation page (ie. upload this file to your project) and you should be able to run the experiment through your PCIbex account (the PHP script only matters for sending the data to the server, but the actual task should still go through)

    As far as I can tell BlueHost offers the same kind of services as DreamHost, so I don’t see any reason to switch your hosting platform. As long as you know how to upload files (eg. PHP script files) to your webspace and set permissions, which you can do with FTP clients like FileZilla for example, the documentation should get you there. I think you may also need to have a secure domain (ie. https) but other than that the setup should be pretty minimal.

    I know of at least one other lab that’s looked into the eyetracker feature, but they haven’t collected actual data with it yet. There’s a Slack channel where people can chat about this, let me know if you’re interested in joining it by sending an email at support@pcibex.net

    Jeremy

    in reply to: presenting Chinese characters #6048
    Jeremy
    Jeremy
    Keymaster

    Hi Peiyao,

    It’s probably an encoding problem. Make sure you save your csv file as UTF-8 and it should display properly.

    Jeremy

Viewing 15 posts - 1 through 15 (of 407 total)