amilam

Forum Replies Created

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • in reply to: Keypress to initiate mediarecord #7322
    Avatar
    amilam
    Participant

    Hi,

    You can do the following (and in the Key command insert any Key you want, and you can add optional text with instructions ):

    [“item”, “PennController”, PennController(
    newText(“instructions”, “Listen to the sentence and then repeat it while recording your voice”)
    .print()
    ,
    newAudio(“sound”, “webaddressofsounnd.html”)
             .print()
             .wait()
    ,
    getAudio(“sound”)
            .remove()
    ,
    newMediaRecorder("recorder", "audio")
            .record()
            .log()
    ,
    newKey(" ")
            .wait()
    ,
    getMediaRecorder("recorder")
            .stop()
    ,
    newButton(“validate”, “Click to continue”)
            .print()
            .wait()
    )]

    Hope it helps!

    • This reply was modified 10 months, 2 weeks ago by Avatar amilam.
    in reply to: Last recording not saved #7089
    Avatar
    amilam
    Participant

    What about adding the “break” right after both sepWith("sendAsync",randomize("experiment1")) and sepWith("sendAsync",randomize("experiment2"))?

    in reply to: Horizontal clickable scale #7087
    Avatar
    amilam
    Participant

    Hi,

    Have you looked at the scale element?

    in reply to: Last recording not saved #7086
    Avatar
    amilam
    Participant

    Hello,

    Have you tried using the Sequence command for initiating the order of your trials?

    in reply to: Using mouse track with dashed sentence #6972
    Avatar
    amilam
    Participant

    Hi,

    Have you tried doing something like this:

    PennController.ResetPrefix(null);
    
    newTrial("frase_1",
        newImage("a1", "aviso1.png")
            .size(200,200)
        ,
    
        newImage("a2", "aviso3.png")
            .size(200,200)
        ,
    
          newMouseTracker("mouse")
            .log()
            .start()
        ,
    
        newCanvas("canvas_esq", "40vw", "40vh")
            .add(250, 10, getImage("a1"))
            .print("center at 25vw", "middle at 50vh")
        ,
    
        newCanvas("canvas_dir","40vw", "40vh")
            .add(50, 10, getImage("a2"))
            .print("center at 75vw", "middle at 50vh")
        ,
    
        newTimer("pausa", 2000)
        .start()
        .wait()
        ,
    
        newController("DashedSentence", {s: "This is not an empty warning."})
            .center()
            .print()
            .log()
        ,
        newSelector("escolha")
            .add(getCanvas("canvas_esq"), getCanvas("canvas_dir"))
            .wait()
            .log()
        ,
        getMouseTracker("mouse")
            .stop()
        )
    

    Hope it helps!

    in reply to: Display time spent on a trial to the participants #6963
    Avatar
    amilam
    Participant

    Hi,

    This is a sample code that illustrates what are you looking for:

    PennController.ResetPrefix(null) // Keep here
    
    newTrial(
        newVar("finishTime").set(v=>Date.now()) 
        ,
        newText("countDown", "0m0s").print()
        ,
        newTimer("updateCountdown",1000).callback( 
            newVar("difference")
                .set(getVar("finishTime")).set(v=>-v+Date.now())
            ,
                    // Transform the Var element into an appropriately formatted string
                    getVar("difference")
                        .set(v=>Math.trunc(v/60000)+"m"+Math.round((v/1000)%60)+"s")
                    ,
                    getText("countDown").text(getVar("difference"))
                    ,
                    // Relaunch the timer to update again in 1s
                    getTimer("updateCountdown").start()
        ).start() // Don't forget to start the timer the initially
        ,
        newButton("Click me").print().wait()
        ,
        getVar("finishTime").set(v=>Date.now()) // This will effectively stop the countdown
        ,
        getTimer("updateCountdown").test.running()
            .success( newText("You clicked in time!").print() )
            .failure( newText("You were too late").print() )
        ,
        newButton("Finish").print().wait()
    )

    Hope it helps!

    • This reply was modified 1 year, 3 months ago by Avatar amilam.
    Avatar
    amilam
    Participant

    Hello,

    The mistake is in that you have spacing between each sets of the words.
    The program interprets the spacing as a word which is why it renders error.

    Here is the correct way to implement it:

    Word,Color,Key
    ABUSO,red,r
    ENOJO,red,r
    BOMBA,red,r
    CANCER,red,r
    CADAVER,red,r
    CRUEL,red,r
    DEPRESION,red,r
    AHOGADO,red,r
    GANGRENA,red,r
    INFIERNO,red,r
    SOLEDAD,red,r
    PESADILLA,red,r
    POBREZA,red,r
    MATANZA,red,r
    ACCIDENTE,blue,a
    ASALTO,blue,a
    SANGRIENTO,blue,a
    CEMENTERIO,blue,a
    COBARDE,blue,a
    MUERTE,blue,a
    DIABLO,blue,a
    FRACASO,blue,a
    TORTURA,blue,a
    DOLOR,blue,a
    MISERIA,blue,a
    PARALISIS,blue,a
    VIOLACION,blue,a
    SUICIDIO,blue,a
    MIEDO,green,v
    TRAICION,green,v
    QUEMADURA,green,v
    CUCARACHA,green,v
    CHOQUE,green,v
    DEMONIO,green,v
    DESASTRE,green,v
    FUNERAL,green,v
    ODIO,green,v
    CARCEL,green,v
    MORGUE,green,v
    VENENO,green,v
    TRISTEZA,green,v
    TERRORISTA,green,v
    BRAZO,red,r
    MENTON,red,r
    CASA,red,r
    CODO,red,r
    DEDO,red,r
    TENEDOR,red,r
    ITEM,red,r
    MOMENTO,red,r
    LAPIZ,red,r
    PANFLETO,red,r
    SILENCIO,red,r
    ESTATUA,red,r
    VENTANA,red,r
    ESFERA,red,r
    CANASTA,blue,a
    SILLA,blue,a
    EDIFICIO,blue,a
    CORTINA,blue,a
    GRANJA,blue,a
    HEBILLA,blue,a
    CORDERO,blue,a
    METAL,blue,a
    PARTE,blue,a
    ORQUESTRA,blue,a
    LLUVIA,blue,a
    CUADRADO,blue,a
    PARAGUAS,blue,a
    CHALECO,blue,a
    BANCO,green,v
    MANTECA,green,v
    NUBES,green,v
    PARPADO,green,v
    PIE,green,v
    CABALLO,green,v
    MANTEL,green,v
    MONJA,green,v
    PAPEL,green,v
    POSTER,green,v
    ASIENTO,green,v
    CALLE,green,v
    VIOLIN,green,v
    UTENSILLO,green,v

    Hope it helps!
    Let me know if you have any further questions.

    Avatar
    amilam
    Participant

    Hi,

    The experiment looks good. However, you should put this line of the code:

    PennController.Sequence("instructions", randomize("experimental-trial2") , "send" );

    before the first trial, not after it.

    The sequence needs to be defined before the trials.
    Let me know if it works.
    If you have any further questions, let me know!

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