var presentation = ["illustrated<\/word>","Christmas Past<\/word>","Yet to Come<\/word>","poor<\/word>","redeem himself<\/word>","A Christmas Carol<\/word>","Charles Dickens<\/word>","John Leech<\/word>","Ebenezer Scrooge<\/word>","elderly miser<\/word>","former business partner<\/word>","Jacob Marley<\/word>","Present<\/word>","gentler man<\/word>","selfish man<\/word>","sympathetic character<\/word>","key themes<\/word>","A Christmas Carol<\/strong>, is a novella by Charles Dickens<\/strong>, first published in London by Chapman & Hall in 1843 and illustrated<\/strong> by John Leech<\/strong>. A Christmas Carol<\/strong> recounts the story of Ebenezer Scrooge<\/strong>, an elderly miser<\/strong> who is visited by the ghost of his former business partner<\/strong> Jacob Marley<\/strong> and the spirits of Christmas Past<\/strong>, Present<\/strong> and Yet to Come<\/strong>. After their visits, Scrooge is transformed into a kinder, gentler man<\/strong>. The treatment of the poor<\/strong> and the ability of a selfish man<\/strong> to redeem himself<\/strong> by transforming into a more sympathetic character<\/strong> are the key themes<\/strong> of the story.<\/phrase>","bleak<\/word>","Christmas Eve<\/word>","dislikes Christmas<\/word>","refuses a dinner invitation<\/word>","turns away<\/word>","seek a donation<\/word>","provide food and heating for the poor<\/word>","Christmas Day off<\/word>","A Christmas Carol<\/word>","seven years<\/word>","Ebenezer Scrooge<\/word>","business partner<\/word>","Jacob Marley<\/word>","his nephew<\/word>","Fred<\/word>","underpaid clerk<\/word>","Bob Cratchit<\/word>","social custom<\/word>","A Christmas Carol<\/strong> opens on a bleak<\/strong>, cold Christmas Eve<\/strong> in London, seven years<\/strong> after the death of Ebenezer Scrooge<\/strong>'s business partner<\/strong>, Jacob Marley<\/strong>. Scrooge, an aging miser, dislikes Christmas<\/strong> and refuses a dinner invitation<\/strong> from his nephew<\/strong> Fred<\/strong>. He turns away<\/strong> two men who seek a donation<\/strong> from him to provide food and heating for the poor<\/strong> and only grudgingly allows his overworked, underpaid clerk<\/strong>, Bob Cratchit<\/strong>, Christmas Day off<\/strong> with pay to conform to the social custom<\/strong>.<\/phrase>","Marley's ghost<\/word>","cursed<\/word>","carry much heavier chains<\/word>","heavy chains and money boxes<\/word>","greed and selfishness<\/word>","single chance<\/word>","avoid<\/word>","same fate<\/word>","three spirits<\/word>","listen<\/word>","That night Scrooge is visited at home by Marley's ghost<\/strong>, who wanders the Earth entwined by heavy chains and money boxes<\/strong> forged during a lifetime of greed and selfishness<\/strong>. Marley tells Scrooge that he has a single chance<\/strong> to avoid<\/strong> the same fate<\/strong>-- he will be visited by three spirits<\/strong> and must listen<\/strong> or be cursed<\/strong> to carry much heavier chains<\/strong> of his own.<\/phrase>","Christmas Past<\/word>","boyhood<\/word>","innocent<\/word>","lonely childhood<\/word>","his relationship with his beloved sister<\/word>","treated him like a son<\/word>","neglected fianc\u00e9e<\/word>","ending their relationship<\/word>","never love her as much as he loves money<\/word>","now-married Belle<\/word>","happy family<\/word>","Christmas Eve<\/word>","remove him from the house<\/word>","first spirit<\/word>","time<\/word>","first employer<\/word>","Mr Fezziwig<\/word>","Belle<\/word>","visit<\/word>","The first spirit<\/strong>, the Ghost of Christmas Past<\/strong>, takes Scrooge to Christmas scenes of Scrooge's boyhood<\/strong>, reminding him of a time<\/strong> when he was more innocent<\/strong>. The scenes reveal Scrooge's lonely childhood<\/strong> at boarding school, his relationship with his beloved sister<\/strong> Fan, and a Christmas party hosted by his first employer<\/strong>, Mr Fezziwig<\/strong>, who treated him like a son<\/strong>. Scrooge's neglected fianc\u00e9e<\/strong> Belle<\/strong> is shown ending their relationship<\/strong>, as she realizes that he will never love her as much as he loves money<\/strong>. Finally, they visit<\/strong> a now-married Belle<\/strong> with her large, happy family<\/strong> on the Christmas Eve<\/strong> that Marley died. Scrooge, upset by hearing Belle<\/strong>'s description of the man that he has become, demands that the ghost remove him from the house<\/strong>.<\/phrase>","joyous market<\/word>","visit Fred's Christmas party<\/word>","Bob Cratchit's family feast<\/word>","Tiny Tim<\/word>","seriously ill<\/word>","Tiny Tim will die<\/word>","unless the course of events changes<\/word>","emaciated children<\/word>","Ghost of Christmas Present<\/word>","Ignorance<\/word>","Want<\/word>","The second spirit, the Ghost of Christmas Present<\/strong>, takes Scrooge to a joyous market<\/strong> with people buying the makings of Christmas dinner and to celebrations of Christmas in a miner's cottage and in a lighthouse. Scrooge and the ghost also visit Fred's Christmas party<\/strong>. A major part of this portion is taken up with Bob Cratchit's family feast<\/strong> and introduces his youngest son, Tiny Tim<\/strong>, a happy boy who is seriously ill<\/strong>. The spirit informs Scrooge that Tiny Tim will die<\/strong> unless the course of events changes<\/strong>. Before disappearing, the spirit shows Scrooge two hideous, emaciated children<\/strong> named Ignorance<\/strong> and Want<\/strong>. He tells Scrooge to beware the former above all and mocks Scrooge's concern for their welfare.<\/phrase>","Ghost of Christmas Yet to Come<\/word>","future<\/word>","funeral<\/word>","attended by local businessmen<\/word>","only on condition that lunch is provided<\/word>","steal his possessions<\/word>","feels emotion over his death<\/word>","poor couple<\/word>","more time to put their finances in order<\/word>","mourning the death of Tiny Tim<\/word>","neglected grave<\/word>","pledges to change his ways<\/word>","Scrooge a Christmas Day<\/word>","rejoice<\/word>","Bob Cratchit<\/word>","Sobbing<\/word>","The third spirit, the Ghost of Christmas Yet to Come<\/strong>, shows Scrooge a Christmas Day<\/strong> in the future<\/strong>. The silent ghost reveals scenes involving the death of a disliked man whose funeral<\/strong> is attended by local businessmen<\/strong> only on condition that lunch is provided<\/strong>. His charwoman, laundress and the local undertaker steal his possessions<\/strong> to sell to a fence. When he asks the spirit to show a single person who feels emotion over his death<\/strong>, he is only given the pleasure of a poor couple<\/strong> who rejoice<\/strong> that his death gives them more time to put their finances in order<\/strong>. When Scrooge asks to see tenderness connected with any death, the ghost shows him Bob Cratchit<\/strong> and his family mourning the death of Tiny Tim<\/strong>. The ghost then allows Scrooge to see a neglected grave<\/strong>, with a tombstone bearing Scrooge's name. Sobbing<\/strong>, Scrooge pledges to change his ways<\/strong>.<\/phrase>","awakens on Christmas morning<\/word>","changed man<\/word>","large donation<\/word>","charity<\/word>","sends a large turkey to the Cratchit home<\/word>","spends the afternoon with Fred's family<\/word>","increase in pay<\/word>","father figure<\/word>","Tiny Tim<\/word>","kindness<\/word>","generosity<\/word>","compassion<\/word>","Scrooge awakens on Christmas morning<\/strong> a changed man<\/strong>. He makes a large donation<\/strong> to the charity<\/strong> he rejected the previous day, anonymously sends a large turkey to the Cratchit home<\/strong> for Christmas dinner and spends the afternoon with Fred's family<\/strong>. The following day he gives Cratchit an increase in pay<\/strong>, and begins to become a father figure<\/strong> to Tiny Tim<\/strong>. From then on Scrooge treats everyone with kindness<\/strong>, generosity<\/strong> and compassion<\/strong>, embodying the spirit of Christmas.<\/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':1821, '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':1821, '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':1821, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }