var presentation = ["advice<\/word>","graduate from college<\/word>","Talk less; smile more<\/word>","Aaron Burr, Sir<\/word>","close-knit allies<\/word>","American Revolution<\/word>","Aaron Burr<\/word>","first appearance<\/word>","Act One<\/word>","Alexander Hamilton<\/word>","New York<\/word>","Aaron Burr<\/strong>'s first appearance<\/strong> is at the beginning of Act One<\/strong> when he is rapping about Alexander Hamilton<\/strong>'s early childhood life. As 19-year-old Alexander Hamilton<\/strong> arrives in New York<\/strong> seeking advice<\/strong> on how to graduate from college<\/strong>, since Burr himself had done so in a span of two years, Burr replies with the witty response, \"Talk less; smile more<\/strong>,\" which is repeated multiple times throughout the musical (\"Aaron Burr, Sir<\/strong>\"). Soon thereafter Burr and Hamilton become close-knit allies<\/strong> in part with the American Revolution<\/strong>.<\/phrase>","American Revolution<\/word>","Aaron Burr<\/word>","John Laurens<\/word>","Hercules Mulligan<\/word>","Marquis de Lafayette<\/word>","join<\/word>","Continental Army<\/word>","As a large supporter of the American Revolution<\/strong>, Aaron Burr<\/strong>, Hamilton, and their allies, including John Laurens<\/strong>, Hercules Mulligan<\/strong>, and Marquis de Lafayette<\/strong>, join<\/strong> the Continental Army<\/strong> in order to contribute to the war against the British.<\/phrase>","winter ball of 1780<\/word>","A Winter's Ball<\/word>","Elizabeth<\/word>","marries her<\/word>","private affair<\/word>","wife of British officer<\/word>","The Story of Tonight (Reprise)<\/word>","patient<\/word>","perfect moment<\/word>","Wait For It<\/word>","attend<\/word>","ball<\/word>","Philip Schuyler<\/word>","Continental Congress<\/word>","Angelica<\/word>","Peggy Schuyler<\/word>","Alexander Hamilton<\/word>","turn<\/word>","wait<\/word>","obtain<\/word>","In the winter ball of 1780<\/strong> (\"A Winter's Ball<\/strong>\"), the latter attend<\/strong> a ball<\/strong> hosted by Philip Schuyler<\/strong>, a wealthy member of the Continental Congress<\/strong>, wherein the three Schuyler sisters, Angelica<\/strong>, Elizabeth<\/strong>, and Peggy Schuyler<\/strong> are in attendance. Alexander Hamilton<\/strong> captures the heart of Elizabeth<\/strong> Schuyler and eventually marries her<\/strong>. Burr offers his congratulations to the couple, and admits to Hamilton that he is having a private affair<\/strong> with the wife of British officer<\/strong>, even though this is unlawful for him to do (\"The Story of Tonight (Reprise)<\/strong>\"). Hamilton urges Burr to go after what he wants. But Burr, in turn<\/strong>, historically known for being patient<\/strong>, replies that he will wait<\/strong> for the perfect moment<\/strong> to obtain<\/strong> his dreams(\"Wait For It<\/strong>\").<\/phrase>","Compromise of 1790<\/word>","financial plan<\/word>","put into action<\/word>","envious<\/word>","power<\/word>","The Room Where It Happens<\/word>","own political power<\/word>","Democratic-Republican<\/word>","winning over the seat<\/word>","Hamilton's father-in-law<\/word>","Thomas Jefferson<\/word>","James Madison<\/word>","plan<\/word>","attempt<\/word>","Philip Schuyler<\/word>","Senate<\/word>","Schuyler Defeated<\/word>","During the Compromise of 1790<\/strong>, Hamilton discusses his financial plan<\/strong> with Thomas Jefferson<\/strong> and James Madison<\/strong>; after they come to an agreement, Hamilton's envisioned plan<\/strong> is put into action<\/strong>. Burr is envious<\/strong> of Hamilton's now extreme power<\/strong> in the government (\"The Room Where It Happens<\/strong>\"). In an attempt<\/strong> to gain his own political power<\/strong>, Burr switches parties and becomes a Democratic-Republican<\/strong>, subsequently winning over the seat<\/strong> of Hamilton's father-in-law<\/strong>, Philip Schuyler<\/strong>, in the Senate<\/strong>, which angers Hamilton (\"Schuyler Defeated<\/strong>\").<\/phrase>","Washington sides with Hamilton<\/word>","cabinet meeting<\/word>","alliance<\/word>","ruin Hamilton's political reputation<\/word>","Washington on your side<\/word>","Yet again, Washington sides with Hamilton<\/strong> in another cabinet meeting<\/strong>. Burr, along with Jefferson and Madison, realize this alliance<\/strong> and wonder how nice it must be to always have George Washington on your side<\/strong>; they then contemplate to ruin Hamilton's political reputation<\/strong> (\"Washington on your side<\/strong>\").<\/phrase>","Hamilton's blackmail with James Reynolds<\/word>","accuse him of stealing money from the government<\/word>","We Know<\/word>","Jefferson, Madison, and Burr find transactions of Hamilton's blackmail with James Reynolds<\/strong>; and they accuse him of stealing money from the government<\/strong>. Hamilton tells them he was not stealing money and reveals his affair to them. Hamilton pleads with Burr not to tell of his affair, and Burr agrees (\"We Know<\/strong>\").<\/phrase>","the Election of 1800<\/word>","Adams is defeated<\/word>","does not have his own political beliefs<\/word>","endorses Jefferson for president<\/word>","second president of the United States<\/word>","challenges him to a duel<\/word>","Your Obedient Servant<\/word>","During the Election of 1800<\/strong>, Adams is defeated<\/strong> and Jefferson and Burr are tied for the presidency. Hamilton convinced that Burr does not have his own political beliefs<\/strong>, endorses Jefferson for president<\/strong>, which helps Jefferson to become the second president of the United States<\/strong> (\"the Election of 1800<\/strong>\"). Enraged, Burr writes to Hamilton and eventually challenges him to a duel<\/strong> (\"Your Obedient Servant<\/strong>\").<\/phrase>","Weehawken, New Jersey<\/word>","not want his daughter to become an orphan<\/word>","throws away his shot<\/word>","villain of history<\/word>","The World Was Wide Enough<\/word>","Alexander Hamilton<\/word>","The duel takes place in Weehawken, New Jersey<\/strong>; and Burr faces Hamilton, and prepares to shoot since Hamilton is talented with a gun and since Burr does not want his daughter to become an orphan<\/strong>. Hamilton instead \"throws away his shot<\/strong>.\" And Burr mortally wounds Hamilton in the side. Though Burr was the victor, he realizes that he would be forever known as the villain of history<\/strong> since he was the man who killed Alexander Hamilton<\/strong> (\"The World Was Wide Enough<\/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':1647, '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':1647, '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':1647, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }