var presentation = ["Bart Simpson<\/word>","animated television series<\/word>","The Simpsons<\/word>","Simpson family<\/word>","ten years old<\/word>","eldest child<\/word>","only son<\/word>","Homer<\/word>","Marge<\/word>","brother<\/word>","Lisa<\/word>","Maggie<\/word>","prominent<\/word>","popular<\/word>","character traits<\/word>","mischievousness<\/word>","rebelliousness<\/word>","disrespect for authority<\/word>","chalkboard gags<\/word>","prank calls<\/word>","Moe<\/word>","catchphrases<\/word>","Bart Simpson<\/strong> is a fictional character in the American animated television series<\/strong> The Simpsons<\/strong> and part of the Simpson family<\/strong>. At ten years old<\/strong>, Bart is the eldest child<\/strong> and only son<\/strong> of Homer<\/strong> and Marge<\/strong>, and the brother<\/strong> of Lisa<\/strong> and Maggie<\/strong>. Bart's most prominent<\/strong> and popular<\/strong> character traits<\/strong> are his mischievousness<\/strong>, rebelliousness<\/strong> and disrespect for authority<\/strong>. Hallmarks of the character include his chalkboard gags<\/strong> in the opening sequence; his prank calls<\/strong> to Moe<\/strong>; and his catchphrases<\/strong>.<\/phrase>","Bart's year of birth<\/word>","I Married Marge<\/word>","early 1980s<\/word>","Simpsorama<\/word>","states his birthday<\/word>","February 23<\/word>","Lower East Side<\/word>","Springfield<\/word>","The Simpsons<\/word>","Lisa<\/word>","born<\/word>","jealous<\/word>","attention<\/word>","she received<\/word>","soon warmed to her<\/word>","Bart was her first word<\/word>","Bart's year of birth<\/strong> was stated in \"I Married Marge<\/strong>\" (season three) as being in the early 1980s<\/strong>. In \"Simpsorama<\/strong>\" (season 26) Bart states his birthday<\/strong> as February 23<\/strong>. He lived with his parents in the Lower East Side<\/strong> of Springfield<\/strong> until The Simpsons<\/strong> bought their first house. When Lisa<\/strong> was born<\/strong>, Bart was at first jealous<\/strong> of the attention<\/strong> she received<\/strong>, but he soon warmed to her<\/strong> when he discovered that Bart was her first word<\/strong>.<\/phrase>","Bart's first day of school<\/word>","early 1990s<\/word>","initial enthusiasm<\/word>","crushed<\/word>","uncaring teacher<\/word>","Marge<\/word>","became worried<\/word>","truly wrong with Bart<\/word>","recess<\/word>","Bart met<\/word>","Milhouse<\/word>","entertaining him<\/word>","other students<\/word>","gestures<\/word>","rude words<\/word>","Principal Skinner<\/word>","started school<\/word>","path you choose<\/word>","one you follow<\/word>","rest of your life<\/word>","what do you say<\/word>","moment of truth<\/word>","Bart responded<\/word>","eat my shorts<\/word>","Bart's first day of school<\/strong> was in the early 1990s<\/strong>. His initial enthusiasm<\/strong> was crushed<\/strong> by an uncaring teacher<\/strong> and Marge<\/strong> became worried<\/strong> that something was truly wrong with Bart<\/strong>. One day during recess<\/strong>, Bart met<\/strong> Milhouse<\/strong> and started entertaining him<\/strong> and other students<\/strong> with various gestures<\/strong> and rude words<\/strong>. Principal Skinner<\/strong> told him \"you've just started school<\/strong>, and the path you choose<\/strong> now may be the one you follow<\/strong> for the rest of your life<\/strong>! Now, what do you say<\/strong>?\" In his moment of truth<\/strong>, Bart responded<\/strong>, \"eat my shorts<\/strong>\".<\/phrase>","Bart's hobbies<\/word>","skateboarding<\/word>","watching television<\/word>","The Krusty the Clown Show<\/word>","The Itchy & Scratchy Show<\/word>","reading comic books<\/word>","Radioactive Man<\/word>","playing video games<\/word>","causing mischief<\/word>","favorite movies<\/word>","Jaws<\/word>","Star Wars Trilogy<\/word>","attended<\/word>","Springfield Elementary School<\/word>","Edna Krabappel<\/word>","fourth grade class<\/word>","too young<\/word>","hold a full-time job<\/word>","part-time jobs<\/word>","Krusty the Clown<\/word>","assistant<\/word>","Bart Gets Famous<\/word>","briefly owns<\/word>","factory<\/word>","Homer's Enemy<\/word>","Bart's hobbies<\/strong> include skateboarding<\/strong>, watching television<\/strong> (especially The Krusty the Clown Show<\/strong> and The Itchy & Scratchy Show<\/strong>), reading comic books<\/strong> (especially Radioactive Man<\/strong>), playing video games<\/strong> and generally causing mischief<\/strong>. His favorite movies<\/strong> are Jaws<\/strong> and the Star Wars Trilogy<\/strong>. For the duration of the series, Bart has attended<\/strong> Springfield Elementary School<\/strong> and has been in Edna Krabappel<\/strong>'s fourth grade class<\/strong>. While he is too young<\/strong> to hold a full-time job<\/strong>, he has had occasional part-time jobs<\/strong>. He works as Krusty the Clown<\/strong>'s assistant<\/strong> in \"Bart Gets Famous<\/strong>\" (season five) and briefly owns<\/strong> his own factory<\/strong> in \"Homer's Enemy<\/strong>\" (season eight).<\/phrase>","character traits<\/word>","rebelliousness<\/word>","disrespect for authority<\/word>","compared<\/word>","America's founding fathers<\/word>","described<\/word>","updated version<\/word>","Tom Sawyer<\/word>","Huckleberry Finn<\/word>","Bart's character traits<\/strong> of rebelliousness<\/strong> and disrespect for authority<\/strong> have been compared<\/strong> to that of America's founding fathers<\/strong>, and he has been described<\/strong> as an updated version<\/strong> of Tom Sawyer<\/strong> and Huckleberry Finn<\/strong>, rolled into one.<\/phrase>","Bart's rebellious attitude<\/word>","disruptive student<\/word>","Springfield Elementary School<\/word>","underachiever<\/word>","proud of it<\/word>","at odds<\/word>","teacher<\/word>","Ms. Krabappel<\/word>","Principal Skinner<\/word>","Groundskeeper Willie<\/word>","does poorly in school<\/word>","Separate Vocations<\/word>","hall monitor<\/word>","grades go up<\/word>","struggles<\/word>","does not pay attention<\/word>","not because<\/word>","stupid<\/word>","reinforced<\/word>","Brother's Little Helper<\/word>","Bart suffers from<\/word>","attention deficit disorder<\/word>","lack of smarts<\/word>","attributed<\/word>","Simpson Gene<\/word>","affects the intelligence<\/word>","male members<\/word>","Simpson family<\/word>","Bart's rebellious attitude<\/strong> has made him a disruptive student<\/strong> at Springfield Elementary School<\/strong>, where he is an underachiever<\/strong> and proud of it<\/strong>. He is constantly at odds<\/strong> with his teacher<\/strong> Ms. Krabappel<\/strong>, Principal Skinner<\/strong>, and occasionally Groundskeeper Willie<\/strong>. Bart does poorly in school<\/strong> and is well aware of it, having once declared, \"I am dumb, okay? Dumb as a post! Think I'm happy about it?\" In \"Separate Vocations<\/strong>\" (season three), Bart becomes hall monitor<\/strong> and his grades go up<\/strong>, suggesting that he struggles<\/strong> mainly because he does not pay attention<\/strong>, not because<\/strong> he is stupid<\/strong>. This idea is reinforced<\/strong> in \"Brother's Little Helper<\/strong>\", (season eleven) in which it is revealed that Bart suffers from<\/strong> attention deficit disorder<\/strong>. His lack of smarts<\/strong> can also be attributed<\/strong> to the hereditary \"Simpson Gene<\/strong>\", which affects the intelligence<\/strong> of most male members<\/strong> of the Simpson family<\/strong>.<\/phrase>","endless trouble<\/word>","shallow<\/word>","selfish<\/word>","qualities<\/word>","high integrity<\/word>","helped<\/word>","Principal Skinner<\/word>","Mrs. Krabappel<\/word>","Sweet Seymour Skinner's Song<\/word>","Bart accidentally<\/word>","got Skinner fired<\/word>","befriended him<\/word>","Bart missed having<\/word>","Skinner as an adversary<\/word>","got him rehired<\/word>","would<\/word>","could no longer be friends<\/word>","Although he gets into endless trouble<\/strong> and can be shallow<\/strong> and selfish<\/strong>, Bart also exhibits many qualities<\/strong> of high integrity<\/strong>. He has, on a few occasions, helped<\/strong> Principal Skinner<\/strong> and Mrs. Krabappel<\/strong>-- In \"Sweet Seymour Skinner's Song<\/strong>\" (season five), Bart accidentally<\/strong> got Skinner fired<\/strong> and befriended him<\/strong> outside the school environment. Bart missed having<\/strong> Skinner as an adversary<\/strong> and got him rehired<\/strong>, knowing that this would<\/strong> mean that the two could no longer be friends<\/strong>.<\/phrase>","mischievousness<\/word>","Homer<\/word>","uncaring<\/word>","incompetent behavior<\/word>","turbulent<\/word>","jaded<\/word>","violent relationship<\/word>","Bart regularly addresses Homer<\/word>","given name<\/word>","instead of Dad<\/word>","refers to him as the boy<\/word>","Due to Bart's mischievousness<\/strong> and Homer<\/strong>'s often uncaring<\/strong> and incompetent behavior<\/strong>, the two have a turbulent<\/strong>, jaded<\/strong>, and a violent relationship<\/strong>. Bart regularly addresses Homer<\/strong> by his given name<\/strong> instead of Dad<\/strong>, while Homer<\/strong> in turn often refers to him as the boy<\/strong>.<\/phrase>","Marge<\/word>","caring<\/word>","understanding<\/word>","nurturing parent<\/word>","Homer<\/word>","refers to Bart<\/word>","handful<\/word>","embarrassed by his antics<\/word>","Marge Be Not Proud<\/word>","mothering Bart too much<\/word>","acting more distant<\/word>","caught shoplifting<\/word>","Bart protested<\/word>","over-mothering<\/word>","attitude changed<\/word>","made it up to her<\/word>","experience humiliation<\/word>","pleasing his mom<\/word>","special little guy<\/word>","defended him<\/word>","many occasions<\/word>","Marge<\/strong> is a much more caring<\/strong>, understanding<\/strong> and nurturing parent<\/strong> than Homer<\/strong>, but she also refers to Bart<\/strong> as a handful<\/strong> and is often embarrassed by his antics<\/strong>. In \"Marge Be Not Proud<\/strong>\", (season seven) she felt she was mothering Bart too much<\/strong> and began acting more distant<\/strong> towards him after he was caught shoplifting<\/strong>. At the beginning of the episode, Bart protested<\/strong> at her over-mothering<\/strong> but as her attitude changed<\/strong>, he felt bad and made it up to her<\/strong>. Despite his attitude, Bart is sometimes willing to experience humiliation<\/strong> if it means pleasing his mom<\/strong>. Marge<\/strong> has expressed an understanding<\/strong> for her \"special little guy<\/strong>\" and has defended him<\/strong> on many occasions<\/strong>.<\/phrase>","sibling rivalry<\/word>","younger sister<\/word>","Lisa<\/word>","buddy-like relationship<\/word>","youngest sister<\/word>","Maggie<\/word>","hurt Lisa<\/word>","fought her physically<\/word>","very close<\/word>","cares for Lisa deeply<\/word>","always apologized<\/word>","going too far<\/word>","believes Lisa<\/word>","superior<\/word>","solving problems<\/word>","goes to her for advice<\/word>","highly protective of Lisa<\/word>","bully<\/word>","destroys<\/word>","box of cupcakes<\/word>","Bart the General<\/word>","Bart immediately stands up for her<\/word>","Bart shares a sibling rivalry<\/strong> with his younger sister<\/strong>, Lisa<\/strong>, but has a buddy-like relationship<\/strong> with his youngest sister<\/strong> Maggie<\/strong>, due to her infant state. While Bart has often hurt Lisa<\/strong>, and even fought her physically<\/strong>, the two are often very close<\/strong>. Bart cares for Lisa deeply<\/strong> and has always apologized<\/strong> for going too far<\/strong>. He also believes Lisa<\/strong> to be his superior<\/strong> when it comes to solving problems<\/strong> and frequently goes to her for advice<\/strong>. Bart is also highly protective of Lisa<\/strong>-- When a bully<\/strong> destroys<\/strong> her box of cupcakes<\/strong> in \"Bart the General<\/strong>\", (season one), Bart immediately stands up for her<\/strong>.<\/phrase>","popular<\/word>","cool boy<\/word>","has many friends<\/word>","his best friend<\/word>","Milhouse Van Houten<\/word>","embarrassment<\/word>","their friendship<\/word>","bad influence<\/word>","Milhouse<\/word>","involved<\/word>","lot of mischief<\/word>","Milhouse's mother forbids<\/word>","Milhouse from playing with Bart<\/word>","Homer Defined<\/word>","pretended<\/word>","he did not care<\/word>","realizes<\/word>","he needs Milhouse<\/word>","Marge manages to convince<\/word>","Mrs. Van Houten<\/word>","reconsider<\/word>","Bart is portrayed as a popular<\/strong> cool boy<\/strong> and has many friends<\/strong> at school. Out of all of them his best friend<\/strong> is Milhouse Van Houten<\/strong>, although Bart has at times shown embarrassment<\/strong> about their friendship<\/strong>. Bart is a bad influence<\/strong> on Milhouse<\/strong>, and the two have been involved<\/strong> in a lot of mischief<\/strong> together. Because of this behavior, Milhouse's mother forbids<\/strong> Milhouse from playing with Bart<\/strong> in \"Homer Defined<\/strong>\" (season three). While at first he pretended<\/strong> that he did not care<\/strong>, Bart eventually realizes<\/strong> that he needs Milhouse<\/strong>, and Marge manages to convince<\/strong> Mrs. Van Houten<\/strong> to reconsider<\/strong>.<\/phrase>","Milhouse<\/word>","frequent target<\/word>","local bullies<\/word>","Nelson Muntz<\/word>","his friends<\/word>","Jimbo<\/word>","Dolph<\/word>","Kearney<\/word>","more socially powerful<\/word>","Bart's social popularity<\/word>","subsided<\/word>","extreme embarrassment<\/word>","unfortunate coincidence<\/word>","Bart and the bullies<\/word>","adversaries<\/word>","declaring war on Nelson<\/word>","school bullies<\/word>","actually like Bart<\/word>","hang out with him at times<\/word>","especially Nelson<\/word>","becomes close friends with him<\/word>","Milhouse<\/strong> is a frequent target<\/strong> for local bullies<\/strong> Nelson Muntz<\/strong> and his friends<\/strong> Jimbo<\/strong>, Dolph<\/strong>, and Kearney<\/strong>. At times, Bart also finds himself at the hands of their abuse. Despite being the more socially powerful<\/strong> of the two, Bart's social popularity<\/strong> has temporarily subsided<\/strong> in various episodes either due to extreme embarrassment<\/strong> caused by his family or an unfortunate coincidence<\/strong>. While Bart and the bullies<\/strong> have been adversaries<\/strong> at times, with Bart once declaring war on Nelson<\/strong>, the school bullies<\/strong> actually like Bart<\/strong> for his ways and hang out with him at times<\/strong>, especially Nelson<\/strong> who eventually becomes close friends with him<\/strong>.<\/phrase>","biggest fans<\/word>","Krusty the Clown<\/word>","sleeps in a room<\/word>","Krusty merchandise<\/word>","helped<\/word>","clown<\/word>","many occasions<\/word>","foiling<\/word>","Sideshow Bob<\/word>","frame Krusty<\/word>","armed robbery<\/word>","Krusty Gets Busted<\/word>","reuniting Krusty<\/word>","estranged father<\/word>","Like Father, Like Clown<\/word>","helping Krusty return to the air<\/word>","comeback special<\/word>","reignite his career<\/word>","Krusty Gets Kancelled<\/word>","Krusty has remained<\/word>","ignorant<\/word>","Bart's help<\/word>","treats Bart<\/word>","disinterest<\/word>","summer<\/word>","attended<\/word>","Kamp Krusty<\/word>","disaster<\/word>","Krusty nowhere to be seen<\/word>","Bart keeps his hopes up<\/word>","Krusty would show up<\/word>","pushed over the edge<\/word>","sick of<\/word>","Krusty's shoddy merchandise<\/word>","takes over the camp<\/word>","Krusty immediately visits the camp<\/word>","ending the conflict<\/word>","appease Bart<\/word>","Bart is one of the biggest fans<\/strong> of children's television host Krusty the Clown<\/strong>. He once declared, \"I've based my whole life on Krusty's teachings,\" and sleeps in a room<\/strong> filled with Krusty merchandise<\/strong>. He has helped<\/strong> the clown<\/strong> on many occasions<\/strong>, for example, foiling<\/strong> Sideshow Bob<\/strong>'s attempt to frame Krusty<\/strong> for armed robbery<\/strong> in \"Krusty Gets Busted<\/strong>\" (season one), reuniting Krusty<\/strong> with his estranged father<\/strong> in \"Like Father, Like Clown<\/strong>\" and helping Krusty return to the air<\/strong> with a comeback special<\/strong> and reignite his career<\/strong> in \"Krusty Gets Kancelled<\/strong>\". For his part, Krusty has remained<\/strong> largely ignorant<\/strong> of Bart's help<\/strong> and treats Bart<\/strong> with disinterest<\/strong>. One summer<\/strong>, Bart enthusiastically attended<\/strong> Kamp Krusty<\/strong>, which turned out to be a disaster<\/strong>, with Krusty nowhere to be seen<\/strong>. Bart keeps his hopes up<\/strong> by believing that Krusty would show up<\/strong>, but is soon pushed over the edge<\/strong>, and finally decides that he is sick of<\/strong> Krusty's shoddy merchandise<\/strong> and takes over the camp<\/strong>. Krusty immediately visits the camp<\/strong> in hopes of ending the conflict<\/strong> and manages to appease Bart<\/strong>.<\/phrase>","Bart foiled<\/word>","Sideshow Bob<\/word>","plans<\/word>","Krusty Gets Busted<\/word>","long-standing feud<\/word>","Bob has appeared<\/word>","fourteen episodes<\/word>","various evil schemes<\/word>","getting revenge on Bart<\/word>","Simpson family<\/word>","always foiled<\/word>","end<\/word>","When Bart foiled<\/strong> Sideshow Bob<\/strong>'s plans<\/strong> in \"Krusty Gets Busted<\/strong>\", it sparked a long-standing feud<\/strong> between the two. Bob has appeared<\/strong> in fourteen episodes<\/strong>, generally plotting various evil schemes<\/strong> which often have to do with getting revenge on Bart<\/strong> (and sometimes the entire Simpson family<\/strong> by proxy), but is always foiled<\/strong> in the end<\/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':3214, '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':3214, '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':3214, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }