var presentation = ["fantasy film<\/word>","Scottish Highlands<\/word>","princess named Merida<\/word>","defies an age-old custom<\/word>","causing chaos<\/word>","expressing the desire not to be betrothed<\/word>","her mother falls victim to a beastly curse<\/word>","turning into a bear<\/word>","look within herself<\/word>","find the key to saving the kingdom<\/word>","Brave<\/word>","Pixar Animation Studios<\/word>","Walt Disney Pictures<\/word>","film<\/word>","Brave<\/strong> is a 2012 American computer-animated fantasy film<\/strong> produced by Pixar Animation Studios<\/strong> and released by Walt Disney Pictures<\/strong>. Set in the Scottish Highlands<\/strong>, the film<\/strong> tells the story of a princess named Merida<\/strong> who defies an age-old custom<\/strong>, causing chaos<\/strong> in the kingdom by expressing the desire not to be betrothed<\/strong>. When her mother falls victim to a beastly curse<\/strong> turning into a bear<\/strong>, Merida must look within herself<\/strong> and find the key to saving the kingdom<\/strong>.<\/phrase>","clan Dunbroch<\/word>","dismay of her mother<\/word>","Merida encounters a will-o'-the-wisp<\/word>","Mor'du<\/word>","attacks the family<\/word>","Merida flees on horseback with Elinor,<\/word>","Fergus and his men fend off Mor'du<\/word>","fight costs him one of his legs<\/word>","Medieval Scotland<\/word>","Princess Merida<\/word>","bow and arrow<\/word>","King Fergus<\/word>","sixth birthday<\/word>","Queen Elinor<\/word>","fetch<\/word>","stray arrow<\/word>","huge demon bear<\/word>","In Medieval Scotland<\/strong>, Princess Merida<\/strong> of the clan Dunbroch<\/strong> is given a bow and arrow<\/strong> by her father, King Fergus<\/strong>, for her sixth birthday<\/strong> to the dismay of her mother<\/strong>, Queen Elinor<\/strong>. While venturing into the woods to fetch<\/strong> a stray arrow<\/strong>, Merida encounters a will-o'-the-wisp<\/strong>. Soon afterward, Mor'du<\/strong>, a huge demon bear<\/strong>, attacks the family<\/strong>. Merida flees on horseback with Elinor,<\/strong> while Fergus and his men fend off Mor'du<\/strong>, though the fight costs him one of his legs<\/strong>.<\/phrase>","Ten years later<\/word>","fiery young woman<\/word>","dislikes her princess duties<\/word>","identical triplets<\/word>","Harris<\/word>","betrothed to the son of one of her father's allies<\/word>","failure to consent to the betrothal could harm Dunbroch<\/word>","legend of a prince<\/word>","follow his father's wishes<\/word>","destroyed his kingdom<\/word>","big sister<\/word>","Hubert<\/word>","Hamish<\/word>","pride and refusal<\/word>","Ten years later<\/strong>, Merida, now a free-spirited and fiery young woman<\/strong> who dislikes her princess duties<\/strong> and is now big sister<\/strong> to identical triplets<\/strong>-Harris<\/strong>, Hubert<\/strong>, and Hamish<\/strong>, discovers that she is to be betrothed to the son of one of her father's allies<\/strong>. Elinor explains that failure to consent to the betrothal could harm Dunbroch<\/strong>, reminding Merida of a legend of a prince<\/strong> whose pride and refusal<\/strong> to follow his father's wishes<\/strong> destroyed his kingdom<\/strong>.<\/phrase>","allied clan chieftains<\/word>","first-born sons arrive<\/word>","compete in the Highland games<\/word>","Merida's hand in marriage<\/word>","her own clan's firstborn<\/word>","she is eligible to compete for her own hand<\/word>","easily bests her suitors in an archery contest<\/word>","runs away into the forest<\/word>","heated disagreement with Elinor<\/word>","Wisps appear<\/word>","hut of an elderly witch<\/word>","Merida bargains for a spell to change her fate<\/word>","witch gives her an enchanted cake<\/word>","The allied clan chieftains<\/strong> and their first-born sons arrive<\/strong> to compete in the Highland games<\/strong> for Merida's hand in marriage<\/strong>. Merida twists the rules, announcing that as her own clan's firstborn<\/strong> she is eligible to compete for her own hand<\/strong>. She easily bests her suitors in an archery contest<\/strong>, shaming the other clans, and runs away into the forest<\/strong> after a heated disagreement with Elinor<\/strong>. Wisps appear<\/strong>, leading her to the hut of an elderly witch<\/strong>. Merida bargains for a spell to change her fate<\/strong>, and the witch gives her an enchanted cake<\/strong>.<\/phrase>","Merida gives Elinor the cake<\/word>","transforms her into a bear<\/word>","unable to speak<\/word>","still retaining her human consciousness<\/word>","Merida returns to the witch's cottage with Elinor<\/word>","find it deserted<\/word>","unless Merida is able to mend the bond torn by pride before the second sunrise, the spell will become permanent<\/word>","look for an answer<\/word>","ends up destroying the witch's cottage<\/word>","teaches the queen what she knows about wilderness survival<\/word>","Elinor is slowly losing her human consciousness<\/word>","turning more and more into a real bear<\/word>","ancient ruins<\/word>","encounter Mor'du<\/word>","Mor'du was the prince in the legend her mother told her<\/word>","Merida vows<\/word>","she will not let the same thing happen to her mother<\/word>","repairing Elinor's tapestry<\/word>","can reverse the curse<\/word>","sneak back into the castle in search of the tapestry<\/word>","wisps<\/word>","When Merida gives Elinor the cake<\/strong>, it transforms her into a bear<\/strong>, unable to speak<\/strong> but still retaining her human consciousness<\/strong>. Merida returns to the witch's cottage with Elinor<\/strong>, only to find it deserted<\/strong>, and discovers a message from the witch: unless Merida is able to mend the bond torn by pride before the second sunrise, the spell will become permanent<\/strong>. Merida once again tries to look for an answer<\/strong>, but ends up destroying the witch's cottage<\/strong>. She then spends the night with her mother and teaches the queen what she knows about wilderness survival<\/strong>, bonding with her as a result. However, Merida soon discovers that Elinor is slowly losing her human consciousness<\/strong>, turning more and more into a real bear<\/strong>. Merida and Elinor are then led by the wisps<\/strong> to ancient ruins<\/strong>, where they encounter Mor'du<\/strong>. Realizing that Mor'du was the prince in the legend her mother told her<\/strong>, Merida vows<\/strong> that she will not let the same thing happen to her mother<\/strong>. She soon concludes that by repairing Elinor's tapestry<\/strong> she damaged during her disagreement with Elinor, she can reverse the curse<\/strong>, so she decides to sneak back into the castle in search of the tapestry<\/strong>.<\/phrase>","return to the castle<\/word>","find the clans on the verge of war<\/word>","arguing about who shall have Merida's hand<\/word>","Merida intends to relent<\/word>","Elinor, having a change of heart<\/word>","firstborns should be allowed to marry in their own time to whomever they choose<\/word>","Merida conducting a beautiful speech<\/word>","moves the hearts of the clans<\/word>","The clans agree<\/word>","renewing and strengthening their alliance<\/word>","tradition demands<\/word>","They return to the castle<\/strong> to find the clans on the verge of war<\/strong>, who are arguing about who shall have Merida's hand<\/strong>. Merida intends to relent<\/strong> and declare herself ready to choose a suitor as tradition demands<\/strong>, but Elinor, having a change of heart<\/strong>, prompts her instead to insist that the firstborns should be allowed to marry in their own time to whomever they choose<\/strong>, and live their own lives before they feel ready to settle down. This leads to Merida conducting a beautiful speech<\/strong> which moves the hearts of the clans<\/strong>. The clans agree<\/strong>, breaking tradition but renewing and strengthening their alliance<\/strong>.<\/phrase>","Merida sneaks into the tapestry room with Elinor<\/word>","Elinor, however, begins to slip in and out of her humanity<\/word>","attacks Fergus<\/word>","suddenly regains her composure and flees<\/word>","Mistaking the queen for Mor'du<\/word>","Fergus pursues the bear with the other clans<\/word>","Merida escapes with the assistance of her brothers<\/word>","eaten the enchanted cake<\/word>","transformed into bear cubs<\/word>","Merida repairs the tapestry<\/word>","Fergus and the clans capture Elinor<\/word>","Merida intervenes<\/word>","before Mor'du arrives<\/word>","Mor'du batters the clan warriors<\/word>","targets Merida<\/word>","Elinor intercedes<\/word>","holding off Mor'du and causing him to be crushed by a falling menhir<\/word>","releases the spirit of the prince<\/word>","Merida covers her mother in the repaired tapestry<\/word>","she remains a bear<\/word>","Merida realizes the mistakes she has made<\/word>","reconciles with Elinor<\/word>","fulfilling the true meaning of the witch's message<\/word>","mend the bond between her and her mother<\/word>","successfully reversing the spell<\/word>","Merida sneaks into the tapestry room with Elinor<\/strong>. Elinor, however, begins to slip in and out of her humanity<\/strong> and attacks Fergus<\/strong>, but suddenly regains her composure and flees<\/strong> the castle. Mistaking the queen for Mor'du<\/strong> and unable to listen to Merida, Fergus pursues the bear with the other clans<\/strong>, locking Merida in the castle. Merida escapes with the assistance of her brothers<\/strong>, who have also eaten the enchanted cake<\/strong> and have been transformed into bear cubs<\/strong>. Merida repairs the tapestry<\/strong> and rides out after her father. Fergus and the clans capture Elinor<\/strong>, but Merida intervenes<\/strong> and stops her father before Mor'du arrives<\/strong>. Mor'du batters the clan warriors<\/strong> and targets Merida<\/strong>, but Elinor intercedes<\/strong>, holding off Mor'du and causing him to be crushed by a falling menhir<\/strong>. This releases the spirit of the prince<\/strong>, who silently thanks Merida for freeing him. Merida covers her mother in the repaired tapestry<\/strong>, but she remains a bear<\/strong>. As the sun rises for the second time, Merida realizes the mistakes she has made<\/strong> and reconciles with Elinor<\/strong>, unknowingly fulfilling the true meaning of the witch's message<\/strong>; to mend the bond between her and her mother<\/strong>, therefore successfully reversing the spell<\/strong>'s effects on her mother and brothers back into humans.<\/phrase>","Mor'du gone<\/word>","Merida and Elinor work together on a new tapestry<\/word>","ride their horses together<\/word>","With Mor'du gone<\/strong>, Merida and Elinor work together on a new tapestry<\/strong> when they are called to the docks to bid farewell to the other clans, and ride their horses together<\/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':2226, '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':2226, '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':2226, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }