aliona

Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • in reply to: Pick combined with randomizeNoMoreThan #7685
    aliona
    Participant

    Hi Jeremy,

    it worked out perfectly! Thanks for the help.

    Aliona

    in reply to: access participants' browser info #6713
    aliona
    Participant

    Oh, I see! Thanks a lot for the link!

    Best,
    Aliona

    in reply to: access participants' browser info #6709
    aliona
    Participant

    Dear Jeremy,

    thanks for getting back to me!
    I was hoping I could use those lines too, but in some cases several browsers are listed and I wasn’t sure how to interpret that.

    `USER AGENT: Mozilla/xx (xxxxxxxxx) xxxxxx (xxxxxxxx) Chrome/xxxxxxx Safari/xxxxxxx Edg/xxxxxxx

    I guess this is then the case of the info not being 100% reliable.

    Best,
    Aliona

    in reply to: DashedSentence in a PennController trial #6435
    aliona
    Participant

    Hi Jeremy,

    I was wondering if there is a way to prevent the dashed function from deviding the chunks and presenting them on different lines? So if there’s not enough space for the whole sentence region on the first line, the presentation starts from the second line. Also right now it happens sometimes that you move your gaze to the next line thinking the next word will apear there, but then another word is added to the previous line:

    Jeremy surely know how to solve
    ——-
    Jeremy surely knows how to solve this
    problem.

    Is there an easy fix for it?

    Thanks a lot!
    Aliona

    Here’s my function:

    // create cumulative function
    cumulative = (sentence, remove) => {
        let words = sentence.split('*'),  blanks = words.map(w=>w.split('').map(c=>'_').join('') ); // 'sentence.split('*')' = '*' defines the chunk boundaries (in the .csv)
        let textName = 'cumulative'+words.join('');
        // We'll return cmds: the first command consists in creating (and printing) a Text element with dashes
        let cmds = [ newText(textName, blanks.join(' '))
        //.print()
        .settings.css("font-family","courier")
        .settings.css("font-size", "20px")
        .cssContainer({"width": "80vw"})
        .print("10vw","50vh")
        //.settings.css("font-size", "0.5em")  
        //.cssContainer({"width": "10vw"})
        ];
    // COURIER as font
    // We'll go through each word, and add two command blocks per word
    for (let i = 0; i <= words.length; i++)
        cmds = cmds.concat([ newKey('cumulative'+i+'_'+words[i], " ").log().wait() , // Wait for (and log) a press on Space; will log "cumulative"+number-of-region_sentence-chunk
                             getText(textName).text(blanks.map((w,n)=>(n<=i?words[n]:w)).join(' ')) ]); // Show word; to make cumulative changed n==i?words to n<=i?words (print words less than or equal to i-region)
    if (remove)  // Remove the text after the last key.wait() is parameter specified
        cmds.push(getText(textName).remove());
    return cmds;
    };
    in reply to: Adding break trials #6415
    aliona
    Participant

    Hi Jeremy,

    it works perfectly! Thanks a lot for your help and all the great work on PC!

    Aliona

    in reply to: Adding break trials #6400
    aliona
    Participant

    Hi Jeremy,

    would it be possible to use the above mentioned SepWithN function while having different number of critical and filler items? In our experiment we have 20 criticals and 30 fillers devided into three blocks by 2 breaks (7/7/6 +10 fillers/block).
    My sequence looks like this:
    PennController.Sequence(…sepWithN(“break” , rshuffle(“critical_trials”, “fillers”) , 17 )…);

    How can I specify the number of the critical items and fillers/block? I tried adding the desired numbers after “critical_trials” and “fillers” in the sequence but that didn’t work, the proportion of criticls and fillers is still random.

    Thanks in advance for your responce!
    Aliona

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