Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Sign in
Toggle navigation
Open sidebar
Kamal Agrawal
StateStreetProject-dev
Commits
b997fde5
Commit
b997fde5
authored
Jun 16, 2021
by
manishatyagi
Browse files
add partially correct question type in category assessment report
parent
685e773e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
src/main/java/com/statestreet/dao/AssessmentRepositoryImpl.java
...in/java/com/statestreet/dao/AssessmentRepositoryImpl.java
+3
-4
src/main/java/com/statestreet/dao/QuizResultRepositoryImpl.java
...in/java/com/statestreet/dao/QuizResultRepositoryImpl.java
+5
-2
No files found.
src/main/java/com/statestreet/dao/AssessmentRepositoryImpl.java
View file @
b997fde5
...
...
@@ -168,8 +168,7 @@ public class AssessmentRepositoryImpl implements AssessmentRepositoryCustom {
// TODO Auto-generated method stub
log
.
debug
(
"inside AssessmentRepositoryImpl called getAssessmentName method with parameter, startDate={},endDate={},subLobId={}"
,
startDate
,
endDate
,
subLobId
);
/*
* AggregationOperation match = Aggregation.match(new Criteria().andOperator(Criteria.where("createdDate").gte(startDate),
AggregationOperation
match
=
Aggregation
.
match
(
new
Criteria
().
andOperator
(
Criteria
.
where
(
"createdDate"
).
gte
(
startDate
),
Criteria
.
where
(
"createdDate"
).
lt
(
endDate
),
Criteria
.
where
(
"subLob._id"
).
is
(
subLobId
),
new
Criteria
().
orOperator
(
Criteria
.
where
(
"status"
).
is
(
CommonUtils
.
Assessment_Status
.
Assessment_Generated
),
Criteria
.
where
(
"status"
).
is
(
CommonUtils
.
Assessment_Status
.
Assessment_Inprogress
))));
...
...
@@ -202,8 +201,8 @@ public class AssessmentRepositoryImpl implements AssessmentRepositoryCustom {
"createdDate"
,
"wrongUserId"
,
"misMatchUserId"
,
"completionDate"
,
"subLob"
,
"completedAssessment"
,
"totalAssessment"
,
"assessmentType"
)
.
sum
(
"passCount"
).
as
(
"passCount"
).
sum
(
"failCount"
).
as
(
"failCount"
).
sum
(
"pendingCount"
).
as
(
"pendingCount"
);
Aggregation
agg
=
Aggregation
.
newAggregation
(
match
,
lookup
,
unwind
,
project
,
group
,
lookup1
,
unwind1
,
project1
,
group1
);
*/
/*
AggregationOperation match = Aggregation.match(new Criteria().andOperator(Criteria.where("createdDate").gte(startDate),
Criteria.where("createdDate").lt(endDate),Criteria.where("subLob._id").is(subLobId),
new Criteria().orOperator(Criteria.where("status").is(CommonUtils.Assessment_Status.Assessment_Generated),
...
...
@@ -231,7 +230,7 @@ public class AssessmentRepositoryImpl implements AssessmentRepositoryCustom {
AggregationOperation group = Aggregation.group("assessmentId","requestorName","requestorEcode","assessmentName","duration","location",
"createdDate","wrongUserId","misMatchUserId","completionDate","subLob","assessmentType").sum("completedAssessment").as("completedAssessment")
.sum("totalAssessment").as("totalAssessment").sum("passCount").as("passCount").sum("failCount").as("failCount").sum("pendingCount").as("pendingCount");
Aggregation
agg
=
Aggregation
.
newAggregation
(
match
,
lookup
,
unwind
,
project
,
lookup1
,
unwind1
,
project1
,
group
);
Aggregation agg = Aggregation.newAggregation(match,lookup,unwind,project,lookup1,unwind1,project1,group);
*/
AggregationResults
<
DBObject
>
result
=
template
.
aggregate
(
agg
,
COLLECTION
,
DBObject
.
class
);
log
.
debug
(
"Response returned from AssessmentRepositoryImpl -- getAssessmentName method, result={}"
,
result
);
return
result
.
getMappedResults
();
...
...
src/main/java/com/statestreet/dao/QuizResultRepositoryImpl.java
View file @
b997fde5
...
...
@@ -835,9 +835,12 @@ AggregationOperation match = Aggregation.match(new Criteria().andOperator(Crite
AggregationOperation
unwind
=
Aggregation
.
unwind
(
"questionList"
);
Cond
correctQuestionOperation
=
ConditionalOperators
.
when
(
Criteria
.
where
(
"questionList.questionResult"
).
is
(
CommonUtils
.
Question_Result_Status
.
Correct
.
name
())).
then
(
1
).
otherwise
(
0
);
Cond
incorrectQuestionOperation
=
ConditionalOperators
.
when
(
Criteria
.
where
(
"questionList.questionResult"
).
is
(
CommonUtils
.
Question_Result_Status
.
Incorrect
.
name
())).
then
(
1
).
otherwise
(
0
);
Cond
partialCorrectQuesOpr
=
ConditionalOperators
.
when
(
Criteria
.
where
(
"questionList.questionResult"
).
is
(
CommonUtils
.
Question_Result_Status
.
Partially_Correct
.
name
())).
then
(
1
).
otherwise
(
0
);
AggregationOperation
project1
=
Aggregation
.
project
(
"userId"
).
and
(
"questionList.category"
).
as
(
"category"
)
.
and
(
correctQuestionOperation
).
as
(
"correctQues"
).
and
(
incorrectQuestionOperation
).
as
(
"inCorrectQues"
);
AggregationOperation
group1
=
Aggregation
.
group
(
"category"
).
sum
(
"correctQues"
).
as
(
"correctQues"
).
sum
(
"inCorrectQues"
).
as
(
"inCorrectQues"
);
.
and
(
correctQuestionOperation
).
as
(
"correctQues"
).
and
(
incorrectQuestionOperation
).
as
(
"inCorrectQues"
)
.
and
(
partialCorrectQuesOpr
).
as
(
"partialCorrectQues"
);
AggregationOperation
group1
=
Aggregation
.
group
(
"category"
).
sum
(
"correctQues"
).
as
(
"correctQues"
)
.
sum
(
"inCorrectQues"
).
as
(
"inCorrectQues"
).
sum
(
"partialCorrectQues"
).
as
(
"partialCorrectQues"
);
Aggregation
agg
=
Aggregation
.
newAggregation
(
match
,
project
,
sort
,
group
,
unwind
,
project1
,
group1
);
AggregationResults
<
DBObject
>
result
=
template
.
aggregate
(
agg
,
COLLECTION
,
DBObject
.
class
);
log
.
debug
(
"Response returned from QuizResultRepositoryImpl--getCategoryAssessmentInfographicReport method,result={}"
,
result
.
getMappedResults
().
size
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment