var presentation = ["based on the 1923 book Bambi, a Life in the Woods<\/word>","Bambi<\/word>","drama film<\/word>","Walt Disney<\/word>","Felix Salten<\/word>","Bambi<\/strong> is a 1942 American animated drama film<\/strong> produced by Walt Disney<\/strong> and based on the 1923 book Bambi, a Life in the Woods<\/strong> by Felix Salten<\/strong>.<\/phrase>","main characters<\/word>","Bambi<\/word>","white-tailed deer<\/word>","his parents<\/word>","Great Prince of the forest<\/word>","unnamed mother<\/word>","his friends<\/word>","Thumper<\/word>","Flower<\/word>","his childhood<\/word>","future mate<\/word>","Faline<\/word>","The main characters<\/strong> are Bambi<\/strong>, a white-tailed deer<\/strong>; his parents<\/strong> (the Great Prince of the forest<\/strong> and his unnamed mother<\/strong>); his friends<\/strong> Thumper<\/strong>; and Flower<\/strong>; and his childhood<\/strong> friend and future mate<\/strong>, Faline<\/strong>.<\/phrase>","doe gives birth to a fawn<\/word>","one day take over the position<\/word>","title currently held by Bambi's father<\/word>","guards the woodland creatures<\/word>","dangers of hunters<\/word>","quickly befriended<\/word>","helps to teach him to walk and speak<\/word>","attached to his mother<\/word>","spends most of his time<\/word>","Bambi<\/word>","Great Prince of the forest<\/word>","energetic rabbit<\/word>","Thumper<\/word>","other friends<\/word>","young skunk<\/word>","Flower<\/word>","female fawn<\/word>","Faline<\/word>","A doe gives birth to a fawn<\/strong> named Bambi<\/strong>, who will one day take over the position<\/strong> of Great Prince of the forest<\/strong>, a title currently held by Bambi's father<\/strong>, who guards the woodland creatures<\/strong> against the dangers of hunters<\/strong>. The fawn is quickly befriended<\/strong> by an eager, energetic rabbit<\/strong> named Thumper<\/strong>, who helps to teach him to walk and speak<\/strong>. Bambi<\/strong> grows up very attached to his mother<\/strong>, with whom he spends most of his time<\/strong>. He soon makes other friends<\/strong>, including a young skunk<\/strong> named Flower<\/strong> and a female fawn<\/strong> named Faline<\/strong>.<\/phrase>","inquisitive<\/word>","Bambi frequently asks about the world around him<\/word>","cautioned about the dangers of life<\/word>","does not realize that he is his father<\/word>","is coming<\/word>","get everyone to safety<\/word>","Bambi is briefly separated from his mother<\/word>","escorted to her by the Great Prince<\/word>","make it back in the forest<\/word>","Man fires his gun<\/word>","Curious<\/word>","forest creature<\/word>","Bambi<\/word>","Great Prince<\/word>","human hunter<\/word>","Man<\/word>","Curious<\/strong> and inquisitive<\/strong>, Bambi frequently asks about the world around him<\/strong> and is cautioned about the dangers of life<\/strong> as a forest creature<\/strong> by his loving mother. One day out in a meadow, Bambi<\/strong> briefly sees The Great Prince<\/strong> but does not realize that he is his father<\/strong>. As the Great Prince<\/strong> wanders uphill, he discovers the human hunter<\/strong> named Man<\/strong> by all the animals is coming<\/strong> and rushes down to the meadow to get everyone to safety<\/strong>. Bambi is briefly separated from his mother<\/strong> during that time but is escorted to her by the Great Prince<\/strong> as the three of them make it back in the forest<\/strong> just as Man fires his gun<\/strong>.<\/phrase>","Bambi's first winter<\/word>","he and Thumper play in the snow<\/word>","Flower hibernates<\/word>","his mother takes him along to find food<\/word>","Man shows up again<\/word>","his mother is shot and killed by the hunter<\/word>","mournful<\/word>","alone<\/word>","Great Prince leads Bambi home<\/word>","reveals to him that he is his father<\/word>","escape<\/word>","During Bambi's first winter<\/strong>, he and Thumper play in the snow<\/strong> while Flower hibernates<\/strong>. One day his mother takes him along to find food<\/strong> when Man shows up again<\/strong>. As they escape<\/strong> his mother is shot and killed by the hunter<\/strong>, leaving the little fawn mournful<\/strong> and alone<\/strong>. Taking pity on his abandoned son, the Great Prince leads Bambi home<\/strong> as he reveals to him that he is his father<\/strong>.<\/phrase>","Bambi has matured into a young stag<\/word>","his childhood friends have entered young adulthood as well<\/word>","warned of twitterpation<\/word>","eventually fall in love<\/word>","view the concept of romance with scorn<\/word>","Thumper and Flower soon encounter their beautiful romantic counterparts<\/word>","Bambi himself encounters Faline as a beautiful doe<\/word>","courtship is quickly interrupted<\/word>","challenged by a belligerent older stag<\/word>","force Faline away from Bambi<\/word>","Bambi successfully manages to defeat Ronno in battle<\/word>","Friend Owl<\/word>","Ronno<\/word>","Next year, Bambi has matured into a young stag<\/strong>, and his childhood friends have entered young adulthood as well<\/strong>. They are warned of twitterpation<\/strong> by Friend Owl<\/strong> and that they will eventually fall in love<\/strong>, although the trio view the concept of romance with scorn<\/strong>. However, Thumper and Flower soon encounter their beautiful romantic counterparts<\/strong> and abandon their former thoughts on love. Bambi himself encounters Faline as a beautiful doe<\/strong>. However, their courtship is quickly interrupted<\/strong> and challenged by a belligerent older stag<\/strong> named Ronno<\/strong>, who attempts to force Faline away from Bambi<\/strong>. Bambi successfully manages to defeat Ronno in battle<\/strong> and earn the rights to the doe's affections.<\/phrase>","Bambi is awakened<\/word>","smell of smoke<\/word>","hunter camp<\/word>","warned by his father<\/word>","Man has returned<\/word>","The two flee to safety<\/word>","Bambi is separated from Faline<\/word>","searches for her<\/word>","cornered by Man's vicious hunting dogs<\/word>","manages to ward off<\/word>","Bambi escapes<\/word>","shot by a hunter<\/word>","Man's camp<\/word>","campfire suddenly spreads<\/word>","resulting in a wildfire<\/word>","manage to reach shelter on a riverbank<\/word>","Faline gives birth to twins under Bambi's watchful eye<\/word>","Bambi<\/word>","fear<\/word>","his father<\/word>","Faline<\/word>","Great Prince of the forest<\/word>","Bambi is awakened<\/strong> afterward by the smell of smoke<\/strong>; he follows it and discovers it leads to a hunter camp<\/strong>. Bambi<\/strong> is warned by his father<\/strong> that Man has returned<\/strong> with more hunters. The two flee to safety<\/strong>, although Bambi is separated from Faline<\/strong> in the turmoil and searches for her<\/strong> along the way. He soon finds her cornered by Man's vicious hunting dogs<\/strong>, which he manages to ward off<\/strong>. Bambi escapes<\/strong> them and is shot by a hunter<\/strong>. Meanwhile, at the Man's camp<\/strong>, their campfire suddenly spreads<\/strong> into the forest, resulting in a wildfire<\/strong> from which the forest residents flee in fear<\/strong>. Bambi<\/strong>, his father<\/strong>, Faline<\/strong>, and the forest animals manage to reach shelter on a riverbank<\/strong>. The following spring, Faline gives birth to twins under Bambi's watchful eye<\/strong> as the new Great Prince of the forest<\/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':2241, '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':2241, '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':2241, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }