updates progress bar accuracy
The progress bar now accounts for live coders that have opted for "finish later" Address part of issue #63
This commit is contained in:
@ -18,6 +18,7 @@ class Candidate < ApplicationRecord
|
||||
|
||||
def answered_questions
|
||||
answers.where.not(answer: nil)
|
||||
.where("answers.answer not like '%later:%'")
|
||||
end
|
||||
|
||||
def fetch_question qid
|
||||
@ -25,12 +26,15 @@ class Candidate < ApplicationRecord
|
||||
end
|
||||
|
||||
def my_quiz
|
||||
CandidateQuiz.new(id).build_my_quiz
|
||||
@candidate_quiz ||= CandidateQuiz.new(id).build_my_quiz
|
||||
end
|
||||
|
||||
def my_status
|
||||
@candidate_status ||= QuizStatus.new(self)
|
||||
end
|
||||
|
||||
def status
|
||||
# TODO: quiz status: not started, started, completed
|
||||
"--"
|
||||
"#{my_status.progress}%"
|
||||
end
|
||||
|
||||
def complete!
|
||||
|
@ -11,7 +11,9 @@
|
||||
<th>Test ID</th>
|
||||
<th>Email</th>
|
||||
<th>Experience</th>
|
||||
<th>Status</th>
|
||||
<th>Progress</th>
|
||||
<th>Completed</th>
|
||||
<th>Reminded</th>
|
||||
</tr>
|
||||
|
||||
<% @candidates.each do |candidate| %>
|
||||
@ -21,6 +23,8 @@
|
||||
<td><%= mail_to(candidate.email) %></td>
|
||||
<td><%= candidate.experience %> years</td>
|
||||
<td><%= candidate.status %></td>
|
||||
<td><%= candidate.completed ? "Submitted" : "" %></td>
|
||||
<td><%= candidate.reminded ? "Yes" : "" %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
Reference in New Issue
Block a user