Skip to content
Snippets Groups Projects
Commit 368f7f24 authored by srosse's avatar srosse
Browse files

OO-2058: backport of the fix

parent fcc1dc3c
No related branches found
No related tags found
No related merge requests found
......@@ -319,14 +319,17 @@ public class CourseAssessmentManagerImpl implements AssessmentManager {
efficiencyStatementManager.updateUserEfficiencyStatement(assessedIdentity, courseEnv, data, cgm.getCourseEntry());
}
if(passed != null && passed.booleanValue() && course.getCourseConfig().isAutomaticCertificationEnabled()) {
if(certificatesManager.isCertificationAllowed(assessedIdentity, cgm.getCourseEntry())) {
if(course.getCourseConfig().isAutomaticCertificationEnabled()) {
CourseNode rootNode = userCourseEnv.getCourseEnvironment().getRunStructure().getRootNode();
ScoreEvaluation rootEval = scoreAccounting.evalCourseNode((AssessableCourseNode)rootNode);
if(rootEval != null && rootEval.getPassed() != null && rootEval.getPassed().booleanValue()
&& certificatesManager.isCertificationAllowed(assessedIdentity, cgm.getCourseEntry())) {
CertificateTemplate template = null;
Long templateId = course.getCourseConfig().getCertificateTemplate();
if(templateId != null) {
template = certificatesManager.getTemplateById(templateId);
}
CertificateInfos certificateInfos = new CertificateInfos(assessedIdentity, score, passed);
CertificateInfos certificateInfos = new CertificateInfos(assessedIdentity, rootEval.getScore(), rootEval.getPassed());
certificatesManager.generateCertificate(certificateInfos, cgm.getCourseEntry(), template, true);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment