displays welcome back when test has started

This commit is contained in:
Mark Moser
2016-08-02 18:30:15 -05:00
parent 1a97bb16fa
commit a3eab2b27a
4 changed files with 32 additions and 0 deletions

View File

@ -14,6 +14,7 @@ class ApplicationController < ActionController::Base
def current_candidate
@current_candidate ||= Candidate.find_by(test_hash: session[:test_id]) if session[:test_id]
end
helper_method :current_candidate
private

View File

@ -11,6 +11,7 @@ class CandidateController < ApplicationController
end
def welcome
render :welcome_back if current_candidate.answers.count > 0
end
def saved

View File

@ -0,0 +1,16 @@
<% content_for :title, "Skills Assessment" %>
<main class="intro_tpl">
<h1 class="prft-heading">Welcome Back</h1>
<p>Hello <%= current_candidate.name %></p>
<p>
We are ready to pick up where you left off.
</p>
<div class="btn-return">
<%= link_to "Return to Test", question_path, { class: "btn primary-btn" } %>
</div>
</main>