Jeremy

Forum Replies Created

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

    It says “Wait success,” which means that the keypress successfully validated a wait command

    Jeremy

    Jeremy
    Keymaster

    Glad to see that you got things to work!

    Note that in this case, you have the alternative option to use the JavaScript ternary conditional rather than a test command, because the value you are checking (row.Question) is already set at the beginning of your experiment and doesn’t change upon runtime. More information on this page of the documentation

    Jeremy

    in reply to: Practice trial to end after a set score is reached #6840
    Jeremy
    Keymaster

    Hi Cecile,

    One solution is to move your test at the beginning of the trial, so that you immediately end it as soon as it starts if the right conditions are met. This is what I illustrated in this post.

    Also, if you want to re-run the same list of trials a given number of times, you don’t have to create duplicate entries in your table: simply reference their labels multiple times in the Sequence command.

    Here is a project to illustrate what I said: https://farm.pcibex.net/r/txQFla/

    Let me know if you have questions

    Jeremy

    Jeremy
    Keymaster

    Hi,

    PennController adds one line to the results file per event that is logged. The start and end of a trial are logged by default, and you additionally log your Text, Key and Timer elements: you get one line for when the Text element was printed, one line for when a key was pressed, and two lines corresponding to the start and end of the Timer element. The third line is the one for the Key element, and you can see that the key that was pressed is R, which matches the correct column, which reports r (it’s not a perfect match because you added a space character before r in your table, and you use lower-case when the pressed character is reported in upper case)

    Jeremy

    in reply to: MTurk completion code #6832
    Jeremy
    Keymaster

    Hello,

    A simple enough solution is to use JavaScript to generate a unique completion code at the top of your script and print a Text element with that code in the last trial of the experiment. The general idea takes the following form in your project’s script:

    code = 'my unique completion code'
    
    Sequence( "intro" , randomize("trials") , SendResults() , "end" )
    
    newTrial("end",
      newText( code ).print()
      ,
      newButton().wait() // end = wait on this screen forever
    )
    
    code = undefined // make it harder to fetch the code by other means

    Here is a more elaborate illustration of this idea: https://farm.pcibex.net/r/BIHiHw/

    Jeremy

    in reply to: Choosing subet of items to present #6831
    Jeremy
    Keymaster

    Hi Ana,

    Glad to see that the issue has been fixed. However it shouldn’t matter whether you open your results file in a new tab and save it as a .txt file, or whether you click “download” to directly get a .csv file: the content is the same in both cases, it’s a comma-separated table.

    Judging from the error message that you got, I suspect that something went adrift with the filename that was passed to read.pcibex. Maybe saving the file with a .txt extension somehow helped in passing the proper value to the function

    Best,
    Jeremy

    in reply to: How to know the total time cost of a participant #6826
    Jeremy
    Keymaster

    Hi Rick,

    For some reason Ibex saves the reception time in seconds, while PennController saves event times in milliseconds. You can take look up the participant’s first row, take the Event Time and subtract it from the Reception Time (times 1000) and you’ll get a proxy for the duration in milliseconds

    Jeremy

    in reply to: Creating a .csv file that can be read in PCIbex Farm #6823
    Jeremy
    Keymaster

    I think what happened is that the stylized double-quote characters were not properly handled by Excel and/or TextEdit, which would cause the exported CSV file to be unreadable once uploaded onto the PCIbex Farm.

    You should replace those characters (both the opening and the closing ones) with ": that expression will be rendered as a double-quote character by the browser running the experiment

    I just tested it and it worked: I couldn’t directly open the file items1.csv in the PCIbex Farm editor (just like you reported) so I downloaded it (checked the box to the left of its filename, then clicked the “download” icon) then opened it in a text editor, replaced all occurrences of the character � (which had replaced the stylized quotes) with " and re-uploaded it back to the project. The experiment then ran smoothly, and I was able to open the file directly in the project’s editor

    Jeremy

    • This reply was modified 4 years, 3 months ago by Jeremy.
    in reply to: newKey with numeric choices #6820
    Jeremy
    Keymaster

    Hello,

    PennController should automatically detect when the argument is an actual number, or a string exclusively consisting of digits. Visibly it fails to do so, and therefore expects a keypress producing the character with code 12, which is inaccessible in a single keystroke.

    To fool PennController, add a dummy non-digit character to your digit string, for example (this one’s called the “replacement character,” I doubt anyone would have configured their keyboard to type it in a single keystroke):

    newKey("1or2", "�12")
        .wait()
        .test.pressed("1")
        .success( newText("success", "You're right!").print() )
        .failure( newText("failure", "You're wrong, 0.999... and 1 do refer to the same number").print() )
    

    Jeremy

    in reply to: Creating a .csv file that can be read in PCIbex Farm #6819
    Jeremy
    Keymaster

    Hi,

    When PennController cannot read a CSV file, it would normally throw an error in the Error tab of the Debug window. What you are describing is different, and I don’t think I’m familiar with this error. Where do you see it, is it in the web console?

    In any case, feel free to share the demonstration link of your experiment (“Share” option in the right menu on your project’s page), whose copies will contain a copy of that CSV file

    Jeremy

    in reply to: Access to the results #6816
    Jeremy
    Keymaster

    Hi Rick,

    Thank you for reporting this issue

    This could happen in two instances: either when trying to access the results while another request to access the results is still running (as reported by the message)—for example a double-click on “Results” could open two tabs, or a refresh of the results tab before it has finished loading would give you this message; or it could also happen when a previous request for the results failed for some reason (because of a disconnection, for example), in which case the message could fail to go away and I would need to fix things manually

    The first case is a feature, so it’ll remain this way: it is not possible to open/download the results file multiple times in parallel. The second case was a bug, and it should now be fixed: in the worst case, you’d need to wait up to 4min before the message disappears

    Jeremy

    in reply to: Choosing subet of items to present #6812
    Jeremy
    Keymaster

    Your experiment contains two Sequence commands, so PennController will ignore one of them. Because you use pick ahead of the second Sequence command and your file pick.js, which is supposed to define that function, is empty, the script crashes on the first call to pick and all the code below it, including the second Sequence command and the Template command that generates your trials labeled "experiment", is not executed.

    Your table does contain a cond column listing values from A to H and values starting with dist, so it does make sense to use row.cond + "-" + row.item in your project

    I have re-filled the file pick.js with the content from the project I initially shared and minimally edited your code along the lines of what we’ve discussed here, you can see the result here: https://farm.pcibex.net/r/MXPSBL/
    (note that it runs only 8 experimental trials and 8 fillers, for the reasons I mentioned above)

    Jeremy

    in reply to: Choosing subet of items to present #6810
    Jeremy
    Keymaster

    The "experiment" in the code referred to the Sequence of presentation: Sequence("TCLE" (consent), "info","instructions", "treino" (trainning),"experiment", SendResults(), "end")

    But the Sequence command that we have been working on so far is not this one, it’s the one that you report later in your message:

    Sequence( 
        conditions[0], pick(fillers,1),
        conditions[1], pick(fillers,1),
        conditions[2], pick(fillers,1),
        conditions[3], pick(fillers,1),
        conditions[4], pick(fillers,1),
        conditions[5], pick(fillers,1),
        conditions[6], pick(fillers,1),
        conditions[7], pick(fillers,1)
    )

    If there is no reference to your trials labeled "experiment" in that Sequence command, then they won’t be included in the experiment

    Jeremy

    in reply to: Choosing subet of items to present #6808
    Jeremy
    Keymaster

    This line row => newTrial("experiment", row.cond + "-" + row.item, labels all your trials "experiment" and does nothing of row.cond + "-" + row.item. If your table has A, B, etc. in cond, simply delete "experiment", and that part should work fine (I think)

    You also reference a variable dist in the first pick function of Sequence but you have defined no such variable: I think the variable name you mean there is fillers, which three lines above you have reference all the trials (in a random order) whose label starts with “dist”. You will only have such trials (that is, after deleting "experiment",) assuming that cond in your table is dist (or at least starts with dist) for your filler items

    One last thing: you need to close the parenthesis of you newController immediately after the } (and then accordingly delete one of the three closing parentheses at the end of your code)

    Because your calls to pick all have 1 as their second argument, your code will include 16 trials in your run: 1 experimental trial, 1 filler trial, 1 experimental trial, 1 filler trial, and so on

    FYI, you can also share code with me (and readers of the forum) by sharing the demonstration link of your project (option “Share” in your project’s right panel menu)

    Jeremy

    in reply to: Choosing subet of items to present #6805
    Jeremy
    Keymaster

    I’m not sure why you are trying to pass the conditions array as the s parameter of your DashedSentence Controller elements.

    The conditions array contains references to labeled trials, and its cells are therefore meant to feature in the Sequence command, as in my example.

    If you take a look at my example project, I simply use a single Button element in the trials I generate. That’s the part where you should use a Controller element with DashedSentence if you need to use it, and presumably reference row.sentence (or, to be consistent with your example, variable.sentence) as the s parameter. You can read more about how the Template command works here, and more about the Sequence command here

    Jeremy

Viewing 15 posts - 886 through 900 (of 1,522 total)