Commit 3b3133a4 by Harsh Shah

Bugfix: Assessment Completed logic considering only left questions

parent 05a36e6f
...@@ -112,7 +112,7 @@ public class Candidate extends BaseCandidate ...@@ -112,7 +112,7 @@ public class Candidate extends BaseCandidate
public boolean assessmentCompleted(Job job) //role public boolean assessmentCompleted(Job job) //role
{ {
int allAnswersCount = job.getAllLeftQuestions(Arrays.asList(Question.searchAll(getTransaction()))).size(); int allAnswersCount = job.getAllQuestions().size();
if(allAnswersCount > 0) if(allAnswersCount > 0)
{ {
......
...@@ -130,6 +130,15 @@ public class Job extends BaseJob ...@@ -130,6 +130,15 @@ public class Job extends BaseJob
return getAssessmentCriteraByType(criteria).size(); return getAssessmentCriteraByType(criteria).size();
} }
public List<Question> getAllQuestions()
{
return Arrays.asList(Question.searchAll(getTransaction()));
}
public List<Question> getAllLeftQuestions()
{
return getAllLeftQuestions(getAllQuestions());
}
//to get only left Questions //to get only left Questions
public List<Question> getAllLeftQuestions(List<Question> totalQuestions) public List<Question> getAllLeftQuestions(List<Question> totalQuestions)
......
...@@ -323,7 +323,7 @@ public class JobApplication extends BaseJobApplication ...@@ -323,7 +323,7 @@ public class JobApplication extends BaseJobApplication
int remainingTime = 0; int remainingTime = 0;
//REQ //REQ
if(getJob()!=null && getJob().getIncludeAssessmentCriteria()==Boolean.TRUE) if(getJob()!=null && isTrue(getJob().getIncludeAssessmentCriteria()))
{ {
if(!selectionCompleted()) if(!selectionCompleted())
{ {
...@@ -359,7 +359,7 @@ public class JobApplication extends BaseJobApplication ...@@ -359,7 +359,7 @@ public class JobApplication extends BaseJobApplication
} }
else //partially completed test for role else //partially completed test for role
{ {
int allAnswersCount = getJob().getAllLeftQuestions(Arrays.asList(Question.searchAll(getTransaction()))).size(); int allAnswersCount = getJob().getAllQuestions().size();
if(allAnswersCount > 0) if(allAnswersCount > 0)
{ {
...@@ -374,7 +374,6 @@ public class JobApplication extends BaseJobApplication ...@@ -374,7 +374,6 @@ public class JobApplication extends BaseJobApplication
} }
} }
} }
return remainingTime; return remainingTime;
} }
} }
\ No newline at end of file
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
if(totalQuestions == null) if(totalQuestions == null)
{ {
totalQuestions = Arrays.asList(Question.searchAll(transaction)); totalQuestions = job.getAllQuestions();
process.setAttribute("TotalQuestions", totalQuestions); process.setAttribute("TotalQuestions", totalQuestions);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment