dod

Forum Replies Created

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • in reply to: Scale feedback and timeout #10761
    dod
    Participant

    Thank you, it works!

    At that point, I’ll have to manually log the accuracy and the response time, though, right? I mean, I can log the scale selection, and set a variable to get the timing (something like newVar(“RT”).global().set(()=>Date.now()) …. getVar(“RT”).set(v=>Date.now()-v). Just thinking if there is a cleaner way to do it.

    Thank you

    in reply to: Scale feedback and timeout #10749
    dod
    Participant

    Hi,

    I’m trying to implement something similar but on a Question controller.

    I would like to print some feedback when the answer is not correct. But being a Question, the scale.test.selected does not work. Is there a command I’m missing? I could still print the correct answer for every question. But I’d prefer not to.

    Also, I’d like to timeout the answer time and print an error message if needed. I know how to do it with a normal Timer element. And I know I can add a timeout message to the item array in the old Ibex. But I’m not sure how to implement the timeout message in PCIbex, when the timeout option is set in the Question controller.

    Thank you in advance for any help!

    • This reply was modified 10 months ago by dod.
    • This reply was modified 10 months ago by dod.
    in reply to: MediaRecorder – filenames using ID #8269
    dod
    Participant

    Thank you! I realized a bit after posting that I had got your first message completely wrong. So eventually I declared it at the beginning of the script but I just messed things up ( I used var speakID = function randomString() {..., and I decided to get rid of the trial (and the log). And as a result, I was getting a “No Var element named “speakID” found” error that was driving me crazy.)
    Now I can see the logic, and it works perfectly!
    Thank you again!

    in reply to: MediaRecorder – filenames using ID #8266
    dod
    Participant

    Hi Jeremy,

    I was trying to store a unique participantID in the audio filename as well.
    I created a javascript variable and referred to it in the newMediaRecorder name, but I always get errors – either “[12:25:57] Uncaught SyntaxError: Unexpected token ‘variable’ (newTrial: 0), or an “ERROR: Wrong number of arguments (or bad argument) to SepWith” (even if I’m not touching the sepWith trials).
    I’m quite sure there is something wrong in the way I refer to the variable in the newMediaRecorder name. But I cannot figure out how to fix it. Could you help me out?

    Here’s the trial with the function to define the variable

    // Set unique participant ID to better recognize audios
    newTrial("speakID",
        newVar("speakID")
            .settings.global()
            .set(v =>[...Array(4)].reduce(a=>a+alphanum.charAt(Math.floor(Math.random()*alphanum.length)),''))
        ,
        newText("speakID", "")
            .settings.text(getVar("speakID"))
            .print(),
        newButton().print().wait()   // to be deleted, just to double check that the code matches the audiofile
        )
        .log("speakID", getVar("speakID"))
    

    And here’s the way I named my newMediaRecorder element in following trials
    newMediaRecorder(row.itemID+"_"+row.modality+"_"+variable.speakID, "audio")

    If I don’t refer to the variable in the audiofile name, everything goes smoothly.

    Thank you in advance!

    Dod

    in reply to: Implementing test recording #8106
    dod
    Participant

    But it definitely serves its purpose, so far!

    So, I guess the same logic applies when printing the MediaRecorder and then uploading it – the zip name I got in the results line refers only to the most recent attempt, doesn’t it?

    Dod

    in reply to: Implementing test recording #8103
    dod
    Participant

    Hi Jeremy, thanks for the quick reply, as always!

    I didn’t think at all about the print option, to be fair. I kept the recorder hidden in the experimental trials, and now I was over-complicating things. At the moment, I don’t see any particular reason for hiding it in the audio check as well. So I’ll go for printing it, and that’s it. If I change my mind later on, I know I can start from your custom interface code (I tried it, and I see your point).

    At least now I’ve learned not to use the callback on the play button 🙂
    Just another naive question that might come in handy in the future. So, in a code like that with the newMediaRecorder in the looped callback command, PCIbex will play and save different recordings even if the mediarecorder has the same name? I mean, at the end of the day, would I have X zip files with the same “audiotest1” from a same participant, or will they somehow be labelled sequentially?

    As for the test.clicked, my bad, there was indeed an error in the syntax. I checked previous codes, and it’s true that I had always put the test in the wait brackets of buttons/dropdowns (something like newButton(“X”).wait(getButton(“X”).test.clicked…). And at the point of course it worked. Sorry again for the silly questions – I’m still pretty new with all the coding-related stuff!

    Thank you

    in reply to: including attention checks and break #7593
    dod
    Participant

    Hi,

    It works perfectly, thank you!

    in reply to: including attention checks and break #7587
    dod
    Participant

    Hi,

    Sorry for jumping in an old post, but I got a similar problem.
    Basically, I need to alternate every single experimental trial with 3 filler sentences to be presented either visually (read&repeat) or aurally (listen&repeat). The modality of the fillers is pre-assigned, but I need to randomize the order throughout the experiment and across participants.

    I used sepWith to alternate the experimental/filler trials, and I defined the Pick function as specified above. It was super useful and I solved the problem of randomizing the modality of the fillers as well as presenting only 3 fillers at every time.
    However, I always get the same 3 filler sentences. I know I should store the set of used fillers in a new variable (the one you referred to as ‘liste’ in the example above). But I am not completely sure about how to add this detail in my sequence without having to apply a pick function+’liste’ variable to each and every of my experimental trials as well.
    To make things even more complicated, it is a production experiment, so ideally I would want to have a sepWith asyncUpload to start uploading the recordings as they go.

    So far, the sequence is specified as follow:

    Sequence("welcome", "preload", "init", sepWith("asyncUpload",(randomize(anyOf("practice-listen","practice-read")))),
          
    	sepWith(
            pick(randomize(anyOf("filler-listen","filler-read")),3),
            "exp-trial"),
    
     "upload", "send", "bye"
    )

    where:
    – “filler-listen” is a trial with the specific code for audio (listen&repeat) stimuli;
    – “filler-read” is a trial with the specific code for visual (read&repeat) stimuli;
    – “exp-trial” is the actual experimental trial of listen&repeat(and record)-read&repeat(and record), with listen sentences and read sentences pre-paired together and stored in the same row in the csv table.

    Thank you in advance for any help!

Viewing 8 posts - 1 through 8 (of 8 total)