Jeremy

Forum Replies Created

Viewing 15 posts - 151 through 165 (of 1,522 total)
  • Author
    Posts
  • Jeremy
    Keymaster

    Hi Xiangyu,

    You cannot use a javascript function in that wait command: documentation, source code. Since that’s not supported, you cannot assume that this.keys will return a key that was pressed

    Neither Ibex nor PennController define a global JavaScript log function. PennController has newTrial().log and element-specific log commands

    If you want to add a column to the rows of this trial that will report whether the pressed key was correct, you can use a global Var element:

    newTrial(
      // ...
      newVar("Correct", 0).global(),
      // ...
      newKey("keypress", "FJ")
        .log()
        .wait()
        .test.pressed( variable.CorrectResponse ) // assuming that CorrectResponse in the table is either F or J
        .success( getVar("Correct").set(1) )
      ,
      // ...
    )
    .log( "CorrectResponse" , getVar("Correct") )
    

    Jeremy

    Jeremy
    Keymaster

    Hi,

    This is indeed a bug. One solution is to code the logic of the AcceptabilityJudgment controller using PennController commands instead:

    newText("sentence").center().print()
    ,
    newScale("AcceptabilityJudgment", 5)
        .before(newText("pas naturelle")).after(newText("très naturelle"))
        .button().center().log().print().keys().wait().remove()
    ,
    newTimer(100).start().wait()

    To make the visual rendering closer to the original controller, you can add these rules to global_main.css in your project’s Aesthetics folder:

    .PennController-AcceptabilityJudgment .option {
      width: 1em;
      height: 1em;
      text-align: center;
      color: blue;
      margin: 0.33em;
      padding: 0.33em;
      border: solid 1px black;
    }
    .PennController-AcceptabilityJudgment .option label {
      width: 100%;
    }
    .PennController-AcceptabilityJudgment-container .PennController-before, .PennController-AcceptabilityJudgment-container .PennController-after {
      line-height: 2.5em;
    }

    Jeremy

    Jeremy
    Keymaster

    This question was answered via email, but posting the suggested code here for the sake of future readers:

    Template("sentences.csv",variable =>
        newTrial("block"+variable.BlockNum,
            newTimer("break", 1000).start().wait()
            ,
            newImage("im",variable.PictureFile).size(400, 400).print()
            ,
            newTimer("image-item", 600).start().wait()
            ,
            newText("ts", variable.TargetSentence).center().print()
            ,
            newTimer("item", 2100).start().wait()
            ,
            newText("response", variable.ResponseSentence1 + " or " + variable.ResponseSentence2).center().print()
            ,
            newKey("keypress", "FJ").log().wait()
        )
    )
    
    // ...
    
    blocks = [randomize('block1'),randomize('block2'),randomize('block3'),randomize('block4')]
    fisherYates(blocks) // Ibex-internal function that shuffles an array
    Sequence("consent","welcome", "instructions",  ...blocks, SendResults(), "goodbye")

    Jeremy

    in reply to: Accidental two columns #10441
    Jeremy
    Keymaster

    Hi Ivan,

    Whatever solution you choose, always make sure you back up the original copy of the results file. I don’t think there’s a clear preferred solution here, but if it were me, I would probably directly edit a copy of the file and look for the regular expression pattern (,fillers,.+)(,[A-Z]\d+){2} and then replace all occurrences with first match + second match ($1$2 in Visual Studio Code)

    Jeremy

    Jeremy
    Keymaster

    Hi Sanghee,

    The EyeTracker element tracks gazes on the elements that you’ve added to it. Since the elements you’ve added to it at the four quadrant Canvas elements, and since each is 50vw*50vh, those are the boundaries of the corresponding elements. If the tracker estimates a gaze to fall within the left 50% of the width of the screen and 50% of the height of the screen, then it will report 1 for _TopLeft, indeed

    Jeremy

    in reply to: Skipping trials logic not working properly #10434
    Jeremy
    Keymaster

    Hi,

    The value of your Var element is numeric, it’s not a string, so I don’t expect the regular expression to test the value

    If you want to test if the value is comprised between 7 and 9 included, use a function instead: getVar("correct").test.is(v=>v>6&&v<10)

    Jeremy

    in reply to: Editing the progress bar #10432
    Jeremy
    Keymaster

    Hi Ari,

    Yes, go to Aesthetics/global_main.css and edit the CSS rules. You may want to replace margin-top: 5em; with something like margin-top: 3em; in the group of rules targeting body

    Jeremy

    Jeremy
    Keymaster

    Hi Sanghee,

    The size of the dots is 48*48px as of PennController 2.0. The calculation starts immediately when the middle dot shows up, and the score is proportional to the average distance from the center of the screen over the (X,Y) coordinates of the estimated gazes (precision = 100 - (distance / halfWindowHeight * 100)). As far as I remember, and as far as I can tell now, there is no default threshold value: if none is provided, then all calibrations will be successful. Reference

    There is no set sampling rate: if memory serves, the WebGazer library will try to run at each update of the visual frame (look up requestAnimationFrame) which will happen more or less frequently depending on the performance of the participant’s browser at the time of the experiment.

    Regarding the Latin Square design, this is something you need to code yourself in your CSV. PennController picks one value from the ones listed in the “Group” or “List” column and subsets the table to all and only the rows containing that one value in that column, and generate the trials from those rows. If you want to cycle through conditions across items in Latin Square fashion, you need to design your table accordingly, as illustrated in the advanced tutorial

    Jeremy

    in reply to: Assign a truth value to the picture verification tasl #10421
    Jeremy
    Keymaster

    Hi Jun,

    Use .test.pressed() on your Key element to test which key was pressed, instead of .test.selected() on an unused Selector element

    Jeremy

    Jeremy
    Keymaster

    Hi Sanghee,

    The “times” column reports how many milliseconds elapsed between when the EyeTracker element was started, and when the data in the corresponding row were collected (which is why the value in that cell is 0 on the very first row below the header: the first eye-tracking data were collected right when the tracker was started)

    The columns starting with _ are named after the elements you added to the EyeTracker element, and report 0 or 1, depending on whether the (X,Y) coordinates that were estimated by the tracker fell within the boundaries of the corresponding element at that time point

    The “trial” column reports the PennController trial’s ID number. If you only have PennController trials in your experiment, it will correspond to the 4th column in your results file (“Item number”) — more generally, it matches the value of the 9th column (PennElementName) for the rows in the results file that report “_Trial_,Start” or “_Trial_,End”

    Jeremy

    in reply to: mediaRecorder with video in Chrome #10417
    Jeremy
    Keymaster

    Hi,

    Thank you for the report. This is a known issue that appeared with the latest release of Chromium, affecting both Chrome and Edge. It seems that Firefox isn’t affected so far, but I can’t guarantee it’ll stay that way. I’m looking into the issue

    Apologies for the inconvenience,
    Jeremy

    in reply to: mediaRecorder to respect container size on print() #10415
    Jeremy
    Keymaster

    Thanks for the tip!

    Jeremy

    in reply to: Big dataset: how to handle? #10414
    Jeremy
    Keymaster

    Hi Andrea,

    That link is invalid. If you create a new project to share, make sure to do so while logged in, so it can be saved in your account; projects created while logged out are automatically deleted 30 minutes after their last edit

    Jeremy

    in reply to: Losing EventTime data #10405
    Jeremy
    Keymaster

    Hi,

    Unless you explicitly tell it to do so, R will not modify the values in the EventTime column. Nor will the read.pcibex function provided in the documentation. That being said, there are preview methods that will alter how the values are displayed

    Maybe your code applies some transformation on the data somewhere else. Would you mind sharing it, so I can take a look?

    Jeremy

    in reply to: Big dataset: how to handle? #10404
    Jeremy
    Keymaster

    Hi Andrea,

    Would you mind sharing a link to your study? I cannot seem to reproduce the problem myself

    Jeremy

Viewing 15 posts - 151 through 165 (of 1,522 total)