var presentation = ["Robin<\/word>","Batman's sidekick<\/word>","crimefighting partner<\/word>","teenage vigilante<\/word>","martial arts<\/word>","high-tech gadgets<\/word>","Gotham City<\/word>","Robin<\/strong> is the position of Batman's sidekick<\/strong> and crimefighting partner<\/strong>, a teenage vigilante<\/strong> who patrols Gotham City<\/strong> armed with intensive martial arts<\/strong> abilities and a number of high-tech gadgets<\/strong>.<\/phrase>","five<\/word>","original Robin<\/word>","Dick Grayson<\/word>","circus acrobat<\/word>","parents had been killed<\/word>","legal ward<\/word>","tragedy<\/word>","find direction<\/word>","outgrow his position<\/word>","replacement Batman<\/word>","Batman Family<\/word>","Bruce Wayne<\/word>","Nightwing<\/word>","There have been five<\/strong> as members of the Batman Family<\/strong> in regular continuity. The original Robin<\/strong> was Dick Grayson<\/strong>, a young circus acrobat<\/strong> whose parents had been killed<\/strong> by mobsters. Bruce Wayne<\/strong> witnessed the murders and took him in as his legal ward<\/strong> to guide him through the tragedy<\/strong> and help him find direction<\/strong>. Grayson would eventually outgrow his position<\/strong> and take the name Nightwing<\/strong> for many years, before eventually becoming a replacement Batman<\/strong> himself.<\/phrase>","Robin<\/word>","orphan<\/word>","troubled youth<\/word>","street hoodlum<\/word>","aggression<\/word>","murdered by the Joker<\/word>","tragedy<\/word>","violent anti-hero persona<\/word>","Jason Todd<\/word>","Infinite Crisis<\/word>","Red Hood<\/word>","Jason Todd<\/strong> was the second Robin<\/strong>, another orphan<\/strong>, a troubled youth<\/strong> in danger of becoming a street hoodlum<\/strong> until Batman took him in and provided an outlet for his aggression<\/strong>. Jason was murdered by the Joker<\/strong>, a tragedy<\/strong> and failure that haunted Batman for many years. Resurrected during Infinite Crisis<\/strong>, he has since adopted the violent anti-hero persona<\/strong> Red Hood<\/strong>.<\/phrase>","Robin<\/word>","great detective<\/word>","from becoming too dark and gritty<\/word>","Red Robin<\/word>","Tim Drake<\/word>","Nightwing<\/word>","balance<\/word>","prevent<\/word>","The third Robin<\/strong> was Tim Drake<\/strong>, notable for seeking the position out instead of being approached for it. He is a great detective<\/strong> himself, and figured out Batman's and Nightwing<\/strong>'s secret identities on his own, explaining that Batman needed a Robin<\/strong> to balance<\/strong> him out and prevent<\/strong> him from becoming too dark and gritty<\/strong>. Since then Drake has become Red Robin<\/strong> to strike out on his own.<\/phrase>","only female Robin<\/word>","fired<\/word>","Stephanie Brown<\/word>","Spoiler<\/word>","Batgirl<\/word>","Stephanie Brown<\/strong>, also known as Spoiler<\/strong> and eventually Batgirl<\/strong> was briefly the fourth and only female Robin<\/strong>, although she was fired<\/strong> for disobeying orders.<\/phrase>","Robin<\/word>","Damian Wayne<\/word>","Batman's son<\/word>","Talia al Ghul<\/word>","aggressive child<\/word>","trained as a superhero<\/word>","redemption<\/word>","League of Assassins<\/word>","The fifth and most recent Robin<\/strong> is Damian Wayne<\/strong>, Batman's son<\/strong> with Talia al Ghul<\/strong>, an aggressive child<\/strong> trained by the League of Assassins<\/strong> for years who is being trained as a superhero<\/strong> to help him find redemption<\/strong>.<\/phrase>","Robin<\/word>","Teen Titans<\/word>","Dick Grayson<\/word>","Damian Wayne<\/word>","Battle for the Cowl<\/word>","Young Justice<\/word>","Bob Kane<\/word>","Bill Finger<\/word>","Jerry Robinson<\/word>","Detective Comics<\/word>","Jason Todd<\/word>","Tim Drake<\/word>","Stephanie Brown<\/word>","Robin<\/strong>'s identity has been associated with a number of teams, including the Teen Titans<\/strong> and Young Justice<\/strong>. Robin<\/strong> as Dick Grayson<\/strong> was created by Bob Kane<\/strong>, Bill Finger<\/strong> and Jerry Robinson<\/strong>, first appearing in Detective Comics<\/strong> #38. Jason Todd<\/strong> first appeared as Robin<\/strong> in Batman #368. Tim Drake<\/strong> became Robin<\/strong> in Batman #457. Stephanie Brown<\/strong> took on the position in Robin<\/strong> #126. Damian Wayne<\/strong> has been Robin<\/strong> since Batman: Battle for the Cowl<\/strong> #3.<\/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':1602, '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':1602, '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':1602, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }