var presentation = ["The Ship of the Dead<\/word>","young-adult fantasy novel<\/word>","Norse mythology<\/word>","third and final novel<\/word>","Magnus Chase and the Gods of Asgard trilogy<\/word>","Asgard's greatest threat<\/word>","Rick Riordan<\/word>","Magnus Chase<\/word>","sail<\/word>","Jotunheim<\/word>","Niflheim<\/word>","The Ship of the Dead<\/strong> is a young-adult fantasy novel<\/strong> based on Norse mythology<\/strong> written by American author Rick Riordan<\/strong>. It is the third and final novel<\/strong> in the Magnus Chase and the Gods of Asgard trilogy<\/strong>. The novel is narrated in the first-person view by Magnus Chase<\/strong>, 16-year-old demigod and homeless orphan. He and his crew sail<\/strong> to the farthest borders of Jotunheim<\/strong> and Niflheim<\/strong> in pursuit of Asgard's greatest threat<\/strong>.<\/phrase>","ocean survival jumping lesson<\/word>","recover notes<\/word>","hold the key to defeating their parent<\/word>","Sam al-Abbas<\/word>","accompany Magnus<\/word>","plan to pick up Blitzen and Hearthstone<\/word>","court of Aegir<\/word>","Hearth and Blitz are held prisoner<\/word>","Aegir was once humiliated by Loki<\/word>","flyting contest<\/word>","Magnus Chase<\/word>","Percy Jackson<\/word>","Annabeth Chase<\/word>","Alex Fierro<\/word>","travel<\/word>","Chase Mansion<\/word>","Randolph<\/word>","Valhalla<\/word>","Frey<\/word>","Mallory Keen<\/word>","Halfborn Gunderson<\/word>","Thomas Jefferson Jr<\/word>","Nine Billow Maidens<\/word>","discover<\/word>","Magnus Chase<\/strong> receives an ocean survival jumping lesson<\/strong> from Percy Jackson<\/strong>, a Greek demigod who is his cousin Annabeth Chase<\/strong>'s boyfriend. Alex Fierro<\/strong> and Magnus travel<\/strong> to the Chase Mansion<\/strong>, where they recover notes<\/strong>, guarded by a wolf, scribbled by Randolph<\/strong> at different points of time. Alex feels that these notes hold the key to defeating their parent<\/strong>. After reaching Valhalla<\/strong>, Magnus summons a ship gifted by his father Frey<\/strong>. Mallory Keen<\/strong>, Halfborn Gunderson<\/strong>, Thomas Jefferson Jr<\/strong>., Sam al-Abbas<\/strong> and Alex accompany Magnus<\/strong>, while they plan to pick up Blitzen and Hearthstone<\/strong> along the way. The crew's talk is heard by the Nine Billow Maidens<\/strong>, who take them to the court of Aegir<\/strong>, where Hearth and Blitz are held prisoner<\/strong> and they discover<\/strong> that Aegir was once humiliated by Loki<\/strong> in a flyting contest<\/strong>.<\/phrase>","Aegir's eldest daughter<\/word>","realizes Magnus' identity<\/word>","swears<\/word>","to defeat Loki in a flyting contest<\/word>","avenge Aegir's humiliation<\/word>","attacked by Aegir's nine daughters<\/word>","defeat Loki<\/word>","drinking Kvasir's mead<\/word>","continue on their journey<\/word>","retrieve Bolverk's whetstone<\/word>","Aegir<\/word>","escape<\/word>","help<\/word>","Njord<\/word>","Aegir's eldest daughter<\/strong> realizes Magnus' identity<\/strong> from his previous encounter with her mother Ran. Upon being threatened, Magnus swears<\/strong> by his troth to defeat Loki in a flyting contest<\/strong> to avenge Aegir's humiliation<\/strong>, and Aegir<\/strong> tells them to escape<\/strong> while he isn't looking. But the crew is nevertheless attacked by Aegir's nine daughters<\/strong>. They escape<\/strong> with the help<\/strong> of Magnus' grandfather Njord<\/strong> who appears even though he is unwelcome but respected. Njord<\/strong> instructs them and tells Magnus that the only way to defeat Loki<\/strong> is by drinking Kvasir's mead<\/strong>. The crew continue on their journey<\/strong>, with Blitz and Hearth traveling separately to retrieve Bolverk's whetstone<\/strong>.<\/phrase>","crew heads to York<\/word>","Mallory died disarming a bomb in Ireland<\/word>","Halfborn died near Jorvik<\/word>","TJ died after forcefully accepting a hopeless challenge<\/word>","Samirah<\/word>","Ramadan<\/word>","As the crew heads to York<\/strong>, the backstories of the members are revealed. Mallory died disarming a bomb in Ireland<\/strong>; Halfborn died near Jorvik<\/strong>; TJ died after forcefully accepting a hopeless challenge<\/strong> (meaning he has to accept all challenges posed to him, whether he fails or succeeds), a trait inherited from his father Tyr. Samirah<\/strong> fasts during the Ramadan<\/strong> season.<\/phrase>","duel with the giant Hrungnir<\/word>","Kvasir's Mead<\/word>","word battle<\/word>","he wins<\/word>","not by insulting Loki<\/word>","making his teamwork evident<\/word>","make Loki shrink<\/word>","evident faults<\/word>","he is alone<\/word>","his loyal wife Sigyn disappears<\/word>","Loki reduces to the size of a nut<\/word>","imprisoned in a walnut<\/word>","Old York<\/word>","Kvasir Mead<\/word>","Jorvik<\/word>","Norway<\/word>","Naglfar<\/word>","The crew arrives at Old York<\/strong>, where they duel with the giant Hrungnir<\/strong> for the location of Kvasir's Mead<\/strong>. They get the information that they need: that the Kvasir Mead<\/strong> is in Jorvik<\/strong> (or Norway<\/strong> ,in the human world). Magnus later has a word battle<\/strong> on board Naglfar<\/strong> (ship made of nails) in which he wins<\/strong> not by insulting Loki<\/strong> but making his teamwork evident<\/strong> and his words make Loki shrink<\/strong> due to his evident faults<\/strong> and says that even among the midst of thousands, he is alone<\/strong>, as even his loyal wife Sigyn disappears<\/strong> from his side. Magnus wins because Loki reduces to the size of a nut<\/strong> and is imprisoned in a walnut<\/strong> given to them earlier by Mallory's mother, the queen of Asgard, when she came to meet Mallory on the train in Norway<\/strong>.<\/phrase>","travel back to Valhalla<\/word>","meet their godly parents<\/word>","congratulate them for defeating Loki<\/word>","delaying the Ragnarok<\/word>","convert his mansion to an orphanage and home for the homeless<\/word>","calls Annabeth<\/word>","Magnus and his friends travel back to Valhalla<\/strong> to meet their godly parents<\/strong> who congratulate them for defeating Loki<\/strong> and delaying the Ragnarok<\/strong> for which Magnus is rewarded with a boon from Lord Odin. Magnus asks Odin to lend him his lawyers so that he can convert his mansion to an orphanage and home for the homeless<\/strong>. He later calls Annabeth<\/strong> and tells her his adventure and notices her sobbing.<\/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':1951, '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':1951, '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':1951, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }