var presentation = ["Beetlejuice<\/word>","recently deceased couple<\/word>","ghosts<\/word>","Netherworld<\/word>","scare away the new inhabitants<\/word>","fantasy comedy film<\/word>","Tim Burton<\/word>","devious poltergeist<\/word>","Beetlejuice<\/strong> is a 1988 American fantasy comedy film<\/strong> directed by Tim Burton<\/strong>. The plot revolves around a recently deceased couple<\/strong> who become ghosts<\/strong> haunting their former home, and an obnoxious, devious poltergeist<\/strong> named Beetlejuice<\/strong> from the Netherworld<\/strong> who tries to scare away the new inhabitants<\/strong>.<\/phrase>","Barbara and Adam Maitland<\/word>","Barbara's cousin<\/word>","sell their large home<\/word>","swerve<\/word>","avoid a dog<\/word>","their car plunges into the river<\/word>","return home<\/word>","have no reflections<\/word>","Handbook for the Recently Deceased<\/word>","drowned in the crash<\/word>","trapped haunting their house<\/word>","live<\/word>","Connecticut<\/word>","country home<\/word>","Winter River<\/word>","Jane Butterfield<\/word>","real estate agent<\/word>","refuse<\/word>","trip<\/word>","hardware store<\/word>","alien desert<\/word>","monstrous sandworms<\/word>","book<\/word>","realize<\/word>","Barbara and Adam Maitland<\/strong> live<\/strong> in an idyllic Connecticut<\/strong> country home<\/strong> in Winter River<\/strong>. Barbara's cousin<\/strong> Jane Butterfield<\/strong>, a pushy real estate agent<\/strong>, hounds them to sell their large home<\/strong> but they refuse<\/strong>. While driving home from a trip<\/strong> to the hardware store<\/strong>, they swerve<\/strong> to avoid a dog<\/strong> and their car plunges into the river<\/strong>. When the two return home<\/strong> they find they cannot remember how they got back, have no reflections<\/strong>, and when Adam attempts to leave the house he steps into an alien desert<\/strong> with monstrous sandworms<\/strong>. They find a book<\/strong> titled Handbook for the Recently Deceased<\/strong> and realize<\/strong> they drowned in the crash<\/strong> and are trapped haunting their house<\/strong>.<\/phrase>","Jane sells their home to the Deetz family<\/word>","his teenage goth daughter<\/word>","interior designer Otho<\/word>","Delia make plans to renovate the house<\/word>","Maitlands attempt to frighten the family<\/word>","Beetlejuice<\/word>","bio-exorcist<\/word>","Netherworld<\/word>","two inquire about Beetlejuice<\/word>","freelancer<\/word>","troublemaker<\/word>","should not seek his help<\/word>","Charles<\/word>","real estate developer<\/word>","second wife<\/word>","Delia<\/word>","Lydia<\/word>","first marriage<\/word>","fail<\/word>","Maitlands<\/word>","discover<\/word>","complex bureaucracy<\/word>","Juno<\/word>","Deetzes<\/word>","former assistant<\/word>","Jane sells their home to the Deetz family<\/strong>, from New York City: Charles<\/strong>, a former real estate developer<\/strong>; his second wife<\/strong> Delia<\/strong>, a sculptor; and his teenage goth daughter<\/strong> Lydia<\/strong>, from his first marriage<\/strong>. With her interior designer Otho<\/strong>, Delia make plans to renovate the house<\/strong>. The Maitlands attempt to frighten the family<\/strong> away but fail<\/strong> because they cannot be seen and take refuge in the attic. A spectre named Beetlejuice<\/strong> sends the two advertisements promoting himself as a \"bio-exorcist<\/strong>\". Consulting the Handbook, the Maitlands<\/strong> open a door to the Netherworld<\/strong> and discover<\/strong> that the afterlife is structured according to a complex bureaucracy<\/strong>. Their caseworker, Juno<\/strong>, informs them it is for them to get the Deetzes<\/strong> out if they want them gone. The two inquire about Beetlejuice<\/strong> and Juno<\/strong> explains he was her former assistant<\/strong> who became a freelancer<\/strong>, and advises that he is a troublemaker<\/strong> and they should not seek his help<\/strong>.<\/phrase>","Maitlands return to their house<\/word>","three become friends<\/word>","They summon Beetlejuice<\/word>","crude personality<\/word>","mistake<\/word>","refuse to work with him<\/word>","attempt to frighten the Deetzes<\/word>","Otho takes the Handbook<\/word>","Beetlejuice<\/word>","monstrous snake<\/word>","providing proof of the afterlife to the living<\/word>","orders them to get rid of the Deetzes<\/word>","cannot bring themselves to scare Lydia<\/word>","family to stay<\/word>","Lydia<\/word>","Maitlands<\/word>","remove<\/word>","Deetzes<\/word>","amuse<\/word>","Juno<\/word>","decide<\/word>","allow<\/word>","The Maitlands return to their house<\/strong> and meet Lydia<\/strong>, who is able to see them due to her strange nature and has read and understood the Handbook; the three become friends<\/strong> but the Maitlands<\/strong> still want to remove<\/strong> the Deetzes<\/strong>. They summon Beetlejuice<\/strong>, but his crude personality<\/strong> convinces them they made a mistake<\/strong> and they refuse to work with him<\/strong>. The Maitlands<\/strong> attempt to frighten the Deetzes<\/strong> at a dinner party, but their actions only amuse<\/strong> them and the Deetzes<\/strong> search the attic, and Otho takes the Handbook<\/strong>. Beetlejuice<\/strong> manifests as a monstrous snake<\/strong> and attacks them until the Maitlands<\/strong> order him back. Juno<\/strong> summons the Maitlands<\/strong> and reprimands them, as their subpar hauntings and summoning of Beetlejuice<\/strong> are providing proof of the afterlife to the living<\/strong>, and orders them to get rid of the Deetzes<\/strong>. The two cannot bring themselves to scare Lydia<\/strong> and decide<\/strong> to allow<\/strong> the family to stay<\/strong>.<\/phrase>","tourist trap<\/word>","proof of the supernatural<\/word>","Otho summons Adam and Barbara<\/word>","s\u00e9ance<\/word>","exorcism<\/word>","Lydia asks Beetlejuice for help<\/word>","he agrees<\/word>","she marry him<\/word>","freed to enter the mortal world<\/word>","she agrees<\/word>","Beetlejuice stops the exorcism<\/word>","ghastly minister<\/word>","Beetlejuice<\/word>","Charles<\/word>","turn<\/word>","Maxie Dean<\/word>","visit<\/word>","decay<\/word>","Otho<\/word>","Lydia<\/word>","Maitlands<\/word>","Charles<\/strong> has the idea to turn<\/strong> the town into a tourist trap<\/strong> themed around the supernatural and convinces his former boss Maxie Dean<\/strong> to visit<\/strong>, and Maxie demands proof of the supernatural<\/strong>. Using the Handbook, Otho summons Adam and Barbara<\/strong>, but they begin to decay<\/strong> and he realizes what he thought was a s\u00e9ance<\/strong> was actually an exorcism<\/strong>. Lydia asks Beetlejuice for help<\/strong> and he agrees<\/strong> on the condition she marry him<\/strong> so he can be freed to enter the mortal world<\/strong>; she agrees<\/strong> and summons him. Beetlejuice stops the exorcism<\/strong> and disposes of Maxie, his wife, and Otho<\/strong>, then summons a ghastly minister<\/strong> to wed Lydia<\/strong>. The Maitlands<\/strong> intervene before the ceremony is completed, with Barbara riding a sandworm through the house to devour Beetlejuice<\/strong>.<\/phrase>","Maitlands and the Deetzes agree to live in the house in harmony<\/word>","socially-adjusted<\/word>","Beetlejuice<\/word>","afterlife waiting room<\/word>","long wait<\/word>","steals a witch doctor's number<\/word>","shrinks his head<\/word>","Lydia<\/word>","The Maitlands and the Deetzes agree to live in the house in harmony<\/strong>, and Lydia<\/strong> becomes more socially-adjusted<\/strong> from her friendship with them as she attends school. Meanwhile in the afterlife, Beetlejuice<\/strong> impatiently sits in the afterlife waiting room<\/strong> waiting to be called in having a long wait<\/strong> and steals a witch doctor's number<\/strong> who is called in next where the witch doctor angrily shrinks his head<\/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':2003, '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':2003, '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':2003, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }