Static quiz module with predefined answers I was building a quiz module for one website. It is a simple true/false statements where you first choose the answer, the correct answer is displayed, and then you can move forward to the next question. 

For better understanding, please find working code snippet here.

I need mentor guidance in order to make my existing code shorter and optimized. 

Here is the jQuery code for this quiz module:

var flag = $('.quiz ul'),
    currentPosition = 0,
    currentQuestion = 0,
    slideWidth = 200,
    option = $('.flag'),
    tryCTA = $('.CTAtry'),
    nextQuestion = $('.next'),
    answer = $('span.answer')
    questionWrapper = $('.quiz ul'),
    totalQuestions = $('.quiz ul li').length,
    answers = ["True","False","False"];

//Set UL width    
questionWrapper.css('width',totalQuestions*slideWidth)

  option.on('click',function(e) {
      e.preventDefault();
      var nextCTA = $(this).parent().next(nextQuestion).length,
          optionWrapper = $(this).parent();
      if(nextCTA) {
          optionWrapper.next(nextQuestion).show();
      } else {
          tryCTA.show();
      }
      optionWrapper.parent().find(answer).html(answers[currentQuestion]).show();
      optionWrapper.hide();
  });

  nextQuestion.on('click',function(e){
      e.preventDefault();
      currentPosition = currentPosition+1;
      $(this).parent().parent().animate({
          'marginLeft' : slideWidth*(-currentPosition)
      });
      currentQuestion++;
  });

  tryCTA.on('click',function(e) {
      e.preventDefault();
      resetQuiz(e);
      $(this).hide();
  })

  function resetQuiz(e) {
      $('.quiz ul').animate({
           opacity: 0
      },0)
      .animate({
           opacity: 1            
       },500)

      $('span.answer').html(" ");
      $('.quiz ul').css('margin-left','0');
      $('.options').show();    
      $('.next').hide();
      currentPosition = 0;
      currentQuestion = 0;
  }


HTML: 

&lt;div class="quiz"&gt;
&lt;ul&gt;
    &lt;li&gt;
        &lt;span class="answer"&gt;&lt;/span&gt;
        &lt;p&gt;Writing Object Oriented JavaScript is not a FUN.&lt;/p&gt;
        &lt;div class="options"&gt;
            &lt;a href="" class="flag"&gt;True&lt;/a&gt;
            &lt;span&gt;or&lt;/span&gt;
            &lt;a href="" class="flag"&gt;False&lt;/a&gt;
        &lt;/div&gt;                        
        &lt;a href="" class="next"&gt;Next&lt;/a&gt;
    &lt;/li&gt;
    &lt;li&gt;
        &lt;span class="answer"&gt;&lt;/span&gt;
        &lt;p&gt;Let's give it a try! No harm in learning anything NEW.&lt;/p&gt;
        &lt;div class="options"&gt;
            &lt;a href="" class="flag"&gt;True&lt;/a&gt;
            &lt;span&gt;or&lt;/span&gt;
            &lt;a href="" class="flag"&gt;False&lt;/a&gt;
        &lt;/div&gt;
        &lt;a href="" class="next"&gt;Next&lt;/a&gt;
    &lt;/li&gt;
    &lt;li&gt;
        &lt;span class="answer"&gt;&lt;/span&gt;
        &lt;p&gt;Some code running !&lt;/p&gt;
        &lt;div class="options"&gt;
            &lt;a href="" class="flag"&gt;True&lt;/a&gt;
            &lt;span&gt;or&lt;/span&gt;
            &lt;a href="" class="flag"&gt;False&lt;/a&gt;
        &lt;/div&gt;
    &lt;/li&gt;
&lt;/ul&gt;
&lt;a href="" class="CTAtry"&gt;Try Again!&lt;/a&gt;
&lt;/div&gt;
Overall this is already pretty well organized and compact.  There isn't a lot of duplication or obvious abstractions that can be made.  It would be helpful to see the HTML to see if there are any changes that would make the Javascript easier to write.
A couple of suggestions:

Wrap the entire code block in an IIFE to avoid cluttering global namespace
 (function ($, undefined) {
     // Your code here ...
 } (jQuery));


Use .width() instead of .css('width', ...)

Some of your variables are only being referenced once and can be inlined:
 $('.flag').on('click', ...); // etc.