var presentation = ["Frontierland<\/word>","Disneyland<\/word>","Big Thunder Mountain Railroad<\/word>","mine train roller coaster<\/word>","name<\/word>","fictional rail line<\/word>","roller coaster depicts<\/word>","Big Thunder Mountain Railroad<\/strong> is a mine train roller coaster<\/strong> located in Frontierland<\/strong> at Disneyland<\/strong>. Big Thunder Mountain Railroad<\/strong> is also the name<\/strong> of the fictional rail line<\/strong> the roller coaster depicts<\/strong>.<\/phrase>","Disneyland<\/word>","use sharp-edged mountains<\/word>","Monument Valley, Arizona<\/word>","Walt Disney World<\/word>","roller coaster<\/word>","open<\/word>","track layout<\/word>","Rivers of America<\/word>","central hub<\/word>","better fit<\/word>","Fantasyland<\/word>","theme park<\/word>","Florida<\/word>","Tokyo<\/word>","Paris<\/word>","vibrant colors<\/word>","rounded features<\/word>","Bryce Canyon<\/word>","Utah<\/word>","While the design of the Walt Disney World<\/strong> version of this roller coaster<\/strong> was done first, Disneyland<\/strong>'s version was the first one to open<\/strong>. The track layout<\/strong> was mirrored, placing the attraction to the right of Rivers of America<\/strong>, if viewed from the central hub<\/strong>. To better fit<\/strong> with the adjacent Fantasyland<\/strong> areas of the theme park<\/strong>, the original Walt Disney World<\/strong> design had to be replaced with something more appropriate for Disneyland<\/strong>. The Florida<\/strong>, Tokyo<\/strong> and Paris<\/strong> versions of the ride use sharp-edged mountains<\/strong> and the vibrant colors<\/strong> of Monument Valley, Arizona<\/strong>, while Disneyland<\/strong>'s version was developed with more rounded features<\/strong> and muted colors resembling the Bryce Canyon<\/strong> hoodoos in Utah<\/strong>.<\/phrase>","queue<\/word>","narrow rock wall and passing<\/word>","100 tons<\/word>","gold ore<\/word>","Rosamond<\/word>","Upon entering the attraction, the queue<\/strong> winds through a narrow rock wall and passing<\/strong> by the tracks. The surrounding walls were originally created from 100 tons<\/strong> of gold ore<\/strong> from Rosamond<\/strong>.<\/phrase>","stalactites<\/word>","coyotes<\/word>","outdoor station<\/word>","enter<\/word>","bat-infested tunnel<\/word>","right hand turn<\/word>","left hand turn<\/word>","first lift hill<\/word>","lift hill<\/word>","train<\/word>","end<\/word>","Leaving the outdoor station<\/strong>, trains enter<\/strong> a bat-infested tunnel<\/strong>, make a right hand turn<\/strong>, then a left hand turn<\/strong> before climbing the first lift hill<\/strong>, which takes trains through a cavern full of stalactites<\/strong>. Leaving the lift hill<\/strong>, the train<\/strong> drops away to the right, then levels out and makes a left hand turn<\/strong>. The track then crosses under the second lift hill<\/strong> drop before making a right hand turn<\/strong>. The sounds of coyotes<\/strong> can be heard howling at the train<\/strong> as it dives into a cave. At the end<\/strong> of the tunnel, the train<\/strong> hits a trim brake, exits the tunnel, and climbs the second lift hill<\/strong>.<\/phrase>","animatronic goat<\/word>","mining camp<\/word>","tunnel is dynamited<\/word>","ribcage of a T-rex skeleton<\/word>","train<\/word>","lift hill<\/word>","left hand turn<\/word>","smoke<\/word>","right hand turn<\/word>","pass<\/word>","Rainbow Ridge<\/word>","At the top of the lift, an animatronic goat<\/strong> bleats at passing guests as the train<\/strong> drops away to the right, crosses under the lift hill<\/strong>, and rises up into a downward spiraling clockwise helix. Leaving the helix, the train<\/strong> shoots through a small canyon, then drops down into a mining camp<\/strong>, where it hits another trim brake. The train<\/strong> then makes a left hand turn<\/strong>, enters another tunnel, and climbs the third lift hill<\/strong>. As the train<\/strong> climbs the lift, the tunnel is dynamited<\/strong>, and artificial smoke<\/strong> is blasted in guests' faces as the train<\/strong> crests the lift and exits the tunnel. The train<\/strong> then drops to the right, towards the river, then makes a right hand turn<\/strong> and passes through a short tunnel. After crossing over the drop, the trains make a left hand turn<\/strong> as they pass<\/strong> through the ribcage of a T-rex skeleton<\/strong>, hit a trim brake, then make a right hand turn<\/strong> into the final brakes. The train<\/strong> then travels by the buildings of Rainbow Ridge<\/strong> as it returns to the station.<\/phrase>","California<\/word>","outdoor station<\/word>","California<\/strong>'s version of the ride is the only version of the ride to feature an outdoor station<\/strong>. All of the other versions feature an indoor station.<\/phrase>","extensive refurbishment<\/word>","lift hill<\/word>","On January 7, 2013, the ride was closed for an extensive refurbishment<\/strong> that included a new track, trains, scenery, and new effects on the third lift hill<\/strong>. The attraction reopened on March 17, 2014.<\/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':1514, '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':1514, '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':1514, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }