Commit 055d0806 by Harsh Shah

For Role Fit Factors displaying % of tScore of Factor vs Max value for that specific factor

parent 3a8b9caf
package performa.orm; package performa.orm;
import oneit.utils.math.NullArith;
public class ClassNormalisation extends BaseClassNormalisation public class ClassNormalisation extends BaseClassNormalisation
{ {
...@@ -16,4 +18,9 @@ public class ClassNormalisation extends BaseClassNormalisation ...@@ -16,4 +18,9 @@ public class ClassNormalisation extends BaseClassNormalisation
{ {
return "ClassNormalisation"; return "ClassNormalisation";
} }
public Double getRoleFitScore(Integer weightedScore)
{
return NullArith.round(((10 * ((weightedScore - getWghtMeanScore()) / getWghtStddevScore())) + 50), 1);
}
} }
\ No newline at end of file
...@@ -313,8 +313,8 @@ public class JobApplication extends BaseJobApplication ...@@ -313,8 +313,8 @@ public class JobApplication extends BaseJobApplication
{ {
try try
{ {
Map<FactorClass, Map<FactorLevelLink, Map>> factorScoreDetails = new LinkedHashMap(); Map<FactorClass, Map<FactorLevelLink, Map>> factorScoreDetails = new LinkedHashMap();
Map<FactorClass, Tuple.T2<Double, ColorCode>> roleScoreMap = (Map<FactorClass, Tuple.T2<Double, ColorCode>>) getRoleFit(); Map<FactorClass, Tuple.T3<Double, ColorCode, Double>> roleScoreMap = (Map<FactorClass, Tuple.T3<Double, ColorCode, Double>>) getRoleFit();
for(FactorClass factorClass : getSortedFactorClasses()) for(FactorClass factorClass : getSortedFactorClasses())
{ {
...@@ -335,7 +335,7 @@ public class JobApplication extends BaseJobApplication ...@@ -335,7 +335,7 @@ public class JobApplication extends BaseJobApplication
public Double getRoleFitScore() public Double getRoleFitScore()
{ {
return getRoleFit() != null && getRoleFit().get(null) != null ? ((Tuple.T2<Double, ColorCode>)getRoleFit().get(null)).get0() : 0d; return getRoleFit() != null && getRoleFit().get(null) != null ? ((Tuple.T3<Double, ColorCode, Double>)getRoleFit().get(null)).get0() : 0d;
} }
public Long getCultureFitScore() public Long getCultureFitScore()
...@@ -375,26 +375,9 @@ public class JobApplication extends BaseJobApplication ...@@ -375,26 +375,9 @@ public class JobApplication extends BaseJobApplication
return score >= 80 ? "green" : (score >= 60 ? "yellow" : "red-b"); return score >= 80 ? "green" : (score >= 60 ? "yellow" : "red-b");
} }
//This will return relative percentage considering topper as 100%
public Double getRoleFitPercentage() public Double getRoleFitPercentage()
{ {
Double myScore = getRoleFitScore(); return getRoleFit() != null && getRoleFit().get(null) != null ? ((Tuple.T3<Double, ColorCode, Double>)getRoleFit().get(null)).get2() : 0d;
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() public List<AppProcessOption> getValidProcessOptions()
......
package performa.orm; package performa.orm;
import oneit.utils.math.NullArith;
public class LevelNormalisation extends BaseLevelNormalisation public class LevelNormalisation extends BaseLevelNormalisation
{ {
...@@ -16,4 +18,9 @@ public class LevelNormalisation extends BaseLevelNormalisation ...@@ -16,4 +18,9 @@ public class LevelNormalisation extends BaseLevelNormalisation
{ {
return "LevelNormalisation"; return "LevelNormalisation";
} }
public Double getRoleFitScore(Double weightedScore)
{
return NullArith.round(((10 * ((weightedScore - getWghtMeanScore()) / getWghtStddevScore())) + 50), 2);
}
} }
\ No newline at end of file
...@@ -413,12 +413,12 @@ public class AnalysisEngine ...@@ -413,12 +413,12 @@ public class AnalysisEngine
return roleFitMap; return roleFitMap;
} }
public static Map<FactorClass, Tuple.T2<Double, ColorCode>> getRoleFitSuitability(Candidate candidate, Level level) public static Map<FactorClass, Tuple.T3<Double, ColorCode, Double>> getRoleFitSuitability(Candidate candidate, Level level)
{ {
LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1, "AnalysisEngine --> getRoleFitSuitability called for candidate ", candidate, " Level ", level); LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1, "AnalysisEngine --> getRoleFitSuitability called for candidate ", candidate, " Level ", level);
TestAnalysis testAnalysis = candidate.getTestAnalysisFor(level); TestAnalysis testAnalysis = candidate.getTestAnalysisFor(level);
Map<FactorClass, Tuple.T2<Double, ColorCode>> scoreMap = new HashMap(); Map<FactorClass, Tuple.T3<Double, ColorCode, Double>> scoreMap = new HashMap();
if(testAnalysis != null && testAnalysis.getCandidateClassScoresCount() > 0) if(testAnalysis != null && testAnalysis.getCandidateClassScoresCount() > 0)
{ {
...@@ -429,30 +429,36 @@ public class AnalysisEngine ...@@ -429,30 +429,36 @@ public class AnalysisEngine
CandidateClassScore candidateClassScore = testAnalysis.pipelineTestAnalysis().toCandidateClassScores(candidateClassScoreFilter).val(); CandidateClassScore candidateClassScore = testAnalysis.pipelineTestAnalysis().toCandidateClassScores(candidateClassScoreFilter).val();
ClassNormalisation classNormalisation = level.getClassNormalisationFor(factorClass); ClassNormalisation classNormalisation = level.getClassNormalisationFor(factorClass);
Double score = 0d; Double score = 0d;
Double maxScore = 0d;
Double scorePercentage = 0d;
ColorCode colorCode = null; ColorCode colorCode = null;
if(candidateClassScore != null && classNormalisation != null && NullArith.greaterThan(classNormalisation.getWghtStddevScore(), 0d)) if(candidateClassScore != null && classNormalisation != null && NullArith.greaterThan(classNormalisation.getWghtStddevScore(), 0d))
{ {
score = NullArith.round(((10 * ((candidateClassScore.getWghtdClassScore() - classNormalisation.getWghtMeanScore()) / classNormalisation.getWghtStddevScore())) + 50), 1); score = classNormalisation.getRoleFitScore(candidateClassScore.getWghtdClassScore());
colorCode = candidateClassScore.getColorCode(); maxScore = classNormalisation.getRoleFitScore(candidateClassScore.getMaxWghtdClassScore());
colorCode = candidateClassScore.getColorCode();
scorePercentage = NullArith.round(NullArith.divide(NullArith.multiply(score, 100), maxScore), 2);
} }
scoreMap.put(factorClass, new Tuple.T2(score, colorCode)); scoreMap.put(factorClass, new Tuple.T3(score, colorCode, scorePercentage));
} }
scoreMap.put(null, getSuitabilityScore(testAnalysis, false)); scoreMap.put(null, getSuitabilityScore(testAnalysis));
} }
LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1, "AnalysisEngine --> getRoleFitSuitability completed for candidate ", candidate, " Level ", level); LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1, "AnalysisEngine --> getRoleFitSuitability completed for candidate ", candidate, " Level ", level);
return scoreMap; return scoreMap;
} }
public static Tuple.T2<Double, ColorCode> getSuitabilityScore(TestAnalysis testAnalysis, boolean maxScore) public static Tuple.T3<Double, ColorCode, Double> getSuitabilityScore(TestAnalysis testAnalysis)
{ {
LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1, "AnalysisEngine --> getSuitabilityScore called for testAnalysis ", testAnalysis); LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1, "AnalysisEngine --> getSuitabilityScore called for testAnalysis ", testAnalysis);
Double totalScore = maxScore ? testAnalysis.getMaxWghtdLevelScore() : testAnalysis.getWghtdLevelScore(); Double rawScore = testAnalysis.getWghtdLevelScore();
Double wghtdMeanScore = 0d; Double wghtdMeanScore = 0d;
Double wghtdStdDevScore = 0d; Double wghtdStdDevScore = 0d;
Double suitabilityScore = 0d; Double suitabilityScore = 0d;
Double maxScore = 0d;
Double suitabilityPercent = 0d;
ColorCode colorCode = null; ColorCode colorCode = null;
LevelNormalisation levelNormalisation = testAnalysis.getLevel().getLevelNormalisation(); LevelNormalisation levelNormalisation = testAnalysis.getLevel().getLevelNormalisation();
...@@ -461,18 +467,20 @@ public class AnalysisEngine ...@@ -461,18 +467,20 @@ public class AnalysisEngine
{ {
wghtdMeanScore = levelNormalisation.getWghtMeanScore(); wghtdMeanScore = levelNormalisation.getWghtMeanScore();
wghtdStdDevScore = levelNormalisation.getWghtStddevScore(); wghtdStdDevScore = levelNormalisation.getWghtStddevScore();
}
if(wghtdStdDevScore > 0d) if(wghtdStdDevScore > 0d)
{ {
suitabilityScore = NullArith.round(((10 * ((totalScore - wghtdMeanScore) / wghtdStdDevScore)) + 50), 2); suitabilityScore = levelNormalisation.getRoleFitScore(rawScore);
maxScore = levelNormalisation.getRoleFitScore(testAnalysis.getMaxWghtdLevelScore());
suitabilityPercent = NullArith.round(NullArith.divide(NullArith.multiply(suitabilityScore, 100), maxScore), 2);
}
} }
if(totalScore >= wghtdMeanScore) if(rawScore >= wghtdMeanScore)
{ {
colorCode = ColorCode.GREEN; colorCode = ColorCode.GREEN;
} }
else if(totalScore < (wghtdMeanScore - wghtdStdDevScore)) else if(rawScore < (wghtdMeanScore - wghtdStdDevScore))
{ {
colorCode = ColorCode.RED; colorCode = ColorCode.RED;
} }
...@@ -482,7 +490,7 @@ public class AnalysisEngine ...@@ -482,7 +490,7 @@ public class AnalysisEngine
} }
LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1, "AnalysisEngine --> getSuitabilityScore completed for testAnalysis ", testAnalysis, " Score:", suitabilityScore, " Color:", colorCode); LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1, "AnalysisEngine --> getSuitabilityScore completed for testAnalysis ", testAnalysis, " Score:", suitabilityScore, " Color:", colorCode);
return new Tuple.T2(suitabilityScore, colorCode); return new Tuple.T3(suitabilityScore, colorCode, suitabilityPercent);
} }
public static Map<FactorLevelLink, Map> getFactorScoreDetails(Candidate candidate, Level level, FactorClass factorClass) public static Map<FactorLevelLink, Map> getFactorScoreDetails(Candidate candidate, Level level, FactorClass factorClass)
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
String tabText = candidate.getToString(); String tabText = candidate.getToString();
String currentPage = WebUtils.getSamePageInRenderMode(request, WebUtils.VIEW_APPLICATION); String currentPage = WebUtils.getSamePageInRenderMode(request, WebUtils.VIEW_APPLICATION);
Map<FactorClass, Tuple.T2<Double, ColorCode>> roleScoreMap = (Map<FactorClass, Tuple.T2<Double, ColorCode>>)jobApplication.getRoleFit(); Map<FactorClass, Tuple.T3<Double, ColorCode, Double>> roleScoreMap = (Map<FactorClass, Tuple.T3<Double, ColorCode, Double>>)jobApplication.getRoleFit();
%> %>
<script> <script>
function tabToggle(tab, selectDiv) { function tabToggle(tab, selectDiv) {
...@@ -117,16 +117,16 @@ ...@@ -117,16 +117,16 @@
<div class="applicant-sub-part"> <div class="applicant-sub-part">
<div class="applicant-left"> <div class="applicant-left">
<% <%
Tuple.T2<Double, ColorCode> roleFitData = (jobApplication.getRoleFit()!=null && jobApplication.getRoleFit().get(null)!=null) ? (Tuple.T2<Double, ColorCode>) jobApplication.getRoleFit().get(null) : null; Tuple.T3<Double, ColorCode, Double> roleFitData = (jobApplication.getRoleFit()!=null && jobApplication.getRoleFit().get(null)!=null) ? (Tuple.T3<Double, ColorCode, Double>) jobApplication.getRoleFit().get(null) : null;
String colorClass = "percent-" +(roleFitData!=null ? roleFitData.get1().getCSSClass() : "green"); String colorClass = "percent-" +(roleFitData!=null ? roleFitData.get1().getCSSClass() : "green");
List<FactorScore> factorScores = jobApplication.getRoleAreaOfConcerns(); List<FactorScore> factorScores = jobApplication.getRoleAreaOfConcerns();
List<Tuple.T2> cultureConcerns = jobApplication.getCultureAreaOfConcerns(); List<Tuple.T2> cultureConcerns = jobApplication.getCultureAreaOfConcerns();
%> %>
<div class="applicant-progress"> <div class="applicant-progress">
<div class="<%= job.getIncludeAssessmentCriteria()==Boolean.TRUE ? "col-sm-4" : "col-sm-6" %> col-xs-12 text-center thr-block role-fit" href="#1a" data-toggle="tab" id="progress1" onClick="tabToggle('#tab1', '.role-fit')"> <div class="<%= job.getIncludeAssessmentCriteria()==Boolean.TRUE ? "col-sm-4" : "col-sm-6" %> col-xs-12 text-center thr-block role-fit" href="#1a" data-toggle="tab" id="progress1" onClick="tabToggle('#tab1', '.role-fit')">
<label class="progress-label">role fit</label> <label class="progress-label">role fit</label>
<div class="<%= colorClass %> fixed-width"> <div class="<%= colorClass %> fixed-width">
<p style="display:none;"><oneit:toString value="<%= jobApplication.getRoleFitPercentage() %>" mode="TwoDPDouble" nullValue="0"/></p> <p style="display:none;"><oneit:toString value="<%= roleFitData!=null ? roleFitData.get2() : 0d %>" mode="TwoDPDouble" nullValue="0"/></p>
</div> </div>
<div class="row four-label"> <div class="row four-label">
<% <%
...@@ -280,14 +280,14 @@ ...@@ -280,14 +280,14 @@
for(FactorClass factorClass : factorClassDtls.keySet()) for(FactorClass factorClass : factorClassDtls.keySet())
{ {
Map<FactorLevelLink, Map> factorDetails = factorClassDtls.get(factorClass); Map<FactorLevelLink, Map> factorDetails = factorClassDtls.get(factorClass);
Double rating = roleScoreMap.get(factorClass).get0(); Double rating = roleScoreMap.get(factorClass).get2();
ColorCode colorCode = roleScoreMap.get(factorClass).get1(); ColorCode colorCode = roleScoreMap.get(factorClass).get1();
String cssClass = colorCode.getCSSClass(); String cssClass = colorCode.getCSSClass();
%> %>
<div class="main-pro-bar"> <div class="main-pro-bar">
<div class="pro-bar"> <div class="pro-bar">
<span class="appli-label"><oneit:toString value="<%= factorClass %>" mode="EscapeHTML"/></span> <span class="appli-label"><oneit:toString value="<%= factorClass %>" mode="EscapeHTML"/></span>
<span class="appli-percen gray"><oneit:toString value="<%= rating %>" mode="WholeNumber"/></span> <span class="appli-percen gray"><oneit:toString value="<%= rating %>" mode="PercentageWholeNumber"/></span>
<span class="appli-progress-bar"> <span class="appli-progress-bar">
<div class="progress"> <div class="progress">
<div class="progress-bar <%= cssClass %>" role="progressbar" aria-valuenow="<%= rating %>" aria-valuemin="0" aria-valuemax="100" style="width:<%= rating %>%"></div> <div class="progress-bar <%= cssClass %>" role="progressbar" aria-valuenow="<%= rating %>" aria-valuemin="0" aria-valuemax="100" style="width:<%= rating %>%"></div>
......
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
Integer overallRank = jobApplication.getOverallRank(); Integer overallRank = jobApplication.getOverallRank();
Boolean isTopRank = CollectionUtils.equals(overallRank, 1); Boolean isTopRank = CollectionUtils.equals(overallRank, 1);
Map<FactorClass, Tuple.T2<Double, ColorCode>> roleScoreMap = (Map<FactorClass, Tuple.T2<Double, ColorCode>>)jobApplication.getRoleFit(); Map<FactorClass, Tuple.T3<Double, ColorCode, Double>> roleScoreMap = (Map<FactorClass, Tuple.T3<Double, ColorCode, Double>>)jobApplication.getRoleFit();
%> %>
<div class="<%= "appl-c-box " + (i == 0 ? " cb-one" : "")%> "> <div class="<%= "appl-c-box " + (i == 0 ? " cb-one" : "")%> ">
<!--TODO: need to work on the logic. just added to demonstrate that there are 3 different colors for this--> <!--TODO: need to work on the logic. just added to demonstrate that there are 3 different colors for this-->
...@@ -157,7 +157,7 @@ ...@@ -157,7 +157,7 @@
<oneit:toString value="<%= factorClass %>" mode="EscapeHTML"/> <oneit:toString value="<%= factorClass %>" mode="EscapeHTML"/>
</div> </div>
<div class="detail-no green"> <div class="detail-no green">
<oneit:toString value="<%= roleScoreMap.get(factorClass).get0() %>" mode="PercentageWholeNumber"/> <oneit:toString value="<%= roleScoreMap.get(factorClass).get2() %>" mode="PercentageWholeNumber"/>
</div> </div>
</div> </div>
<% <%
......
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