var presentation = ["Anne of Green Gables<\/word>","L.M. Montgomery<\/word>","classic children's novel<\/word>","siblings<\/word>","Matthew and Marilla Cuthbert,<\/word>","adopt a boy<\/word>","Avonlea<\/word>","Prince Edward Island, Canada<\/word>","Lucy Maud Montgomery<\/word>","19th century<\/word>","novel recounts<\/word>","Anne Shirley<\/word>","11-year-old orphan girl<\/word>","help<\/word>","their farm<\/word>","fictional town<\/word>","Cuthberts<\/word>","Anne of Green Gables<\/strong> is a 1908 novel by Canadian author Lucy Maud Montgomery<\/strong> (published as L.M. Montgomery<\/strong>). Written for all ages, it has been considered a classic children's novel<\/strong> since the mid-twentieth century. Set in the late 19th century<\/strong>, the novel recounts<\/strong> the adventures of Anne Shirley<\/strong>, an 11-year-old orphan girl<\/strong>, who is mistakenly sent to two middle-aged siblings<\/strong>, Matthew and Marilla Cuthbert,<\/strong> who had originally intended to adopt a boy<\/strong> to help<\/strong> them on their farm<\/strong> in the fictional town<\/strong> of Avonlea<\/strong> on Prince Edward Island, Canada<\/strong>. The novel recounts<\/strong> how Anne makes her way through life with the Cuthberts<\/strong>, in school, and within the town.<\/phrase>","Bolingbroke, Nova Scotia<\/word>","Marilla and Matthew Cuthbert<\/word>","siblings<\/word>","adopt a boy<\/word>","run their farm<\/word>","Green Gables<\/word>","Avonlea<\/word>","Anne Shirley<\/word>","young orphan<\/word>","fictional community<\/word>","live<\/word>","help<\/word>","fictional town<\/word>","Anne Shirley<\/strong>, a young orphan<\/strong> from the fictional community<\/strong> of Bolingbroke, Nova Scotia<\/strong>, is sent to live<\/strong> with Marilla and Matthew Cuthbert<\/strong>, siblings<\/strong> in their fifties and sixties, after a childhood spent in strangers' homes and orphanages. Marilla and Matthew had originally decided to adopt a boy<\/strong> from the orphanage to help<\/strong> Matthew run their farm<\/strong> at Green Gables<\/strong>, which is set in the fictional town<\/strong> of Avonlea<\/strong>. Through a misunderstanding, the orphanage sends Anne instead.<\/phrase>","fanciful<\/word>","imaginative<\/word>","dramatic<\/word>","defensive about her appearance<\/word>","freckles<\/word>","return to the orphanage<\/word>","let her stay<\/word>","red hair<\/word>","Anne is fanciful<\/strong>, imaginative<\/strong>, eager to please, and dramatic<\/strong>. However, she is defensive about her appearance<\/strong>, despising her red hair<\/strong>, freckles<\/strong> and pale, thin frame, but liking her nose. She is talkative, especially when it comes to describing her fantasies and dreams. At first, stern Marilla says Anne must return to the orphanage<\/strong>, but after much observation and consideration, along with kind, quiet Matthew's encouragement, Marilla decides to let her stay<\/strong>.<\/phrase>","thriving in the close-knit farming village<\/word>","Green Gables<\/word>","Anne takes much joy in life and adapts quickly, thriving in the close-knit farming village<\/strong>. Her imagination and talkativeness soon brighten up Green Gables<\/strong>.<\/phrase>","Green Gables<\/word>","country school<\/word>","friendship<\/word>","rivalry<\/word>","instant hatred<\/word>","no longer hates Gilbert<\/word>","book<\/word>","Diana Barry<\/word>","Gilbert Blythe<\/word>","red hair<\/word>","The book<\/strong> recounts Anne's struggles and joys in settling in to Green Gables<\/strong> (the first real home she's ever known): the country school<\/strong> where she quickly excels in her studies; her friendship<\/strong> with Diana Barry<\/strong>, the girl living next door (her best friend); her budding literary ambitions; and her rivalry<\/strong> with her classmate Gilbert Blythe<\/strong>, who teases her about her red hair<\/strong>. For that, he earns her instant hatred<\/strong>, although he apologizes several times. Although, as time passes, Anne realizes she no longer hates Gilbert<\/strong>, but her pride and stubbornness keep her from speaking to him.<\/phrase>","Anne's adventures in Avonlea<\/word>","Pye sisters<\/word>","Gertie and Josie<\/word>","book<\/word>","Jane Andrews<\/word>","Ruby Gillis<\/word>","The book<\/strong> also follows Anne's adventures in Avonlea<\/strong>. Episodes include play-time with her friends Diana, calm, placid Jane Andrews<\/strong>, and beautiful, boy-crazy Ruby Gillis<\/strong>. She has run-ins with the unpleasant Pye sisters<\/strong>, Gertie and Josie<\/strong>, and frequent domestic \"scrapes\" such as dyeing her hair green while intending to dye it black.<\/phrase>","Queen's Academy<\/word>","teaching license<\/word>","top student in English<\/word>","Bachelor of Arts degree<\/word>","license<\/word>","Avery Scholarship<\/word>","allow<\/word>","Redmond College<\/word>","Nova Scotia<\/word>","At sixteen, Anne goes to Queen's Academy<\/strong> to earn a teaching license<\/strong>, along with Gilbert, Ruby, Josie, Jane, and several other students, excluding Diana, much to Anne's dismay. She obtains her license<\/strong> in one year instead of the usual two and wins the Avery Scholarship<\/strong> awarded to the top student in English<\/strong>. This scholarship would allow<\/strong> her to pursue a Bachelor of Arts degree<\/strong> at the fictional Redmond College<\/strong> on the mainland in Nova Scotia<\/strong>.<\/phrase>","Matthew dies of a heart attack<\/word>","money has been lost in a bank failure<\/word>","Green Gables<\/word>","Anne gives up the scholarship<\/word>","help Marilla<\/word>","teach at the Carmody school<\/word>","friendship<\/word>","gives up his teaching position<\/word>","Avonlea School<\/word>","White Sands School<\/word>","stay close to Marilla<\/word>","looks forward to what life will bring next<\/word>","end<\/word>","book<\/word>","Gilbert Blythe<\/word>","work<\/word>","Near the end<\/strong> of the book<\/strong>, however, tragedy strikes when Matthew dies of a heart attack<\/strong> after learning that all of his and Marilla's money has been lost in a bank failure<\/strong>. Out of devotion to Marilla and Green Gables<\/strong>, Anne gives up the scholarship<\/strong> to stay at home and help Marilla<\/strong>, whose eyesight is failing. She plans to teach at the Carmody school<\/strong>, the nearest school available, and return to Green Gables<\/strong> on weekends. In an act of friendship<\/strong>, Gilbert Blythe<\/strong> gives up his teaching position<\/strong> at the Avonlea School<\/strong> to work<\/strong> at the White Sands School<\/strong> instead, knowing that Anne wants to stay close to Marilla<\/strong> after Matthew's death. After this kind act, Anne and Gilbert's friendship<\/strong> is cemented, and Anne looks forward to what life will bring next<\/strong>.<\/phrase>"]; var currentPosition = 0; var totalPositions = 0; var timePerWord = 1500; var timePerPhraseWord = 120 var readAheadPlayerTimer; var autoPlay = true; var setMinimized = false; var wordSpeedOptions = {'Slower':2000,'Moderate':1200,'Fast':800}; var phraseSpeedOptions = {'Slower':280,'Moderate':200,'Fast':80}; var defaultWordSpeedOption = 'Moderate'; var defaultPhraseSpeedOption = 'Moderate'; var logToLTI = false; $(window).load(function(){ totalPositions = presentation.length; if (totalPositions > 0){ $('body').prepend('
'); $('body').prepend('
'); $('#read_ahead_player').prepend('
'); initializeReadAheadControls(); initializeReadAheadSlider(); initializeReadAheadSpeedOptions(); currentReadAheadControls(); resumeReadAheadPlayback(); } }); $(document).keyup(function(e){ switch(e.which) { case 37: pauseReadAheadPresentation(); priorReadAheadPresentationItem(); break; case 39: pauseReadAheadPresentation(); nextReadAheadPresentationItem(); break; default: break; } }); function initializeReadAheadControls(){ var s = ''; s += ''; s += ''; s += ''; s += '
'; s += ''; s += ''; s += ''; s += ''; s += ''; s += ''; s += ''; s += ''; s += ''; s += '
'; $('#read_ahead_player').append(s); } function initializeReadAheadSlider(){ var s = ''; s += '
'; s += '
'; s += '
'; $('#read_ahead_controls').prepend(s); updateReadAheadSliderPosition(); } function initializeReadAheadSpeedOptions(){ var s = '
'; s += '
'; s += ' Word Speed
'; s += '
'; optionCount = 0; for (index in wordSpeedOptions) { optionCount++; } optionWidth = 100 / optionCount; for (index in wordSpeedOptions) { var option = wordSpeedOptions[index]; if (index == defaultWordSpeedOption) { s += ''; updateReadAheadWordSpeed(option); } else { s += ''; } } s += '
'; s += '
'; s += '
'; s += ' Phrase Speed
'; s += '
'; optionCount = 0; for (index in phraseSpeedOptions) { optionCount++; } optionWidth = 100 / optionCount; for (index in phraseSpeedOptions) { var option = phraseSpeedOptions[index]; if (index == defaultWordSpeedOption) { s += ''; updateReadAheadPhraseSpeed(option); } else { s += ''; } } s += '
'; s += '
'; s += '
'; $('#read_ahead_controls').append(s); } function updateReadAheadWordSpeed(microseconds,sender) { microseconds = microseconds != undefined && microseconds > 0 ? microseconds : 0; if (microseconds > 0) { timePerWord = microseconds; } if (sender!=undefined) { $('#slider_control_word_speed').find('a').removeClass('current_speed'); $(sender).addClass('current_speed'); } logReadAheadPlayerAction('updateReadAheadWordSpeed','Presentation',microseconds); } function updateReadAheadPhraseSpeed(microseconds,sender) { microseconds = microseconds != undefined && microseconds > 0 ? microseconds : 0; if (microseconds > 0 ) { timePerPhraseWord = microseconds; } if (sender!=undefined) { $('#slider_control_phrase_speed').find('a').removeClass('current_speed'); $(sender).addClass('current_speed'); } logReadAheadPlayerAction('updateReadAheadPhraseSpeed','Presentation',microseconds); } function updateReadAheadSliderPosition(){ var currentSliderBarWidth = 100 - (100 / totalPositions * (currentPosition + 1)); $('#readAheadSliderBar').css('width',currentSliderBarWidth+'%'); } function currentReadAheadControls(){ $('#read_ahead_player_pause_play').show(); if (currentPosition < totalPositions - 1) { $('#read_ahead_player_next_word').removeClass('disabled'); } else { $('#read_ahead_player_next_word').addClass('disabled'); } if (currentPosition > 0) { $('#read_ahead_player_previous_word').removeClass('disabled'); } else { $('#read_ahead_player_previous_word').addClass('disabled'); } } function restartReadAheadPresentation(){ currentPosition = 0; logReadAheadPlayerAction('restartReadAheadPresentation','Presentation',''); resumeReadAheadPlayback(); } function resumeReadAheadPlayback(){ $('.fa-repeat').removeClass('fa-repeat').addClass('fa-play'); $('#read_ahead_player_pause_play').each(function(){ $(this).find('.fa-play').removeClass('fa-play').addClass('fa-pause'); $(this).off('click'); $(this).attr('onclick','pauseReadAheadPresentation()'); }); logReadAheadPlayerAction('resumeReadAheadPlayback','Presentation',''); playReadAheadPresentation(); } function pauseReadAheadPresentation(){ $('#read_ahead_player_pause_play').each(function(){ $(this).find('.fa-pause').removeClass('fa-pause').addClass('fa-play'); $(this).off('click'); $(this).attr('onclick','resumeReadAheadPlayback()'); }); logReadAheadPlayerAction('pauseReadAheadPresentation','Presentation',''); read_ahead_pause(); } function endReadAheadPresentation(){ $('.fa-play').removeClass('fa-play').addClass('fa-repeat'); $('.fa-pause').removeClass('fa-pause').addClass('fa-repeat'); $('#read_ahead_player_pause_play').each(function(){ $(this).off('click'); $(this).attr('onclick','restartReadAheadPresentation()'); }); logReadAheadPlayerAction('endReadAheadPresentation','Presentation',''); logLTIEndPresentation(); } function playReadAheadPresentation(){ autoPlay=true; currentPosition--; logReadAheadPlayerAction('playReadAheadPresentation','Presentation',''); nextReadAheadPresentationItem(); } function startReadAheadStepper(timeDisplayWord){ clearInterval(readAheadPlayerTimer); readAheadPlayerTimer = setTimeout(function() { read_ahead_step(); },timeDisplayWord); } function stopReadAheadStepper(){ clearInterval(readAheadPlayerTimer); } function read_ahead_step(){ if (autoPlay) { nextReadAheadPresentationItem(); } } function read_ahead_pause(){ autoPlay=false; stopReadAheadStepper(); } function showReadAheadPresentationItem(index){ currentPosition = index; currentPresentationItem = presentation[currentPosition] != undefined ? presentation[currentPosition].trim() : ""; if (currentPresentationItem != "") { currentItemWordCount = presentation[currentPosition].replace("\n","").split(" ").length; if (currentPresentationItem.startsWith("")){ startReadAheadStepper(currentItemWordCount*timePerWord); $('#read_ahead_player_field').html('
'+currentPresentationItem+'
'); logReadAheadPlayerAction('showReadAheadPresentationItem','Word',currentPresentationItem); } else { startReadAheadStepper(currentItemWordCount*timePerPhraseWord); $('#read_ahead_player_field').html('
'+currentPresentationItem.replace("\n","
")+'
'); logReadAheadPlayerAction('showReadAheadPresentationItem','Phrase',''); } } else { if (currentPosition < totalPositions) { nextReadAheadPresentationItem(); } else { endReadAheadPresentation(); read_ahead_minimize(); } } currentReadAheadControls(); updateReadAheadSliderPosition(); saveReadAheadPosition(); } function priorReadAheadPresentationItem(){ stopReadAheadStepper(); logReadAheadPlayerAction('priorReadAheadPresentationItem','Controls',''); showReadAheadPresentationItem(currentPosition-1); } function nextReadAheadPresentationItem(){ stopReadAheadStepper(); logReadAheadPlayerAction('nextReadAheadPresentationItem','Controls',''); showReadAheadPresentationItem(currentPosition+1); } function read_ahead_playAgain(){ currentWordIndex = 0; logReadAheadPlayerAction('read_ahead_playAgain','Controls',''); playReadAheadPresentation(); } function read_ahead_minimize(){ setMinimized = true; logReadAheadPlayerAction('read_ahead_minimize','Controls',''); read_ahead_switch_min_max(); } function read_ahead_maximize(){ setMinimized = false; logReadAheadPlayerAction('read_ahead_maximize','Controls',''); read_ahead_switch_min_max(); } function read_ahead_switch_min_max(forceSwitch){ forceSwitch = forceSwitch != undefined ? forceSwitch : false; if (forceSwitch) { setMinimized = !setMinimized; } if (setMinimized) { $('#read_ahead_player_back').fadeOut(); $('#read_ahead_player').addClass('minimize'); $('.player-icons .fa-stack').removeClass('fa-lg').addClass('fa-sm'); $('.player-icons .fa-minus').removeClass('fa-minus').addClass('fa-expand'); logReadAheadPlayerAction('read_ahead_switch_min_max','Min',''); //$('#read_ahead_player_max_min').each(function(){ // $(this).off('click'); // $(this).attr('onclick','read_ahead_maximize()'); //}); } else { $('#read_ahead_player_back').fadeIn(); $('#read_ahead_player').removeClass('minimize'); $('.player-icons .fa-stack').removeClass('fa-sm').addClass('fa-lg'); $('.player-icons .fa-expand').removeClass('fa-expand').addClass('fa-minus'); logReadAheadPlayerAction('read_ahead_switch_min_max','Max',''); //$('#read_ahead_player_max_min').each(function(){ // $(this).off('click'); // $(this).attr('onclick','read_ahead_minimize()'); //}); } } function saveReadAheadPosition(){ $.ajax({ type:'POST', url:'/ajax/save_user_presentation_position.php', data: { 'id':1822, 'position': currentPosition } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); } function logLTIEndPresentation(action) { if (!logToLTI) { return; } $.ajax({ type:'POST', url:'/lti/presentationEnded.php', data: { 'documentId':1822, 'userId':0, } }) } function logReadAheadPlayerAction(action,area,details){ var d = new Date(); var t = d.getTime(); action = action != undefined ? action.trim() : 'UNKNOWN'; area = area != undefined ? area.trim() : ''; details = details != undefined ? details : ''; // If we are about to show a new word, increase the number of keywords // reinforced so we can log that for the Dashboard page. if (area == 'Word') { window.keywordCount++; } $.ajax({ type:'POST', url:'/logging/logPlayerAction.php', data: { 'documentId':1822, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }