var presentation = ["Albus Dumbledore<\/word>","J. K. Rowling<\/word>","Harry Potter series<\/word>","headmaster<\/word>","wizarding school<\/word>","Hogwarts<\/word>","revealed<\/word>","founder<\/word>","leader<\/word>","Order of the Phoenix<\/word>","organization<\/word>","dedicated<\/word>","fighting Lord Voldemort<\/word>","main antagonist<\/word>","Albus Dumbledore<\/strong> is a fictional character in J. K. Rowling<\/strong>'s Harry Potter series<\/strong>. For most of the series, he is the headmaster<\/strong> of the wizarding school<\/strong> Hogwarts<\/strong>. As part of his backstory, it is revealed<\/strong> that he is the founder<\/strong> and leader<\/strong> of the Order of the Phoenix<\/strong>, an organization<\/strong> dedicated<\/strong> to fighting Lord Voldemort<\/strong>, the main antagonist<\/strong> of the series.<\/phrase>","Albus Dumbledore<\/word>","tall<\/word>","thin<\/word>","silver hair<\/word>","beard so long<\/word>","long and crooked nose<\/word>","long and skillful fingers<\/word>","eyes are described<\/word>","soul-piercing shade of blue<\/word>","twinkled<\/word>","kindness<\/word>","mischief<\/word>","Albus Dumbledore<\/strong> is tall<\/strong> and thin<\/strong>, with silver hair<\/strong> and beard so long<\/strong> that they can be tucked into his belt. He has a very long and crooked nose<\/strong> that looks as if it has been broken at least twice. He is also said to have long and skillful fingers<\/strong>. His eyes are described<\/strong> as being a brilliant, soul-piercing shade of blue<\/strong>, and usually twinkled<\/strong> with kindness<\/strong> and mischief<\/strong>.<\/phrase>","half-moon spectacles<\/word>","colorful array of robes<\/word>","scar<\/word>","above his left knee<\/word>","map<\/word>","London Underground<\/word>","demeanor<\/word>","serene<\/word>","ethereal<\/word>","speaks<\/word>","calm<\/word>","pleasant voice<\/word>","Dumbledore wears half-moon spectacles<\/strong> and a colorful array of robes<\/strong>, ranging from purple to bright orange. He once claimed to have a scar<\/strong> above his left knee<\/strong> in the precise shape of a map<\/strong> of the London Underground<\/strong>, but whether or not he actually does is unknown. His demeanor<\/strong> is often \u2013 if not always \u2013 serene<\/strong> and ethereal<\/strong>, and he usually speaks<\/strong> in a calm<\/strong>, pleasant voice<\/strong> even when Harry thought that he is actually furious.<\/phrase>","last year of his life,<\/word>","right hand<\/word>","scarred<\/word>","dons Marvolo Gaunt's Ring<\/word>","cursed<\/word>","Had Snape not intervened<\/word>","counter-curse<\/word>","Dumbledore would have died<\/word>","more quickly<\/word>","curse left his hand blackened<\/word>","dead-looking,<\/word>","no amount of healing<\/word>","could repair<\/word>","According to Snape<\/word>","curse would eventually spread<\/word>","Dumbledore was doomed to die<\/word>","During the last year of his life,<\/strong> Dumbledore's right hand<\/strong> is scarred<\/strong> when he dons Marvolo Gaunt's Ring<\/strong>, which was cursed<\/strong>. Had Snape not intervened<\/strong> with a counter-curse<\/strong>, Dumbledore would have died<\/strong> much more quickly<\/strong>. Regardless, the curse left his hand blackened<\/strong> and dead-looking,<\/strong> and no amount of healing<\/strong> could repair<\/strong> the appearance. According to Snape<\/strong>, the curse would eventually spread<\/strong> itself from the contained hand, and Dumbledore was doomed to die<\/strong> in no more than one year's time.<\/phrase>","most powerful wizard in the world<\/word>","benevolent<\/word>","wise<\/word>","good wizard<\/word>","aura<\/word>","serenity<\/word>","composure<\/word>","rarely displaying intense emotions<\/word>","anger<\/word>","fear<\/word>","benign nature<\/word>","Dumbledore is the only wizard<\/word>","Lord Voldemort<\/word>","ever truly feared<\/word>","very eccentric<\/word>","fond<\/word>","knitting patterns<\/word>","frequently wears<\/word>","flamboyant clothing<\/word>","odd displays<\/word>","whimsicality<\/word>","uses humor<\/word>","make people feel comfortable<\/word>","supremely talented wizard<\/word>","numerous examples<\/word>","extraordinary powers<\/word>","abilities as a wizard<\/word>","cunning<\/word>","subtlety of mind<\/word>","allowed him<\/word>","comprehend human nature<\/word>","better aspects of humanity<\/word>","trust<\/word>","love<\/word>","friendship<\/word>","Voldemort's disadvantage in particular<\/word>","Considered the most powerful wizard in the world<\/strong>, Dumbledore is benevolent<\/strong> and wise<\/strong>, a good wizard<\/strong> in the style of Merlin. He exudes an aura<\/strong> of serenity<\/strong> and composure<\/strong>, rarely displaying intense emotions<\/strong> of anger<\/strong> or fear<\/strong>. Yet despite his benign nature<\/strong>, it is said that Dumbledore is the only wizard<\/strong> Lord Voldemort<\/strong> ever truly feared<\/strong>. Dumbledore is very eccentric<\/strong>; he is very fond<\/strong> of knitting patterns<\/strong> and frequently wears<\/strong> flamboyant clothing<\/strong>. He is also known for his odd displays<\/strong> of whimsicality<\/strong>; he often uses humor<\/strong> to make people feel comfortable<\/strong> in his presence. As a supremely talented wizard<\/strong>, Dumbledore displays numerous examples<\/strong> of extraordinary powers<\/strong>. His abilities as a wizard<\/strong> are combined with a kind of cunning<\/strong> and subtlety of mind<\/strong> that allowed him<\/strong> to comprehend human nature<\/strong> and turn the better aspects of humanity<\/strong> (trust<\/strong>, love<\/strong>, and friendship<\/strong>) to Voldemort's disadvantage in particular<\/strong>.<\/phrase>","deep capacity for love<\/word>","reminding Harry<\/word>","love<\/word>","greatest magic of all<\/word>","believes in the good in everyone<\/word>","insists<\/word>","giving second chances<\/word>","greatest example<\/word>","Dumbledore's relationship with Snape<\/word>","Dumbledore is willing to place<\/word>","considerable amount of faith<\/word>","showed remorse<\/word>","highly perceptive<\/word>","emotionally intelligent<\/word>","person's true personality<\/word>","goes beyond<\/word>","good judge of character<\/word>","never more apparent<\/word>","complex insights<\/word>","Voldemort's psyche<\/word>","together<\/word>","deduce<\/word>","Voldemort's horcruxes<\/word>","hidden<\/word>","More than anything else, Dumbledore has a deep capacity for love<\/strong>, frequently reminding Harry<\/strong> that love<\/strong> was the greatest magic of all<\/strong>. Dumbledore believes in the good in everyone<\/strong> and insists<\/strong> on giving second chances<\/strong>. The greatest example<\/strong> of this is Dumbledore's relationship with Snape<\/strong>, in whom Dumbledore is willing to place<\/strong> a considerable amount of faith<\/strong> because he showed remorse<\/strong>. Dumbledore is highly perceptive<\/strong> and emotionally intelligent<\/strong>; his knowledge of a person's true personality<\/strong> goes beyond<\/strong> simply being a good judge of character<\/strong>. This is never more apparent<\/strong> than in his complex insights<\/strong> into Voldemort's psyche<\/strong>, which he pieces together<\/strong> with Harry to deduce<\/strong> where Voldemort's horcruxes<\/strong> are hidden<\/strong>.<\/phrase>","Dumbledore's many extraordinary qualities<\/word>","flawed character<\/word>","greatest flaw<\/word>","desire for power<\/word>","best suited for power<\/word>","those who do not seek it<\/word>","he and Grindelwald first meet<\/word>","make plans<\/word>","enslave Muggles<\/word>","re-establish wizards<\/word>","natural rulers of the world<\/word>","Dumbledore becomes disillusioned<\/word>","his sister<\/word>","Ariana<\/word>","killed<\/word>","duel<\/word>","between himself<\/word>","his brother<\/word>","Aberforth<\/word>","Grindelwald<\/word>","However, in spite of Dumbledore's many extraordinary qualities<\/strong>, he is a flawed character<\/strong>. Dumbledore's greatest flaw<\/strong>, which he admits to Harry, is his desire for power<\/strong>. He eventually finds that those best suited for power<\/strong> are those who do not seek it<\/strong>. When he and Grindelwald first meet<\/strong>, they make plans<\/strong> to enslave Muggles<\/strong> and re-establish wizards<\/strong> as the natural rulers of the world<\/strong>. However, Dumbledore becomes disillusioned<\/strong> of this fantasy after his sister<\/strong> Ariana<\/strong> is killed<\/strong> during a duel<\/strong> between himself<\/strong>, his brother<\/strong> Aberforth<\/strong>, and Grindelwald<\/strong>.<\/phrase>","haunted<\/word>","sad family history<\/word>","riddled with guilt<\/word>","circumstances<\/word>","death of his sister<\/word>","enormous remorse<\/word>","his selfishness<\/word>","involved in the circumstances<\/word>","led to her death<\/word>","tortured for the rest of his life<\/word>","possibility<\/word>","might have been the one<\/word>","cast the spell<\/word>","killed her<\/word>","Mirror of Erised<\/word>","sees himself redeemed<\/word>","his brother<\/word>","his entire family alive<\/word>","together<\/word>","Dumbledore is haunted<\/strong> by his sad family history<\/strong>. In particular, he is riddled with guilt<\/strong> over the circumstances<\/strong> surrounding the death of his sister<\/strong>. He feels enormous remorse<\/strong> for his selfishness<\/strong> in getting involved in the circumstances<\/strong> that led to her death<\/strong>, and is tortured for the rest of his life<\/strong> by the possibility<\/strong> that he might have been the one<\/strong> who cast the spell<\/strong> that killed her<\/strong>. When he looks into the Mirror of Erised<\/strong>, he sees himself redeemed<\/strong> in the eyes of his brother<\/strong> and his entire family alive<\/strong> and together<\/strong>.<\/phrase>","Albus Dumbledore<\/word>","born<\/word>","Percival and Kendra Dumbledore<\/word>","referenced<\/word>","his brother<\/word>","Aberforth<\/word>","Harry Potter and the Deathly Hallows<\/word>","revealed<\/word>","Albus is three years older<\/word>","Ariana<\/word>","six years old<\/word>","vicious attack<\/word>","three male Muggle youths<\/word>","witnessed her doing magic<\/word>","get her to repeat<\/word>","what they had seen<\/word>","upon her failure to recreate it<\/word>","young age<\/word>","try to stop her<\/word>","being different<\/word>","severe trauma of the attack<\/word>","leaves Ariana<\/word>","unable to function socially<\/word>","properly perform magic<\/word>","Percival is given a life sentence<\/word>","Azkaban<\/word>","tracking down<\/word>","hexing the boys<\/word>","traumatized his daughter<\/word>","prevent her<\/word>","being institutionalized<\/word>","St. Mungo's Hospital<\/word>","hurting someone accidentally<\/word>","uncontrolled magic<\/word>","Kendra moves the family<\/word>","Godric's Hollow<\/word>","conceals Ariana's illness<\/word>","wizarding neighbors<\/word>","assumed<\/word>","Ariana is a non-magical squib<\/word>","Kendra is hiding her<\/word>","out of shame<\/word>","Albus Dumbledore<\/strong> was born<\/strong> to Percival and Kendra Dumbledore<\/strong>. The character had previously referenced<\/strong> his brother<\/strong> Aberforth<\/strong>, and in Harry Potter and the Deathly Hallows<\/strong>, it is revealed<\/strong> that Albus is three years older<\/strong> than Aberforth<\/strong>. The same book introduced their sister Ariana<\/strong> who, at six years old<\/strong>, suffers a vicious attack<\/strong> by three male Muggle youths<\/strong> who had witnessed her doing magic<\/strong>. Frightened, they first try to get her to repeat<\/strong> what they had seen<\/strong>, and upon her failure to recreate it<\/strong> due to her young age<\/strong>, they try to stop her<\/strong> from being different<\/strong>. The severe trauma of the attack<\/strong> leaves Ariana<\/strong> unable to function socially<\/strong> or to properly perform magic<\/strong> again. Percival is given a life sentence<\/strong> in Azkaban<\/strong> for tracking down<\/strong> and hexing the boys<\/strong> who traumatized his daughter<\/strong>. To prevent her<\/strong> being institutionalized<\/strong> in St. Mungo's Hospital<\/strong>, or hurting someone accidentally<\/strong> with her uncontrolled magic<\/strong>, Kendra moves the family<\/strong> to Godric's Hollow<\/strong>, and conceals Ariana's illness<\/strong>. Their wizarding neighbors<\/strong> and acquaintances assumed<\/strong> that Ariana is a non-magical squib<\/strong>, and that Kendra is hiding her<\/strong> out of shame<\/strong>.<\/phrase>","Dumbledore and his friend<\/word>","Elphias Doge<\/word>","leave Hogwarts<\/word>","plan<\/word>","take their tour of the world<\/word>","eve of their trip<\/word>","Ariana<\/word>","accidentally kills Kendra<\/word>","uncontrolled outbursts of magic<\/word>","Dumbledore's parents are absent<\/word>","his father<\/word>","Azkaban<\/word>","his mother<\/word>","dead<\/word>","head of the family<\/word>","becomes his duty<\/word>","put food on the table<\/word>","family's misfortunes<\/word>","left them poor<\/word>","forced to remain in his house with Ariana<\/word>","Aberforth<\/word>","completes his education<\/word>","Aberforth knows<\/word>","his brother's resentment<\/word>","offers to care for Ariana<\/word>","Albus refuses<\/word>","it is his duty<\/word>","eldest child<\/word>","care for the family<\/word>","When Dumbledore and his friend<\/strong> Elphias Doge<\/strong> leave Hogwarts<\/strong> at the age of 18, they plan<\/strong> to take their tour of the world<\/strong>. On the eve of their trip<\/strong>, however, Ariana<\/strong> accidentally kills Kendra<\/strong> during one of her uncontrolled outbursts of magic<\/strong>. Because Dumbledore's parents are absent<\/strong> (his father<\/strong> in Azkaban<\/strong> and his mother<\/strong> dead<\/strong>), he becomes the head of the family<\/strong> and it becomes his duty<\/strong> to put food on the table<\/strong>, as the family's misfortunes<\/strong> have left them poor<\/strong>. He is forced to remain in his house with Ariana<\/strong> while Aberforth<\/strong> completes his education<\/strong>. Aberforth knows<\/strong> of his brother's resentment<\/strong> and offers to care for Ariana<\/strong> himself, claiming that she prefers him to Albus, but Albus refuses<\/strong>, stating that it is his duty<\/strong> as the eldest child<\/strong> to care for the family<\/strong>.<\/phrase>","Gellert Grindelwald<\/word>","arrives<\/word>","Godric's Hollow<\/word>","he and Dumbledore become<\/word>","immediate friends<\/word>","two dream<\/word>","new world order<\/word>","wizards rule over Muggles<\/word>","greater good<\/word>","Dumbledore and Grindelwald<\/word>","suggest<\/word>","leave the Dumbledore home<\/word>","carry on their plans<\/word>","Aberforth protested<\/word>","Ariana's condition<\/word>","not allow her to be moved<\/word>","ensuing argument<\/word>","between Albus<\/word>","Aberforth<\/word>","Grindelwald<\/word>","duel<\/word>","Ariana<\/word>","more stimulated<\/word>","caught in the crossfire<\/word>","killed<\/word>","neither Albus nor Aberforth<\/word>","are sure<\/word>","whether one of them or Grindlewald<\/word>","caused her death<\/word>","Stricken with grief<\/word>","remorse<\/word>","Dumbledore breaks ties with Grindelwald<\/word>","Philosopher's Stone<\/word>","mentions to Harry<\/word>","deepest desire of his heart<\/word>","revealed<\/word>","Mirror of Erised<\/word>","have a pair<\/word>","woolen socks<\/word>","seventh novel<\/word>","Harry realizes<\/word>","he and Dumbledore see<\/word>","same thing in the Mirror<\/word>","their reunited families<\/word>","When Gellert Grindelwald<\/strong> arrives<\/strong> at Godric's Hollow<\/strong>, he and Dumbledore become<\/strong> immediate friends<\/strong>, and the two dream<\/strong> of a new world order<\/strong> in which wizards rule over Muggles<\/strong> for the greater good<\/strong>. Dumbledore and Grindelwald<\/strong> suggest<\/strong> that they have to leave the Dumbledore home<\/strong> to carry on their plans<\/strong>, but Aberforth protested<\/strong> against this, as Ariana's condition<\/strong> would not allow her to be moved<\/strong>. The ensuing argument<\/strong> between Albus<\/strong>, Aberforth<\/strong> and Grindelwald<\/strong> turns into a duel<\/strong>, and as Ariana<\/strong> becomes more and more stimulated<\/strong>, she is caught in the crossfire<\/strong> and killed<\/strong> - though neither Albus nor Aberforth<\/strong> are sure<\/strong> whether one of them or Grindlewald<\/strong> caused her death<\/strong>. Stricken with grief<\/strong> and remorse<\/strong>, Dumbledore breaks ties with Grindelwald<\/strong> for good. In Philosopher's Stone<\/strong>, he also mentions to Harry<\/strong> that the deepest desire of his heart<\/strong>, revealed<\/strong> by the Mirror of Erised<\/strong>, is to have a pair<\/strong> of woolen socks<\/strong>, but in the seventh novel<\/strong>, Harry realizes<\/strong> that he and Dumbledore see<\/strong> the same thing in the Mirror<\/strong>-- their reunited families<\/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':3309, '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':3309, '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':3309, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }