Commit 3b3133a4 by Harsh Shah

Bugfix: Assessment Completed logic considering only left questions

parent 05a36e6f
......@@ -112,7 +112,7 @@ public class Candidate extends BaseCandidate
public boolean assessmentCompleted(Job job) //role
{
int allAnswersCount = job.getAllLeftQuestions(Arrays.asList(Question.searchAll(getTransaction()))).size();
int allAnswersCount = job.getAllQuestions().size();
if(allAnswersCount > 0)
{
......
......@@ -130,6 +130,15 @@ public class Job extends BaseJob
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
public List<Question> getAllLeftQuestions(List<Question> totalQuestions)
......
......@@ -323,7 +323,7 @@ public class JobApplication extends BaseJobApplication
int remainingTime = 0;
//REQ
if(getJob()!=null && getJob().getIncludeAssessmentCriteria()==Boolean.TRUE)
if(getJob()!=null && isTrue(getJob().getIncludeAssessmentCriteria()))
{
if(!selectionCompleted())
{
......@@ -359,7 +359,7 @@ public class JobApplication extends BaseJobApplication
}
else //partially completed test for role
{
int allAnswersCount = getJob().getAllLeftQuestions(Arrays.asList(Question.searchAll(getTransaction()))).size();
int allAnswersCount = getJob().getAllQuestions().size();
if(allAnswersCount > 0)
{
......@@ -374,7 +374,6 @@ public class JobApplication extends BaseJobApplication
}
}
}
return remainingTime;
}
}
\ No newline at end of file
......@@ -20,7 +20,7 @@
if(totalQuestions == null)
{
totalQuestions = Arrays.asList(Question.searchAll(transaction));
totalQuestions = job.getAllQuestions();
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