var presentation = ["daughter<\/word>","Hiram and Hermione Lodge<\/word>","girlfriend<\/word>","ex-girlfriend<\/word>","Veronica Lodge<\/word>","Archie Andrews<\/word>","Reggie Mantle<\/word>","Veronica Lodge<\/strong> is the daughter<\/strong> of Hiram and Hermione Lodge<\/strong>. She is the girlfriend<\/strong> of Archie Andrews<\/strong> and the ex-girlfriend<\/strong> of Reggie Mantle<\/strong>.<\/phrase>","Riverdale High School<\/word>","member<\/word>","Josie and the pussycats<\/word>","New York<\/word>","her mother's hometown<\/word>","Riverdale<\/word>","her father's arrest<\/word>","start over<\/word>","leave her troubled past behind<\/word>","River Vixens<\/word>","subsequent incarceration<\/word>","Veronica is a student at Riverdale High School<\/strong>. In addition, she is a member<\/strong> of the River Vixens<\/strong> and Josie and the pussycats<\/strong>. She moved from New York<\/strong> to her mother's hometown<\/strong> of Riverdale<\/strong> due to her father's arrest<\/strong> and subsequent incarceration<\/strong>. She arrives in Riverdale<\/strong> in order to start over<\/strong> and leave her troubled past behind<\/strong>.<\/phrase>","New York<\/word>","filthy rich<\/word>","popular<\/word>","fashionable<\/word>","bully<\/word>","her father is arrested<\/word>","she and her mother<\/word>","Hermione<\/word>","forced to flee New York City<\/word>","relocate to Riverdale<\/word>","struggles to find the truth<\/word>","her father's loyalties<\/word>","fears<\/word>","he is released from prison<\/word>","trying to reform herself<\/word>","mean girl<\/word>","While living in New York<\/strong>, Veronica was filthy rich<\/strong>, popular<\/strong>, and fashionable<\/strong>. She was also a bully<\/strong> and a mean girl<\/strong>. After her father is arrested<\/strong>, she and her mother<\/strong> Hermione<\/strong> are forced to flee New York City<\/strong> and relocate to Riverdale<\/strong>. She struggles to find the truth<\/strong> behind her father's loyalties<\/strong> and intentions, as she fears<\/strong> what will happen once he is released from prison<\/strong> and back home with them. Meanwhile, she is also trying to reform herself<\/strong> into a better person.<\/phrase>","develops friendships<\/word>","Archie Andrews' girlfriend<\/word>","later on<\/word>","Reggie Mantle's girlfriend<\/word>","Betty Cooper<\/word>","Jughead Jones<\/word>","Josie McCoy<\/word>","Cheryl Blossom<\/word>","Kevin Keller<\/word>","She eventually develops friendships<\/strong> with all of the main characters including Betty Cooper<\/strong>, Jughead Jones<\/strong>, Josie McCoy<\/strong>, Cheryl Blossom<\/strong> and Kevin Keller<\/strong>. She becomes Archie Andrews' girlfriend<\/strong> and later on<\/strong>, Reggie Mantle's girlfriend<\/strong>.<\/phrase>","season 2<\/word>","Veronica's father<\/word>","released from jail<\/word>","Riverdale<\/word>","join Hermione and Veronica<\/word>","involved in the Lodge family business<\/word>","turns against her father<\/word>","realizes what a horrible person he is<\/word>","blind faith in him<\/word>","adversary to her father<\/word>","spent the majority of the third season<\/word>","taking her father down<\/word>","put in prison<\/word>","crimes he has committed<\/word>","Hiram<\/word>","time<\/word>","In season 2<\/strong>, Veronica's father<\/strong> Hiram<\/strong> is released from jail<\/strong> and moves back to Riverdale<\/strong> to join Hermione and Veronica<\/strong> as a family. After Hiram<\/strong> is released, Veronica gets involved in the Lodge family business<\/strong>. However, with time<\/strong>, she turns against her father<\/strong> and finally realizes what a horrible person he is<\/strong> despite constantly having blind faith in him<\/strong> the entire time<\/strong>. She is now an adversary to her father<\/strong> and spent the majority of the third season<\/strong> taking her father down<\/strong> and successfully having him put in prison<\/strong> for all of the crimes he has committed<\/strong> in Riverdale<\/strong>.<\/phrase>","believed<\/word>","been the only child of her father<\/word>","later on revealed<\/word>","older paternal half-sister<\/word>","Hiram<\/word>","Hermosa Lodge<\/word>","Though she believed<\/strong> to have been the only child of her father<\/strong> Hiram<\/strong>, it's later on revealed<\/strong> that she has an older paternal half-sister<\/strong> named Hermosa Lodge<\/strong>, who made her first appearance in the fourth season.<\/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':2489, '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':2489, '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':2489, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }