var presentation = ["Avengers: Infinity War<\/word>","superhero film<\/word>","superhero team<\/word>","the Avengers<\/word>","sequel to The Avengers<\/word>","Avengers: Age of Ultron<\/word>","Guardians of the Galaxy<\/word>","prevent Thanos<\/word>","six all-powerful Infinity Stones<\/word>","kill half of all life<\/word>","Marvel Comics<\/word>","film<\/word>","attempt<\/word>","Avengers: Infinity War<\/strong> is a 2018 American superhero film<\/strong> based on the Marvel Comics<\/strong> superhero team<\/strong> the Avengers<\/strong>. It is the sequel to The Avengers<\/strong> and Avengers: Age of Ultron<\/strong>. In the film<\/strong>, the Avengers<\/strong> and the Guardians of the Galaxy<\/strong> attempt<\/strong> to prevent Thanos<\/strong> from collecting the six all-powerful Infinity Stones<\/strong> as part of his quest to kill half of all life<\/strong> in the universe.<\/phrase>","Power Stone<\/word>","planet<\/word>","Xandar<\/word>","Thanos<\/word>","his lieutenants<\/word>","intercept the spaceship<\/word>","survivors of Asgard's destruction<\/word>","subduing Thor<\/word>","Thanos extracts the Space Stone<\/word>","Tesseract<\/word>","overpowers the Hulk<\/word>","kills Loki<\/word>","Thanos also kills Heimdall<\/word>","sends Hulk to Earth<\/word>","Ebony Maw<\/word>","Cull Obsidian<\/word>","Proxima Midnight<\/word>","Corvus Glaive<\/word>","Having acquired the Power Stone<\/strong>\u2013one of the six Infinity Stones\u2013from the planet<\/strong> Xandar<\/strong>, Thanos<\/strong> and his lieutenants<\/strong>-- Ebony Maw<\/strong>, Cull Obsidian<\/strong>, Proxima Midnight<\/strong>, and Corvus Glaive<\/strong>, intercept the spaceship<\/strong> carrying the survivors of Asgard's destruction<\/strong>. After subduing Thor<\/strong>, Thanos extracts the Space Stone<\/strong> from the Tesseract<\/strong>, overpowers the Hulk<\/strong>, and kills Loki<\/strong>. Thanos also kills Heimdall<\/strong> after he sends Hulk to Earth<\/strong> using the Bifr\u00f6st. Thanos<\/strong> and his lieutenants<\/strong> leave, destroying the ship.<\/phrase>","Hulk crash-lands<\/word>","reverting to the form of Bruce Banner<\/word>","warns Stephen Strange and Wong<\/word>","Thanos' plan<\/word>","destroy half of all life in the universe<\/word>","recruit Tony Stark<\/word>","Maw and Obsidian arrive<\/word>","retrieve the Time Stone from Strange<\/word>","Maw is unable to take the Time Stone<\/word>","captures Strange instead<\/word>","Stark and Parker sneak aboard Maw's spaceship<\/word>","Wong stays behind<\/word>","guard the Sanctum<\/word>","Sanctum Sanctorum in New York City<\/word>","Peter Parker<\/word>","Hulk crash-lands<\/strong> in the Sanctum Sanctorum in New York City<\/strong>, reverting to the form of Bruce Banner<\/strong>. He warns Stephen Strange and Wong<\/strong> about Thanos' plan<\/strong> to destroy half of all life in the universe<\/strong>, and they recruit Tony Stark<\/strong>. Maw and Obsidian arrive<\/strong> to retrieve the Time Stone from Strange<\/strong>, drawing Peter Parker<\/strong>'s attention. Maw is unable to take the Time Stone<\/strong> due to an enchantment and captures Strange instead<\/strong>. Stark and Parker sneak aboard Maw's spaceship<\/strong> while Wong stays behind<\/strong> to guard the Sanctum<\/strong>.<\/phrase>","Midnight and Glaive ambush Wanda Maximoff and Vision<\/word>","retrieve the Mind Stone<\/word>","Vision's forehead<\/word>","rescue them<\/word>","take shelter with James Rhodes and Banner<\/word>","Avengers' compound<\/word>","Vision asks Maximoff to destroy him and the Mind Stone<\/word>","keep Thanos from retrieving it<\/word>","Maximoff refuses<\/word>","travel to Wakanda<\/word>","resources to remove the Stone<\/word>","without killing Vision<\/word>","Edinburgh<\/word>","Steve Rogers<\/word>","Natasha Romanoff<\/word>","Sam Wilson<\/word>","In Edinburgh<\/strong>, Midnight and Glaive ambush Wanda Maximoff and Vision<\/strong> to retrieve the Mind Stone<\/strong> in Vision's forehead<\/strong>. Steve Rogers<\/strong>, Natasha Romanoff<\/strong>, and Sam Wilson<\/strong> rescue them<\/strong> and they take shelter with James Rhodes and Banner<\/strong> at the Avengers' compound<\/strong>. Vision asks Maximoff to destroy him and the Mind Stone<\/strong> to keep Thanos from retrieving it<\/strong>, but Maximoff refuses<\/strong>. Rogers suggests they travel to Wakanda<\/strong>, which he believes has the resources to remove the Stone<\/strong> without killing Vision<\/strong>.<\/phrase>","Guardians of the Galaxy<\/word>","distress call<\/word>","Asgardian ship<\/word>","Thanos is going after the Reality Stone<\/word>","Taneleer Tivan posseses on Knowhere<\/word>","Rocket, Groot, and Thor<\/word>","enlist the aid<\/word>","creating a powerful weapon<\/word>","battle-axe<\/word>","Stormbreaker<\/word>","Peter Quill<\/word>","find Thanos<\/word>","already in his possession<\/word>","Thanos kidnaps Gamora<\/word>","save Nebula from torture<\/word>","Stone's keeper<\/word>","Thanos<\/word>","he can only acquire it<\/word>","sacrificing someone he loves<\/word>","Thanos kills Gamora<\/word>","earning the Stone<\/word>","rescue<\/word>","Thor<\/word>","travel<\/word>","Nidavellir<\/word>","Eitri<\/word>","Gamora<\/word>","Drax<\/word>","Mantis<\/word>","Knowhere<\/word>","Reality Stone<\/word>","Soul Stone on Vormir<\/word>","Red Skull<\/word>","The Guardians of the Galaxy<\/strong> respond to a distress call<\/strong> from the Asgardian ship<\/strong> and rescue<\/strong> Thor<\/strong>, who surmises that Thanos is going after the Reality Stone<\/strong>, which Taneleer Tivan posseses on Knowhere<\/strong>. Rocket, Groot, and Thor<\/strong> travel<\/strong> to Nidavellir<\/strong> to enlist the aid<\/strong> of Eitri<\/strong> in creating a powerful weapon<\/strong>\u2013the battle-axe<\/strong> Stormbreaker<\/strong>\u2013while Peter Quill<\/strong>, Gamora<\/strong>, Drax<\/strong>, and Mantis<\/strong> travel<\/strong> to Knowhere<\/strong>, and they find Thanos<\/strong> with the Reality Stone<\/strong> already in his possession<\/strong>. Thanos kidnaps Gamora<\/strong>, who sees the Soul Stone on Vormir<\/strong> to save Nebula from torture<\/strong>. On Vormir, the Stone's keeper<\/strong>, Red Skull<\/strong>, tells Thanos<\/strong> that he can only acquire it<\/strong> by sacrificing someone he loves<\/strong>. Thanos kills Gamora<\/strong>, earning the Stone<\/strong>.<\/phrase>","Nebula escapes captivity<\/word>","Thanos' destroyed homeworld<\/word>","Stark and Parker kill Maw<\/word>","rescue Strange<\/word>","meet Quill, Drax, and Mantis<\/word>","Time Stone<\/word>","view millions of possible futures<\/word>","only one in which the Avengers win<\/word>","formulates a plan<\/word>","subdue Thanos<\/word>","Thanos<\/word>","justifies his plans<\/word>","guarantee the survival of a universe<\/word>","Nebula arrives soon<\/word>","deduces that Thanos has killed Gamora<\/word>","Enraged, Quill attacks Thanos<\/word>","allowing him to break the group's hold<\/word>","overpower them<\/word>","Thanos grievously wounds Stark<\/word>","spares him<\/word>","exchange for the Time Stone<\/word>","Strange's request<\/word>","Guardians<\/word>","Titan<\/word>","remove<\/word>","Infinity Gauntlet<\/word>","Nebula escapes captivity<\/strong> and asks the remaining Guardians<\/strong> to meet her on Thanos' destroyed homeworld<\/strong>, Titan<\/strong>. Stark and Parker kill Maw<\/strong> and rescue Strange<\/strong>. Landing on Titan<\/strong>, they meet Quill, Drax, and Mantis<\/strong>. Strange uses the Time Stone<\/strong> to view millions of possible futures<\/strong>, seeing only one in which the Avengers win<\/strong>. The group formulates a plan<\/strong> to subdue Thanos<\/strong> and remove<\/strong> the Infinity Gauntlet<\/strong>, which he uses to safely house the Stones. Thanos<\/strong> appears and justifies his plans<\/strong> as necessary to guarantee the survival of a universe<\/strong> threatened by overpopulation. Nebula arrives soon<\/strong> after and helps the others subdue Thanos<\/strong> until she deduces that Thanos has killed Gamora<\/strong>. Enraged, Quill attacks Thanos<\/strong>, inadvertently allowing him to break the group's hold<\/strong> and overpower them<\/strong>. Thanos grievously wounds Stark<\/strong>, but spares him<\/strong> in exchange for the Time Stone<\/strong>, at Strange's request<\/strong>.<\/phrase>","Wakanda<\/word>","Thanos' army invades<\/word>","the Avengers<\/word>","Wakandan forces<\/word>","mount a defense<\/word>","Shuri works to extract the Mind Stone from Vision<\/word>","Thanos<\/word>","Banner fights in Stark's Hulkbuster armor<\/word>","arrive to reinforce the Avengers<\/word>","they kill Midnight, Obsidian, and Glaive<\/word>","Shuri is unable to complete the extraction<\/word>","Maximoff destroys the Mind Stone and Vision<\/word>","Thanos uses the Time Stone to reverse her actions<\/word>","rips the repaired Mind Stone from Vision's forehead<\/word>","killing him<\/word>","Thor severely wounds Thanos<\/word>","Stormbreaker<\/word>","Thanos activates the completed Gauntlet<\/word>","Thor<\/word>","Rocket<\/word>","Groot<\/word>","In Wakanda<\/strong>, Rogers reunites with Bucky Barnes before Thanos' army invades<\/strong>. the Avengers<\/strong>, along with T'Challa and the Wakandan forces<\/strong>, mount a defense<\/strong> while Shuri works to extract the Mind Stone from Vision<\/strong>. Hulk refuses to fight after losing to Thanos<\/strong>, so Banner fights in Stark's Hulkbuster armor<\/strong>. Thor<\/strong>, Rocket<\/strong>, and Groot<\/strong> arrive to reinforce the Avengers<\/strong> and together they kill Midnight, Obsidian, and Glaive<\/strong>. The invading army routes, but Shuri is unable to complete the extraction<\/strong> before Thanos<\/strong> arrives. Maximoff destroys the Mind Stone and Vision<\/strong>, but Thanos uses the Time Stone to reverse her actions<\/strong> and rips the repaired Mind Stone from Vision's forehead<\/strong>, killing him<\/strong>. Thor severely wounds Thanos<\/strong> with Stormbreaker<\/strong>, but Thanos activates the completed Gauntlet<\/strong> by snapping his fingers before teleporting away.<\/phrase>","Half of all life across the universe<\/word>","Maria Hill<\/word>","Nick Fury<\/word>","disintegrates<\/word>","Fury is able to send an emergency signal<\/word>","Stark and Nebula remain stranded on Titan<\/word>","left on the Wakandan battlefield<\/word>","Thanos watches a sunrise<\/word>","peaceful planet<\/word>","Groot<\/word>","Mantis<\/word>","Drax<\/word>","Rocket<\/word>","Thor<\/word>","Half of all life across the universe<\/strong>, including Barnes, T'Challa, Groot<\/strong>, Maximoff, Wilson, Mantis<\/strong>, Drax<\/strong>, Quill, Strange, Parker, Maria Hill<\/strong>, and Nick Fury<\/strong> disintegrates<\/strong>, though Fury is able to send an emergency signal<\/strong> on a modified pager. Stark and Nebula remain stranded on Titan<\/strong> while Banner, M'Baku, Okoye, Rhodes, Rocket<\/strong>, Rogers, Romanoff, and Thor<\/strong> are left on the Wakandan battlefield<\/strong>. Meanwhile, Thanos watches a sunrise<\/strong> on a peaceful planet<\/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':2337, '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':2337, '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':2337, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }