var presentation = ["Beauty and the Beast<\/word>","animated musical romantic fantasy film<\/word>","based on<\/word>","French fairy tale<\/word>","magically transformed into a monster<\/word>","punishment for his arrogance<\/word>","imprisons in his castle<\/word>","break the curse<\/word>","Beast must learn to love Belle<\/word>","earn her love<\/word>","before the last petal falls<\/word>","enchanted rose<\/word>","else the Beast will remain a monster forever<\/word>","Walt Disney Feature Animation<\/word>","Walt Disney Pictures<\/word>","same name<\/word>","Jeanne-Marie Leprince de Beaumont<\/word>","Beast<\/word>","his servants<\/word>","household objects<\/word>","Belle<\/word>","young woman<\/word>","return<\/word>","Beauty and the Beast<\/strong> is a 1991 American animated musical romantic fantasy film<\/strong> produced by Walt Disney Feature Animation<\/strong> and released by Walt Disney Pictures<\/strong>. It is based on<\/strong> the 1756 French fairy tale<\/strong> of the same name<\/strong> by Jeanne-Marie Leprince de Beaumont<\/strong>. Beauty and the Beast<\/strong> focuses on the relationship between the Beast<\/strong>, a prince who is magically transformed into a monster<\/strong> and his servants<\/strong> into household objects<\/strong> as punishment for his arrogance<\/strong>, and Belle<\/strong>, a young woman<\/strong> whom he imprisons in his castle<\/strong>. To break the curse<\/strong>, Beast must learn to love Belle<\/strong> and earn her love<\/strong> in return<\/strong> before the last petal falls<\/strong> from an enchanted rose<\/strong> or else the Beast will remain a monster forever<\/strong>.<\/phrase>","enchantress disguised as an old beggar woman<\/word>","offers a rose<\/word>","cruel and selfish prince<\/word>","exchange for shelter<\/word>","he refuses<\/word>","reveals her identity<\/word>","As punishment<\/word>","enchantress transforms him into a beast<\/word>","casts a spell on the rose<\/word>","warns the prince<\/word>","spell will only be broken if he learns to love another<\/word>","loved in return<\/word>","before the last petal falls<\/word>","his servants<\/word>","household objects<\/word>","remain<\/word>","beast forever<\/word>","An enchantress disguised as an old beggar woman<\/strong> offers a rose<\/strong> to a cruel and selfish prince<\/strong> in exchange for shelter<\/strong> from a storm. When he refuses<\/strong>, she reveals her identity<\/strong>. As punishment<\/strong> for the prince's lack of compassion, the enchantress transforms him into a beast<\/strong> and his servants<\/strong> into household objects<\/strong>. She casts a spell on the rose<\/strong> and warns the prince<\/strong> that the spell will only be broken if he learns to love another<\/strong>, and be loved in return<\/strong>, before the last petal falls<\/strong>, or he will remain<\/strong> a beast forever<\/strong>.<\/phrase>","Maurice<\/word>","dreams of adventure<\/word>","his way to a fair<\/word>","showcase his latest invention<\/word>","Maurice gets lost<\/word>","seeks refuge in the Beast's castle<\/word>","Beast imprisons him for trespassing<\/word>","Maurice's horse returns without him<\/word>","Belle ventures out in search for him<\/word>","Beast agrees to free Maurice<\/word>","take his place as prisoner<\/word>","nearby village<\/word>","Belle<\/word>","book-loving daughter<\/word>","eccentric inventor<\/word>","castle dungeon<\/word>","Some years later, in a nearby village<\/strong>, Belle<\/strong>, the book-loving daughter<\/strong> of an eccentric inventor<\/strong> named Maurice<\/strong>, dreams of adventure<\/strong>. On his way to a fair<\/strong> to showcase his latest invention<\/strong>, Maurice gets lost<\/strong> in the forest, and seeks refuge in the Beast's castle<\/strong>, but the Beast imprisons him for trespassing<\/strong>. When Maurice's horse returns without him<\/strong>, Belle ventures out in search for him<\/strong>, and finds him locked in the castle dungeon<\/strong>. The Beast agrees to free Maurice<\/strong> if she will take his place as prisoner<\/strong>.<\/phrase>","Belle befriends the castle's servants<\/word>","Lumi\u00e8re<\/word>","candelabra<\/word>","clock<\/word>","teapot<\/word>","teacup<\/word>","serve her a spectacular dinner<\/word>","wanders into the forbidden west wing<\/word>","enraged Beast scares her<\/word>","into fleeing the castle<\/word>","ambushed by a pack of wolves<\/word>","Beast rescues her<\/word>","injured in the process<\/word>","Belle nurses his wounds<\/word>","friendship develops<\/word>","begin to fall in love<\/word>","Cogsworth<\/word>","Mrs Potts<\/word>","her son<\/word>","Chip<\/word>","Belle befriends the castle's servants<\/strong>; Lumi\u00e8re<\/strong> the candelabra<\/strong>, Cogsworth<\/strong> the clock<\/strong>, Mrs Potts<\/strong> the teapot<\/strong>, and her son<\/strong> Chip<\/strong>, the teacup<\/strong>; they serve her a spectacular dinner<\/strong>. When she wanders into the forbidden west wing<\/strong> and finds the rose, the enraged Beast scares her<\/strong> into fleeing the castle<\/strong>. In the woods, she is ambushed by a pack of wolves<\/strong>, but the Beast rescues her<\/strong>, and is injured in the process<\/strong>. As Belle nurses his wounds<\/strong>, a friendship develops<\/strong> between them, and they begin to fall in love<\/strong>.<\/phrase>","Maurice returns to the village<\/word>","fails to convince the townsfolk of Belle's predicament<\/word>","Maurice<\/word>","Gaston hatches a plan<\/word>","bribes Monsieur D'Arque<\/word>","warden of the town's insane asylum<\/word>","have Maurice locked up as a lunatic<\/word>","no one to support her<\/word>","have no choice but to marry Gaston<\/word>","Maurice leaves for the castle to attempt a rescue<\/word>","Beast<\/word>","Belle<\/word>","Meanwhile, Maurice returns to the village<\/strong> and fails to convince the townsfolk of Belle's predicament<\/strong>. Hearing Maurice<\/strong>'s statements about the Beast<\/strong>, Gaston hatches a plan<\/strong>; He bribes Monsieur D'Arque<\/strong>, the warden of the town's insane asylum<\/strong>, to have Maurice locked up as a lunatic<\/strong>. With no one to support her<\/strong>, Belle<\/strong> would then have no choice but to marry Gaston<\/strong>. Before they can act, however, Maurice leaves for the castle to attempt a rescue<\/strong> alone.<\/phrase>","sharing a romantic dance<\/word>","check on her father<\/word>","sees him collapsing in the woods<\/word>","Beast releases her to save Maurice<\/word>","giving her the mirror<\/word>","Belle takes her father to the village<\/word>","villagers led by Gaston arrive to arrest Maurice<\/word>","uses the mirror<\/word>","show the Beast to the townsfolk<\/word>","proving her father's sanity<\/word>","Gaston has her and her father locked in the basement<\/word>","rallies the villagers<\/word>","to the castle to slay the Beast<\/word>","help of Chip<\/word>","Maurice's wood-chopping machine<\/word>","Maurice<\/word>","rush back to the castle<\/word>","Beast<\/word>","Belle<\/word>","magic mirror<\/word>","follow<\/word>","escape<\/word>","After sharing a romantic dance<\/strong> with the Beast<\/strong>, Belle<\/strong> uses the Beast<\/strong>'s magic mirror<\/strong> to check on her father<\/strong> and sees him collapsing in the woods<\/strong>. The Beast releases her to save Maurice<\/strong>, giving her the mirror<\/strong> as a souvenir. After Belle takes her father to the village<\/strong>, a band of villagers led by Gaston arrive to arrest Maurice<\/strong>. Belle<\/strong> uses the mirror<\/strong> to show the Beast to the townsfolk<\/strong>, proving her father's sanity<\/strong>. Realizing that Belle<\/strong> loves the Beast<\/strong>, a jealous Gaston has her and her father locked in the basement<\/strong>. He rallies the villagers<\/strong> to follow<\/strong> him to the castle to slay the Beast<\/strong>. With the help of Chip<\/strong> (who arrived at their house as a stowaway) and Maurice's wood-chopping machine<\/strong>, Maurice<\/strong> and Belle<\/strong> escape<\/strong>, and then rush back to the castle<\/strong>.<\/phrase>","Beast's servants fend off the villagers<\/word>","Gaston attacks the Beast<\/word>","heartbroken from Belle's departure<\/word>","regains his spirit<\/word>","seeing Belle return<\/word>","defeats Gaston<\/word>","spares his life<\/word>","reuniting with Belle<\/word>","Gaston treacherously stabs the Beast with a knife<\/word>","falls to his death<\/word>","Beast dies in Belle's arms<\/word>","before the last petal falls<\/word>","Belle tearfully professes her love to the Beast<\/word>","spell is undone<\/word>","reviving the Beast<\/word>","restoring his human form<\/word>","Prince and Belle host a ball<\/word>","dance happily<\/word>","battle<\/word>","his servants<\/word>","his castle<\/word>","During the battle<\/strong>, the Beast's servants fend off the villagers<\/strong>. Gaston attacks the Beast<\/strong> in his tower, who is too heartbroken from Belle's departure<\/strong> to fight back, but regains his spirit<\/strong> upon seeing Belle return<\/strong>. He defeats Gaston<\/strong>, but spares his life<\/strong> before reuniting with Belle<\/strong>. However, Gaston treacherously stabs the Beast with a knife<\/strong> and falls to his death<\/strong> after losing his footing. The Beast dies in Belle's arms<\/strong> before the last petal falls<\/strong>. Belle tearfully professes her love to the Beast<\/strong> and the spell is undone<\/strong>, reviving the Beast<\/strong> and restoring his human form<\/strong> along with all his servants<\/strong> and his castle<\/strong>. The Prince and Belle host a ball<\/strong> for the kingdom, where they dance happily<\/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':2275, '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':2275, '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':2275, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }