var presentation = ["neuroscientist<\/word>","Sheldon's love interest<\/word>","PhD in neurobiology<\/word>","addiction in primates and invertebrates<\/word>","mentioning such experiments<\/word>","addicted to cigarettes<\/word>","Amy Farrah Fowler<\/word>","research focus<\/word>","capuchin monkey<\/word>","Amy Farrah Fowler<\/strong>, PhD is a neuroscientist<\/strong> and Sheldon's love interest<\/strong> in the series. She has a PhD in neurobiology<\/strong>, with a research focus<\/strong> on addiction in primates and invertebrates<\/strong>, occasionally mentioning such experiments<\/strong> as getting a capuchin monkey<\/strong> addicted to cigarettes<\/strong> or starfish addicted to cocaine.<\/phrase>","Raj and Howard found Amy<\/word>","online dating site<\/word>","secretly establishing an account using Sheldon's name<\/word>","site matches her to Sheldon<\/word>","two share many similar traits<\/word>","she and Sheldon meet<\/word>","Sheldon puts it<\/word>","girl who is his friend<\/word>","but not his girlfriend<\/word>","two initially communicate by computer<\/word>","she starts socializing with the gang in person<\/word>","Raj and Howard found Amy<\/strong> through an online dating site<\/strong> after secretly establishing an account using Sheldon's name<\/strong> and information. The site matches her to Sheldon<\/strong>, and the two share many similar traits<\/strong>. Once she and Sheldon meet<\/strong>, she becomes, as Sheldon puts it<\/strong>, a girl who is his friend<\/strong>, but not his girlfriend<\/strong>. The two initially communicate by computer<\/strong>, but at the encouragement of the group, she starts socializing with the gang in person<\/strong>.<\/phrase>","Early on<\/word>","Amy is essentially a female counterpart to Sheldon<\/word>","displays little emotion<\/word>","awkward in social situations<\/word>","endearing<\/word>","embarrassing<\/word>","Amy goes out on a date<\/word>","Sheldon decides to solidify their relationship<\/word>","Amy begins a campaign to increase Sheldon's feelings for her<\/word>","becoming more involved in his interests<\/word>","video games<\/word>","Sheldon<\/word>","Howard and Bernadette's wedding ceremony<\/word>","two of them are as happy together<\/word>","as he is alone<\/word>","hurting Amy's feelings<\/word>","spontaneously takes her hand<\/word>","comfort<\/word>","launched into space<\/word>","comic-book store owner<\/word>","Stuart<\/word>","Relationship Agreement<\/word>","Star Trek<\/word>","Howard<\/word>","Early on<\/strong>, Amy is essentially a female counterpart to Sheldon<\/strong>. She is coldly rational, displays little emotion<\/strong>, and is awkward in social situations<\/strong> ranging from endearing<\/strong> to embarrassing<\/strong>. In season five, after Amy goes out on a date<\/strong> with comic-book store owner<\/strong> Stuart<\/strong>, Sheldon decides to solidify their relationship<\/strong> as boyfriend\/girlfriend with a 31-page Relationship Agreement<\/strong>. Later in the season, Amy begins a campaign to increase Sheldon's feelings for her<\/strong> by becoming more involved in his interests<\/strong>, including video games<\/strong> and Star Trek<\/strong>, and treating him as his mother did. Sheldon<\/strong> says during Howard and Bernadette's wedding ceremony<\/strong> that he hopes the two of them are as happy together<\/strong> as he is alone<\/strong>, hurting Amy's feelings<\/strong>, but he spontaneously takes her hand<\/strong> for comfort<\/strong> later as Howard<\/strong> is launched into space<\/strong>.<\/phrase>","beginning of season six<\/word>","holding hands at Amy's insistence<\/word>","Sheldon repeatedly resists<\/word>","Sheldon gets some intimate views of Amy<\/word>","cares for her while she has the flu<\/word>","traditional relationship with her<\/word>","By the beginning of season six<\/strong>, they are regularly holding hands at Amy's insistence<\/strong>, but Sheldon repeatedly resists<\/strong> all of her attempts to engage in further physical intimacy. By mid-season, Sheldon gets some intimate views of Amy<\/strong> when he cares for her while she has the flu<\/strong>, pushing him further toward a traditional relationship with her<\/strong>.<\/phrase>","move into Penny's old apartment together<\/word>","Penny moves in with Leonard<\/word>","three-month course<\/word>","science camp<\/word>","Sheldon's encouragement<\/word>","becomes angry<\/word>","Sheldon<\/word>","spending time with Ramona Nowitzki<\/word>","romantic feelings for Sheldon<\/word>","season finale<\/word>","Ramona kisses Sheldon<\/word>","visits Amy and proposes to her<\/word>","episode ends on a cliffhanger<\/word>","season 11 premiere episode<\/word>","The Proposal Proposal<\/word>","Amy's answer is further delayed<\/word>","phone call<\/word>","Leonard and Penny<\/word>","finally says yes<\/word>","New Jersey<\/word>","They eventually move into Penny's old apartment together<\/strong>, while Penny moves in with Leonard<\/strong>, and later make the arrangement permanent. Amy is later offered a three-month course<\/strong> at a science camp<\/strong> in New Jersey<\/strong> and leaves with Sheldon's encouragement<\/strong>. She becomes angry<\/strong> when she learns of Sheldon<\/strong> spending time with Ramona Nowitzki<\/strong>, who she suspects has romantic feelings for Sheldon<\/strong>. In the season finale<\/strong>, after Ramona kisses Sheldon<\/strong>, he visits Amy and proposes to her<\/strong>. The episode ends on a cliffhanger<\/strong> awaiting her answer. In the season 11 premiere episode<\/strong> \"The Proposal Proposal<\/strong>\", which picks up immediately after Sheldon<\/strong>'s proposal, Amy's answer is further delayed<\/strong> by a phone call<\/strong> from Leonard and Penny<\/strong>, after which she finally says yes<\/strong>.<\/phrase>","final season<\/word>","Sheldon and Amy<\/word>","super-asymmetric string theory<\/word>","Nobel Prize in Physics<\/word>","work<\/word>","In the final season<\/strong>, Sheldon and Amy<\/strong> publish their work<\/strong> on super-asymmetric string theory<\/strong> and win the Nobel Prize in Physics<\/strong> together.<\/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':2410, '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':2410, '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':2410, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }