PennController for IBEX › Forums › Support › Bidirectional self-paced reading
Tagged: bidirectional self-paced reading
- This topic has 5 replies, 3 voices, and was last updated 1 year, 4 months ago by jjgreen.
-
AuthorPosts
-
July 1, 2022 at 11:30 am #8253JunLyuParticipant
Hi Jeremy,
I wonder how we can make a self-paced reading task bidirectional, where participants can regress to the previous regions. What things should change based on a typical mono-directional self-paced reading script? Also, any links/resources would be greatly appreciated!
Thank you!
JunJuly 7, 2022 at 1:57 pm #8262JeremyKeymasterHi Jun,
You’ll have to edit DashedSentence.js in the Modules folder and replace the conditional on
"self-paced reading"
toward the top with a simpleif (this.mode == "self-paced reading") this.sprResults = [];
. Then replace thesafeBind
piece of code further down with this:this.safeBind($(document), 'keydown', function(e) { var time = new Date().getTime(); var code = e.keyCode; if (code == 37 || code == 39) { var word = t.currentWord; if (word > 0 && word <= t.stoppingPoint) t.sprResults.push([time,t.previousTime,word]); t.previousTime = time; if (code == 37){ if (code != t.lastKey) t.currentWord--; if (t.currentWord < t.stoppingPoint) t.blankWord(t.currentWord); if (t.currentWord - 1 >= 0) t.showWord(t.currentWord - 1); t.currentWord--; if (t.currentWord<0) t.currentWord = 0; } else if (code == 39){ if (t.currentWord>0 && code != t.lastKey) t.currentWord++; if (t.currentWord - 1 >= 0) t.blankWord(t.currentWord - 1); if (t.currentWord < t.stoppingPoint) t.showWord(t.currentWord); t.currentWord++; if (t.currentWord > t.stoppingPoint) { t.processSprResults(); t.finishedCallback(t.resultsLines); } } t.lastKey = code; return false; // *** } else { return true; } });
And the
processSprResults
piece of code toward the end of the script with this:processSprResults: function () { for (var i = 0; i < this.sprResults.length; ++i) { var n = this.sprResults[i][2]; this.resultsLines.push([ ["Word number", n], ["Word", csv_url_encode(this.words[n-1]||"")], ["Reading time", this.sprResults[i][0] - this.sprResults[i][1]], ["Newline?", (! this.display == "in place") && boolToInt(((n+1) < this.wordOSpans.length) && (this.wordOSpans[n].offset().top != this.wordOSpans[n+1].offset().top))], ["Sentence (or sentence MD5)", this.sentenceDesc] ]); } }
Jeremy
July 7, 2022 at 6:11 pm #8264JunLyuParticipantThank you!! I will try that.
May 24, 2023 at 3:59 pm #10619jjgreenParticipantI just tried doing this, but the words all show up on the screen together, and only disappear once I’ve moved past them. Any suggestions?
Here’s my simple implementation: https://farm.pcibex.net/r/GgVLoq/
May 25, 2023 at 6:19 am #10623JeremyKeymasterHi,
Since you’ve created a new controller instead of just editing DashedSentence.js, you’ll need to create a file in the Aesthetics folder named BidirectionalDashedSentence.css in which you paste the same rules that already exist in DashedSentence.css
Jeremy
June 7, 2023 at 5:12 pm #10665jjgreenParticipantOh I see. Thank you!
-
AuthorPosts
- You must be logged in to reply to this topic.