diff --git a/app/assets/images/icon-dropdownlist.png b/app/assets/images/icon-dropdownlist.png new file mode 100644 index 0000000..759e862 Binary files /dev/null and b/app/assets/images/icon-dropdownlist.png differ diff --git a/app/assets/images/icon-unorderedlistbullet.png b/app/assets/images/icon-unorderedlistbullet.png new file mode 100644 index 0000000..7cbd331 Binary files /dev/null and b/app/assets/images/icon-unorderedlistbullet.png differ diff --git a/app/assets/images/perficientdigital.png b/app/assets/images/perficientdigital.png new file mode 100644 index 0000000..cf0c8ac Binary files /dev/null and b/app/assets/images/perficientdigital.png differ diff --git a/app/controllers/candidate_controller.rb b/app/controllers/candidate_controller.rb new file mode 100644 index 0000000..aa6cb4c --- /dev/null +++ b/app/controllers/candidate_controller.rb @@ -0,0 +1,19 @@ +class CandidateController < ApplicationController + def welcome + end + + def question + @question = Question.where(input_type: 'live-coder').order("RAND()").first + @status = QuizStatus.new(Candidate.order("RAND()").first) + @answer = @question.answers.order("RAND()").first + end + + def summary + end + + def thankyou + end + + def saved + end +end diff --git a/app/views/candidate/question.html.erb b/app/views/candidate/question.html.erb new file mode 100644 index 0000000..942631c --- /dev/null +++ b/app/views/candidate/question.html.erb @@ -0,0 +1,53 @@ +<% + content_for :title, "Skills Assessment" + content_for :category, @question.category + content_for :footer_title, "Skills Assessment" +%> +
+
+

<%= @question.question %>

+ <%= render partial: "questions/#{@question.input_type}" %> + + <% if @status.on_summary %> + +
+ +
+ + <% else %> + +
+ +
+
+ +
+ + <% end %> +
+
+ + diff --git a/app/views/candidate/saved.html.erb b/app/views/candidate/saved.html.erb new file mode 100644 index 0000000..8d2eb0e --- /dev/null +++ b/app/views/candidate/saved.html.erb @@ -0,0 +1,8 @@ +

+ Your test results have been saved. You can visit again later with your candidate ID to complete + the test starting from where you left off. +

+ +
+ Return to Test +
diff --git a/app/views/candidate/summary.html.erb b/app/views/candidate/summary.html.erb new file mode 100644 index 0000000..4d178c1 --- /dev/null +++ b/app/views/candidate/summary.html.erb @@ -0,0 +1,2 @@ +

Candidate#summary

+

Find me in app/views/candidate/summary.html.erb

diff --git a/app/views/candidate/thankyou.html.erb b/app/views/candidate/thankyou.html.erb new file mode 100644 index 0000000..4f04a58 --- /dev/null +++ b/app/views/candidate/thankyou.html.erb @@ -0,0 +1,5 @@ +

+ Your answers have been submitted. We will review and your recruiter + will contact you if we would like to set up an interview. +

+ diff --git a/app/views/candidate/welcome.html.erb b/app/views/candidate/welcome.html.erb new file mode 100644 index 0000000..db8866f --- /dev/null +++ b/app/views/candidate/welcome.html.erb @@ -0,0 +1,43 @@ +<% content_for :title, "Skills Assessment" %> + + + +
+

Oops!

+

+ Looks like you hit the browser's Back button. You can't go backwards in the test, + but you'll have a chance at the end to review your answers and make changes. +

+ +
+ + + +
+

Let's Get Started

+

+ This is a skills assessment test. It's the first step in the process of interviewing + for a Front-End Development position with Perficient Digital. +

+

+ The questions will test your knowledge in the areas of HTML, CSS, and JavaScript. + Please note that you can only move forward through the test, not back, + and you must attempt to answer the question before moving to the + next one. You'll have an opportunity at the end of the test to review and update your + answers if need be. At any time, you may save your progress and log back in to continue + taking the test from where you left off. +

+

+ Please answer to the best of your ability—it's totally okay to say + "I don't know"!—and above all, relax and have fun! Once you submit your + answers, we will review your assessment and your recruiter will be in touch. +

