var presentation = ["Barty Crouch Sr<\/word>","head<\/word>","Department of Magical Law Enforcement<\/word>","Voldemort<\/word>","first came to power<\/word>","megalomaniacal<\/word>","intensely preoccupied<\/word>","presenting the appearance<\/word>","respectability<\/word>","narrow<\/word>","inflexible man<\/word>","stiffly followed the rules<\/word>","despised<\/word>","Dark Arts<\/word>","lengths<\/word>","willing to go<\/word>","disassociate<\/word>","anything<\/word>","might blemish his reputation<\/word>","led him<\/word>","behave almost as cruelly<\/word>","Dark Side<\/word>","gave Aurors powers<\/word>","kill<\/word>","rather than capture<\/word>","suspected Death Eaters<\/word>","resisted arrest<\/word>","sent<\/word>","Sirius Black<\/word>","wizard prison<\/word>","Azkaban<\/word>","without a trial<\/word>","Barty Crouch Sr<\/strong>. was the head<\/strong> of the Department of Magical Law Enforcement<\/strong> when Voldemort<\/strong> first came to power<\/strong>. Crouch was somewhat megalomaniacal<\/strong> and intensely preoccupied<\/strong> with presenting the appearance<\/strong> of respectability<\/strong>. Crouch was a narrow<\/strong>, inflexible man<\/strong> who stiffly followed the rules<\/strong>. Though he despised<\/strong> the Dark Arts<\/strong>, the lengths<\/strong> to which he was willing to go<\/strong> to disassociate<\/strong> with anything<\/strong> that might blemish his reputation<\/strong> led him<\/strong> to behave almost as cruelly<\/strong> as many on the Dark Side<\/strong>, and gave Aurors powers<\/strong> to kill<\/strong> rather than capture<\/strong> suspected Death Eaters<\/strong> who resisted arrest<\/strong>. He sent<\/strong> Sirius Black<\/strong> to the wizard prison<\/strong> Azkaban<\/strong> without a trial<\/strong>.<\/phrase>","favorite<\/word>","become the next<\/word>","Minister for Magic<\/word>","until his son<\/word>","Barty Crouch Jr.<\/word>","caught<\/word>","Lestranges<\/word>","Death Eaters<\/word>","assisting<\/word>","Voldemort's rise to power<\/word>","tortured Neville's parents<\/word>","Cruciatus Curse<\/word>","gave his son a trial<\/word>","before sending him<\/word>","Azkaban<\/word>","according to Sirius<\/word>","trial was a sham<\/word>","public demonstration<\/word>","how much he hated the boy<\/word>","The public<\/word>","sympathetic<\/word>","Crouch Jr.<\/word>","placed all the blame<\/word>","Crouch Sr.<\/word>","accusing him<\/word>","driving his son<\/word>","join the Death Eaters<\/word>","parental neglect<\/word>","After the trial<\/word>","Crouch lost much of his popularity<\/word>","any chance<\/word>","becoming Minister of Magic<\/word>","shunted sideways<\/word>","post<\/word>","head<\/word>","Department of International Magical Cooperation<\/word>","Crouch appeared to be the favorite<\/strong> to become the next<\/strong> Minister for Magic<\/strong> until his son<\/strong>, Barty Crouch Jr.<\/strong>, was caught<\/strong> with the Lestranges<\/strong>, Death Eaters<\/strong> who were assisting<\/strong> Voldemort's rise to power<\/strong> and who had tortured Neville's parents<\/strong> with the Cruciatus Curse<\/strong>. Crouch gave his son a trial<\/strong> before sending him<\/strong> to Azkaban<\/strong>; however, according to Sirius<\/strong>, the trial was a sham<\/strong>, merely a public demonstration<\/strong> of how much he hated the boy<\/strong>. The public<\/strong> were sympathetic<\/strong> to Crouch Jr.<\/strong>, and placed all the blame<\/strong> on Crouch Sr.<\/strong>, accusing him<\/strong> of driving his son<\/strong> to join the Death Eaters<\/strong> because of his parental neglect<\/strong>. After the trial<\/strong>, Crouch lost much of his popularity<\/strong> and any chance<\/strong> he had of becoming Minister of Magic<\/strong>, and he was shunted sideways<\/strong> to a post<\/strong> as the head<\/strong> of the Department of International Magical Cooperation<\/strong>.<\/phrase>","After the trial<\/word>","Crouch's terminally ill wife<\/word>","begged for her son's life to be saved<\/word>","Crouch abetted the two<\/word>","trading appearances<\/word>","Polyjuice Potion<\/word>","Mrs. Crouch died<\/word>","Crouch Jr.<\/word>","Azkaban<\/word>","Crouch Sr.<\/word>","Imperius Curse<\/word>","keep Crouch Jr.<\/word>","house arrest<\/word>","Bertha Jorkins<\/word>","discovered the truth<\/word>","Crouch Sr. silenced her<\/word>","powerful Memory Charm<\/word>","permanently damaged her memory<\/word>","About a year After the trial<\/strong>, Crouch's terminally ill wife<\/strong> begged for her son's life to be saved<\/strong>, so Crouch abetted the two<\/strong> in trading appearances<\/strong> using Polyjuice Potion<\/strong>. Mrs. Crouch died<\/strong> as Crouch Jr.<\/strong> in Azkaban<\/strong>, while Crouch Sr.<\/strong> subsequently used the Imperius Curse<\/strong> to keep Crouch Jr.<\/strong> under house arrest<\/strong>. When Bertha Jorkins<\/strong> discovered the truth<\/strong>, Crouch Sr. silenced her<\/strong> with a powerful Memory Charm<\/strong> that permanently damaged her memory<\/strong>.<\/phrase>","Crouch Sr.<\/word>","first appearance<\/word>","Quidditch World Cup<\/word>","Goblet of Fire<\/word>","attends the Quidditch World Cup<\/word>","house elf<\/word>","Winky<\/word>","Crouch Jr.<\/word>","hidden<\/word>","Invisibility Cloak<\/word>","Winky's fear of heights<\/word>","able to slip away<\/word>","steals Harry's wand<\/word>","conjure<\/word>","Dark Mark<\/word>","Winky is subsequently caught<\/word>","Amos Diggory<\/word>","Harry's wand<\/word>","Crouch Sr. angrily dismisses Winky<\/word>","failing to keep his son<\/word>","under control<\/word>","her idea<\/word>","let Crouch Jr. attend<\/word>","Crouch Sr.<\/strong> makes his first appearance<\/strong> in the series at the Quidditch World Cup<\/strong> in Goblet of Fire<\/strong>, when he attends the Quidditch World Cup<\/strong> with his house elf<\/strong> Winky<\/strong> as well as Crouch Jr.<\/strong>, who is hidden<\/strong> under an Invisibility Cloak<\/strong>. Due to Winky's fear of heights<\/strong>, Crouch Jr.<\/strong> is able to slip away<\/strong> and steals Harry's wand<\/strong> to conjure<\/strong> the Dark Mark<\/strong>. When Winky is subsequently caught<\/strong> by Amos Diggory<\/strong> with Harry's wand<\/strong>, Crouch Sr. angrily dismisses Winky<\/strong> on the spot for failing to keep his son<\/strong> under control<\/strong>, as it was her idea<\/strong> to let Crouch Jr. attend<\/strong>.<\/phrase>","Voldemort<\/word>","Peter Pettigrew<\/word>","show up<\/word>","Crouch family home<\/word>","having found out<\/word>","Crouch Jr.<\/word>","interrogating Jorkins<\/word>","Crouch Sr.<\/word>","Imperius Curse<\/word>","freeing Crouch Jr<\/word>","forces Crouch<\/word>","continue to appear in public<\/word>","nothing wrong<\/word>","still under the Imperius Curse<\/word>","Crouch Sr. acts<\/word>","one of the five judges<\/word>","Triwizard Tournament<\/word>","Crouch will fight off the effects<\/word>","Voldemort later has him imprisoned<\/word>","has him communicate exclusively<\/word>","supervised owl post<\/word>","precaution<\/word>","Crouch manages to break free<\/word>","makes his way<\/word>","Hogwarts<\/word>","hoping to warn Dumbledore<\/word>","running into<\/word>","Harry and Viktor Krum<\/word>","Forbidden Forest<\/word>","Harry is on his way<\/word>","summon Dumbledore<\/word>","unwittingly alerts Crouch Jr.<\/word>","Polyjuice Potion<\/word>","impersonate<\/word>","Mad-Eye Moody<\/word>","his father's presence<\/word>","Crouch Jr. immediately<\/word>","forest<\/word>","stuns Krum<\/word>","kills his own father<\/word>","Shortly thereafter, Voldemort<\/strong> and Peter Pettigrew<\/strong> show up<\/strong> at the Crouch family home<\/strong>, having found out<\/strong> about Crouch Jr.<\/strong> from interrogating Jorkins<\/strong>. Voldemort<\/strong> places Crouch Sr.<\/strong> under the Imperius Curse<\/strong>, freeing Crouch Jr<\/strong> from the Imperius Curse<\/strong> placed on him by his father, and forces Crouch<\/strong> to continue to appear in public<\/strong> as if there is nothing wrong<\/strong>. While still under the Imperius Curse<\/strong>, Crouch Sr. acts<\/strong> as one of the five judges<\/strong> at the Triwizard Tournament<\/strong>. However, worried that Crouch will fight off the effects<\/strong> of the Imperius Curse<\/strong>, Voldemort later has him imprisoned<\/strong> within his own house and has him communicate exclusively<\/strong> through supervised owl post<\/strong>. Despite this precaution<\/strong>, Crouch manages to break free<\/strong> of the Imperius Curse<\/strong>, and makes his way<\/strong> to Hogwarts<\/strong>, hoping to warn Dumbledore<\/strong> of what is happening, running into<\/strong> Harry and Viktor Krum<\/strong> in the Forbidden Forest<\/strong>. However, while Harry is on his way<\/strong> to summon Dumbledore<\/strong>, he unwittingly alerts Crouch Jr.<\/strong>, who is using Polyjuice Potion<\/strong> to impersonate<\/strong> Mad-Eye Moody<\/strong>, to his father's presence<\/strong>. Crouch Jr. immediately<\/strong> goes to the forest<\/strong>, stuns Krum<\/strong>, and then kills his own father<\/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':3301, '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':3301, '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':3301, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }