var presentation = ["Guardians of the Galaxy<\/word>","superhero film<\/word>","go on the run<\/word>","stealing a powerful artifact<\/word>","Marvel Comics<\/word>","superhero team<\/word>","same name<\/word>","film<\/word>","Peter Quill<\/word>","extraterrestrial criminals<\/word>","Guardians of the Galaxy<\/strong> is a 2014 American superhero film<\/strong> based on the Marvel Comics<\/strong> superhero team<\/strong> of the same name<\/strong>. In the film<\/strong>, Peter Quill<\/strong> and a group of extraterrestrial criminals<\/strong> go on the run<\/strong> after stealing a powerful artifact<\/strong>.<\/phrase>","following his mother's death<\/word>","abducted from Earth<\/word>","Twenty-six years later<\/word>","Quill steals a mysterious orb<\/word>","attacked<\/word>","forces<\/word>","fanatical Kree renegade<\/word>","Quill escapes with the orb<\/word>","Yondu discovers his theft<\/word>","issues a bounty<\/word>","Ronan sends the assassin<\/word>","Gamora<\/word>","after the orb<\/word>","Peter Quill<\/word>","alien thieves and smugglers<\/word>","Ravagers<\/word>","Yondu Udonta<\/word>","Morag<\/word>","Ronan the Accuser<\/word>","In 1988, following his mother's death<\/strong>, a young Peter Quill<\/strong> is abducted from Earth<\/strong> by a group of alien thieves and smugglers<\/strong> called the Ravagers<\/strong> led by Yondu Udonta<\/strong>. Twenty-six years later<\/strong> on the abandoned planet Morag<\/strong>, Quill steals a mysterious orb<\/strong>, but is attacked<\/strong> by forces<\/strong> of the fanatical Kree renegade<\/strong>, Ronan the Accuser<\/strong>. Although Quill escapes with the orb<\/strong>, Yondu discovers his theft<\/strong> and issues a bounty<\/strong> for his capture, while Ronan sends the assassin<\/strong> Gamora<\/strong> after the orb<\/strong>.<\/phrase>","Quill attempts to sell the orb on Xandar<\/word>","capital<\/word>","Gamora<\/word>","ambushes him<\/word>","steals it<\/word>","genetically and cybernetically modified raccoon<\/word>","capture the four<\/word>","Kyln prison<\/word>","attempts to kill Gamora<\/word>","killed his family<\/word>","Gamora reveals that she has betrayed Ronan<\/word>","Gamora intends to sell the orb to the Collector Taneleer Tivan<\/word>","work with her to escape the Kyln<\/word>","Quill's ship<\/word>","the Milano<\/word>","Nova Empire<\/word>","fight ensues<\/word>","bounty hunters<\/word>","Rocket<\/word>","tree-like humanoid<\/word>","Groot<\/word>","Nova Corps<\/word>","Drax the Destroyer<\/word>","her association<\/word>","intergalactic warlord<\/word>","Thanos<\/word>","When Quill attempts to sell the orb on Xandar<\/strong>, capital<\/strong> of the Nova Empire<\/strong>, Gamora<\/strong> ambushes him<\/strong> and steals it<\/strong>. A fight ensues<\/strong>, drawing in a pair of bounty hunters<\/strong>-- the genetically and cybernetically modified raccoon<\/strong> Rocket<\/strong>, and the tree-like humanoid<\/strong> Groot<\/strong>. Nova Corps<\/strong> officers capture the four<\/strong>, detaining them in the Kyln prison<\/strong>. An inmate there, Drax the Destroyer<\/strong>, attempts to kill Gamora<\/strong> due to her association<\/strong> with the powerful intergalactic warlord<\/strong>, Thanos<\/strong>, and Ronan, who killed his family<\/strong>. Quill convinces Drax that Gamora<\/strong> can bring Ronan to him, though Gamora reveals that she has betrayed Ronan<\/strong>, unwilling to let him use the orb's power. Learning that Gamora intends to sell the orb to the Collector Taneleer Tivan<\/strong>, Quill, Rocket<\/strong>, Groot<\/strong>, and Drax work with her to escape the Kyln<\/strong> in Quill's ship<\/strong>, the Milano<\/strong>.<\/phrase>","Ronan meets with<\/word>","Gamora's adoptive father<\/word>","discuss her betrayal<\/word>","Quill's group flees to Knowhere<\/word>","drunken Drax summons Ronan<\/word>","rest of the group meets Tivan<\/word>","opens the orb<\/word>","item of immeasurable power<\/word>","destroys all<\/word>","but the most powerful beings who wield it<\/word>","Tivan's slave<\/word>","grabs the Stone<\/word>","explosion<\/word>","engulfs Tivan's archive<\/word>","Ronan arrives<\/word>","easily defeats Drax<\/word>","others flee by ship<\/word>","Ronan's followers<\/word>","Gamora's adoptive sister<\/word>","Nebula destroys Gamora's ship<\/word>","her floating in space<\/word>","Ronan's fighters capture the orb<\/word>","Thanos<\/word>","remote lawless outpost<\/word>","head<\/word>","Power Stone<\/word>","Carina<\/word>","Nebula<\/word>","Ronan meets with<\/strong> Gamora's adoptive father<\/strong>, Thanos<\/strong>, to discuss her betrayal<\/strong>. Quill's group flees to Knowhere<\/strong>, a remote lawless outpost<\/strong> in space built in the giant severed head<\/strong> of a Celestial. A drunken Drax summons Ronan<\/strong> while the rest of the group meets Tivan<\/strong>. Tivan opens the orb<\/strong>, revealing the Power Stone<\/strong>, an item of immeasurable power<\/strong> that destroys all<\/strong> but the most powerful beings who wield it<\/strong>. Tivan's slave<\/strong> Carina<\/strong> grabs the Stone<\/strong>, triggering an explosion<\/strong> that engulfs Tivan's archive<\/strong>. Ronan arrives<\/strong> and easily defeats Drax<\/strong>, while the others flee by ship<\/strong>, pursued by Ronan's followers<\/strong> and Gamora's adoptive sister<\/strong> Nebula<\/strong>. Nebula destroys Gamora's ship<\/strong>, leaving her floating in space<\/strong>, and Ronan's fighters capture the orb<\/strong>.<\/phrase>","Quill contacts Yondu<\/word>","following Gamora into space<\/word>","giving her his helmet to survive<\/word>","Yondu arrives<\/word>","retrieves the pair<\/word>","Rocket, Drax, and Groot threaten to attack Yondu's ship<\/word>","truce<\/word>","promising the orb to Yondu<\/word>","Quill's group<\/word>","cannot let him use the Infinity Stone<\/word>","destroy the galaxy<\/word>","Ronan's flagship<\/word>","Dark Aster<\/word>","Ronan embeds the Stone in his warhammer<\/word>","contacts Thanos<\/word>","threatening to kill him<\/word>","hateful of her adoptive father<\/word>","Nebula allies with Ronan<\/word>","rescue<\/word>","Quill contacts Yondu<\/strong> before following Gamora into space<\/strong>, giving her his helmet to survive<\/strong>; Yondu arrives<\/strong> and retrieves the pair<\/strong>. Rocket, Drax, and Groot threaten to attack Yondu's ship<\/strong> to rescue<\/strong> them, but Quill negotiates a truce<\/strong>, promising the orb to Yondu<\/strong>. Quill's group<\/strong> agrees that facing Ronan means certain death, but that they cannot let him use the Infinity Stone<\/strong> to destroy the galaxy<\/strong>. On Ronan's flagship<\/strong>, the Dark Aster<\/strong>, Ronan embeds the Stone in his warhammer<\/strong>, taking its power for himself. He contacts Thanos<\/strong>, threatening to kill him<\/strong> after first destroying Xandar; hateful of her adoptive father<\/strong>, Nebula allies with Ronan<\/strong>.<\/phrase>","Quill's group<\/word>","Dark Aster<\/word>","the Milano<\/word>","Ronan uses his empowered warhammer<\/word>","Nova Corps fleet<\/word>","Gamora defeats Nebula<\/word>","escapes<\/word>","outmatched by Ronan's power<\/word>","Rocket crashes a Ravager ship<\/word>","Dark Aster crash-lands on Xandar<\/word>","Groot sacrificing himself<\/word>","Ronan emerges<\/word>","prepares to destroy Xandar<\/word>","Quill distracts him<\/word>","Drax and Rocket to destroy Ronan's warhammer<\/word>","Quill grabs the freed Stone<\/word>","with Gamora, Drax, and Rocket sharing its burden<\/word>","uses it to vaporize Ronan<\/word>","Ravagers<\/word>","join<\/word>","Nova Corps<\/word>","destroy<\/word>","The Ravagers<\/strong> and Quill's group<\/strong> join<\/strong> with the Nova Corps<\/strong> to confront the Dark Aster<\/strong> at Xandar, with Quill's group<\/strong> breaching the Dark Aster<\/strong> with the Milano<\/strong>. Ronan uses his empowered warhammer<\/strong> to destroy<\/strong> the Nova Corps fleet<\/strong>. Drax kills Korath and Gamora defeats Nebula<\/strong>, who escapes<\/strong>, but the group finds themselves outmatched by Ronan's power<\/strong> until Rocket crashes a Ravager ship<\/strong> through the Dark Aster<\/strong>. The damaged Dark Aster crash-lands on Xandar<\/strong>, with Groot sacrificing himself<\/strong> to shield the group. Ronan emerges<\/strong> from the wreck and prepares to destroy Xandar<\/strong>, but Quill distracts him<\/strong>, allowing Drax and Rocket to destroy Ronan's warhammer<\/strong>. Quill grabs the freed Stone<\/strong>, and with Gamora, Drax, and Rocket sharing its burden<\/strong>, uses it to vaporize Ronan<\/strong>.<\/phrase>","Quill tricks Yondu<\/word>","container<\/word>","supposedly containing the Stone<\/word>","gives the real Stone<\/word>","Ravagers leave<\/word>","Yondu remarks<\/word>","turned out well<\/word>","did not deliver Quill to his father<\/word>","Quill's group<\/word>","now known as the Guardians of the Galaxy<\/word>","criminal records expunged<\/word>","Quill learns that he is only half-human<\/word>","opens the last present<\/word>","received from his mother<\/word>","cassette tape<\/word>","potted sapling cut from Groot<\/word>","grows into a baby version of him<\/word>","Nova Corps<\/word>","In the aftermath, Quill tricks Yondu<\/strong> into taking a container<\/strong> supposedly containing the Stone<\/strong>, and gives the real Stone<\/strong> to the Nova Corps<\/strong>. As the Ravagers leave<\/strong> Xandar, Yondu remarks<\/strong> that it turned out well<\/strong> that they did not deliver Quill to his father<\/strong> per their contract. Quill's group<\/strong>, now known as the Guardians of the Galaxy<\/strong>, has their criminal records expunged<\/strong>, and Quill learns that he is only half-human<\/strong>, his father being part of an ancient, unknown species. Quill finally opens the last present<\/strong> he received from his mother<\/strong>, a cassette tape<\/strong> filled with her favorite songs. The Guardians leave in the rebuilt Milano along with a potted sapling cut from Groot<\/strong>, which grows into a baby version of him<\/strong>.<\/phrase>","post-credits scene<\/word>","Tivan sits in his destroyed archive<\/word>","canine cosmonaut<\/word>","anthropomorphic duck<\/word>","In a post-credits scene<\/strong>, Tivan sits in his destroyed archive<\/strong> with two of his living exhibits--a canine cosmonaut<\/strong> and an anthropomorphic duck<\/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':2324, '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':2324, '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':2324, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }