Commit 50b035ae by Harsh Shah

Express Questionnaire

parent 30ca47c5
......@@ -11,6 +11,9 @@
<column name="level_desc" type="String" nullable="true" length="30"/>
<column name="level_notes" type="CLOB" nullable="true"/>
<column name="rpt_hdr" type="CLOB" nullable="true"/>
<column name="applied_to_express" type="Boolean" nullable="true"/>
<column name="css_class" type="String" nullable="true" length="100"/>
<column name="enabled" type="Boolean" nullable="true"/>
</NODE>
</NODE></OBJECTS>
\ No newline at end of file
......@@ -8,7 +8,7 @@
<column name="object_id" type="Long" nullable="false" length="11"/>
<column name="object_last_updated_date" type="Date" nullable="false" length="22"/>
<column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="weighting" type="String" nullable="false" length="200"/>
<column name="weighting" type="String" nullable="true" length="200"/>
<column name="class_code" type="String" nullable="false" length="200"/>
<column name="level_number" type="Long" length="11" nullable="true"/>
</NODE>
......
......@@ -10,6 +10,8 @@
<column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="description" type="String" nullable="true" length="80"/>
<column name="is_right_quest" type="Boolean" nullable="true"/>
<column name="is_express_question" type="Boolean" nullable="true"/>
<column name="inner_sort_order" type="Long" nullable="true"/>
<column name="section_number" type="Long" length="11" nullable="true"/>
<column name="right_quest_number" type="Long" length="11" nullable="true"/>
<column name="high_low_factor_id" type="Long" length="11" nullable="true"/>
......
......@@ -10,7 +10,10 @@ CREATE TABLE tl_level (
,
level_desc varchar(30) NULL,
level_notes text NULL,
rpt_hdr text NULL
rpt_hdr text NULL,
applied_to_express char(1) NULL,
css_class varchar(100) NULL,
enabled char(1) NULL
);
......
......@@ -8,7 +8,7 @@ CREATE TABLE tl_level_class_criteria (
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
weighting varchar(200) NOT NULL,
weighting varchar(200) NULL,
class_code varchar(200) NOT NULL,
level_number numeric(12) NULL
);
......
......@@ -10,6 +10,8 @@ CREATE TABLE tl_quest_lin (
,
description varchar(80) NULL,
is_right_quest char(1) NULL,
is_express_question char(1) NULL,
inner_sort_order numeric(12) NULL,
section_number numeric(12) NULL,
right_quest_number numeric(12) NULL,
high_low_factor_id numeric(12) NULL
......
......@@ -11,7 +11,10 @@ CREATE TABLE tl_level (
,
level_desc varchar2(30) NULL,
level_notes clob NULL,
rpt_hdr clob NULL
rpt_hdr clob NULL,
applied_to_express char(1) NULL,
css_class varchar2(100) NULL,
enabled char(1) NULL
);
......
......@@ -9,7 +9,7 @@ CREATE TABLE tl_level_class_criteria (
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
weighting varchar2(200) NOT NULL,
weighting varchar2(200) NULL,
class_code varchar2(200) NOT NULL,
level_number number(12) NULL
);
......
......@@ -11,6 +11,8 @@ CREATE TABLE tl_quest_lin (
,
description varchar2(80) NULL,
is_right_quest char(1) NULL,
is_express_question char(1) NULL,
inner_sort_order number(12) NULL,
section_number number(12) NULL,
right_quest_number number(12) NULL,
high_low_factor_id number(12) NULL
......
......@@ -11,7 +11,10 @@ CREATE TABLE tl_level (
,
level_desc varchar(30) NULL,
level_notes text NULL,
rpt_hdr text NULL
rpt_hdr text NULL,
applied_to_express char(1) NULL,
css_class varchar(100) NULL,
enabled char(1) NULL
);
......
......@@ -9,7 +9,7 @@ CREATE TABLE tl_level_class_criteria (
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
weighting varchar(200) NOT NULL,
weighting varchar(200) NULL,
class_code varchar(200) NOT NULL,
level_number numeric(12) NULL
);
......
......@@ -11,6 +11,8 @@ CREATE TABLE tl_quest_lin (
,
description varchar(80) NULL,
is_right_quest char(1) NULL,
is_express_question char(1) NULL,
inner_sort_order numeric(12) NULL,
section_number numeric(12) NULL,
right_quest_number numeric(12) NULL,
high_low_factor_id numeric(12) NULL
......
......@@ -30,7 +30,7 @@ public class CompleteApplicationFP extends SaveFP
jobApplication.setApplicationStatus(ApplicationStatus.SUBMITTED);
jobApplication.setSubmittedDate(new Date());
AnalysisEngine.analyseAnswers(jobApplication.getCandidate(), jobApplication.getJob().getLevel(), jobApplication.getCompletedAnswers());
AnalysisEngine.analyseAnswers(jobApplication.getCandidate(), jobApplication.getJob().getLevel(), jobApplication.getCompletedAnswers()); //getCompletedAnswers() returns collection now
if(jobApplication.hasFailedEssentialRequirements())
{
......
......@@ -45,6 +45,11 @@ public class ProcessCultureFP extends SaveFP
if(fromJobMatch)
{
BusinessObjectParser.assertFieldCondition(job.getLevel()!= null, job , Job.SINGLEREFERENCE_Level, "mandatory", exceptions, true, request);
if(job.getLevel() != null)
{
BusinessObjectParser.assertFieldCondition(job.showLevelOption(job.getLevel()), job , Job.SINGLEREFERENCE_Level, "invalid", exceptions, true, request);
}
}
}
}
\ No newline at end of file
......@@ -17,8 +17,7 @@ import oneit.utils.BusinessException;
import oneit.utils.DateDiff;
import oneit.utils.MultiException;
import performa.intercom.utils.IntercomUtils;
import performa.orm.CompanyUser;
import performa.orm.Job;
import performa.orm.*;
import performa.orm.types.JobStatus;
......@@ -90,6 +89,11 @@ public class SaveJobFP extends SaveFP
if(job.getJobStatus() != JobStatus.DRAFT || openJob == Boolean.TRUE)
{
BusinessObjectParser.assertFieldCondition(job.getLevel() != null, job , Job.SINGLEREFERENCE_Level, "mandatory", exceptions, true, request);
if(job.getLevel() != null)
{
BusinessObjectParser.assertFieldCondition(job.showLevelOption(job.getLevel()), job , Job.SINGLEREFERENCE_Level, "invalid", exceptions, true, request);
}
}
super.validate(process, submission, exceptions, params);
......
......@@ -125,7 +125,7 @@ public abstract class BaseLevelClassCriteria extends BaseBusinessClass
metaInfo.put ("attribHelper", "EnumeratedAttributeHelper");
metaInfo.put ("dbcol", "weighting");
metaInfo.put ("mandatory", "true");
metaInfo.put ("mandatory", "false");
metaInfo.put ("name", "Importance");
metaInfo.put ("type", "Importance");
......@@ -271,7 +271,6 @@ public abstract class BaseLevelClassCriteria extends BaseBusinessClass
oldAndNewIdentical = HELPER_Importance.compare (_Importance, newImportance);
}
BusinessObjectParser.assertFieldCondition (newImportance != null, this, FIELD_Importance, "mandatory");
if (FIELD_Importance_Validators.length > 0)
......@@ -1241,7 +1240,7 @@ public abstract class BaseLevelClassCriteria extends BaseBusinessClass
List result = super.getAttributes ();
result.add(HELPER_Importance.getAttribObject (getClass (), _Importance, true, FIELD_Importance));
result.add(HELPER_Importance.getAttribObject (getClass (), _Importance, false, FIELD_Importance));
result.add(HELPER_FactorClass.getAttribObject (getClass (), _FactorClass, true, FIELD_FactorClass));
return result;
......
package performa.orm;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collection;
import java.util.Comparator;
......@@ -18,7 +17,8 @@ import oneit.utils.CollectionUtils;
import oneit.utils.DateDiff;
import oneit.utils.ObjectTransform;
import oneit.utils.StringUtils;
import oneit.utils.filter.Filter;
import oneit.utils.filter.*;
import performa.utils.ExpressAnswerFilter;
public class Candidate extends BaseCandidate
......@@ -109,6 +109,10 @@ public class Candidate extends BaseCandidate
return false;
}
public Collection<Answer> getCompletedAnswers(Job job)
{
return CollectionFilter.filter(getProfileAssessmentAnswersSet(), new ExpressAnswerFilter(job.isExpressJob()));
}
public boolean assessmentCompleted(Job job) //role
{
......@@ -116,12 +120,10 @@ public class Candidate extends BaseCandidate
if(allAnswersCount > 0)
{
Filter filter = Answer.SearchByAll().andAnswerNo(new IsNotNullFilter<>());
Collection selectedAnswers = pipelineCandidate().toProfileAssessmentAnswers(filter).vals();
Collection selectedAnswers = getCompletedAnswers(job);
return (selectedAnswers.size() >= allAnswersCount);
}
return false;
}
......
......@@ -162,9 +162,14 @@ public class Job extends BaseJob
return getAssessmentCriteraByType(criteria).size();
}
public boolean isExpressJob()
{
return getAssessmentType() == AssessmentType.EXPRESS;
}
public List<Question> getAllQuestions()
{
return Arrays.asList(Question.searchAll(getTransaction()));
return Arrays.asList(Question.SearchByAll().andIsExpressQuestion(new EqualsFilter(isExpressJob())).search(getTransaction()));
}
public List<Question> getAllLeftQuestions()
......@@ -178,8 +183,8 @@ public class Job extends BaseJob
Filter filter = Question.SearchByAll().andIsRightQuestion(new EqualsFilter<>(Boolean.FALSE));
return ObjstoreUtils.sort(CollectionFilter.filter(totalQuestions , filter),
new ObjectTransform[] {Question.pipesQuestion().toSection().toObjectID(), Question.pipesQuestion().toObjectID()},
new Comparator[]{CollectionUtils.DEFAULT_COMPARATOR, CollectionUtils.DEFAULT_COMPARATOR});
new ObjectTransform[] {Question.pipesQuestion().toSection().toObjectID(),Question.pipesQuestion().toInnerSortOrder(),Question.pipesQuestion().toObjectID()},
new Comparator[]{CollectionUtils.DEFAULT_COMPARATOR,CollectionUtils.DEFAULT_COMPARATOR,CollectionUtils.DEFAULT_COMPARATOR});
}
......@@ -195,17 +200,6 @@ public class Job extends BaseJob
}
public Level[] getAllLevels()
{
List<Level> levels = new ArrayList<>();
Utils.getLevelsForComprehensive(getTransaction()).stream().forEach((tuple) -> {
levels.add((Level)tuple.get0());
});
return levels.toArray(new Level[0]);
}
public int getNoOfCandidatesApplied()
{
return getNoOfCandidatesFor(ApplicationStatus.SUBMITTED, ApplicationStatus.SHORTLISTED, ApplicationStatus.UNSUITABLE);
......@@ -549,4 +543,27 @@ public class Job extends BaseJob
{
return LoopbackHTTP.getRemoteAccessURL("/j/" + (getShortenedURL() != null ? getShortenedURL().getCode() : ""));
}
public String getLevelClass(Level level)
{
if(!showLevelOption(level))
{
return "hide";
}
if(CollectionUtils.equals(level, getLevel()))
{
return "active";
}
return "";
}
public boolean showLevelOption(Level level)
{
if(isExpressJob())
{
return isTrue(level.getAppliedToExpress());
}
return !isTrue(level.getAppliedToExpress());
}
}
\ No newline at end of file
......@@ -14,7 +14,7 @@ import oneit.utils.math.NullArith;
import oneit.utils.math.Rounding;
import oneit.utils.parsers.FieldException;
import performa.orm.types.*;
import performa.utils.AnalysisEngine;
import performa.utils.*;
public class JobApplication extends BaseJobApplication
......@@ -128,49 +128,6 @@ public class JobApplication extends BaseJobApplication
}
public boolean initAssessmentAnswers(List<Question> questions) throws StorageException, FieldException
{
boolean redirect = false;
List<Question> allQuestions = new ArrayList<>();
Candidate candidate = getCandidate();
for(Question question : questions)
{
allQuestions.add(question);
if(question.getRightQuestion() != null)
{
allQuestions.add(question.getRightQuestion());
}
}
for(Question question : allQuestions)
{
boolean available = false;
for(Answer answer : candidate.getProfileAssessmentAnswersSet())
{
if(question.equals(answer.getQuestion()))
{
available = true;
break;
}
}
if(!available)
{
Answer answer = Answer.createAnswer(getTransaction());
candidate.addToProfileAssessmentAnswers(answer);
answer.setQuestion(question);
redirect = true;
}
}
return redirect;
}
public Answer getAnswerForQuestion(Question question) throws FieldException
{
Filter filter = Answer.SearchByAll().andQuestion(new EqualsFilter<>(question));
......@@ -230,7 +187,7 @@ public class JobApplication extends BaseJobApplication
public int getActualQuestionNumber()
{
Filter<Answer> filter = Answer.SearchByAll().andAnswerNo(new NotEqualsFilter<>(0));
Filter<Answer> filter = new ExpressAnswerFilter(getJob().isExpressJob());
return getCandidate().pipelineCandidate().toProfileAssessmentAnswers(filter).uniqueVals().size() + 1;
}
......@@ -238,7 +195,7 @@ public class JobApplication extends BaseJobApplication
public int getQuestionNumber()
{
Filter<Answer> filter = Answer.SearchByAll().andAnswerNo(new NotEqualsFilter<>(0));
Filter<Answer> filter = new ExpressAnswerFilter(getJob().isExpressJob());
return getCandidate().pipelineCandidate().toProfileAssessmentAnswers(filter).uniqueVals().size()
- getCandidate().pipelineCandidate().toProfileAssessmentAnswers(filter).toQuestion().toRightQuestion().uniqueVals().size();
......@@ -330,7 +287,7 @@ public class JobApplication extends BaseJobApplication
for(FactorClass factorClass : getSortedFactorClasses())
{
if(roleScoreMap.get(factorClass) != null && roleScoreMap.get(factorClass).get0() > 0d)
if(getJob().isExpressJob() || (roleScoreMap.get(factorClass) != null && roleScoreMap.get(factorClass).get0() > 0d))
{
factorScoreDetails.put(factorClass, AnalysisEngine.getFactorScoreDetails(getCandidate(), getJob().getLevel(), factorClass));
}
......@@ -446,9 +403,9 @@ public class JobApplication extends BaseJobApplication
}
public Set<Answer> getCompletedAnswers()
public Collection<Answer> getCompletedAnswers()
{
return getCandidate().getProfileAssessmentAnswersSet();
return getCandidate().getCompletedAnswers(getJob());
}
......@@ -504,11 +461,12 @@ public class JobApplication extends BaseJobApplication
//to get remaining time for role test
public Integer getRoleTestRemainingTime()
{
int remainingTime = 20;
int totalTime = getJob() != null && getJob().getAssessmentType() != null ? getJob().getAssessmentType().getTotalTime() : 20; //Default to 20 as per current code
int remainingTime = totalTime;
if(assessmentCompleted())
{
remainingTime -= 20;
remainingTime -= totalTime;
}
else //partially completed test for role
{
......@@ -516,14 +474,14 @@ public class JobApplication extends BaseJobApplication
if(allAnswersCount > 0)
{
Filter filter = Answer.SearchByAll().andAnswerNo(new IsNotNullFilter<>());
Filter filter = new ExpressAnswerFilter(getJob().isExpressJob());
Collection selectedAnswers = getCandidate().pipelineCandidate().toProfileAssessmentAnswers(filter).vals();
if(selectedAnswers!=null && selectedAnswers.size()>0)
{
Double answerrate = NullArith.divide(selectedAnswers.size(), allAnswersCount);
remainingTime -= Rounding.roundDouble( NullArith.multiply(answerrate, 20), 0);
remainingTime -= Rounding.roundDouble(NullArith.multiply(answerrate, totalTime), 0);
}
}
}
......
package performa.orm;
import java.util.*;
import oneit.objstore.rdbms.filters.EqualsFilter;
import oneit.objstore.ObjectTransaction;
import oneit.objstore.rdbms.filters.*;
import oneit.objstore.utils.ObjstoreUtils;
import oneit.utils.*;
import oneit.utils.filter.*;
......@@ -68,4 +69,9 @@ public class Level extends BaseLevel
new ObjectTransform[]{FactorScoreResult.pipesFactorScoreResult().toFromScore()},
new Comparator[]{CollectionUtils.DEFAULT_COMPARATOR});
}
public static Level[] getAllLevels(ObjectTransaction objTran)
{
return Level.SearchByAll().andEnabled(new EqualsFilter(Boolean.TRUE)).search(objTran);
}
}
\ No newline at end of file
......@@ -18,6 +18,9 @@
<ATTRIB name="LevelDescription" type="String" dbcol="level_desc" length="30"/>
<ATTRIB name="LevelNotes" type="String" dbcol="level_notes"/>
<ATTRIB name="ReportHeader" type="String" dbcol="rpt_hdr"/>
<ATTRIB name="AppliedToExpress" type="Boolean" dbcol="applied_to_express" defaultValue="Boolean.FALSE"/>
<ATTRIB name="CSSClass" type="String" dbcol="css_class" length="100"/>
<ATTRIB name="Enabled" type="Boolean" dbcol="enabled" defaultValue="Boolean.FALSE"/>
</TABLE>
......
......@@ -7,7 +7,7 @@
<TABLE name="tl_level_class_criteria" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="Importance" type="Importance" dbcol="weighting" attribHelper="EnumeratedAttributeHelper" mandatory="true"/>
<ATTRIB name="Importance" type="Importance" dbcol="weighting" attribHelper="EnumeratedAttributeHelper" mandatory="false"/> <!--Mandatory removed for newly added express data-->
<ATTRIB name="FactorClass" type="FactorClass" dbcol="class_code" attribHelper="EnumeratedAttributeHelper" mandatory="true"/>
<SINGLEREFERENCE name="Level" type="Level" dbcol="level_number" backreferenceName="LevelClassCriterias"/>
......
......@@ -29,12 +29,18 @@ public class LevelPersistenceMgr extends ObjectPersistenceMgr
private String dummyLevelDescription;
private String dummyLevelNotes;
private String dummyReportHeader;
private Boolean dummyAppliedToExpress;
private String dummyCSSClass;
private Boolean dummyEnabled;
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper HELPER_LevelDescription = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_LevelNotes = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_ReportHeader = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_AppliedToExpress = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_CSSClass = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_Enabled = DefaultAttributeHelper.INSTANCE;
......@@ -44,10 +50,13 @@ public class LevelPersistenceMgr extends ObjectPersistenceMgr
dummyLevelDescription = (String)(HELPER_LevelDescription.initialise (dummyLevelDescription));
dummyLevelNotes = (String)(HELPER_LevelNotes.initialise (dummyLevelNotes));
dummyReportHeader = (String)(HELPER_ReportHeader.initialise (dummyReportHeader));
dummyAppliedToExpress = (Boolean)(HELPER_AppliedToExpress.initialise (dummyAppliedToExpress));
dummyCSSClass = (String)(HELPER_CSSClass.initialise (dummyCSSClass));
dummyEnabled = (Boolean)(HELPER_Enabled.initialise (dummyEnabled));
}
private String SELECT_COLUMNS = "{PREFIX}tl_level.object_id as id, {PREFIX}tl_level.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_level.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_level.level_desc, {PREFIX}tl_level.level_notes, {PREFIX}tl_level.rpt_hdr, 1 AS commasafe ";
private String SELECT_COLUMNS = "{PREFIX}tl_level.object_id as id, {PREFIX}tl_level.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_level.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_level.level_desc, {PREFIX}tl_level.level_notes, {PREFIX}tl_level.rpt_hdr, {PREFIX}tl_level.applied_to_express, {PREFIX}tl_level.css_class, {PREFIX}tl_level.enabled, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
......@@ -100,7 +109,10 @@ public class LevelPersistenceMgr extends ObjectPersistenceMgr
if (false || !tl_levelPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!tl_levelPSet.containsAttrib(Level.FIELD_LevelDescription)||
!tl_levelPSet.containsAttrib(Level.FIELD_LevelNotes)||
!tl_levelPSet.containsAttrib(Level.FIELD_ReportHeader))
!tl_levelPSet.containsAttrib(Level.FIELD_ReportHeader)||
!tl_levelPSet.containsAttrib(Level.FIELD_AppliedToExpress)||
!tl_levelPSet.containsAttrib(Level.FIELD_CSSClass)||
!tl_levelPSet.containsAttrib(Level.FIELD_Enabled))
{
// We will need to retrieve it
idsToFetch.add (id.longValue());
......@@ -170,10 +182,10 @@ public class LevelPersistenceMgr extends ObjectPersistenceMgr
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_level " +
"SET level_desc = ?, level_notes = ?, rpt_hdr = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"SET level_desc = ?, level_notes = ?, rpt_hdr = ?, applied_to_express = ?, css_class = ?, enabled = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_level.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_LevelDescription.getForSQL(dummyLevelDescription, tl_levelPSet.getAttrib (Level.FIELD_LevelDescription))).listEntry (HELPER_LevelNotes.getForSQL(dummyLevelNotes, tl_levelPSet.getAttrib (Level.FIELD_LevelNotes))).listEntry (HELPER_ReportHeader.getForSQL(dummyReportHeader, tl_levelPSet.getAttrib (Level.FIELD_ReportHeader))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
CollectionUtils.listEntry (HELPER_LevelDescription.getForSQL(dummyLevelDescription, tl_levelPSet.getAttrib (Level.FIELD_LevelDescription))).listEntry (HELPER_LevelNotes.getForSQL(dummyLevelNotes, tl_levelPSet.getAttrib (Level.FIELD_LevelNotes))).listEntry (HELPER_ReportHeader.getForSQL(dummyReportHeader, tl_levelPSet.getAttrib (Level.FIELD_ReportHeader))).listEntry (HELPER_AppliedToExpress.getForSQL(dummyAppliedToExpress, tl_levelPSet.getAttrib (Level.FIELD_AppliedToExpress))).listEntry (HELPER_CSSClass.getForSQL(dummyCSSClass, tl_levelPSet.getAttrib (Level.FIELD_CSSClass))).listEntry (HELPER_Enabled.getForSQL(dummyEnabled, tl_levelPSet.getAttrib (Level.FIELD_Enabled))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
......@@ -481,6 +493,9 @@ public class LevelPersistenceMgr extends ObjectPersistenceMgr
tl_levelPSet.setAttrib(Level.FIELD_LevelDescription, HELPER_LevelDescription.getFromRS(dummyLevelDescription, r, "level_desc"));
tl_levelPSet.setAttrib(Level.FIELD_LevelNotes, HELPER_LevelNotes.getFromRS(dummyLevelNotes, r, "level_notes"));
tl_levelPSet.setAttrib(Level.FIELD_ReportHeader, HELPER_ReportHeader.getFromRS(dummyReportHeader, r, "rpt_hdr"));
tl_levelPSet.setAttrib(Level.FIELD_AppliedToExpress, HELPER_AppliedToExpress.getFromRS(dummyAppliedToExpress, r, "applied_to_express"));
tl_levelPSet.setAttrib(Level.FIELD_CSSClass, HELPER_CSSClass.getFromRS(dummyCSSClass, r, "css_class"));
tl_levelPSet.setAttrib(Level.FIELD_Enabled, HELPER_Enabled.getFromRS(dummyEnabled, r, "enabled"));
}
......@@ -498,10 +513,10 @@ public class LevelPersistenceMgr extends ObjectPersistenceMgr
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_level " +
" (level_desc, level_notes, rpt_hdr, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
" (level_desc, level_notes, rpt_hdr, applied_to_express, css_class, enabled, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_LevelDescription.getForSQL(dummyLevelDescription, tl_levelPSet.getAttrib (Level.FIELD_LevelDescription))).listEntry (HELPER_LevelNotes.getForSQL(dummyLevelNotes, tl_levelPSet.getAttrib (Level.FIELD_LevelNotes))).listEntry (HELPER_ReportHeader.getForSQL(dummyReportHeader, tl_levelPSet.getAttrib (Level.FIELD_ReportHeader))) .listEntry (objectID.longID ()).toList().toArray());
" (?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_LevelDescription.getForSQL(dummyLevelDescription, tl_levelPSet.getAttrib (Level.FIELD_LevelDescription))).listEntry (HELPER_LevelNotes.getForSQL(dummyLevelNotes, tl_levelPSet.getAttrib (Level.FIELD_LevelNotes))).listEntry (HELPER_ReportHeader.getForSQL(dummyReportHeader, tl_levelPSet.getAttrib (Level.FIELD_ReportHeader))).listEntry (HELPER_AppliedToExpress.getForSQL(dummyAppliedToExpress, tl_levelPSet.getAttrib (Level.FIELD_AppliedToExpress))).listEntry (HELPER_CSSClass.getForSQL(dummyCSSClass, tl_levelPSet.getAttrib (Level.FIELD_CSSClass))).listEntry (HELPER_Enabled.getForSQL(dummyEnabled, tl_levelPSet.getAttrib (Level.FIELD_Enabled))) .listEntry (objectID.longID ()).toList().toArray());
tl_levelPSet.setStatus (PersistentSetStatus.PROCESSED);
}
......
......@@ -21,7 +21,11 @@ public class Question extends BaseQuestion
public QuestionType getQuestionType()
{
if(getSection() != null)
if(isTrue(getIsExpressQuestion()))
{
return QuestionType.SCALAR; //Express doesnt support Ipsative
}
else if(getSection() != null)
{
return getSection().getQuestionType();
}
......
......@@ -9,8 +9,10 @@
<TABLE name="tl_quest_lin" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="Description" type="String" dbcol="description" length="80"/>
<ATTRIB name="IsRightQuestion" type="Boolean" dbcol="is_right_quest" defaultValue="Boolean.FALSE"/>
<ATTRIB name="Description" type="String" dbcol="description" length="80"/>
<ATTRIB name="IsRightQuestion" type="Boolean" dbcol="is_right_quest" defaultValue="Boolean.FALSE"/>
<ATTRIB name="IsExpressQuestion" type="Boolean" dbcol="is_express_question" defaultValue="Boolean.FALSE"/>
<ATTRIB name="InnerSortOrder" type="Integer" dbcol="inner_sort_order" defaultValue="1"/> <!-- Added mainly for express question PERSONAL VALUES section, question #1073 -->
<SINGLEREFERENCE name="Section" type="Section" dbcol="section_number" backreferenceName="Questions"/>
<SINGLEREFERENCE name="RightQuestion" type="Question" dbcol="right_quest_number" backreferenceName="LeftQuestions"/>
......
......@@ -28,11 +28,15 @@ public class QuestionPersistenceMgr extends ObjectPersistenceMgr
// Private attributes corresponding to business object data
private String dummyDescription;
private Boolean dummyIsRightQuestion;
private Boolean dummyIsExpressQuestion;
private Integer dummyInnerSortOrder;
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper HELPER_Description = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_IsRightQuestion = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_IsExpressQuestion = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_InnerSortOrder = DefaultAttributeHelper.INSTANCE;
......@@ -41,10 +45,12 @@ public class QuestionPersistenceMgr extends ObjectPersistenceMgr
{
dummyDescription = (String)(HELPER_Description.initialise (dummyDescription));
dummyIsRightQuestion = (Boolean)(HELPER_IsRightQuestion.initialise (dummyIsRightQuestion));
dummyIsExpressQuestion = (Boolean)(HELPER_IsExpressQuestion.initialise (dummyIsExpressQuestion));
dummyInnerSortOrder = (Integer)(HELPER_InnerSortOrder.initialise (dummyInnerSortOrder));
}
private String SELECT_COLUMNS = "{PREFIX}tl_quest_lin.object_id as id, {PREFIX}tl_quest_lin.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_quest_lin.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_quest_lin.description, {PREFIX}tl_quest_lin.is_right_quest, {PREFIX}tl_quest_lin.section_number, {PREFIX}tl_quest_lin.right_quest_number, {PREFIX}tl_quest_lin.high_low_factor_id, 1 AS commasafe ";
private String SELECT_COLUMNS = "{PREFIX}tl_quest_lin.object_id as id, {PREFIX}tl_quest_lin.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_quest_lin.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_quest_lin.description, {PREFIX}tl_quest_lin.is_right_quest, {PREFIX}tl_quest_lin.is_express_question, {PREFIX}tl_quest_lin.inner_sort_order, {PREFIX}tl_quest_lin.section_number, {PREFIX}tl_quest_lin.right_quest_number, {PREFIX}tl_quest_lin.high_low_factor_id, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
......@@ -97,6 +103,8 @@ public class QuestionPersistenceMgr extends ObjectPersistenceMgr
if (false || !tl_quest_linPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!tl_quest_linPSet.containsAttrib(Question.FIELD_Description)||
!tl_quest_linPSet.containsAttrib(Question.FIELD_IsRightQuestion)||
!tl_quest_linPSet.containsAttrib(Question.FIELD_IsExpressQuestion)||
!tl_quest_linPSet.containsAttrib(Question.FIELD_InnerSortOrder)||
!tl_quest_linPSet.containsAttrib(Question.SINGLEREFERENCE_Section)||
!tl_quest_linPSet.containsAttrib(Question.SINGLEREFERENCE_RightQuestion)||
!tl_quest_linPSet.containsAttrib(Question.SINGLEREFERENCE_HighLowFactor))
......@@ -199,10 +207,10 @@ public class QuestionPersistenceMgr extends ObjectPersistenceMgr
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_quest_lin " +
"SET description = ?, is_right_quest = ?, section_number = ? , right_quest_number = ? , high_low_factor_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"SET description = ?, is_right_quest = ?, is_express_question = ?, inner_sort_order = ?, section_number = ? , right_quest_number = ? , high_low_factor_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_quest_lin.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_Description.getForSQL(dummyDescription, tl_quest_linPSet.getAttrib (Question.FIELD_Description))).listEntry (HELPER_IsRightQuestion.getForSQL(dummyIsRightQuestion, tl_quest_linPSet.getAttrib (Question.FIELD_IsRightQuestion))).listEntry (SQLManager.CheckNull((Long)(tl_quest_linPSet.getAttrib (Question.SINGLEREFERENCE_Section)))).listEntry (SQLManager.CheckNull((Long)(tl_quest_linPSet.getAttrib (Question.SINGLEREFERENCE_RightQuestion)))).listEntry (SQLManager.CheckNull((Long)(tl_quest_linPSet.getAttrib (Question.SINGLEREFERENCE_HighLowFactor)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
CollectionUtils.listEntry (HELPER_Description.getForSQL(dummyDescription, tl_quest_linPSet.getAttrib (Question.FIELD_Description))).listEntry (HELPER_IsRightQuestion.getForSQL(dummyIsRightQuestion, tl_quest_linPSet.getAttrib (Question.FIELD_IsRightQuestion))).listEntry (HELPER_IsExpressQuestion.getForSQL(dummyIsExpressQuestion, tl_quest_linPSet.getAttrib (Question.FIELD_IsExpressQuestion))).listEntry (HELPER_InnerSortOrder.getForSQL(dummyInnerSortOrder, tl_quest_linPSet.getAttrib (Question.FIELD_InnerSortOrder))).listEntry (SQLManager.CheckNull((Long)(tl_quest_linPSet.getAttrib (Question.SINGLEREFERENCE_Section)))).listEntry (SQLManager.CheckNull((Long)(tl_quest_linPSet.getAttrib (Question.SINGLEREFERENCE_RightQuestion)))).listEntry (SQLManager.CheckNull((Long)(tl_quest_linPSet.getAttrib (Question.SINGLEREFERENCE_HighLowFactor)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
......@@ -460,6 +468,8 @@ public class QuestionPersistenceMgr extends ObjectPersistenceMgr
tl_quest_linPSet.setAttrib(Question.FIELD_Description, HELPER_Description.getFromRS(dummyDescription, r, "description"));
tl_quest_linPSet.setAttrib(Question.FIELD_IsRightQuestion, HELPER_IsRightQuestion.getFromRS(dummyIsRightQuestion, r, "is_right_quest"));
tl_quest_linPSet.setAttrib(Question.FIELD_IsExpressQuestion, HELPER_IsExpressQuestion.getFromRS(dummyIsExpressQuestion, r, "is_express_question"));
tl_quest_linPSet.setAttrib(Question.FIELD_InnerSortOrder, HELPER_InnerSortOrder.getFromRS(dummyInnerSortOrder, r, "inner_sort_order"));
tl_quest_linPSet.setAttrib(Question.SINGLEREFERENCE_Section, r.getObject ("section_number"));
tl_quest_linPSet.setAttrib(Question.SINGLEREFERENCE_RightQuestion, r.getObject ("right_quest_number"));
......@@ -480,10 +490,10 @@ public class QuestionPersistenceMgr extends ObjectPersistenceMgr
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_quest_lin " +
" (description, is_right_quest, section_number, right_quest_number, high_low_factor_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
" (description, is_right_quest, is_express_question, inner_sort_order, section_number, right_quest_number, high_low_factor_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_Description.getForSQL(dummyDescription, tl_quest_linPSet.getAttrib (Question.FIELD_Description))).listEntry (HELPER_IsRightQuestion.getForSQL(dummyIsRightQuestion, tl_quest_linPSet.getAttrib (Question.FIELD_IsRightQuestion))) .listEntry (SQLManager.CheckNull((Long)(tl_quest_linPSet.getAttrib (Question.SINGLEREFERENCE_Section)))).listEntry (SQLManager.CheckNull((Long)(tl_quest_linPSet.getAttrib (Question.SINGLEREFERENCE_RightQuestion)))).listEntry (SQLManager.CheckNull((Long)(tl_quest_linPSet.getAttrib (Question.SINGLEREFERENCE_HighLowFactor)))) .listEntry (objectID.longID ()).toList().toArray());
" (?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_Description.getForSQL(dummyDescription, tl_quest_linPSet.getAttrib (Question.FIELD_Description))).listEntry (HELPER_IsRightQuestion.getForSQL(dummyIsRightQuestion, tl_quest_linPSet.getAttrib (Question.FIELD_IsRightQuestion))).listEntry (HELPER_IsExpressQuestion.getForSQL(dummyIsExpressQuestion, tl_quest_linPSet.getAttrib (Question.FIELD_IsExpressQuestion))).listEntry (HELPER_InnerSortOrder.getForSQL(dummyInnerSortOrder, tl_quest_linPSet.getAttrib (Question.FIELD_InnerSortOrder))) .listEntry (SQLManager.CheckNull((Long)(tl_quest_linPSet.getAttrib (Question.SINGLEREFERENCE_Section)))).listEntry (SQLManager.CheckNull((Long)(tl_quest_linPSet.getAttrib (Question.SINGLEREFERENCE_RightQuestion)))).listEntry (SQLManager.CheckNull((Long)(tl_quest_linPSet.getAttrib (Question.SINGLEREFERENCE_HighLowFactor)))) .listEntry (objectID.longID ()).toList().toArray());
tl_quest_linPSet.setStatus (PersistentSetStatus.PROCESSED);
}
......
......@@ -22,7 +22,7 @@ public class AssessmentType extends AbstractEnumerated
public static final AssessmentType COMPREHENSIVE = new AssessmentType ("COMPREHENSIVE", "COMPREHENSIVE", "Talentology Comprehensive", false);
public static final AssessmentType EXPRESS = new AssessmentType ("EXPRESS", "EXPRESS", "Talentology Express", true);
public static final AssessmentType EXPRESS = new AssessmentType ("EXPRESS", "EXPRESS", "Talentology Express", false);
private static final AssessmentType[] allAssessmentTypes =
new AssessmentType[] { COMPREHENSIVE,EXPRESS};
......@@ -33,9 +33,7 @@ public class AssessmentType extends AbstractEnumerated
return allAssessmentTypes;
}
private transient String HeaderDesc;
private transient String AdditionalDesc;
private transient Integer TotalTime;
private transient String QuestionDetails;
......@@ -46,14 +44,9 @@ public class AssessmentType extends AbstractEnumerated
super (name, value, description, disabled);
}
public String getHeaderDesc()
{
return HeaderDesc;
}
public String getAdditionalDesc()
public Integer getTotalTime()
{
return AdditionalDesc;
return TotalTime;
}
public String getQuestionDetails()
......@@ -133,13 +126,11 @@ public class AssessmentType extends AbstractEnumerated
public static void defineAdditionalData ()
{
COMPREHENSIVE.HeaderDesc = "";
COMPREHENSIVE.AdditionalDesc = "";
COMPREHENSIVE.TotalTime = 20;
COMPREHENSIVE.QuestionDetails = " (250 Questions - 20 Minutes)";
COMPREHENSIVE.TestDescr = "Comprehensive Assessment";
EXPRESS.HeaderDesc = "";
EXPRESS.AdditionalDesc = "";
EXPRESS.QuestionDetails = " (30 Questions - 5 Minutes)";
EXPRESS.TotalTime = 5;
EXPRESS.QuestionDetails = " (48 Questions - 5 Minutes)";
EXPRESS.TestDescr = "Express Assessment";
}
......@@ -168,8 +159,7 @@ public class AssessmentType extends AbstractEnumerated
{
Map attribs = new HashMap ();
attribs.put ("HeaderDesc", ArrayFormatter.toObject(getHeaderDesc()));
attribs.put ("AdditionalDesc", ArrayFormatter.toObject(getAdditionalDesc()));
attribs.put ("TotalTime", ArrayFormatter.toObject(getTotalTime()));
attribs.put ("QuestionDetails", ArrayFormatter.toObject(getQuestionDetails()));
attribs.put ("TestDescr", ArrayFormatter.toObject(getTestDescr()));
......
......@@ -3,18 +3,15 @@
<ROOT>
<CONSTANT package="performa.orm.types" name="AssessmentType">
<DATA name="HeaderDesc" type="String" />
<DATA name="AdditionalDesc" type="String" />
<DATA name="TotalTime" type="Integer" />
<DATA name="QuestionDetails" type="String" />
<DATA name="TestDescr" type="String" />
<VALUE name="COMPREHENSIVE" description="Talentology Comprehensive" HeaderDesc='""'
AdditionalDesc='""'
<VALUE name="COMPREHENSIVE" description="Talentology Comprehensive" TotalTime="20"
QuestionDetails='" (250 Questions - 20 Minutes)"'
TestDescr='"Comprehensive Assessment"'/>
<VALUE name="EXPRESS" description="Talentology Express" HeaderDesc='""' disabled="true"
AdditionalDesc='""'
QuestionDetails='" (30 Questions - 5 Minutes)"'
<VALUE name="EXPRESS" description="Talentology Express" TotalTime="5"
QuestionDetails='" (48 Questions - 5 Minutes)"'
TestDescr='"Express Assessment"'/>
</CONSTANT>
</ROOT>
\ No newline at end of file
......@@ -52,7 +52,7 @@ public class FactorClass extends AbstractEnumerated
public static final FactorClass ACTINTER = new FactorClass ("ACTINTER", "ACTINTER", "Act Interdependently", false);
public static final FactorClass INNOVSPIR = new FactorClass ("INNOVSPIR", "INNOVSPIR", "iNnovative Spirit", false);
public static final FactorClass INNOVSPIR = new FactorClass ("INNOVSPIR", "INNOVSPIR", "Innovative Spirit", false);
public static final FactorClass EMPATHRESP = new FactorClass ("EMPATHRESP", "EMPATHRESP", "Empathy & Respect", false);
......@@ -77,9 +77,17 @@ public class FactorClass extends AbstractEnumerated
public static final FactorClass SHOWADAP = new FactorClass ("SHOWADAP", "SHOWADAP", "Show Adaptability", false);
public static final FactorClass ENGINSP = new FactorClass ("ENGINSP", "ENGINSP", "Engage And Inspire", false);
public static final FactorClass INFLUENCING = new FactorClass ("INFLUENCING", "INFLUENCING", "Influencing", false);
public static final FactorClass CONSGRP = new FactorClass ("CONSGRP", "CONSGRP", "Conscientious Group", false);
public static final FactorClass EMOTSTAB = new FactorClass ("EMOTSTAB", "EMOTSTAB", "Emotional Stability", false);
public static final FactorClass SOCIALGRP = new FactorClass ("SOCIALGRP", "SOCIALGRP", "Social Group", false);
private static final FactorClass[] allFactorClasss =
new FactorClass[] { CARDRV,CONFL,COPING,INTPER,LEADINFL,NEGOT,OPER,PEOPLE,POWERINFL,PROBLEM,STRATEGIC,VALUES,WORKSTYLE,CONSISTENCY,HIGHQUAL,ACTINTER,INNOVSPIR,EMPATHRESP,LEADER,OTHERS,ANSSCALE,LEVINNOV,LEADCOUR,SOUNDDEC,DRVINNIT,FOSTCOMM,PROMCOLL,SHOWADAP,ENGINSP};
new FactorClass[] { CARDRV,CONFL,COPING,INTPER,LEADINFL,NEGOT,OPER,PEOPLE,POWERINFL,PROBLEM,STRATEGIC,VALUES,WORKSTYLE,CONSISTENCY,HIGHQUAL,ACTINTER,INNOVSPIR,EMPATHRESP,LEADER,OTHERS,ANSSCALE,LEVINNOV,LEADCOUR,SOUNDDEC,DRVINNIT,FOSTCOMM,PROMCOLL,SHOWADAP,ENGINSP,INFLUENCING,CONSGRP,EMOTSTAB,SOCIALGRP};
private static FactorClass[] getAllFactorClasss ()
......@@ -195,6 +203,10 @@ public class FactorClass extends AbstractEnumerated
PROMCOLL.SortOrder = 250;
SHOWADAP.SortOrder = 260;
ENGINSP.SortOrder = 270;
INFLUENCING.SortOrder = 280;
CONSGRP.SortOrder = 290;
EMOTSTAB.SortOrder = 300;
SOCIALGRP.SortOrder = 310;
}
......
......@@ -21,7 +21,7 @@
<VALUE name="CONSISTENCY" description="Consistency" SortOrder="100"/>
<VALUE name="HIGHQUAL" description="Highest Quality" SortOrder="110"/>
<VALUE name="ACTINTER" description="Act Interdependently" SortOrder="120"/>
<VALUE name="INNOVSPIR" description="iNnovative Spirit" SortOrder="130"/>
<VALUE name="INNOVSPIR" description="Innovative Spirit" SortOrder="130"/>
<VALUE name="EMPATHRESP" description="Empathy &amp; Respect" SortOrder="140"/>
<VALUE name="LEADER" description="Leadership" SortOrder="150"/>
<VALUE name="OTHERS" description="Other Factors" SortOrder="160"/>
......@@ -34,6 +34,10 @@
<VALUE name="PROMCOLL" description="Promote Collaboration and Team" SortOrder="250"/>
<VALUE name="SHOWADAP" description="Show Adaptability" SortOrder="260"/>
<VALUE name="ENGINSP" description="Engage And Inspire" SortOrder="270"/>
<VALUE name="INFLUENCING" description="Influencing" SortOrder="280"/>
<VALUE name="CONSGRP" description="Conscientious Group" SortOrder="290"/>
<VALUE name="EMOTSTAB" description="Emotional Stability" SortOrder="300"/>
<VALUE name="SOCIALGRP" description="Social Group" SortOrder="310"/>
</CONSTANT>
</ROOT>
\ No newline at end of file
......@@ -20,7 +20,7 @@ public class AnalysisEngine
{
private static final Long MAX_VALID_FACTOR_NUMBER = 49L; //Don't consider unusally high/low answer factors i.e 50/51
public static void analyseAnswers(Candidate candidate, Level level, Set<Answer> answers) throws StorageException, FieldException
public static void analyseAnswers(Candidate candidate, Level level, Collection<Answer> answers) throws StorageException, FieldException
{
LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1, "Inside AnalysisEngine --> analyseAnswers for candidate ", candidate, " Level ", level);
......@@ -213,8 +213,12 @@ public class AnalysisEngine
candidateClassScore.setClassScore(classScore);
candidateClassScore.setWghtdClassScore(wghtdclassScore);
candidateClassScore.setMaxWghtdClassScore(maxWghtdClassScore);
candidateClassScore.setColorCode(NullArith.lessThan(classScore, classNormalisation.getLeftMeanScore()) ? ColorCode.RED : (NullArith.lessThan(classScore, classNormalisation.getMeanScore()) ? ColorCode.AMBER : ColorCode.GREEN));
candidateClassScore.setWghtdColorCode(NullArith.lessThan(wghtdclassScore, classNormalisation.getWghtLeftMeanScore()) ? ColorCode.RED : (NullArith.lessThan(wghtdclassScore, classNormalisation.getWghtMeanScore()) ? ColorCode.AMBER : ColorCode.GREEN));
if(classNormalisation != null)
{
candidateClassScore.setColorCode(NullArith.lessThan(classScore, classNormalisation.getLeftMeanScore()) ? ColorCode.RED : (NullArith.lessThan(classScore, classNormalisation.getMeanScore()) ? ColorCode.AMBER : ColorCode.GREEN));
candidateClassScore.setWghtdColorCode(NullArith.lessThan(wghtdclassScore, classNormalisation.getWghtLeftMeanScore()) ? ColorCode.RED : (NullArith.lessThan(wghtdclassScore, classNormalisation.getWghtMeanScore()) ? ColorCode.AMBER : ColorCode.GREEN));
}
testAnalysis.addToCandidateClassScores(candidateClassScore);
}
}
......
package performa.utils;
import oneit.utils.filter.Filter;
import performa.orm.Answer;
/**
*
* @author Harsh
*/
public class ExpressAnswerFilter implements Filter<Answer>
{
private final boolean isExpressJob;
public ExpressAnswerFilter(boolean isExpressJob)
{
this.isExpressJob = isExpressJob;
}
@Override
public boolean accept(Answer answer)
{
if(answer != null && answer.getQuestion() != null)
{
return answer.getAnswerNo() != null && answer.getAnswerNo() != 0 && (answer.getQuestion().getIsExpressQuestion() == isExpressJob);
}
return false;
}
}
\ No newline at end of file
......@@ -40,13 +40,9 @@ public class Utils
public static final String PRIV_ACCESS_APPLICANT_PORTAL = "TL_AccessApplicantPortal";
public static final String PRIV_ACCESS_COMPANY_ADMIN = "TL_AccessCompanyAdmin";
public static final String PRIV_ACCESS_COMPANY = "TL_AccessCompany";
public static final String LEVEL_GENERAL_PURPOSE = "General Purpose";
public static final String LEVEL_SALES = "Sales";
public static final String LEVEL_MANAGEMENT = "Management";
public static final String LEVEL_EXECUTIVE = "Executive";
public static final String HEAP_ANALYSIS_ID = ConfigMgr.getKeyfileString("heap.analysis.id", "3411110378");
public static final String INTERCOM_APP_ID = ConfigMgr.getKeyfileString("intercom.appId", "");
public static final String INTERCOM_TOKEN = ConfigMgr.getKeyfileString("intercom.token", "");
public static final String INTERCOM_APP_ID = ConfigMgr.getKeyfileString("intercom.appId", "");
public static final String INTERCOM_TOKEN = ConfigMgr.getKeyfileString("intercom.token", "");
public static Role getRole(String role, ObjectTransaction transaction)
{
......@@ -90,20 +86,6 @@ public class Utils
return importances.toArray(new Importance[0]);
}
// TODO: Levels hardcoded for this phase, needs to be changed later!
public static List<Tuple.T3> getLevelsForComprehensive(ObjectTransaction objTran)
{
List<Tuple.T3> levels = new ArrayList();
levels.add(new Tuple.T3(Level.searchName(objTran, LEVEL_GENERAL_PURPOSE), "General Purpose", "gn-pu"));
levels.add(new Tuple.T3(Level.searchName(objTran, LEVEL_SALES), "Sales", "sales-pic"));
levels.add(new Tuple.T3(Level.searchName(objTran, LEVEL_MANAGEMENT), "Management", "manag-pic"));
levels.add(new Tuple.T3(Level.searchName(objTran, LEVEL_EXECUTIVE), "Executive", "exe-pic"));
return levels;
}
//to sort jobs list
public static List<Job> getJobsSorted(Job[] jobs, JobSortOption jobSortOption, JobStatus jobStatus)
{
......
......@@ -282,7 +282,7 @@
Map<FactorLevelLink, Map> factorDetails = factorClassDtls.get(factorClass);
Double rating = roleScoreMap.get(factorClass).get2();
ColorCode colorCode = roleScoreMap.get(factorClass).get1();
String cssClass = colorCode.getCSSClass();
String cssClass = colorCode != null ? colorCode.getCSSClass() : "";
%>
<div class="main-pro-bar">
<div class="pro-bar">
......
......@@ -13,16 +13,7 @@
%>
<script>
$(document).ready(function(){
$('.type_radio').click(function(){
return false;
});
$(".level_radio").change(function(){
$('.form-page-area li.active').removeClass("active" );
$("input.level_radio:checked").closest('li').addClass("active" );
});
setupRecalc ($("form"), {'recalcOnError':true});
});
</script>
<oneit:form name="editJob" method="post" enctype="multipart/form-data">
......@@ -48,17 +39,11 @@
<%
FormTag jobForm = FormTag.getActiveFormTag(request);
FormBuilder formBuilder = jobForm.getFormBuilder();
String assessmentTypeKey = WebUtils.getInputKey(request, job, Job.FIELD_AssessmentType);
String assessmentTypeValue = formBuilder.fieldValue (assessmentTypeKey, job.getAssessmentType() == null ? "" : job.getAssessmentType().getName());
for(AssessmentType assessmentType : AssessmentType.getAssessmentTypeArray())
{
if(assessmentType.getDisabled() == Boolean.TRUE)
{
continue;
}
String assessmentTypeId = assessmentType.getName();
String selectedStr = CollectionUtils.equals(assessmentTypeValue, assessmentTypeId) ? "checked" : "";
%>
......@@ -66,48 +51,41 @@
<input type="radio" name="<%= assessmentTypeKey %>" id="<%= assessmentTypeId %>" class="type_radio" value="<%= assessmentType.getName() %>" <%= selectedStr %>/>
<label for="<%= assessmentTypeId %>">
<span class="label-title"><oneit:toString value="<%= assessmentType %>" mode="EscapeHTML" /></span>
<oneit:toString value="<%= assessmentType.getHeaderDesc() %>" mode="EscapeHTML"/>
<oneit:toString value="<%= assessmentType.getQuestionDetails() %>" mode="EscapeHTML"/><br />
<span class="sub-radio-title"><oneit:toString value="<%= assessmentType.getAdditionalDesc() %>" mode="EscapeHTML" /></span>
</label>
</div>
<%
if(assessmentType == AssessmentType.COMPREHENSIVE)
{
String levelKey = WebUtils.getRadioSingleAssocKey(request, job, Job.SINGLEREFERENCE_Level);
String levelValue = formBuilder.fieldValue (levelKey, job.getLevel() == null ? "" : String.valueOf(job.getLevelID()));
%>
<div class="main-pack-type">
<ul>
<%
for(Tuple.T3 tuple : Utils.getLevelsForComprehensive(transaction))
{
Level level = (Level)tuple.get0();
String levelId = String.valueOf(level.getID().longID());
boolean isSelected = CollectionUtils.equals(levelId, levelValue);
String selected = isSelected ? "checked" : "";
String liClass = isSelected ? "active" : "";
%>
<li class="<%= liClass %>" >
<a href="javascript:void(0)">
<input type="radio" name="<%= levelKey %>" id="<%= levelId %>" class="level_radio" value="<%= levelId %>" <%= selected %>/>
<label for="<%= levelId %>">
<span class="talen">Talentology</span>
<span class="pack-type"><oneit:toString value="<%= tuple.get1() %>" mode="EscapeHTML" /></span>
<span class="pack-img <%= tuple.get2() %>"></span>
</label>
</a>
</li>
<%
}
%>
</ul>
</div>
<div class="clearfix"></div>
<%
}
}
%>
String levelKey = WebUtils.getRadioSingleAssocKey(request, job, Job.SINGLEREFERENCE_Level);
String levelValue = formBuilder.fieldValue (levelKey, job.getLevel() == null ? "" : String.valueOf(job.getLevelID()));
%>
<div class="main-pack-type">
<ul>
<%
for(Level level : Level.getAllLevels(transaction))
{
String levelId = String.valueOf(level.getID().longID());
boolean isSelected = CollectionUtils.equals(levelId, levelValue);
String selected = isSelected ? "checked" : "";
String liClass = isSelected ? "active" : "";
%>
<oneit:recalcClass htmlTag="li" classScript="job.getLevelClass(level)" job="<%= job %>" level="<%= level %>">
<a href="javascript:void(0)">
<input type="radio" name="<%= levelKey %>" id="<%= levelId %>" class="level_radio" value="<%= levelId %>" <%= selected %>/>
<label for="<%= levelId %>">
<span class="talen">Talentology</span>
<span class="pack-type"><oneit:toString value="<%= level %>" mode="EscapeHTML" /></span>
<span class="pack-img <%= level.getCSSClass() %>"></span>
</label>
</a>
</oneit:recalcClass>
<%
}
%>
</ul>
</div>
<div class="clearfix"></div>
<div class="text-center">
<oneit:button value="Save as draft" name="saveJob" cssClass="btn btn-primary top-margin-37 largeBtn greyBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", jobPage)
......
......@@ -145,26 +145,33 @@
<img src="images/app-job-match-icon.svg"> Role fit
<span><oneit:toString value="<%= jobApplication.getRoleFitPercentage() %>" mode="PercentageTwoDP" /></span>
</div>
<div class="detail-box">
<%
for(FactorClass factorClass : jobApplication.getSortedFactorClasses())
{
if(factorClass != null && roleScoreMap.get(factorClass) != null)
<%
if(!job.isExpressJob())
{
%>
<div class="detail-box">
<%
for(FactorClass factorClass : jobApplication.getSortedFactorClasses())
{
%>
<div class="detail-row">
<div class="detail-label">
<oneit:toString value="<%= factorClass %>" mode="EscapeHTML"/>
</div>
<div class="detail-no">
<oneit:toString value="<%= roleScoreMap.get(factorClass).get2() %>" mode="PercentageWholeNumber"/>
</div>
</div>
<%
if(factorClass != null && roleScoreMap.get(factorClass) != null)
{
%>
<div class="detail-row">
<div class="detail-label">
<oneit:toString value="<%= factorClass %>" mode="EscapeHTML"/>
</div>
<div class="detail-no">
<oneit:toString value="<%= roleScoreMap.get(factorClass).get2() %>" mode="PercentageWholeNumber"/>
</div>
</div>
<%
}
}
}
%>
</div>
%>
</div>
<%
}
%>
<div class="culture jcc">
<img src="images/culture-icon.svg"> culture fit
<span>
......
......@@ -25,44 +25,82 @@
String currentPage = WebUtils.getArticleLink(request, objTran, WebUtils.JOB_APPLICATION, "JobMatchAssessment");
String nextPage = WebUtils.getArticleLink(request, objTran, WebUtils.JOB_APPLICATION, "SubmitApplication");
String culturePage = WebUtils.getArticleLink(request, objTran, WebUtils.JOB_APPLICATION, "WorkplaceCulture");
boolean isExpress = job.isExpressJob();
%>
<oneit:form name="editApplication" method="POST">
<oneit:evalBody buffer="<%= getBuffer(request) %>">
<%
if(actualNumber == 1 )
{
int maxRating = 7;
int midRating = 4;
String otherRating = "2, 3, 5, 6";
%>
<div class="main-sc-section sj-1">
<p>Using the scale given, indicate how important to you are the following aspects in your work life. Use the following system:</p>
<ul class="security-level">
<li><span>1</span> means of very little importance to you</li>
<li><oneit:toString value="<%= midRating %>" mode="EscapeHTML"/> means about average in importance to you</li>
<li><oneit:toString value="<%= maxRating %>" mode="EscapeHTML"/> means of high importance to you</li>
</ul>
<p>Use the other numbers (<oneit:toString value="<%= otherRating %>" mode="EscapeHTML"/>) to indicate in-between levels of importance to you.</p>
</div>
<div class="selection-br-line"></div>
<%
}
else if(questionType == QuestionType.IPSATIVE && actualNumber == 31)
<%
if(actualNumber == 1 )
{
int maxRating = 7;
int midRating = 4;
String otherRating = "2, 3, 5, 6";
%>
<div class="main-sc-section sj-1">
<p>Using the scale given, indicate how important to you are the following aspects in your work life. Use the following system:</p>
<ul class="security-level">
<li><span>1</span> means of very little importance to you</li>
<li><oneit:toString value="<%= midRating %>" mode="EscapeHTML"/> means about average in importance to you</li>
<li><oneit:toString value="<%= maxRating %>" mode="EscapeHTML"/> means of high importance to you</li>
</ul>
<p>Use the other numbers (<oneit:toString value="<%= otherRating %>" mode="EscapeHTML"/>) to indicate in-between levels of importance to you.</p>
</div>
<div class="selection-br-line"></div>
<%
}
else if(!isExpress && questionType == QuestionType.IPSATIVE && actualNumber == 31)
{
%>
<div class="main-sc-section sj-1">
<p>
For questions like these, indicate your preference by selecting the number closest to the term or idea that's most like you. We know that it can be challenging to make a choice sometimes, but try to avoid selecting the middle value.
</p>
</div>
<div class="selection-br-line"></div>
<%
}
else if(isExpress)
{
if(actualNumber == 17 || actualNumber == 30 || actualNumber == 34 || actualNumber == 37)
{
%>
%>
<div class="main-sc-section sj-1">
<p>
For questions like these, indicate your preference by selecting the number closest to the term or idea that's most like you. We know that it can be challenging to make a choice sometimes, but try to avoid selecting the middle value.
<%
if(actualNumber == 17)
{
%>
To what extent would you like each of the following activities to be <strong>required</strong> in your work?
A score of 1 means &quot;not very much at all&quot;, 4 means &quot;an average amount&quot;, while 7 means &quot;very greatly indeed&quot;.
The other numbers indicate in-between scores in your view.
<%
}
else if(actualNumber == 30 || actualNumber == 37)
{
%>
To what extent are the following statements true about you?
Use the same scale with 1 meaning not at all like you, 4 meaning middling or rather like you and 7 meaning definitely like you.
<%
}
else if(actualNumber == 34)
{
%>
To what extent would you agree with each of the following statements about work life?
Mark your answer on the 7-point scale, with 1 meaning very little agreement with the statement, 4 meaning &quot;average&quot; or middling agreement and 7 meaning very strong agreement.
<%
}
%>
</p>
</div>
<div class="selection-br-line"></div>
<%
<%
}
%>
}
%>
<div class="main-sc-section main-rate-section">
<%
int totNoOfQuestions = totalQuestions.size();
......@@ -144,28 +182,28 @@
}
%>
</div>
<%
if(!jobApplication.cultureCompleted())
{
%>
<oneit:button value=" " name="gotoPage" id="gotoPageNext" cssClass="box-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", culturePage)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry("attribNamesToRestore", Collections.singleton("JobApplication"))
.toMap() %>"/>
<%
}
else
{
%>
<oneit:button value=" " name="completeApplication" id="gotoPageNext" cssClass="box-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry("attribNamesToRestore", Collections.singleton("JobApplication"))
.toMap() %>"/>
<%
}
%>
<%
if(!jobApplication.cultureCompleted())
{
%>
<oneit:button value=" " name="gotoPage" id="gotoPageNext" cssClass="box-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", culturePage)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry("attribNamesToRestore", Collections.singleton("JobApplication"))
.toMap() %>"/>
<%
}
else
{
%>
<oneit:button value=" " name="completeApplication" id="gotoPageNext" cssClass="box-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry("attribNamesToRestore", Collections.singleton("JobApplication"))
.toMap() %>"/>
<%
}
%>
</oneit:evalBody>
</oneit:form>
\ No newline at end of file
......@@ -31,6 +31,9 @@
process.setAttribute("JobApplicationID" , jobApplication.getID().longValue());
}
//preloading
jobApplication.pipelineJobApplication().toCandidate().toProfileAssessmentAnswers().toQuestion().toRightQuestion().uniqueVals();
Job job = jobApplication.getJob();
Candidate candidate = jobApplication.getCandidate();
int questionNumber = jobApplication.getQuestionNumber();
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au">
<NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.RedefineTableOperation">
<tableName factory="String">tl_level</tableName>
<column name="applied_to_express" type="Boolean" nullable="true"/>
</NODE>
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.RedefineTableOperation">
<tableName factory="String">tl_quest_lin</tableName>
<column name="is_express_question" type="Boolean" nullable="true"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
-- @AutoRun
update tl_level set applied_to_express = 'N';
update tl_quest_lin set is_express_question = 'N';
This source diff could not be displayed because it is too large. You can view the blob instead.
alter table tl_level_class_criteria alter column weighting drop not null;
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au">
<NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.RedefineTableOperation">
<tableName factory="String">tl_level</tableName>
<column name="css_class" type="String" nullable="true" length="100"/>
<column name="enabled" type="Boolean" nullable="true"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au">
<NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.RedefineTableOperation">
<tableName factory="String">tl_quest_lin</tableName>
<column name="inner_sort_order" type="Long" nullable="true"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
update tl_level set enabled = 'N';
update tl_level set enabled = 'Y' where level_desc in ('Management', 'General Purpose', 'Sales', 'Executive', 'Customer Service', 'Non-Managers');
update tl_level set css_class = 'manag-pic' where level_desc = 'Management';
update tl_level set css_class = 'exe-pic' where level_desc = 'Executive';
update tl_level set css_class = 'sales-pic' where level_desc in ('Sales', 'Customer Service');
update tl_level set css_class = 'gn-pu' where level_desc in ('Non-Managers', 'General Purpose');
update tl_quest_lin set inner_sort_order = 1;
update tl_quest_lin set inner_sort_order = 0 where object_id in (1051, 1056, 1073);
<?xml version="1.0"?>
<!-- @AutoRun -->
<OBJECTS name="">
<NODE name="Script" factory="Vector">
<NODE name="insertOp" factory="Participant" class="oneit.sql.transfer.InsertOperation">
<tableName factory="String">tl_level_norm</tableName>
<value name='object_id' factory='Participant' class="oneit.sql.transfer.DBTransferer$ObjectID"/>
<value name='object_last_updated_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='object_created_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='level_number' factory='Integer'>1001</value>
<value name='mean_score' factory='Double'>138.202437480215</value>
<value name='max_score' factory='Double'>160</value>
<value name='min_score' factory='Double'>75</value>
<value name='stddev_score' factory='Double'>14.7452681120821</value>
<value name='left_mean_score' factory='Double'>123.457169368133</value>
<value name='right_mean_score' factory='Double'>152.947705592297</value>
<value name='wght_mean_score' factory='Double'>940.692465970244</value>
<value name='wght_stddev_score' factory='Double'>107.142439252228</value>
<value name='wght_left_mean_score' factory='Double'>833.550026718016</value>
<value name='wght_right_mean_score' factory='Double'>1047.83490522247</value>
</NODE>
<NODE name="insertOp" factory="Participant" class="oneit.sql.transfer.InsertOperation">
<tableName factory="String">tl_level_norm</tableName>
<value name='object_id' factory='Participant' class="oneit.sql.transfer.DBTransferer$ObjectID"/>
<value name='object_last_updated_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='object_created_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='level_number' factory='Integer'>1002</value>
<value name='mean_score' factory='Double'>141.329177057357</value>
<value name='max_score' factory='Double'>160</value>
<value name='min_score' factory='Double'>58</value>
<value name='stddev_score' factory='Double'>13.9459276967423</value>
<value name='left_mean_score' factory='Double'>127.383249360614</value>
<value name='right_mean_score' factory='Double'>155.275104754099</value>
<value name='wght_mean_score' factory='Double'>1018.50997506234</value>
<value name='wght_stddev_score' factory='Double'>98.2572227406089</value>
<value name='wght_left_mean_score' factory='Double'>920.252752321735</value>
<value name='wght_right_mean_score' factory='Double'>1116.76719780295</value>
</NODE>
<NODE name="insertOp" factory="Participant" class="oneit.sql.transfer.InsertOperation">
<tableName factory="String">tl_level_norm</tableName>
<value name='object_id' factory='Participant' class="oneit.sql.transfer.DBTransferer$ObjectID"/>
<value name='object_last_updated_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='object_created_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
<value name='level_number' factory='Integer'>1003</value>
<value name='mean_score' factory='Double'>140.98855938582</value>
<value name='max_score' factory='Double'>160</value>
<value name='min_score' factory='Double'>25</value>
<value name='stddev_score' factory='Double'>14.8990033103132</value>
<value name='left_mean_score' factory='Double'>126.089556075506</value>
<value name='right_mean_score' factory='Double'>155.887562696133</value>
<value name='wght_mean_score' factory='Double'>928.618846906518</value>
<value name='wght_stddev_score' factory='Double'>97.8014012838546</value>
<value name='wght_left_mean_score' factory='Double'>830.817445622664</value>
<value name='wght_right_mean_score' factory='Double'>1026.42024819037</value>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
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