var presentation = ["Anastasia<\/word>","based on the 1997 film<\/word>","Grand Duchess Anastasia<\/word>","escaped the execution<\/word>","amnesiac orphan named Anya<\/word>","find some trace of her family<\/word>","wish to take advantage<\/word>","likeness to the Grand Duchess<\/word>","same name<\/word>","her family<\/word>","con men<\/word>","Anastasia<\/strong> is a musical based on the 1997 film<\/strong> of the same name<\/strong>. The musical adapts the legend of Grand Duchess Anastasia<\/strong> of Russia, who could have escaped the execution<\/strong> of her family<\/strong>. Years later, an amnesiac orphan named Anya<\/strong> hopes to find some trace of her family<\/strong> by siding with two con men<\/strong> who wish to take advantage<\/strong> of her likeness to the Grand Duchess<\/strong>.<\/phrase>","St. Petersburg, Russia<\/word>","Dowager Empress<\/word>","Grand Duchess Anastasia<\/word>","moving to Paris<\/word>","gives<\/word>","Anastasia<\/word>","Prologue: Once Upon a December<\/word>","Eleven years later<\/word>","ball with her family<\/word>","Bolsheviks invade<\/word>","shot at and captured<\/word>","rest of her family<\/word>","The Last Dance of the Romanovs<\/word>","entire family has been executed<\/word>","youngest granddaughter<\/word>","her grandmother<\/word>","music box<\/word>","parting gift<\/word>","Romanovs<\/word>","attempt<\/word>","escape<\/word>","In 1906 St. Petersburg, Russia<\/strong>, the Dowager Empress<\/strong> comforts her youngest granddaughter<\/strong>, 5-year-old Grand Duchess Anastasia<\/strong>, who is saddened by the fact that her grandmother<\/strong> is moving to Paris<\/strong>, France. Before leaving, the Dowager Empress<\/strong> gives<\/strong> Anastasia<\/strong> a music box<\/strong> as a parting gift<\/strong> (\"Prologue: Once Upon a December<\/strong>\"). Eleven years later<\/strong>, Anastasia<\/strong> is attending a ball with her family<\/strong> when the Bolsheviks invade<\/strong> the palace. As the Romanovs<\/strong> attempt<\/strong> to escape<\/strong>, Anastasia<\/strong> tries to retrieve her music box<\/strong>, only to be shot at and captured<\/strong>, along with the rest of her family<\/strong> (\"The Last Dance of the Romanovs<\/strong>\"). The Dowager Empress<\/strong> later receives word in Paris that the entire family has been executed<\/strong>.<\/phrase>","general<\/word>","renamed<\/word>","Russians protest<\/word>","uplifted by a rumor<\/word>","Anastasia<\/word>","may have survived<\/word>","handsome young Dmitry<\/word>","ex-member<\/word>","biggest con in history<\/word>","groom a na\u00efve girl to become Anastasia<\/word>","extract money<\/word>","Dowager Empress<\/word>","A Rumor in St. Petersburg<\/word>","Gleb Vaganov<\/word>","Bolsheviks<\/word>","Saint Petersburg<\/word>","Leningrad<\/word>","peaceful future<\/word>","con men<\/word>","Imperial Court<\/word>","Vlad Popov<\/word>","In 1927, Gleb Vaganov<\/strong>, a general<\/strong> for the Bolsheviks<\/strong> who now control Russia, announces to the gloomy Russians that the now-poor Saint Petersburg<\/strong> has been renamed<\/strong> Leningrad<\/strong>, and he promises a bright and peaceful future<\/strong>. The Russians protest<\/strong> this change, but are uplifted by a rumor<\/strong> that Anastasia<\/strong> may have survived<\/strong> the Bolshevik's attacks. Two wanted con men<\/strong>, the handsome young Dmitry<\/strong> and an ex-member<\/strong> of the Imperial Court<\/strong> named Vlad Popov<\/strong>, hear the rumors and brainstorm the biggest con in history<\/strong>-- they will groom a na\u00efve girl to become Anastasia<\/strong> in order to extract money<\/strong> from the Dowager Empress<\/strong> (\"A Rumor in St. Petersburg<\/strong>\").<\/phrase>","give up hope<\/word>","street sweeper named Anya<\/word>","ask Dmitry<\/word>","tickets for Paris<\/word>","In My Dreams<\/word>","memory loss<\/word>","resemblance to Anastasia<\/word>","select Anya as their impostor<\/word>","unsuccessful auditions<\/word>","Yusupov Palace<\/word>","suitable impostor<\/word>","become fascinated<\/word>","her amnesia<\/word>","few memories<\/word>","her past<\/word>","Dmitry and Vlad hold unsuccessful auditions<\/strong> for the scheme at the theater in the abandoned Yusupov Palace<\/strong>. Just as they are about to give up hope<\/strong> of finding a suitable impostor<\/strong>, a street sweeper named Anya<\/strong> walks in to ask Dmitry<\/strong> about paperwork to get tickets for Paris<\/strong>. Dmitry and Vlad become fascinated<\/strong> as Anya explains that she doesn't remember who she is due to her amnesia<\/strong> and has very few memories<\/strong> of her past<\/strong> (\"In My Dreams<\/strong>\"). Amazed by her memory loss<\/strong> and resemblance to Anastasia<\/strong>, they select Anya as their impostor<\/strong>.<\/phrase>","plot to Gleb<\/word>","dismisses them<\/word>","The Rumors Never End<\/word>","Vlad and Dmitry groom a feisty Anya<\/word>","become Anastasia<\/word>","Learn to Do It<\/word>","government workers<\/word>","rumors and reports<\/word>","further action<\/word>","bitter actresses report<\/word>","At the capital, government workers<\/strong> sort through rumors and reports<\/strong> for any that require further action<\/strong>. Three bitter actresses report<\/strong> Anya, Dmitry, and Vlad's plot to Gleb<\/strong>, but he dismisses them<\/strong> and files a case for Anya (\"The Rumors Never End<\/strong>\"). Back at the palace, Vlad and Dmitry groom a feisty Anya<\/strong> to become Anastasia<\/strong> through history, dining, and dancing lessons (\"Learn to Do It<\/strong>\").<\/phrase>","Gleb orders Anya's arrest<\/word>","general interrogates the girl<\/word>","Anastasia<\/word>","Gleb notices that Anya has the Romanov eyes<\/word>","could indeed be Anastasia<\/word>","harbors feelings for her<\/word>","lets her off with a warning<\/word>","The Neva Flows<\/word>","Nevsky Prospect<\/word>","his father<\/word>","Romanovs<\/word>","Gleb orders Anya's arrest<\/strong>, and she is brought to his office in the Nevsky Prospect<\/strong>. The general interrogates the girl<\/strong> and warns her about the consequences of pretending to be Anastasia<\/strong>. He tries to convince her that Anastasia<\/strong> is really dead. He reveals that his father<\/strong> was one of the soldiers who shot the Romanovs<\/strong> and, as a boy, Gleb heard the gunshots and the family's screams. However, Gleb notices that Anya has the Romanov eyes<\/strong> and realizes that Anya could indeed be Anastasia<\/strong>. As he harbors feelings for her<\/strong>, he lets her off with a warning<\/strong> (\"The Neva Flows<\/strong>\").<\/phrase>","Anya reunites with Dmitry<\/word>","attacked<\/word>","The Neva Flows Reprise<\/word>","Dmitry opens up<\/word>","take care of himself as an orphan<\/word>","given to Anastasia<\/word>","Dowager Empress<\/word>","Once Upon a December<\/word>","don't have enough money<\/word>","gives him<\/word>","diamond<\/word>","sewn to her dress<\/word>","A Secret She Kept<\/word>","old con partners<\/word>","fighting skills<\/word>","time<\/word>","his childhood<\/word>","My Petersburg<\/word>","trust<\/word>","music box<\/word>","box<\/word>","vaguely remember<\/word>","her past<\/word>","train tickets<\/word>","prized possession<\/word>","found<\/word>","Anya reunites with Dmitry<\/strong> and they are teased and attacked<\/strong> by his old con partners<\/strong>, whom they must fight off (\"The Neva Flows Reprise<\/strong>\"). Impressed by Anya's fighting skills<\/strong>, Dmitry opens up<\/strong> to her for the first time<\/strong> and tells her about his childhood<\/strong> in the streets of St. Petersburg and how he had to take care of himself as an orphan<\/strong> (\"My Petersburg<\/strong>\"). Dmitry begins to trust<\/strong> her enough to show her a music box<\/strong> that he's failed to open, unaware it is the memento that was given to Anastasia<\/strong> by the Dowager Empress<\/strong>. Anya easily winds and opens the box<\/strong> and begins to vaguely remember<\/strong> her past<\/strong>, including an imperial ball many years earlier (\"Once Upon a December<\/strong>\"). After this episode, Anya is more resolute than ever in her desire to get to Paris, but Dmitry tells her that they don't have enough money<\/strong> to buy the train tickets<\/strong>. Then she gives him<\/strong> her most prized possession<\/strong>, a diamond<\/strong> that was found<\/strong> sewn to her dress<\/strong> when she was discovered years earlier (\"A Secret She Kept<\/strong>\").<\/phrase>","recognizes Anya as Anastasia<\/word>","board the train to Paris<\/word>","prayer of farewell to Russia<\/word>","Stay, I Pray You<\/word>","hope to accomplish<\/word>","Anastasia<\/word>","Dmitry's desire for the money<\/word>","Vlad hoping to win back<\/word>","Dowager Empress's lady-in-waiting<\/word>","We'll Go From There<\/word>","Count Ipolitov is fatally shot<\/word>","narrowly avoiding capture<\/word>","train station<\/word>","Count Ipolitov<\/word>","hand<\/word>","train ride<\/word>","discover<\/word>","Countess Lily<\/word>","illegally boarding<\/word>","train<\/word>","wanted criminals<\/word>","jump<\/word>","At the train station<\/strong>, Count Ipolitov<\/strong> recognizes Anya as Anastasia<\/strong> and kisses her hand<\/strong>. As they board the train to Paris<\/strong>, Count Ipolitov<\/strong> leads everyone in a prayer of farewell to Russia<\/strong> (\"Stay, I Pray You<\/strong>\"). During the train ride<\/strong>, Anya, Dmitry, and Vlad reflect on what they hope to accomplish<\/strong> in Paris-- Anya hoping to discover<\/strong> that she is actually Anastasia<\/strong>, Dmitry's desire for the money<\/strong>, and Vlad hoping to win back<\/strong> Countess Lily<\/strong>, the Dowager Empress's lady-in-waiting<\/strong> with whom he had an affair (\"We'll Go From There<\/strong>\"). Count Ipolitov is fatally shot<\/strong> by the police for illegally boarding<\/strong> the train<\/strong>. The police officers then go after Anya, Dmitry, and Vlad since they are wanted criminals<\/strong> in Russia, but they all jump<\/strong> off the train<\/strong>, narrowly avoiding capture<\/strong>.<\/phrase>","Gleb receives orders<\/word>","follow Anya and kill her<\/word>","Anastasia<\/word>","Traveling Sequence<\/word>","Gleb agrees<\/word>","realizes that he is in love with Anya<\/word>","questions his heart<\/word>","Still<\/word>","arrive in France<\/word>","courage to continue on<\/word>","finally discover who she is<\/word>","Journey to the Past<\/word>","travel<\/word>","hope<\/word>","As they travel<\/strong> across Russia by foot, Gleb receives orders<\/strong> to follow Anya and kill her<\/strong> if she is the real Anastasia<\/strong> (\"Traveling Sequence<\/strong>\"). Gleb agrees<\/strong> to the task, but he realizes that he is in love with Anya<\/strong> and questions his heart<\/strong> (\"Still<\/strong>\"). Anya, Vlad, and Dmitry finally arrive in France<\/strong>, and as they travel<\/strong> to Paris, Anya summons the courage to continue on<\/strong> with the hope<\/strong> that she will finally discover who she is<\/strong> (\"Journey to the Past<\/strong>\").<\/phrase>","arrive in Paris<\/word>","swept up<\/word>","Paris Holds the Key (to Your Heart)<\/word>","Anya visits the Pont Alexandre III bridge<\/word>","named after Anastasia's grandfather<\/word>","Crossing a Bridge<\/word>","Anya, Vlad, and Dmitry arrive in Paris<\/strong> and are swept up<\/strong> by the sights and sounds of the city (\"Paris Holds the Key (to Your Heart)<\/strong>\"). When Vlad and Dmitry go off on their own, Anya visits the Pont Alexandre III bridge<\/strong>, named after Anastasia's grandfather<\/strong>, and she feels a strong connection to it (\"Crossing a Bridge<\/strong>\").<\/phrase>","bitter, elderly woman<\/word>","Dowager Empress<\/word>","letters of various Anastasia impersonators<\/word>","gives up hope<\/word>","finding Anastasia<\/word>","Lily parties at the Neva Club<\/word>","Russians reminisce about the old Russia<\/word>","Land of Yesterday<\/word>","Lily is reunited with Vlad<\/word>","rekindle their scandalous romance<\/word>","convinces her<\/word>","let Anya meet the Dowager Empress<\/word>","The Countess and the Common Man<\/word>","Vlad accidentally drops the ballet tickets<\/word>","Land of Yesterday Reprise<\/word>","Close the Door<\/word>","Now a bitter, elderly woman<\/strong>, the Dowager Empress<\/strong> reads the letters of various Anastasia impersonators<\/strong> and, heartbroken, gives up hope<\/strong> of finding Anastasia<\/strong> (\"Close the Door<\/strong>\"). As Gleb arrives in Paris, Lily parties at the Neva Club<\/strong>, where rich and noble Russians reminisce about the old Russia<\/strong> (\"Land of Yesterday<\/strong>\"). Lily is reunited with Vlad<\/strong>, with whom she is angry for stealing her jewelry when they were lovers. The two rekindle their scandalous romance<\/strong> and Vlad convinces her<\/strong> to let Anya meet the Dowager Empress<\/strong> at the ballet the next week (\"The Countess and the Common Man<\/strong>\"). However, Vlad accidentally drops the ballet tickets<\/strong> and Gleb, overhearing their plans, picks up their tickets (\"Land of Yesterday Reprise<\/strong>\").<\/phrase>","Anya has a nightmare<\/word>","execution of the Romanovs<\/word>","A Nightmare<\/word>","Dmitry comforts<\/word>","Anastasia<\/word>","realize that Anya is indeed<\/word>","Grand Duchess Anastasia<\/word>","In a Crowd of Thousands<\/word>","At the hotel, Anya has a nightmare<\/strong> about the execution of the Romanovs<\/strong> (\"A Nightmare<\/strong>\"). Dmitry comforts<\/strong> her and recounts a story of how he bowed to Anastasia<\/strong> at a parade as a young boy. Anya vividly remembers this, and the two realize that Anya is indeed<\/strong> the Grand Duchess Anastasia<\/strong> (\"In a Crowd of Thousands<\/strong>\").<\/phrase>","Vlad suspects<\/word>","Anya and Dmitry<\/word>","falling in love<\/word>","Meant to Be<\/word>","Anya sees the Dowager Empress<\/word>","remembers her<\/word>","Dowager Empress<\/word>","Dmitry and Gleb<\/word>","reflect on their romantic feelings<\/word>","Swan Lake<\/word>","Quartet at the Ballet<\/word>","At the ballet, Vlad suspects<\/strong> that Anya and Dmitry<\/strong> are falling in love<\/strong> and is heartbroken that the two can never be together (\"Meant to Be<\/strong>\"). During the performance of Swan Lake<\/strong>, Anya sees the Dowager Empress<\/strong> and remembers her<\/strong>. The Dowager Empress<\/strong> also sees Anya and recognizes her, but clings to denial. Dmitry and Gleb<\/strong> (who is conflicted about whether or not to shoot Anya) reflect on their romantic feelings<\/strong> (\"Quartet at the Ballet<\/strong>\").<\/phrase>","Lily also recognizes Anya as Anastasia<\/word>","takes her to the Dowager Empress<\/word>","realizes that he is in love with Anya<\/word>","knows he must let her go<\/word>","Everything to Win<\/word>","Dowager Empress<\/word>","Vlad and Dmitry intended to use her in their scheme<\/word>","Dmitry waits for the Dowager Empress<\/word>","Dowager Empress coldly dismisses him<\/word>","begs her to see Anya<\/word>","she refuses again<\/word>","her family<\/word>","After the ballet, Lily also recognizes Anya as Anastasia<\/strong> and immediately takes her to the Dowager Empress<\/strong>. Dmitry is anxious about the meeting and realizes that he is in love with Anya<\/strong>, but knows he must let her go<\/strong> to her family<\/strong> (\"Everything to Win<\/strong>\"). Anya leaves the meeting enraged, having learned from the Dowager Empress<\/strong> that Vlad and Dmitry intended to use her in their scheme<\/strong> for money. As she storms off, Dmitry waits for the Dowager Empress<\/strong>. The Dowager Empress coldly dismisses him<\/strong>, but Dmitry disrespectfully stops her. He begs her to see Anya<\/strong>, but she refuses again<\/strong>.<\/phrase>","Anya starts her packing<\/word>","interrupted<\/word>","Dowager Empress<\/word>","questions Anya about her past<\/word>","Anya suddenly remembers the night<\/word>","Dowager Empress left her for Paris<\/word>","sings the lullaby<\/word>","Anya really is Anastasia<\/word>","Once Upon a December Reprise<\/word>","music box<\/word>","Back at their hotel, Anya starts her packing<\/strong>, but she is interrupted<\/strong> by the Dowager Empress<\/strong>, who impressed by Dmitry's courage, has come to give her an opportunity. Anya is shocked by the Dowager Empress<\/strong>'s cruelty, asserting that she isn't the nana that Anya remembered. The Dowager Empress<\/strong> angrily questions Anya about her past<\/strong> and the Romanov family, but Anya compels her to reflect on the person she has become over last two decades. Anya suddenly remembers the night<\/strong> that the Dowager Empress left her for Paris<\/strong>. When Anya produces the music box<\/strong> and sings the lullaby<\/strong>, the Dowager Empress<\/strong> finally realizes that Anya really is Anastasia<\/strong> and the two embrace, now reunited after twenty years (\"Once Upon a December Reprise<\/strong>\").<\/phrase>","Vlad and Lily<\/word>","fend off the hungry reporters<\/word>","The Press Conference<\/word>","Dowager Empress<\/word>","tells Anya<\/word>","Dmitry did not take the reward<\/word>","realizes that she is in love with Dmitry<\/word>","must go after him<\/word>","Everything to Win Reprise<\/word>","Gleb has slipped in<\/word>","Gleb says that he must kill her<\/word>","complete his father's mission<\/word>","remembers the day her family was killed<\/word>","taunts him to kill her<\/word>","she can be with her family<\/word>","shame of his father<\/word>","Gleb is unable to kill Anya<\/word>","Still\/The Neva Flows Reprise<\/word>","Anya comforts Gleb<\/word>","call a truce<\/word>","press conference<\/word>","A press conference<\/strong> is held the next morning, where Vlad and Lily<\/strong> try to fend off the hungry reporters<\/strong> (\"The Press Conference<\/strong>\"). Before appearing in public, the Dowager Empress<\/strong> tells Anya<\/strong> that Dmitry did not take the reward<\/strong> after all and reveals her respect for him. Anya expresses misgivings about her future life as a princess and the Dowager Empress<\/strong> insists that no matter what she chooses, they'll always be together. Anya runs off to think; she realizes that she is in love with Dmitry<\/strong>, and decides that she must go after him<\/strong> (\"Everything to Win Reprise<\/strong>\"). As she turns to leave, Anya sees that Gleb has slipped in<\/strong> and locked them in the room. She realizes why he is there and Gleb says that he must kill her<\/strong> to complete his father's mission<\/strong>. Anya now clearly remembers the day her family was killed<\/strong> and, without fear, taunts him to kill her<\/strong> so that she can be with her family<\/strong>. Overcome with emotion and not willing to bear the shame of his father<\/strong>, Gleb is unable to kill Anya<\/strong> (\"Still\/The Neva Flows Reprise<\/strong>\"). Anya comforts Gleb<\/strong> and they call a truce<\/strong>.<\/phrase>","search for Anya<\/word>","Dowager Empress<\/word>","rumors of Anastasia will now cease<\/word>","Anya discovers Dmitry at Pont Alexandre III<\/word>","they embrace<\/word>","spirits of the Romanovs celebrate the life<\/word>","Anya and Dmitry will have together<\/word>","announce<\/word>","Finale<\/word>","Vlad, Lily, and the palace staff search for Anya<\/strong> and the Dowager Empress<\/strong> is joyful, knowing that Anya is now where she belongs. She and Gleb announce<\/strong> to their people that the rumors of Anastasia will now cease<\/strong>; the reward for finding her will be donated to charity. Anya discovers Dmitry at Pont Alexandre III<\/strong>, where they embrace<\/strong>. The couple leaves Paris as the spirits of the Romanovs celebrate the life<\/strong> that Anya and Dmitry will have together<\/strong> (\"Finale<\/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':2760, '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':2760, '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':2760, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }