Skip to content
Snippets Groups Projects
Commit 83c9affe authored by srosse's avatar srosse
Browse files

Merge OpenOLAT 10.4 to OpenOLAT 10.5 with 470c31839688bca5b6cbcc967c2cdc19d2d22e03

parents 8bdb8495 2ff38ad0
No related branches found
No related tags found
No related merge requests found
......@@ -62,6 +62,7 @@ import org.olat.course.certificate.model.CertificateInfos;
import org.olat.course.nodes.AssessableCourseNode;
import org.olat.course.nodes.CourseNode;
import org.olat.course.properties.CoursePropertyManager;
import org.olat.course.run.scoring.ScoreAccounting;
import org.olat.course.run.scoring.ScoreEvaluation;
import org.olat.course.run.userview.UserCourseEnvironment;
import org.olat.properties.Property;
......@@ -868,6 +869,7 @@ public class NewCachePersistingAssessmentManager extends BasicManager implements
// we could also sync on the assessedIdentity.
Long attempts = CoordinatorManager.getInstance().getCoordinator().getSyncer().doInSync(createOLATResourceableForLocking(assessedIdentity), new SyncerCallback<Long>(){
@Override
public Long execute() {
Long attempts = null;
Float score = scoreEvaluation.getScore();
......@@ -879,26 +881,36 @@ public class NewCachePersistingAssessmentManager extends BasicManager implements
if(incrementUserAttempts) {
attempts = incrementNodeAttemptsProperty(courseNode, assessedIdentity, cpm);
}
boolean evaluated = false;
ScoreAccounting scoreAccounting = assessedUserCourseEnv.getScoreAccounting();
if(courseNode instanceof AssessableCourseNode) {
assessedUserCourseEnv.getScoreAccounting().scoreInfoChanged((AssessableCourseNode)courseNode, scoreEvaluation);
// Update users efficiency statement
EfficiencyStatementManager esm = EfficiencyStatementManager.getInstance();
esm.updateUserEfficiencyStatement(assessedUserCourseEnv);
evaluated = true;//scoreInfoChanged() == evaluateAll()
scoreAccounting.scoreInfoChanged((AssessableCourseNode)courseNode, scoreEvaluation);
// Update users efficiency statement
EfficiencyStatementManager.getInstance().updateUserEfficiencyStatement(assessedUserCourseEnv);
}
if(passed != null && passed.booleanValue() && course.getCourseConfig().isAutomaticCertificationEnabled()) {
CertificatesManager certificatesManager = CoreSpringFactory.getImpl(CertificatesManager.class);
if(certificatesManager.isCertificationAllowed(assessedIdentity, courseEntry)) {
CertificateTemplate template = null;
Long templateId = course.getCourseConfig().getCertificateTemplate();
if(templateId != null) {
template = certificatesManager.getTemplateById(templateId);
if(course.getCourseConfig().isAutomaticCertificationEnabled()) {
CourseNode rootNode = assessedUserCourseEnv.getCourseEnvironment().getRunStructure().getRootNode();
if(!evaluated) {
scoreAccounting.evaluateAll();
}
ScoreEvaluation rootEval = scoreAccounting.evalCourseNode((AssessableCourseNode)rootNode);
if(rootEval != null && rootEval.getPassed() != null && rootEval.getPassed().booleanValue()) {
CertificatesManager certificatesManager = CoreSpringFactory.getImpl(CertificatesManager.class);
if(certificatesManager.isCertificationAllowed(assessedIdentity, courseEntry)) {
CertificateTemplate template = null;
Long templateId = course.getCourseConfig().getCertificateTemplate();
if(templateId != null) {
template = certificatesManager.getTemplateById(templateId);
}
CertificateInfos certificateInfos = new CertificateInfos(assessedIdentity, rootEval.getScore(), rootEval.getPassed());
certificatesManager.generateCertificate(certificateInfos, courseEntry, template, true);
}
CertificateInfos certificateInfos = new CertificateInfos(assessedIdentity, score, passed);
certificatesManager.generateCertificate(certificateInfos, courseEntry, template, true);
}
}
return attempts;
}});
......
......@@ -144,6 +144,7 @@ public class CertificatesOptionsController extends FormBasicController {
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
setFormTitle("options.certificates.title");
setFormTitleIconCss("o_icon o_icon_certificate");
setFormDescription("options.certificates.descr");
setFormContextHelp("Course Settings#_leistungsnachweis");
formLayout.setElementCssClass("o_sel_course_certificates");
......
......@@ -15,7 +15,8 @@ details.course.infos=Kursdetails
download.button=Zertifikat herunterladen
options.certificates.title=Konfiguration Leistungnachweis
options.certificates.title=Damit Kurse als bestanden angezeigt werden k\u00F6nnen, muss im Kurshauptknoten zwingend im "Punkte"-Tab die Option <strong>Bestanden berechnen?</strong> aktiviert werden.
options.certificates.descr=Test
generate.certificate=Zertifikat erzeugen
no.certificate=Kein Zertifikat vorhanden
pdf.certificates=PDF Zertifikat erzeugen
......
......@@ -35,6 +35,7 @@ notifications.desc={0} received a new certificate.
notifications.header=New certificates for the course "{0}".
notifications.title=New Certificates in course "{0}".
options.certificates.title=Evidence of achievement configuration
options.certificates.descr=Courses will only be listed as passed if the checkbox <strong>Calculate passing score?</strong> is selected in the "Score" tab in the course root node.
orientation=Orientation
pdf.certificates=Generate PDF certificate
pdf.certificates.auto=Automatically after passing the course
......
......@@ -35,6 +35,7 @@ import org.olat.core.gui.control.generic.wizard.Step;
import org.olat.core.gui.control.generic.wizard.StepRunnerCallback;
import org.olat.core.gui.control.generic.wizard.StepsMainRunController;
import org.olat.core.id.OLATResourceable;
import org.olat.core.util.StringHelper;
import org.olat.core.util.vfs.VFSContainer;
import org.olat.portfolio.EPArtefactHandler;
import org.olat.portfolio.PortfolioModule;
......@@ -204,7 +205,7 @@ public class ArtefactWizzardStepsController extends BasicController {
if (source == collectStepsCtrl) {
if (event == Event.CHANGED_EVENT) {
ePFMgr.updateArtefact(artefact);
showInfo("collect.success", artefact.getTitle());
showInfo("collect.success", StringHelper.escapeHtml(artefact.getTitle()));
} else {
// set back artefact-values
// artefact = ePFMgr.loadArtefact(artefact.getKey());
......
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