var presentation = ["Parks and Recreation<\/word>","sarcastic<\/word>","Tom Haverford<\/word>","underachieving government official<\/word>","Aziz Ansari<\/word>","Tom Haverford<\/strong> is a fictional character in the NBC comedy-drama Parks and Recreation<\/strong>. He is a sarcastic<\/strong> and underachieving government official<\/strong> for the city of Pawnee. He is portrayed by Aziz Ansari<\/strong>.<\/phrase>","Indian American<\/word>","Parks and Recreation<\/word>","right-hand man<\/word>","Tom Haverford<\/word>","Leslie Knope<\/word>","immediate subordinate<\/word>","often serving<\/word>","Tom Haverford<\/strong> is Indian American<\/strong>. He works as Leslie Knope<\/strong>'s immediate subordinate<\/strong> at the Pawnee Parks and Recreation<\/strong> department, often serving<\/strong> as her right-hand man<\/strong>.<\/phrase>","married his college friend Wendy<\/word>","U.S. citizenship<\/word>","aggressively flirts with other women<\/word>","Canadian resident<\/word>","green card marriage<\/word>","South Carolina<\/word>","Tom married his college friend Wendy<\/strong>, a Canadian resident<\/strong>, to get her U.S. citizenship<\/strong>. This green card marriage<\/strong> was so successfully hidden because people always assumed Tom was the one who would need citizenship, which he could prove wrong because he was born in South Carolina<\/strong>. Despite the marriage, Tom aggressively flirts with other women<\/strong>, which has prompted confusion from people unfamiliar with his arrangement with Wendy.<\/phrase>","constantly pursuing<\/word>","his marriage<\/word>","Ann Perkins<\/word>","Miss Pawnee<\/word>","He is constantly pursuing<\/strong> women even during his marriage<\/strong>, as far as going to clubs, hitting on Ann Perkins<\/strong>, and judging at the Miss Pawnee<\/strong> pageant.<\/phrase>","parks department<\/word>","Scrabble<\/word>","Ron Swanson<\/word>","work time<\/word>","order<\/word>","little government interference<\/word>","zero initiative<\/word>","team player<\/word>","government employee<\/word>","Tom appears lazy about his work at the parks department<\/strong> and regularly undermines Leslie. He plays online Scrabble<\/strong> against his superior, Ron Swanson<\/strong>, during work time<\/strong> and loses on purpose in order<\/strong> to further his career. Ron, who believes in as little government interference<\/strong> as possible, approvingly states of Tom, \"He doesn't do a lot of work around here. He shows zero initiative<\/strong>. He's not a team player<\/strong>. He never wants to go that extra mile. Tom is exactly what I'm looking for in a government employee<\/strong>.\"<\/phrase>","field projects<\/word>","small amount<\/word>","public power<\/word>","Tom is often chosen to go on field projects<\/strong> with Leslie. He is also known for abusing his small amount<\/strong> of public power<\/strong> for self-benefit.<\/phrase>","arranged marriage<\/word>","Wendy Haverford<\/word>","her citizenship<\/word>","Ron discovers Tom's arranged marriage<\/strong> with Wendy Haverford<\/strong> but agrees to keep it secret. Tom and Wendy get a divorce shortly after she gets her citizenship<\/strong>. Although he initially appears fine, Tom realizes he did in fact harbor feelings for Wendy and regrets the parting.<\/phrase>","youth basketball league<\/word>","jealousy<\/word>","Ben Wyatt<\/word>","Andy Dwyer<\/word>","Ron Swanson<\/word>","When Ben Wyatt<\/strong> sets up a youth basketball league<\/strong>, Tom uses his uniform from the footwear outlet to act as the referee. He gives preferential treatment to Andy Dwyer<\/strong> out of jealousy<\/strong> that Ron Swanson<\/strong> is dating his ex-wife Wendy.<\/phrase>","Ron's ex-wife<\/word>","Tammy 2<\/word>","Ron & Tammy: Part 2<\/word>","attempt<\/word>","parks department<\/word>","stop<\/word>","As an attempt<\/strong> to exact revenge on Ron, Tom brings Ron's ex-wife<\/strong> Tammy 2<\/strong> as a date to an event organized by the parks department<\/strong> in \"Ron & Tammy: Part 2<\/strong>.\" The night ends in chaos with Ron and Tammy being arrested and getting married. Tom tries to stop<\/strong> Ron from proceeding with Tammy, which causes Tammy to beat him senseless. Realizing Tammy is still a horrible woman, Ron breaks up with her and carries Tom off in a huff.<\/phrase>","The Fight<\/word>","The Snakehole Lounge<\/word>","parks department<\/word>","Snake Juice<\/word>","Chris<\/word>","In \"The Fight<\/strong>\", the parks department<\/strong> comes out to The Snakehole Lounge<\/strong> bar for the debut of Tom's new drink \"Snake Juice<\/strong>.\" Chris<\/strong> forces Tom to sell his shares in The Snakehole Lounge<\/strong> because it conflicts with his government job, much to his disappointment.<\/phrase>","Li'l Sebastian<\/word>","memorial service<\/word>","entertainment company<\/word>","Jean-Ralphio Saperstein<\/word>","City Hall<\/word>","start<\/word>","In \"Li'l Sebastian<\/strong>,\" Tom and his friend Jean-Ralphio Saperstein<\/strong> successfully organize Li'l Sebastian<\/strong>'s memorial service<\/strong>, which helps inspire Tom to leave City Hall<\/strong> to start<\/strong> an entertainment company<\/strong> with Jean-Ralphio.<\/phrase>","Entertainment 720<\/word>","Ron and Tammys<\/word>","bankrupt<\/word>","Tom begins working at Entertainment 720<\/strong>. In \"Ron and Tammys<\/strong>\", Tom tasks Ben with helping out with his grossly mismanaged new company. Entertainment 720<\/strong> goes bankrupt<\/strong> after quickly blowing through their funding while doing little actual work.<\/phrase>","The Treaty<\/word>","return<\/word>","parks department<\/word>","Ron tries to persuade Tom to take his old job back. Tom initially refuses but eventually agrees to return<\/strong> to the parks department<\/strong> in \"The Treaty<\/strong>.\"<\/phrase>","reputable business<\/word>","rent his own high-end clothing<\/word>","middle school boys<\/word>","Halloween Surprise<\/word>","Rent-a-Swag<\/word>","Tom finally begins what appears to be a reputable business<\/strong>, based on an idea he came up with during a fundraiser for Jerry in \"Halloween Surprise<\/strong>.\" The idea, aptly titled \"Rent-a-Swag<\/strong>\" is to rent his own high-end clothing<\/strong> to middle school boys<\/strong> whose mothers won't buy them nice things through puberty.<\/phrase>","counter-attack<\/word>","will open a store<\/word>","across the street<\/word>","Rent-a-Swag<\/word>","offer<\/word>","Tommy<\/word>","Closet<\/word>","Rent-a-Swag<\/strong> is offered a deal to be bought out. Tom rejects the offer<\/strong> and so a counter-attack<\/strong>, the client will open a store<\/strong> across the street<\/strong> from Rent-a-Swag<\/strong> called \"Tommy<\/strong>'s Closet<\/strong>\" which is the exact same idea as Rent-a-Swag<\/strong> but sells baby's, grown-up and elder's high fashion clothes. Business at Rent-a-Swag<\/strong> is dead because of Tommy<\/strong>'s Closet<\/strong>.<\/phrase>","Tom's Bistro<\/word>","wildly successful<\/word>","Unity Concert<\/word>","Tom goes on yet another business venture that he calls \"Tom's Bistro<\/strong>,\" which turns out to be wildly successful<\/strong> at its opening after the Unity Concert<\/strong>.<\/phrase>","Tom's Bistro<\/word>","most successful businesses<\/word>","try to get her back<\/word>","Chicago<\/word>","visit<\/word>","Lucy<\/word>","Tom's Bistro<\/strong> is one of the most successful businesses<\/strong> in Pawnee. After being persuaded by Andy, Tom goes to Chicago<\/strong> to visit<\/strong> his ex-girlfriend Lucy<\/strong> to try to get her back<\/strong>. After discovering that she has a boyfriend, he panics and asks her to work at the bistro. She agrees and moves back to Pawnee.<\/phrase>","Donna's wedding<\/word>","going as coworkers<\/word>","go as her date<\/word>","visit<\/word>","Lucy<\/word>","After going to visit<\/strong> her boyfriend, Lucy<\/strong> comes back to Pawnee to tell Tom that she and her boyfriend have just broken up. He later asks her to come with him to Donna's wedding<\/strong>, but nervously adds that they would only be going as coworkers<\/strong>. After much contemplation, he tells Lucy<\/strong> that he would like to go as her date<\/strong>, to which she agrees.<\/phrase>","Two Funerals<\/word>","propose<\/word>","proposal action movie trailer<\/word>","The Snakehole Lounge<\/word>","Lucy<\/word>","help<\/word>","In \"Two Funerals<\/strong>,\" Leslie convinces Tom that he should propose<\/strong> to Lucy<\/strong> when he picks her up from the airport. With Leslie and Jean-Ralphio's help<\/strong>, he shoots a proposal action movie trailer<\/strong> for Lucy<\/strong>. When Lucy<\/strong> arrives at the airport, Tom tells Leslie that he can't give her the movie, and tells her to get a vase of flowers, pancakes from JJ's Diner, and a deck of cards, and to meet him at The Snakehole Lounge<\/strong>.<\/phrase>","reenacting his and Lucy's first date<\/word>","Will you marry me?<\/word>","Lucy<\/word>","hug<\/word>","He takes Lucy<\/strong> to the lounge, where he sets up a table with the pancakes and flowers, reenacting his and Lucy's first date<\/strong> in the place they first met . He recalls how he tried to show her a card trick and attempts to do it again. When Lucy<\/strong> picks her card, it says \"Will you marry me?<\/strong>\" Lucy<\/strong> says yes, and the two hug<\/strong>.<\/phrase>","One Last Ride<\/word>","expand his business<\/word>","authors two self-help bestsellers<\/word>","reacquires Tom's Bistros<\/word>","Senior Advisory Board<\/word>","In \"One Last Ride<\/strong>\", his future montage shows that at the advice of his Senior Advisory Board<\/strong>, he attempts to expand his business<\/strong>, which ultimately fails. He then authors two self-help bestsellers<\/strong> and reacquires Tom's Bistros<\/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':1730, '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':1730, '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':1730, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }