var presentation = ["The Snow Queen<\/word>","journey<\/word>","iceman<\/word>","na\u00efve snowman<\/word>","trapped their kingdom<\/word>","Frozen<\/word>","musical fantasy film<\/word>","Walt Disney Animation Studios<\/word>","Hans Christian Andersen<\/word>","fairy tale<\/word>","fearless princess<\/word>","loyal reindeer<\/word>","estranged sister<\/word>","icy powers<\/word>","eternal winter<\/word>","Frozen<\/strong> is a 2013 American 3D computer-animated musical fantasy film<\/strong> produced by Walt Disney Animation Studios<\/strong>. it is inspired by Hans Christian Andersen<\/strong>'s 1844 fairy tale<\/strong> \"The Snow Queen<\/strong>\". It tells the story of a fearless princess<\/strong> who sets off on a journey<\/strong> alongside a rugged iceman<\/strong>, his loyal reindeer<\/strong>, and a na\u00efve snowman<\/strong> to find her estranged sister<\/strong>, whose icy powers<\/strong> have inadvertently trapped their kingdom<\/strong> in eternal winter<\/strong>.<\/phrase>","control and create ice and snow<\/word>","using her powers to play<\/word>","Elsa accidentally injures Anna<\/word>","Queen<\/word>","take both siblings to a colony of trolls<\/word>","heals Anna<\/word>","alters her memories<\/word>","she forgets about Elsa's magic<\/word>","warns Elsa<\/word>","learn to control her powers<\/word>","King and Queen isolate both sisters<\/word>","closing the castle gates<\/word>","protect her sister<\/word>","Elsa ceases all contact with Anna<\/word>","rift between them<\/word>","their parents are lost at sea<\/word>","Princess Elsa of Arendelle<\/word>","magical powers<\/word>","younger sister<\/word>","Anna<\/word>","her magic<\/word>","their parents<\/word>","King<\/word>","Grand Pabbie<\/word>","fear<\/word>","greatest enemy<\/word>","unpredictable powers<\/word>","Princess Elsa of Arendelle<\/strong> possesses magical powers<\/strong> that allow her to control and create ice and snow<\/strong>, often using her powers to play<\/strong> with her younger sister<\/strong>, Anna<\/strong>. After Elsa accidentally injures Anna<\/strong> with her magic<\/strong>, their parents<\/strong>, the King<\/strong> and Queen<\/strong>, take both siblings to a colony of trolls<\/strong> led by Grand Pabbie<\/strong>. He heals Anna<\/strong> but alters her memories<\/strong> so that she forgets about Elsa's magic<\/strong>. Grand Pabbie<\/strong> warns Elsa<\/strong> that she must learn to control her powers<\/strong> and that fear<\/strong> will be her greatest enemy<\/strong>. The King and Queen isolate both sisters<\/strong> within the castle, closing the castle gates<\/strong> to their subjects. To protect her sister<\/strong> from her increasingly unpredictable powers<\/strong>, Elsa ceases all contact with Anna<\/strong>, creating a rift between them<\/strong>. When the sisters are teenagers, their parents are lost at sea<\/strong> during a storm.<\/phrase>","Elsa is to be crowned queen of Arendelle<\/word>","afraid<\/word>","citizens might find out about her powers<\/word>","fear her<\/word>","castle gates open<\/word>","first time in years<\/word>","Anna falls in love with at first sight<\/word>","Elsa's coronation takes place<\/word>","she remains distant from Anna<\/word>","Anna and Hans develop a romantic connection<\/word>","he impulsively proposes to her<\/word>","Elsa objects<\/word>","seek her blessing<\/word>","Anna protests<\/word>","Elsa to explain her fear and isolation<\/word>","Elsa to accidentally unleash her powers<\/word>","Branded a monster<\/word>","Elsa flees to the North Mountain<\/word>","building an ice palace<\/word>","engulfs Arendelle in an eternal winter<\/word>","21st birthday<\/word>","Duke of Weselton<\/word>","Prince Hans of the Southern Isles<\/word>","coronation festivities<\/word>","live<\/word>","hermit life<\/word>","her magic<\/word>","Following her 21st birthday<\/strong>, Elsa is to be crowned queen of Arendelle<\/strong>. She is afraid<\/strong> that the kingdom's citizens might find out about her powers<\/strong> and fear her<\/strong>. The castle gates open<\/strong> to the public and visiting dignitaries for the first time in years<\/strong>. Among them are the scheming Duke of Weselton<\/strong> and the dashing Prince Hans of the Southern Isles<\/strong>, with whom Anna falls in love with at first sight<\/strong>. Elsa's coronation takes place<\/strong> without incident, but she remains distant from Anna<\/strong>. Anna and Hans develop a romantic connection<\/strong> during the coronation festivities<\/strong>, and he impulsively proposes to her<\/strong>, but Elsa objects<\/strong> when they seek her blessing<\/strong>. Hurt and confused, Anna protests<\/strong>, begging Elsa to explain her fear and isolation<\/strong>. The emotional strain causes Elsa to accidentally unleash her powers<\/strong> before the court. Branded a monster<\/strong> by the Duke, Elsa flees to the North Mountain<\/strong>, where she finally acknowledges her powers, building an ice palace<\/strong> to live<\/strong> a hermit life<\/strong>. In the process, her magic<\/strong> unintentionally engulfs Arendelle in an eternal winter<\/strong>.<\/phrase>","ventures out to find Elsa<\/word>","end the winter<\/word>","leaving Hans in command<\/word>","collecting supplies<\/word>","Wandering Oaken's shop<\/word>","iceman<\/word>","attack by wolves<\/word>","Kristoff's sleigh being destroyed<\/word>","brought to life<\/word>","offers to lead them to her<\/word>","Anna's horse returns to Arendelle without her<\/word>","Hans sets out to find Anna and Elsa<\/word>","Duke's minions<\/word>","orders to kill Elsa<\/word>","Anna<\/word>","Kristoff<\/word>","his reindeer<\/word>","Sven<\/word>","Olaf<\/word>","cheerful snowman<\/word>","Anna<\/strong> ventures out to find Elsa<\/strong> and end the winter<\/strong>, leaving Hans in command<\/strong>. She gets lost, collecting supplies<\/strong> at Wandering Oaken's shop<\/strong>. She meets an iceman<\/strong> named Kristoff<\/strong> and his reindeer<\/strong>, Sven<\/strong>, convincing them to take her to the mountains. An attack by wolves<\/strong> leads to Kristoff's sleigh being destroyed<\/strong>. On foot, they meet Olaf<\/strong>, a cheerful snowman<\/strong> brought to life<\/strong> unknowingly by Elsa, who offers to lead them to her<\/strong>. When Anna's horse returns to Arendelle without her<\/strong>, Hans sets out to find Anna and Elsa<\/strong>, accompanied by the Duke's minions<\/strong>, who have secret orders to kill Elsa<\/strong>.<\/phrase>","meets Elsa<\/word>","Elsa confesses she does not know how to undo her magic<\/word>","accidentally freezes Anna's heart<\/word>","injuring her<\/word>","creates a giant snow monster<\/word>","chases Anna, Kristoff, and Olaf away<\/word>","Kristoff takes her to the trolls<\/word>","reveals that Anna will freeze solid<\/word>","unless an act of true love reverses the spell<\/word>","ice palace<\/word>","Anna<\/word>","Her fear<\/word>","Marshmallow<\/word>","Grand Pabbie<\/word>","Reaching the ice palace<\/strong>, Anna<\/strong> meets Elsa<\/strong>. When Anna<\/strong> reveals what has become of Arendelle, a horrified Elsa confesses she does not know how to undo her magic<\/strong>. Her fear<\/strong> causes her powers to manifest themselves once more, and she accidentally freezes Anna's heart<\/strong>, seriously injuring her<\/strong>. Elsa then creates a giant snow monster<\/strong> named Marshmallow<\/strong>, who chases Anna, Kristoff, and Olaf away<\/strong>. Realizing the effects of Elsa's spell on Anna<\/strong>, Kristoff takes her to the trolls<\/strong>, his adoptive family. Grand Pabbie<\/strong> reveals that Anna will freeze solid<\/strong> unless an act of true love reverses the spell<\/strong>.<\/phrase>","Kristoff races Anna back home<\/word>","Hans can give her true love's kiss<\/word>","defeating Marshmallow<\/word>","capturing Elsa<\/word>","Anna is delivered to Hans<\/word>","Hans instead reveals<\/word>","plotting to seize the throne of Arendelle<\/word>","eliminating both sisters<\/word>","Hans locks Anna in a room to die<\/word>","manipulates the dignitaries<\/word>","believing that Elsa killed her<\/word>","not before they were married<\/word>","orders the queen's execution<\/word>","escaped her detention cell<\/word>","Kristoff races Anna back home<\/strong> so Hans can give her true love's kiss<\/strong>. Hans and his men reach Elsa's palace, defeating Marshmallow<\/strong> and capturing Elsa<\/strong>. Anna is delivered to Hans<\/strong>, but rather than kissing her, Hans instead reveals<\/strong> that he has actually been plotting to seize the throne of Arendelle<\/strong> by eliminating both sisters<\/strong>. Hans locks Anna in a room to die<\/strong> and then manipulates the dignitaries<\/strong> into believing that Elsa killed her<\/strong>, but not before they were married<\/strong>. He orders the queen's execution<\/strong>, only to discover she has escaped her detention cell<\/strong>.<\/phrase>","Olaf frees Anna<\/word>","venture into the blizzard<\/word>","meet Kristoff<\/word>","revealed is in love with her<\/word>","Hans confronts Elsa<\/word>","claiming that she killed Anna<\/word>","Elsa to break down<\/word>","stop the storm<\/word>","Anna spots Hans about to kill Elsa<\/word>","she leaps in the way<\/word>","freezes solid<\/word>","stopping Hans<\/word>","Elsa hugs and mourns over her sister<\/word>","thaws out<\/word>","heroism constituting an act of true love<\/word>","Olaf<\/word>","Olaf frees Anna<\/strong>, and they venture into the blizzard<\/strong> outside to meet Kristoff<\/strong>, who Olaf<\/strong> has revealed is in love with her<\/strong>. Hans confronts Elsa<\/strong> outside, claiming that she killed Anna<\/strong>, causing Elsa to break down<\/strong> and abruptly stop the storm<\/strong>. Anna spots Hans about to kill Elsa<\/strong>; she leaps in the way<\/strong> and freezes solid<\/strong>, stopping Hans<\/strong>. Devastated, Elsa hugs and mourns over her sister<\/strong>, who thaws out<\/strong>, her heroism constituting an act of true love<\/strong>.<\/phrase>","love is the key to controlling her magic<\/word>","Elsa ends the winter<\/word>","gives Olaf his own snow flurry<\/word>","survive the warmer climate<\/word>","Hans is arrested<\/word>","exiled<\/word>","for his attempted assassination<\/word>","Duke's trade links<\/word>","cut off<\/word>","Anna gives Kristoff a new sleigh<\/word>","two kiss<\/word>","sisters are reunited<\/word>","Elsa promises never to lock the castle gates again<\/word>","Realizing that love is the key to controlling her magic<\/strong>, Elsa ends the winter<\/strong> and gives Olaf his own snow flurry<\/strong> to survive the warmer climate<\/strong>. Hans is arrested<\/strong> and exiled<\/strong> from the kingdom for his attempted assassination<\/strong>, while the Duke's trade links<\/strong> with Arendelle are cut off<\/strong>. Anna gives Kristoff a new sleigh<\/strong>, and the two kiss<\/strong>. The sisters are reunited<\/strong>, and Elsa promises never to lock the castle gates again<\/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':2305, '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':2305, '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':2305, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }