var presentation = ["Aberforth Dumbledore<\/word>","Albus Dumbledore<\/word>","brother<\/word>","younger brother<\/word>","less skilled<\/word>","usually left in the background<\/word>","his brother basks in the glory<\/word>","comparative success<\/word>","first appearance<\/word>","Harry Potter and the Goblet of Fire<\/word>","parents' deaths<\/word>","Albus' return home<\/word>","look after<\/word>","unstable sister<\/word>","Ariana<\/word>","Aberforth quarrels<\/word>","his brother<\/word>","his brother's friend<\/word>","Gellert Grindelwald<\/word>","their plans<\/word>","new order<\/word>","neglecting Ariana<\/word>","Grindelwald began torturing him<\/word>","three dueling<\/word>","results<\/word>","Ariana's accidental death<\/word>","Ariana's funeral<\/word>","Aberforth publicly confronts Albus<\/word>","strikes him<\/word>","breaking his nose<\/word>","Aberforth becomes<\/word>","owner<\/word>","barman<\/word>","Hog's Head inn<\/word>","strong affinity<\/word>","goats<\/word>","His Patronus<\/word>","form of a goat<\/word>","recounts<\/word>","as a boy<\/word>","fed the goats<\/word>","with his sister<\/word>","tried<\/word>","Wizengamot<\/word>","Wizard High Court<\/word>","performing inappropriate charms<\/word>","His tavern<\/word>","according to Harry's description<\/word>","Harry Potter and the Order of the Phoenix<\/word>","faint smell of goats<\/word>","Aberforth Dumbledore<\/strong> is Albus Dumbledore<\/strong>'s brother<\/strong>. He is the younger brother<\/strong> by some three years and the less skilled<\/strong> of the two; as such, he is usually left in the background<\/strong> while his brother basks in the glory<\/strong> of his comparative success<\/strong>. His first appearance<\/strong> is in the book Harry Potter and the Goblet of Fire<\/strong>. After his parents' deaths<\/strong> and Albus' return home<\/strong> to look after<\/strong> their unstable sister<\/strong> Ariana<\/strong>, Aberforth quarrels<\/strong> with his brother<\/strong> and his brother's friend<\/strong>, Gellert Grindelwald<\/strong>, over their plans<\/strong> to start a new order<\/strong>, neglecting Ariana<\/strong>. Grindelwald began torturing him<\/strong>, leading to the three dueling<\/strong>. This argument results<\/strong> in Ariana's accidental death<\/strong> at the hands of one of them. At Ariana's funeral<\/strong>, Aberforth publicly confronts Albus<\/strong> and strikes him<\/strong>, breaking his nose<\/strong>. Eventually, Aberforth becomes<\/strong> the owner<\/strong> and barman<\/strong> of the Hog's Head inn<\/strong>. He is known for his strong affinity<\/strong> with goats<\/strong>. His Patronus<\/strong> takes the form of a goat<\/strong>, and he recounts<\/strong> to the trio that as a boy<\/strong> he fed the goats<\/strong> in company with his sister<\/strong>, Ariana<\/strong>. Aberforth was also tried<\/strong> before the Wizengamot<\/strong>, the Wizard High Court<\/strong>, for performing inappropriate charms<\/strong> on a goat. His tavern<\/strong> also, according to Harry's description<\/strong> in Harry Potter and the Order of the Phoenix<\/strong>, has a faint smell of goats<\/strong>.<\/phrase>","Deathly Hallows<\/word>","Aberforth plays<\/word>","important role<\/word>","taking<\/word>","Harry, Ron, and Hermione<\/word>","his bar<\/word>","before the Death Eaters<\/word>","capture them<\/word>","Aberforth later reveals<\/word>","did not know about the history<\/word>","Dumbledore family<\/word>","held prisoner<\/word>","Malfoy Manor<\/word>","Harry briefly glimpses<\/word>","Aberforth's eye<\/word>","remaining shard<\/word>","two-way mirror<\/word>","given by Sirius<\/word>","calls for<\/word>","Aberforth's help<\/word>","Aberforth bought<\/word>","its counterpart<\/word>","Mundungus Fletcher<\/word>","Using the mirror<\/word>","watch over the trio<\/word>","Aberforth sends Dobby<\/word>","rescue them<\/word>","other prisoners<\/word>","He liked Dobby<\/word>","was upset to hear<\/word>","Bellatrix Lestrange<\/word>","killed him<\/word>","It is not until Deathly Hallows<\/strong> that Aberforth plays<\/strong> an important role<\/strong> in the series by taking<\/strong> Harry, Ron, and Hermione<\/strong> into his bar<\/strong> before the Death Eaters<\/strong> can capture them<\/strong>. Aberforth later reveals<\/strong> to the trio some facts they did not know about the history<\/strong> of the Dumbledore family<\/strong>. While being held prisoner<\/strong> in Malfoy Manor<\/strong>, Harry briefly glimpses<\/strong> Aberforth's eye<\/strong> in the remaining shard<\/strong> of the two-way mirror<\/strong> he was given by Sirius<\/strong> and calls for<\/strong> Aberforth's help<\/strong>. Aberforth bought<\/strong> its counterpart<\/strong> from Mundungus Fletcher<\/strong>. Using the mirror<\/strong> to watch over the trio<\/strong>, Aberforth sends Dobby<\/strong> to rescue them<\/strong> and the other prisoners<\/strong> from the Manor. He liked Dobby<\/strong> and was upset to hear<\/strong> Bellatrix Lestrange<\/strong> killed him<\/strong>.<\/phrase>","allows<\/word>","resistance fighters<\/word>","secure passageway<\/word>","Hog's Head<\/word>","Room of Requirement<\/word>","Ariana's portrait<\/word>","only unguarded entrance<\/word>","Hogwarts<\/word>","This passage<\/word>","used to evacuate<\/word>","underage students<\/word>","according to Neville<\/word>","also used by members<\/word>","Dumbledore's Army<\/word>","get food<\/word>","Aberforth leaves the Order<\/word>","believing the war against Voldemort<\/word>","is lost<\/word>","he quickly joins<\/word>","Battle of Hogwarts<\/word>","last seen<\/word>","Stunning<\/word>","Augustus Rookwood<\/word>","Aberforth allows<\/strong> the resistance fighters<\/strong> to use a secure passageway<\/strong> from the Hog's Head<\/strong> to the Room of Requirement<\/strong> through Ariana's portrait<\/strong>, it being the only unguarded entrance<\/strong> into Hogwarts<\/strong>. This passage<\/strong> is used to evacuate<\/strong> underage students<\/strong> from Hogwarts<\/strong> and, according to Neville<\/strong>, it was also used by members<\/strong> of Dumbledore's Army<\/strong> to get food<\/strong> when they were living in the Room of Requirement<\/strong> because that is one thing the Room of Requirement<\/strong> would not do. Aberforth leaves the Order<\/strong>, believing the war against Voldemort<\/strong> is lost<\/strong>. However, he quickly joins<\/strong> the Battle of Hogwarts<\/strong> and is last seen<\/strong> Stunning<\/strong> Augustus Rookwood<\/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':3308, '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':3308, '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':3308, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }