anchor.diff:          <%= image_tag "quiz_launch_error.png", style:'width:40%' %>
         </div>
   
  -      Your <strong>routes.rb</strong> file at the end should somewhat look like this for our Quiz application:<br><br>
  +      Your <strong>routes.rb</strong> file at the end should somewhat
  +      look like this for our Quiz application:
  +      <br><br>
         <pre>
           Rails.application.routes.draw do
  -          get 'quiz/index'
  -          resources :questions
  -          post 'questions/submitQuestion'=>'questions#submitQuestion', as: :submit_question
  -          root 'sessions#login'
  -          get "signup", :to => "users#new"
  -          get "login", :to => "sessions#login"
  -          get "logout", :to => "sessions#logout"
  -          get "home", :to => "sessions#home"
  -          get "profile", :to => "sessions#profile"
  -          get "setting", :to => "sessions#setting"
  -          post "signup", :to => "users#new"
  -          post "login", :to => "sessions#login"
  -          post "logout", :to => "sessions#logout"
  -          post "login_attempt", :to => "sessions#login_attempt"
  -          get "login_attempt", :to => "sessions#login_attempt"
  -          post "user_create", :to => "users#create"
  -          get "all", :to => "questions#index"
  -          get "result", :to => "questions#result"
  -          get 'lti/launch'
  -          post 'lti/launch'
  -          get 'lti/submitscore'
  -          post 'lti/submitscore'
  +        get 'quiz/index'
  +        resources :questions
  +        post 'questions/submitQuestion'=>'questions#submitQuestion', as: :submit_question
  +        root 'sessions#login'
  +        get "signup", :to => "users#new"
  +        get "login", :to => "sessions#login"
  +        get "logout", :to => "sessions#logout"
  +        get "home", :to => "sessions#home"
  +        get "profile", :to => "sessions#profile"
  +        get "setting", :to => "sessions#setting"
  +        post "signup", :to => "users#new"
  +        post "login", :to => "sessions#login"
  +        post "logout", :to => "sessions#logout"
  +        post "login_attempt", :to => "sessions#login_attempt"
  +        get "login_attempt", :to => "sessions#login_attempt"
  +        post "user_create", :to => "users#create"
  +        get "all", :to => "questions#index"
  +        get "result", :to => "questions#result"
  +        get 'lti/launch'
  +        post 'lti/launch'
  +        get 'lti/submitscore'
  +        post 'lti/submitscore'
           end
         </pre>
       </p><br>
   
       <p>
  -      At this point you have a working LTI enabled quiz application which will work as is for non LTI launches (on your own domain) and will also work as an LTI tool when launched from within a tool consumer. If it is launched from within a tool consumer, then once a user submits an assessment, his scores will be recorded in a gradebook. On Canvas it will look like this:
  +      At this point you should have a working LTI-enabled quiz
  +      application.
  +      It will work as-is for non LTI launches (on your own domain),
  +      and will also work as an LTI tool when launched from within a
  +      tool consumer.
  +      If it is launched from within a tool consumer,
  +      then once a user submits an assessment, his scores can be
  +      recorded in the tool consumer's gradebook.
  +      On Canvas it will look like this:
   
         <div class="text-center">
           <%= image_tag "quiz_result.png", style:'width:50%' %>
         </div><br><br>
         Here you can download the
  -      <a href="https://github.com/CSSPLICE/LTI/tree/master/Quiz-LTI">complete source code</a> for a version of the quiz application with LTI support.
  +      <a href="https://github.com/CSSPLICE/LTI/tree/master/Quiz-LTI">complete source code</a>
  +      for a version of the quiz application with LTI support.
       </p>
     </span>
   </div>
  
positive.code:       <pre>
          require 'oauth/request_proxy/action_controller_request'
          @provider = IMS::LTI::ToolProvider.new(
            params[:oauth_consumer_key],
            Rails.configuration.lti_settings[params[:oauth_consumer_key]],
            params
          )
  
          if not @provider.valid_request?(request)
            # the request wasn't validated
            render :launch_error, status: 401
            return
          end</pre>
      </p><br>
  
      <p>
        <strong>Step 7:</strong>
        At this point, you have a valid and authentic LTI request. Now, our quiz application requires a user to be logged in order to take a quiz but this application is launched through Canvas and the whole purpose of LTI is to provide seamless experience to user. Therefore, we will have to create a user account and log him in automatically. To do so, add the following code.
        <pre>
          @@launch_params=params;
          email = params[:lis_person_contact_email_primary]
          @user = User.where(email: email).first
          if @user.blank?
            @user = User.new(:username => email,
                             :email => email,
                             :password => email,
                             :password_confirmation => email)
            if !@user.save
              puts @user.errors.full_messages.first
            end
          end
  
          #Login the user and create his session.
  
negative.code:       controller named <i><strong>lti</i></strong> with
        a <i><strong>launch</i></strong> endpoint (so the url can say
        '..../lti/launch' for readability). This launch endpoint will
        receive the post request from the tool consumer, and we will
        validate and authenticate the LTI requests within this
        endpoint.
      </p><br>
  
      <p>
        <strong>Step 4:</strong>
        We need is to keep a check if our application is
        launched as an LTI application or not.
        If it is launched as an LTI application, then we will have to
        make a few changes to the normal behavior of our app.
        Typically, we might need to hide the header and footer that we
        display to other users, because the application will load in an
        iframe.
        In that context, it should look like a part of a Tool
        Consumer.
        Also, we will have to send scores back to the Tool Consumer.
        This might imply that we don't want to show the results to the
        user ourselves, such as displaying a results page.
        For example, our simple Quiz application will
        look like this if you do not remove the header from an
        LTI launch:
        <div class="text-center">
          <%= image_tag "quiz_no_iframe.png", style:'width:40%' %>
        </div><br><br>
  
        To fix this, add the following line at the beginning of the <em>launch</em> endpoint.
        <pre>
          session[:isLTI]=true</pre>
        To hide the header, add the following
        in <em>views/layout/application.html.erb</em> after moving
        header code in the <em>_header</em> partial.
        <br><br>
        <pre>
          render "layouts/header" unless session[:isLTI]</pre>
        Now, when your application is launched inside a tool provider
        like Canvas, it will look like this:
        <div class="text-center">
          <%= image_tag "quiz_iframe.png", style:'width:40%' %>
        </div><br><br>
      </p><br>
  
      <p>
  