if (identityAndItsScore[0] != null){
if (allowedIdKeys.contains(((Identity)identityAndItsScore[0]).getKey())){
IdentityEnvironment ienv = new IdentityEnvironment();
ienv.setIdentity((Identity)identityAndItsScore[0]);
UserCourseEnvironment uce = new UserCourseEnvironmentImpl(ienv, course.getCourseEnvironment());
String scoreAsString = (String) identityAndItsScore[1];
if(scoreAsString != null){
try {
Float score = Float.valueOf(scoreAsString);
//*** Score granted: Yes --> it must have a minimum and a maximum score value
if (hasScore){
// score < minimum score
if ((min != null && score.floatValue() < min.floatValue())
|| (score.floatValue() < AssessmentHelper.MIN_SCORE_SUPPORTED)) {
Object[] feedback = new Object[]{Boolean.FALSE, identityAndItsScore[0],
translator.translate("bulk.action.lessThanMin",new String[]{String.valueOf(min)})};
feedbacks.add(feedback);
}
// score > maximum score
else if ((max != null && score.floatValue() > max.floatValue())
|| (score.floatValue() > AssessmentHelper.MAX_SCORE_SUPPORTED)) {
Object[] feedback = new Object[]{Boolean.FALSE, identityAndItsScore[0],
translator.translate("bulk.action.greaterThanMax",new String[]{String.valueOf(max)})};
feedbacks.add(feedback);
}
// score between minimum and maximum score
else {
ScoreEvaluation se;
// *** Display passed/not passed: yes
// *** Type of display: automatic using cut value --> it must have a cut value
if (hasPassed && cut != null){
Boolean passed = (score.floatValue() >= cut.floatValue()) ? Boolean.TRUE : Boolean.FALSE;
se = new ScoreEvaluation(score, passed);
// *** Display passed/not passed: yes
// *** Type of display: Manual by tutor --> there is no cut value
// or
// *** Display passed/not passed: no --> there is no cut value
}else{
se = new ScoreEvaluation(score, null);
}
// Update score,passed properties in db, and the user's efficiency statement
boolean incrementAttempts = false;
courseNode.updateUserScoreEvaluation(se, uce, coachIdentity, incrementAttempts);
// Refresh score view
uce.getScoreAccounting().scoreInfoChanged(this.courseNode, se);
Object[] feedback = new Object[]{Boolean.TRUE, identityAndItsScore[0],translator.translate("bulk.action.ok")};
feedbacks.add(feedback);
}
}else{ // *** Score granted: No