displaying a cropped word after manipulating that word's presentation time

Skip to first unread message


Jun 10, 2021, 5:21:07 AMJun 10
to ibexexperiments
Hi All, 

I'm trying to get my critical words to appear for a different time than all other words in a sentence. My solution so far is to add # before every critical word in the stimuli set, and  set the timing for that word in the wordPauseTimeout function in DashedSentence. 

So, my stimuli look something like this:

    [["practice1",1], "DashedSentence", {s: "Word word word #critical and another #critical"},"Question", {q:"Question? ", as: ["target","word"]}],

wordPauseTimeout function to display targets for 3000ms: 

            if (this.mode == "speeded acceptability") {
                var t = this;
                function wordTimeout() {
                    if (t.currentWord >= t.stoppingPoint)
                        t.finishedCallback([[["Sentence (or sentence MD5)", t.sentenceDesc]]]);
                    t.utils.setTimeout(wordPauseTimeout, t.wordPauseTime);
                function wordPauseTimeout() {
                    let duration = t.wordTime;
                    if (t.words[t.currentWord].substring(0,1) == "#") {
                        duration = 3000;
                    t.utils.setTimeout(wordTimeout, duration);

What I can't figure out though is how to get rid of the # for the actual word presentation? I tried putting an if statement that crops and presents currentWord in various places in DashedSentence, but it either ends up not cropping them, or cropping them before wordPauseTimeout manipulates the timing, so critical words end up not being presented for 3000ms. Any pointers would be appreciated! 

Jeremy Zehr

Jun 10, 2021, 11:18:48 AMJun 10
to ibexexperiments

You can try replacing line 127 (.text(this.words[j]));) with:

and line 271 (this.wordSpan.text(this.words[this.currentWord]);) with:


Jun 11, 2021, 4:26:26 AMJun 11
to ibexexperiments
This works! Thanks a lot
Reply all
Reply to author
0 new messages