var presentation = ["protagonist<\/word>","Parks and Recreation<\/word>","Leslie Knope<\/word>","Leslie Knope<\/strong> is the protagonist<\/strong> in the NBC comedy Parks and Recreation<\/strong>.<\/phrase>","Parks and Recreation Department<\/word>","Pawnee, Indiana<\/word>","over-achiever<\/word>","serve the people<\/word>","Deputy Director<\/word>","fictional city<\/word>","For most of the show's run, she serves as the Deputy Director<\/strong> of the Parks and Recreation Department<\/strong> of the fictional city<\/strong> of Pawnee, Indiana<\/strong>. An over-achiever<\/strong>, Knope believes the government should serve the people<\/strong>.<\/phrase>","mid-level bureaucrat<\/word>","Parks and Recreation Department<\/word>","Pawnee, Indiana<\/word>","becoming the first female President<\/word>","her career<\/word>","her town<\/word>","her goal<\/word>","Leslie is a mid-level bureaucrat<\/strong> in the Parks and Recreation Department<\/strong> of Pawnee, Indiana<\/strong> who hopes to advance her career<\/strong> and improve her town<\/strong>, while working towards her goal<\/strong> of becoming the first female President<\/strong>.<\/phrase>","Secretary of State<\/word>","Madeline Albright<\/word>","Condoleezza Rice<\/word>","Janet Reno<\/word>","Nancy Pelosi<\/word>","Hillary Clinton<\/word>","prominently displaying<\/word>","official portrait<\/word>","her door<\/word>","Knope is a fan of Hillary Clinton<\/strong>, prominently displaying<\/strong> her official portrait<\/strong> as Secretary of State<\/strong> on the wall next to her door<\/strong>. In addition, she displays the photographs of Madeline Albright<\/strong>, Condoleezza Rice<\/strong>, Janet Reno<\/strong>, and Nancy Pelosi<\/strong>.<\/phrase>","action committees<\/word>","City Hall<\/word>","Equal Opportunity Committee<\/word>","Fun in the Sun Committee<\/word>","proud member<\/word>","Leslie is a proud member<\/strong> of numerous action committees<\/strong> in and around City Hall<\/strong>, including, but not limited to: the Equal Opportunity Committee<\/strong>, the Fun in the Sun Committee<\/strong>, and many more.<\/phrase>","impress her mother<\/word>","well-known politician<\/word>","public forum<\/word>","Ann Perkins<\/word>","her house<\/word>","her boyfriend<\/word>","Andy Dwyer<\/word>","She is also desperate to impress her mother<\/strong> Marlene, who is a well-known politician<\/strong> in the Pawnee government. At a public forum<\/strong>, she meets Ann Perkins<\/strong>, who informs her about a pit near her house<\/strong> that her boyfriend<\/strong>, Andy Dwyer<\/strong>, fell into.<\/phrase>","quickly becomes friends with Ann<\/word>","park<\/word>","Leslie takes on the project, hoping to build a park<\/strong> there, and quickly becomes friends with Ann<\/strong>. However, she learns that overcoming the red tape of government and budget deficits is difficult.<\/phrase>","The Master Plan<\/word>","state auditors<\/word>","Ben Wyatt<\/word>","Chris Traeger<\/word>","In \"The Master Plan<\/strong>,\" Leslie meets Ben Wyatt<\/strong> and Chris Traeger<\/strong>, who are state auditors<\/strong> who have come to Pawnee because the city is broke. At first, Leslie doesn't get along with Ben. When he asks her out to have a drink, they begin to respect each other more.<\/phrase>","financial future<\/word>","Pawnee Harvest Festival<\/word>","Parks Department<\/word>","Leslie decides to bring back the defunct Pawnee Harvest Festival<\/strong>, the success or failure of which will determine the financial future<\/strong> of the Parks Department<\/strong>. After weeks of planning, the Harvest Festival is a success.<\/phrase>","inter-office dating rules<\/word>","Ben Wyatt<\/word>","Chris Traeger<\/word>","offer<\/word>","Indianapolis<\/word>","stay<\/word>","Leslie is shown to have feelings for Ben Wyatt<\/strong>. She wants to take another step in their relationship but isn't allowed to because of Chris Traeger<\/strong>'s inter-office dating rules<\/strong>. Ben struggles with choosing between a job offer<\/strong> in Indianapolis<\/strong> and one in Pawnee. Not wanting to show that she likes him, Leslie tells him it's a \"tough call\" and tells him to make a pros and cons list. He ultimately decides he likes Pawnee and wants to stay<\/strong> there because he's moved around so much.<\/phrase>","follow-up meeting<\/word>","secretly dating<\/word>","bubble<\/word>","Marlene Griggs-Knope<\/word>","request<\/word>","prepare<\/word>","Leslie and Ben revel in \"the bubble<\/strong>,\" the beginning stage of a relationship when everything is simple and fun. Their bubble<\/strong> is threatened, however, when Leslie's notoriously tough mother Marlene Griggs-Knope<\/strong>, a Pawnee politician, meets with Ben to discuss a business request<\/strong>. Leslie initially makes Ben nervous for the meeting and Marlene believes him to be weak. When Leslie tries to prepare<\/strong> him for a follow-up meeting<\/strong>, Ben is so confident that Marlene ends up becoming attracted to him herself. Fed up, Ben admits he is secretly dating<\/strong> Leslie, much to Marlene's amusement.<\/phrase>","Pawnee: The Greatest Town in America<\/word>","her relationship with Ben cannot continue<\/word>","City Council<\/word>","book<\/word>","love<\/word>","realize<\/word>","After some encouragement from Ben, Leslie decides to run for City Council<\/strong>. She writes a book<\/strong> detailing her love<\/strong> for the city of Pawnee entitled Pawnee: The Greatest Town in America<\/strong>. Leslie soon comes to realize<\/strong> that while she is running, her relationship with Ben cannot continue<\/strong>, and they regretfully break up.<\/phrase>","get back together<\/word>","full-scale investigation<\/word>","ethics hearing<\/word>","Ben sacrifices his job<\/word>","City Council<\/word>","Andy Dwyer<\/word>","save<\/word>","Leslie then announces her City Council<\/strong> candidacy to the public. She decides to hire Andy Dwyer<\/strong> as her assistant. After both Ben and Leslie find they cannot get over one another, they get back together<\/strong>. Chris, regretfully, launches a full-scale investigation<\/strong> into their relationship and arranges an ethics hearing<\/strong> for each of them. Ben sacrifices his job<\/strong> to save<\/strong> Leslie from losing hers and she's suspended for two weeks with pay. The scandal of their relationship and her plummeting poll numbers causes her campaign staff, to abandon her.<\/phrase>","recount<\/word>","won the election<\/word>","Bobby Newport<\/word>","City Council<\/word>","Bobby Newport<\/strong> is announced as the winner of the City Council<\/strong> election by 21 votes. After a recount<\/strong>, Ann tells Leslie that she has won the election<\/strong>.<\/phrase>","flash-forwards<\/word>","serve two terms<\/word>","hinted<\/word>","President of the United States<\/word>","Governor of Indiana<\/word>","Democratic Party<\/word>","Through flash-forwards<\/strong> in the final season, it is shown that by the year 2025, Leslie will run a successful campaign for Governor of Indiana<\/strong> as a member of the Democratic Party<\/strong>, and will serve two terms<\/strong> in that office. It is hinted<\/strong> that either she or Ben has been elected President of the United States<\/strong> by 2048.<\/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':1717, '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':1717, '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':1717, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }