Buggy code:
private Map < String , Serializable > getOrLoadScorePassedAttemptsMap ( Identity identity , List < Property > properties , boolean prepareForNewData ) { } void putPropertyIntoCache ( Identity identity , Property property ) { } void removePropertyFromCache ( Identity identity , Property property ) { } private void addPropertyToCache ( Map < String , Serializable > acache , Property property ) throws AssertionError { } private void removePropertyFromCache ( Map < String , Serializable > acache , Property property ) throws AssertionError { } void saveNodeScore ( CourseNode courseNode , Identity assessedIdentity , Float score , CoursePropertyManager coursePropManager ) { } void saveNodeFullyAssessed ( CourseNode courseNode , Identity identity , Identity assessedIdentity , Boolean fullyAssessed , CoursePropertyManager coursePropManager ) { } public void saveNodeAttempts ( final CourseNode courseNode , final Identity identity , final Identity assessedIdentity , final Integer attempts ) { } void saveNodePassed ( CourseNode courseNode , Identity assessedIdentity , Boolean passed , CoursePropertyManager coursePropManager ) { } public void saveNodeComment ( final CourseNode courseNode , final Identity identity , final Identity assessedIdentity , final String comment ) { } public void saveNodeCoachComment ( final CourseNode courseNode , final Identity assessedIdentity , final String comment ) { } public void incrementNodeAttempts ( CourseNode courseNode , Identity identity , UserCourseEnvironment userCourseEnv ) { } @ Override public void incrementNodeAttemptsInBackground ( CourseNode courseNode , Identity identity , UserCourseEnvironment userCourseEnv ) { } private void incrementNodeAttempts ( final CourseNode courseNode , final Identity identity , final UserCourseEnvironment userCourseEnv , boolean logActivity ) { } private long incrementNodeAttemptsProperty ( CourseNode courseNode , Identity identity , CoursePropertyManager cpm ) { } public Float getNodeScore ( CourseNode courseNode , Identity identity ) { } public Boolean getNodePassed ( CourseNode courseNode , Identity identity ) { } public Integer getNodeAttempts ( CourseNode courseNode , Identity identity ) { } public String getNodeComment ( CourseNode courseNode , Identity identity ) { } public String getNodeCoachComment ( CourseNode courseNode , Identity identity ) { } @ Override public Boolean getNodeFullyAssessed ( CourseNode courseNode , Identity identity ) { } private String getCacheKey ( CourseNode courseNode , String propertyName ) { } private String getCacheKey ( String nodeIdent , String propertyName ) { } private String getPropertyCacheKey ( Property property ) { } private String getLastModifiedCacheKey ( Property property ) { } public void registerForAssessmentChangeEvents ( GenericEventListener gel , Identity identity ) { } public void deregisterFromAssessmentChangeEvents ( GenericEventListener gel ) { } void saveAssessmentID ( CourseNode courseNode , Identity assessedIdentity , Long assessmentID , CoursePropertyManager coursePropManager ) { } public Long getAssessmentID ( CourseNode courseNode , Identity identity ) { } @ Override public Date getScoreLastModifiedDate ( CourseNode courseNode , Identity identity ) { } public void saveScoreEvaluation ( final CourseNode courseNode , final Identity identity , final Identity assessedIdentity , final ScoreEvaluation scoreEvaluation , final UserCourseEnvironment userCourseEnv , final boolean incrementUserAttempts ) { final ICourse course = CourseFactory . loadCourse ( ores ) ; final CoursePropertyManager cpm = course . getCourseEnvironment ( ) . getCoursePropertyManager ( ) ; final RepositoryEntry courseEntry = course . getCourseEnvironment ( ) . getCourseGroupManager ( ) . getCourseEntry ( ) ; Long attempts = CoordinatorManager . getInstance ( ) . getCoordinator ( ) . getSyncer ( ) . doInSync ( createOLATResourceableForLocking ( assessedIdentity ) , new org . olat . core . util . coordinate . SyncerCallback < Long > ( ) { public Long execute ( ) { Long attempts = null ; Float score = scoreEvaluation . getScore ( ) ; Boolean passed = scoreEvaluation . getPassed ( ) ; saveNodeScore ( courseNode , assessedIdentity , score , cpm ) ; saveNodePassed ( courseNode , assessedIdentity , passed , cpm ) ; saveAssessmentID ( courseNode , assessedIdentity , scoreEvaluation . getAssessmentID ( ) , cpm ) ; if ( incrementUserAttempts ) { attempts = incrementNodeAttemptsProperty ( courseNode , assessedIdentity , cpm ) ; } if ( courseNode instanceof AssessableCourseNode ) { userCourseEnv . getScoreAccounting ( ) . scoreInfoChanged ( ( ( AssessableCourseNode ) ( courseNode ) ) , scoreEvaluation ) ; EfficiencyStatementManager esm = EfficiencyStatementManager . getInstance ( ) ; esm . updateUserEfficiencyStatement ( userCourseEnv ) ; } <START_BUG> if ( ( scoreEvaluation . getPassed ( ) ) && ( course . getCourseConfig ( ) . isAutomaticCertificationEnabled ( ) ) ) { <END_BUG> CertificatesManager certificatesManager = CoreSpringFactory . getImpl ( CertificatesManager . class ) ; if ( certificatesManager . isRecertificationAllowed ( assessedIdentity , courseEntry ) ) { CertificateTemplate template = null ; Long templateId = course . getCourseConfig ( ) . getCertificateTemplate ( ) ; if ( templateId != null ) { template = certificatesManager . getTemplateById ( templateId ) ; } CertificateInfos certificateInfos = new CertificateInfos ( assessedIdentity , score , passed ) ; MailerResult result = new MailerResult ( ) ; certificatesManager . generateCertificate ( certificateInfos , courseEntry , template , result ) ; } } return attempts ; } } ) ; UserNodeAuditManager am = course . getCourseEnvironment ( ) . getAuditManager ( ) ; am . appendToUserNodeLog ( courseNode , identity , assessedIdentity , ( ( ( SCORE ) + "<seq2seq4repair_space>set<seq2seq4repair_space>to:<seq2seq4repair_space>" ) + ( String . valueOf ( scoreEvaluation . getScore ( ) ) ) ) ) ; if ( ( scoreEvaluation . getPassed ( ) ) != null ) { am . appendToUserNodeLog ( courseNode , identity , assessedIdentity , ( ( ( PASSED ) + "<seq2seq4repair_space>set<seq2seq4repair_space>to:<seq2seq4repair_space>" ) + ( scoreEvaluation . getPassed ( ) . toString ( ) ) ) ) ; } else { am . appendToUserNodeLog ( courseNode , identity , assessedIdentity , ( ( PASSED ) + "<seq2seq4repair_space>set<seq2seq4repair_space>to<seq2seq4repair_space>\"undefined\"" ) ) ; } if ( ( scoreEvaluation . getAssessmentID ( ) ) != null ) { am . appendToUserNodeLog ( courseNode , assessedIdentity , assessedIdentity , ( ( ( ASSESSMENT_ID ) + "<seq2seq4repair_space>set<seq2seq4repair_space>to:<seq2seq4repair_space>" ) + ( scoreEvaluation . getAssessmentID ( ) . toString ( ) ) ) ) ; } AssessmentChangedEvent ace = new AssessmentChangedEvent ( AssessmentChangedEvent . TYPE_SCORE_EVAL_CHANGED , assessedIdentity ) ;

Fix:
if ( ( ( passed != null ) && ( passed . booleanValue ( ) ) ) && ( course . getCourseConfig ( ) . isAutomaticCertificationEnabled ( ) ) ) {