Commit b1453e0a by Harsh Shah

Percentage for Role Fit: percentage should be relative to maximum possible value

parent ecca434f
......@@ -351,11 +351,23 @@ public class JobApplication extends BaseJobApplication
//This will return relative percentage considering topper as 100%
public Double getRoleFitPercentage()
{
JobApplication jobTopper = getJob() != null ? getJob().getTopper() : null;
Double myScore = getRoleFitScore();
Double topScore = jobTopper != null ? jobTopper.getRoleFitScore() : null;
Double myScore = getRoleFitScore();
return NullArith.round(NullArith.divide(NullArith.multiply(myScore, 100), topScore), 2);
if(myScore > 0 && getCandidate() != null && getJob() != null && getJob().getLevel() != null)
{
TestAnalysis testAnalysis = getCandidate().getTestAnalysisFor(getJob().getLevel());
if(testAnalysis != null)
{
Double topScore = AnalysisEngine.getSuitabilityScore(testAnalysis, true).get0();
if(topScore > 0)
{
return NullArith.round(NullArith.divide(NullArith.multiply(myScore, 100), topScore), 2);
}
}
}
return 0d;
}
public List<AppProcessOption> getValidProcessOptions()
......
......@@ -438,18 +438,18 @@ public class AnalysisEngine
}
scoreMap.put(factorClass, new Tuple.T2(score, colorCode));
}
scoreMap.put(null, getSuitabilityScore(testAnalysis));
scoreMap.put(null, getSuitabilityScore(testAnalysis, false));
}
LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1, "AnalysisEngine --> getRoleFitSuitability completed for candidate ", candidate, " Level ", level);
return scoreMap;
}
public static Tuple.T2<Double, ColorCode> getSuitabilityScore(TestAnalysis testAnalysis)
public static Tuple.T2<Double, ColorCode> getSuitabilityScore(TestAnalysis testAnalysis, boolean maxScore)
{
LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1, "AnalysisEngine --> getSuitabilityScore called for testAnalysis ", testAnalysis);
Double totalScore = testAnalysis.getWghtdLevelScore();
Double totalScore = maxScore ? testAnalysis.getMaxWghtdLevelScore() : testAnalysis.getWghtdLevelScore();
Double wghtdMeanScore = 0d;
Double wghtdStdDevScore = 0d;
Double suitabilityScore = 0d;
......
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