+ +
+
+ + +
+ +
+
diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb new file mode 100644 index 0000000..9ba1d7e --- /dev/null +++ b/app/views/layouts/_footer.html.erb @@ -0,0 +1,5 @@ + diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 71eab8a..1515cdc 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,14 +1,38 @@ - - - SkillAssessmentApp + + + + <%= csrf_meta_tags %> - <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> - <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> - + <%= yield(:title) %> + <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> + + - <%= yield %> +
+ <% if content_for?(:category) %> + +
+ -- NO PROGRESS BAR ON EDITS -- +
+
Section: <%= yield(:category) %>
+
+
+ + <% else %> + +
+
+
Perficient Digital Skills Assessment
+
+
+ + <% end %> + <%= yield %> +
+ <%= render partial: 'layouts/footer' %> + <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> diff --git a/app/views/questions/_checkbox.html.erb b/app/views/questions/_checkbox.html.erb new file mode 100644 index 0000000..bdc1c59 --- /dev/null +++ b/app/views/questions/_checkbox.html.erb @@ -0,0 +1,20 @@ +
+ + <% + @question.input_options.each do | option | + option_id = "#{option.parameterize}_#{@question.to_i}" + %> +
+ + > + +
+ <% end %> + + -- MOVE TO FLASH HASH -- +
Please select or enter an answer.
+
diff --git a/app/views/questions/_live-coder.html.erb b/app/views/questions/_live-coder.html.erb new file mode 100644 index 0000000..ba2b10e --- /dev/null +++ b/app/views/questions/_live-coder.html.erb @@ -0,0 +1,41 @@ +
+ Please revisit this page with JavaScript enabled to modify your answer. +
+ +
+

+ This is a question where you will be asked to write code, and it utilizes a JavaScript-enabled + environment. It looks like JavaScript is not loaded for some reason. Please check the box below + to acknowledge that you agree to come back at a later time to finish answering this question + before you can submit the test. +

+ + +
+ +
+ <% + # answers inserted dynamically via jQuery .load() + # to check for JS capability/enabled + %> + +
+ + +
+ +
+ + +
+ +
+ + +
+ + -- MOVE TO FLASH HASH -- +
You must write code in one of the above textareas to progress.
+ +
+
diff --git a/app/views/questions/_radio.html.erb b/app/views/questions/_radio.html.erb new file mode 100644 index 0000000..3975252 --- /dev/null +++ b/app/views/questions/_radio.html.erb @@ -0,0 +1,20 @@ +
+ + <% + @question.input_options.each do | option | + option_id = "#{option.parameterize}_#{@question.to_i}" + %> +
+ + > + +
+ <% end %> + + -- MOVE TO FLASH HASH -- +
Please select or enter an answer. (The character limit for a textarea answer is 1000)
+
diff --git a/app/views/questions/_text.html.erb b/app/views/questions/_text.html.erb new file mode 100644 index 0000000..baba253 --- /dev/null +++ b/app/views/questions/_text.html.erb @@ -0,0 +1,11 @@ +
+ + + + +
Characters remaining:
+ + -- MOVE TO FLASH HASH -- +
Please select or enter an answer. (The character limit for a textarea answer is 1000)
+ +
diff --git a/app/workers/quiz_status.rb b/app/workers/quiz_status.rb index 9e6d695..8b5af02 100644 --- a/app/workers/quiz_status.rb +++ b/app/workers/quiz_status.rb @@ -20,4 +20,27 @@ class QuizStatus def can_submit on_summary && candidate.answered_questions.count == candidate.questions.count end + + # query($TotalQuestions); + # $TotalQuestions = $result->num_rows + 1; + # + # $progressBarValue = round($questionId/$TotalQuestions * 100); + # $_SESSION['pBarValue'] = $progressBarValue; + # + # $pValue = $_SESSION['pBarValue']; + # + # if(!isset($_GET['qid'])) { ?> + #
+ #
+ # % + #
+ #
+ # end diff --git a/config/routes.rb b/config/routes.rb index 787824f..fdf912c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,3 +1,10 @@ Rails.application.routes.draw do + get "/welcome", to: 'candidate#welcome', as: :welcome + get "/thankyou", to: 'candidate#thankyou', as: :thankyou + get "/saved", to: 'candidate#saved', as: :saved + get "/summary", to: 'candidate#summary', as: :summary + get "/question", to: 'candidate#question', as: :question + + root to: 'candidate#welcome' # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html end