diff --git a/src/main/java/org/olat/core/commons/services/webdav/manager/WebDAVManagerImpl.java b/src/main/java/org/olat/core/commons/services/webdav/manager/WebDAVManagerImpl.java index 1874303618c5f4593abf74f75e652eabc616fb6e..f7f1869c2c93377a3d7d9b8320941fefad20659c 100644 --- a/src/main/java/org/olat/core/commons/services/webdav/manager/WebDAVManagerImpl.java +++ b/src/main/java/org/olat/core/commons/services/webdav/manager/WebDAVManagerImpl.java @@ -310,7 +310,7 @@ public class WebDAVManagerImpl implements WebDAVManager, InitializingBean { } /** - * @see org.olat.core.commons.services.webdav.WebDAVManager#isEnabled() + * @see org.olat.core.commons.services.webdav.WebDAVManager#isTrue() */ public boolean isEnabled() { return enabled; diff --git a/src/main/java/org/olat/course/assessment/CourseAssessmentService.java b/src/main/java/org/olat/course/assessment/CourseAssessmentService.java index 7752af750e8550bc9980bff52ddfaa8cc9de9f16..35e37c028e8db4924bf4f5f644c77de944c757ae 100644 --- a/src/main/java/org/olat/course/assessment/CourseAssessmentService.java +++ b/src/main/java/org/olat/course/assessment/CourseAssessmentService.java @@ -137,7 +137,7 @@ public interface CourseAssessmentService { public Double getCurrentRunCompletion(CourseNode courseNode, UserCourseEnvironment userCourseEnvironment); public void updateCurrentCompletion(CourseNode courseNode, UserCourseEnvironment userCourseEnvironment, - Identity identity, Double currentCompletion, AssessmentRunStatus status, Role by); + Double currentCompletion, AssessmentRunStatus status, Role by); /** * @param courseNode diff --git a/src/main/java/org/olat/course/assessment/manager/CourseAssessmentManagerImpl.java b/src/main/java/org/olat/course/assessment/manager/CourseAssessmentManagerImpl.java index 4aeebb7908cd87fc28f3be354ca1f86d2a2fecc7..e72b6bbe8e4d6d5563bde978e8e93c20bb84049c 100644 --- a/src/main/java/org/olat/course/assessment/manager/CourseAssessmentManagerImpl.java +++ b/src/main/java/org/olat/course/assessment/manager/CourseAssessmentManagerImpl.java @@ -61,6 +61,7 @@ import org.olat.course.certificate.CertificatesManager; import org.olat.course.certificate.model.CertificateConfig; import org.olat.course.certificate.model.CertificateInfos; import org.olat.course.groupsandrights.CourseGroupManager; +import org.olat.course.nodeaccess.NodeAccessService; import org.olat.course.nodes.CourseNode; import org.olat.course.run.environment.CourseEnvironment; import org.olat.course.run.scoring.AssessmentEvaluation; @@ -75,6 +76,7 @@ import org.olat.modules.assessment.model.AssessmentEntryStatus; import org.olat.modules.assessment.model.AssessmentRunStatus; import org.olat.repository.RepositoryEntry; import org.olat.util.logging.activity.LoggingResourceable; +import org.springframework.beans.factory.annotation.Autowired; /** * @@ -93,18 +95,21 @@ public class CourseAssessmentManagerImpl implements AssessmentManager { private static final Integer INTEGER_ZERO = Integer.valueOf(0); private final CourseGroupManager cgm; - private final AssessmentService assessmentService; - private final CertificatesManager certificatesManager; - private final EfficiencyStatementManager efficiencyStatementManager; - private final CourseAssessmentService courseAssessmentService; - + + @Autowired + private AssessmentService assessmentService; + @Autowired + private CertificatesManager certificatesManager; + @Autowired + private EfficiencyStatementManager efficiencyStatementManager; + @Autowired + private CourseAssessmentService courseAssessmentService; + @Autowired + private NodeAccessService nodeAccessService; public CourseAssessmentManagerImpl(CourseGroupManager cgm) { this.cgm = cgm; - assessmentService = CoreSpringFactory.getImpl(AssessmentService.class); - certificatesManager = CoreSpringFactory.getImpl(CertificatesManager.class); - efficiencyStatementManager = CoreSpringFactory.getImpl(EfficiencyStatementManager.class); - courseAssessmentService = CoreSpringFactory.getImpl(CourseAssessmentService.class); + CoreSpringFactory.autowireObject(this); } private AssessmentEntry getOrCreate(Identity assessedIdentity, CourseNode courseNode) { @@ -415,6 +420,8 @@ public class CourseAssessmentManagerImpl implements AssessmentManager { } assessmentService.updateAssessmentEntry(nodeAssessment); DBFactory.getInstance().commit(); + + nodeAccessService.onCompletionUpdate(courseNode, userCourseEnvironment, currentCompletion, runStatus, by); } @Override diff --git a/src/main/java/org/olat/course/assessment/manager/CourseAssessmentServiceImpl.java b/src/main/java/org/olat/course/assessment/manager/CourseAssessmentServiceImpl.java index 23d9e52d92ef46c9d3631edcc3e2e5362dc02a56..5d7d09f7c4153f0874661a9afa2ae36fd4314f49 100644 --- a/src/main/java/org/olat/course/assessment/manager/CourseAssessmentServiceImpl.java +++ b/src/main/java/org/olat/course/assessment/manager/CourseAssessmentServiceImpl.java @@ -65,7 +65,7 @@ import org.springframework.stereotype.Service; @Service public class CourseAssessmentServiceImpl implements CourseAssessmentService, NodeVisitedListener { - private static final String NON_ASSESSMENT_TYPE = NonAssessmentHandler.NODE_TYPE; + private static final String NON_ASSESSMENT_TYPE = NonAssessmentHandler.NODE_TYPE; @Autowired private List<AssessmentHandler> loadedAssessmentHandlers; @@ -160,7 +160,7 @@ public class CourseAssessmentServiceImpl implements CourseAssessmentService, Nod @Override public void updateCurrentCompletion(CourseNode courseNode, UserCourseEnvironment userCourseEnvironment, - Identity identity, Double currentCompletion, AssessmentRunStatus runStatus, Role by) { + Double currentCompletion, AssessmentRunStatus runStatus, Role by) { AssessmentManager am = userCourseEnvironment.getCourseEnvironment().getAssessmentManager(); Identity assessedIdentity = userCourseEnvironment.getIdentityEnvironment().getIdentity(); am.updateCurrentCompletion(courseNode, assessedIdentity, userCourseEnvironment, currentCompletion, runStatus, diff --git a/src/main/java/org/olat/course/condition/ConditionNodeAccessProvider.java b/src/main/java/org/olat/course/condition/ConditionNodeAccessProvider.java index 504c55f4a24a516cd9e92772802496d13b044bfd..1679b06aa23962b69027c6fb6c2fe725bffefa86 100644 --- a/src/main/java/org/olat/course/condition/ConditionNodeAccessProvider.java +++ b/src/main/java/org/olat/course/condition/ConditionNodeAccessProvider.java @@ -33,6 +33,8 @@ import org.olat.course.nodes.CourseNode; import org.olat.course.run.userview.CourseTreeNodeBuilder; import org.olat.course.run.userview.UserCourseEnvironment; import org.olat.course.tree.CourseEditorTreeModel; +import org.olat.modules.assessment.Role; +import org.olat.modules.assessment.model.AssessmentRunStatus; import org.springframework.stereotype.Service; /** @@ -79,4 +81,10 @@ public class ConditionNodeAccessProvider implements NodeAccessProvider { return new ConditionCourseTreeNodeBuilder(userCourseEnvironment); } + @Override + public void onCompletionUpdate(CourseNode courseNode, UserCourseEnvironment userCourseEnvironment, + Double completion, AssessmentRunStatus runStatus, Role by) { + // nothing to do + } + } diff --git a/src/main/java/org/olat/course/learningpath/LearningPathConfigs.java b/src/main/java/org/olat/course/learningpath/LearningPathConfigs.java index e564d2b4a2808f828efe8ba1b0c74bf7381dc05e..ffa0f80d453eb045e0a15539f647ac408f132393 100644 --- a/src/main/java/org/olat/course/learningpath/LearningPathConfigs.java +++ b/src/main/java/org/olat/course/learningpath/LearningPathConfigs.java @@ -19,6 +19,8 @@ */ package org.olat.course.learningpath; +import org.olat.modules.assessment.model.AssessmentRunStatus; + /** * * Initial date: 30 Aug 2019<br> @@ -32,5 +34,9 @@ public interface LearningPathConfigs { public LearningPathObligation getObligation(); public boolean isDoneOnNodeVisited(); + + public boolean isDoneOnCompletion(Double completion); + public boolean isDoneOnRunStatus(AssessmentRunStatus runStatus); + } diff --git a/src/main/java/org/olat/course/learningpath/manager/LearningPathNodeAccessProvider.java b/src/main/java/org/olat/course/learningpath/manager/LearningPathNodeAccessProvider.java index d98022ed629ed35c068342d30e2be88648167e2d..54d784186b84724d6e70f28409c15b52ab59faaa 100644 --- a/src/main/java/org/olat/course/learningpath/manager/LearningPathNodeAccessProvider.java +++ b/src/main/java/org/olat/course/learningpath/manager/LearningPathNodeAccessProvider.java @@ -40,6 +40,7 @@ import org.olat.course.run.userview.UserCourseEnvironment; import org.olat.course.tree.CourseEditorTreeModel; import org.olat.modules.assessment.Role; import org.olat.modules.assessment.model.AssessmentEntryStatus; +import org.olat.modules.assessment.model.AssessmentRunStatus; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -84,22 +85,36 @@ public class LearningPathNodeAccessProvider implements NodeAccessProvider, NodeV return new TabbableLeaningPathNodeConfigController(ureq, wControl, configCtrl); } + @Override + public CourseTreeNodeBuilder getNodeEvaluationBuilder(UserCourseEnvironment userCourseEnvironment) { + return new LearningPathCourseTreeNodeBuilder(userCourseEnvironment); + } + @Override public boolean onNodeVisited(CourseNode courseNode, UserCourseEnvironment userCourseEnvironment) { boolean doneOnNodeStarted = getConfigs(courseNode).isDoneOnNodeVisited(); boolean participant = userCourseEnvironment.isParticipant(); if (doneOnNodeStarted && participant) { - AssessmentManager am = userCourseEnvironment.getCourseEnvironment().getAssessmentManager(); - Identity identity = userCourseEnvironment.getIdentityEnvironment().getIdentity(); - am.updateAssessmentStatus(courseNode, identity, AssessmentEntryStatus.done, Role.user); + updateAssessmentStatusDone(courseNode, userCourseEnvironment, Role.user); return true; } return false; } @Override - public CourseTreeNodeBuilder getNodeEvaluationBuilder(UserCourseEnvironment userCourseEnvironment) { - return new LearningPathCourseTreeNodeBuilder(userCourseEnvironment); + public void onCompletionUpdate(CourseNode courseNode, UserCourseEnvironment userCourseEnvironment, + Double completion, AssessmentRunStatus runStatus, Role by) { + boolean isDoneOnCompletion = getConfigs(courseNode).isDoneOnCompletion(completion); + boolean isDoneOnRunStatus = getConfigs(courseNode).isDoneOnRunStatus(runStatus); + if (isDoneOnCompletion || isDoneOnRunStatus) { + updateAssessmentStatusDone(courseNode, userCourseEnvironment, by); + } + } + + private void updateAssessmentStatusDone(CourseNode courseNode, UserCourseEnvironment userCourseEnvironment, Role by) { + AssessmentManager am = userCourseEnvironment.getCourseEnvironment().getAssessmentManager(); + Identity identity = userCourseEnvironment.getIdentityEnvironment().getIdentity(); + am.updateAssessmentStatus(courseNode, identity, AssessmentEntryStatus.done, by); } } diff --git a/src/main/java/org/olat/course/learningpath/model/ModuleLearningPathConfigs.java b/src/main/java/org/olat/course/learningpath/model/ModuleLearningPathConfigs.java index ab31f75c98d048826b55e415c8593323d629376d..683d1c55d62a2cec7e9df8530886d551f694c9fc 100644 --- a/src/main/java/org/olat/course/learningpath/model/ModuleLearningPathConfigs.java +++ b/src/main/java/org/olat/course/learningpath/model/ModuleLearningPathConfigs.java @@ -24,12 +24,13 @@ import static org.olat.course.learningpath.ui.LearningPathNodeConfigController.C import static org.olat.course.learningpath.ui.LearningPathNodeConfigController.CONFIG_KEY_DONE_TRIGGER; import static org.olat.course.learningpath.ui.LearningPathNodeConfigController.CONFIG_KEY_ESTIMATED_DURATION; import static org.olat.course.learningpath.ui.LearningPathNodeConfigController.CONFIG_KEY_OBLIGATION; +import static org.olat.course.learningpath.ui.LearningPathNodeConfigController.CONFIG_VALUE_DONE_TRIGGER_RUN_DONE; import org.olat.core.util.StringHelper; -import org.olat.course.assessment.AssessmentAction; import org.olat.course.learningpath.LearningPathConfigs; import org.olat.course.learningpath.LearningPathObligation; import org.olat.modules.ModuleConfiguration; +import org.olat.modules.assessment.model.AssessmentRunStatus; /** * @@ -71,11 +72,26 @@ public class ModuleLearningPathConfigs implements LearningPathConfigs { @Override public boolean isDoneOnNodeVisited() { String doneTriggerName = getDoneTriggerName(); - return AssessmentAction.nodeVisited.name().equals(doneTriggerName); + return CONFIG_VALUE_DONE_TRIGGER_RUN_DONE.equals(doneTriggerName); } private String getDoneTriggerName() { return moduleConfiguration.getStringValue(CONFIG_KEY_DONE_TRIGGER, CONFIG_DEFAULT_DONE_TRIGGER); } + @Override + public boolean isDoneOnCompletion(Double completion) { + // not implemented yet + return false; + } + + @Override + public boolean isDoneOnRunStatus(AssessmentRunStatus runStatus) { + String doneTriggerName = getDoneTriggerName(); + if (AssessmentRunStatus.done.equals(runStatus) && CONFIG_VALUE_DONE_TRIGGER_RUN_DONE.equals(doneTriggerName)) { + return true; + } + return false; + } + } diff --git a/src/main/java/org/olat/course/learningpath/model/UnsupportedLearningPathConfigs.java b/src/main/java/org/olat/course/learningpath/model/UnsupportedLearningPathConfigs.java index 871e37637364d1762c20911a6ac6af1259ade9d3..745db0bcc6de8084cf1c337763222821bd7be84f 100644 --- a/src/main/java/org/olat/course/learningpath/model/UnsupportedLearningPathConfigs.java +++ b/src/main/java/org/olat/course/learningpath/model/UnsupportedLearningPathConfigs.java @@ -21,6 +21,7 @@ package org.olat.course.learningpath.model; import org.olat.course.learningpath.LearningPathConfigs; import org.olat.course.learningpath.LearningPathObligation; +import org.olat.modules.assessment.model.AssessmentRunStatus; /** * @@ -45,4 +46,14 @@ public class UnsupportedLearningPathConfigs implements LearningPathConfigs { return false; } + @Override + public boolean isDoneOnCompletion(Double completion) { + return false; + } + + @Override + public boolean isDoneOnRunStatus(AssessmentRunStatus runStatus) { + return false; + } + } diff --git a/src/main/java/org/olat/course/learningpath/ui/LearningPathNodeConfigController.java b/src/main/java/org/olat/course/learningpath/ui/LearningPathNodeConfigController.java index e5bf4792a7e5f0e3dd2d7b1bf214caa22b8f417f..d0465297788f230ad4c47ad4f42841d12a64fe19 100644 --- a/src/main/java/org/olat/course/learningpath/ui/LearningPathNodeConfigController.java +++ b/src/main/java/org/olat/course/learningpath/ui/LearningPathNodeConfigController.java @@ -22,8 +22,6 @@ package org.olat.course.learningpath.ui; import static org.olat.core.gui.components.util.KeyValues.entry; import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; import org.olat.core.gui.UserRequest; import org.olat.core.gui.components.form.flexible.FormItemContainer; @@ -36,7 +34,6 @@ import org.olat.core.gui.control.Controller; import org.olat.core.gui.control.Event; import org.olat.core.gui.control.WindowControl; import org.olat.core.util.StringHelper; -import org.olat.course.assessment.AssessmentAction; import org.olat.course.learningpath.LearningPathObligation; import org.olat.modules.ModuleConfiguration; @@ -46,13 +43,16 @@ import org.olat.modules.ModuleConfiguration; * @author uhensler, urs.hensler@frentix.com, http://www.frentix.com * */ -public class LearningPathNodeConfigController extends FormBasicController { - +public class LearningPathNodeConfigController extends FormBasicController { + public static final String CONFIG_KEY_ESTIMATED_DURATION = "learning.path.estimated.duration"; public static final String CONFIG_KEY_OBLIGATION = "learning.path.obligation"; public static final String CONFIG_DEFAULT_OBLIGATION = LearningPathObligation.mandatory.name(); public static final String CONFIG_KEY_DONE_TRIGGER = "learning.path.done.trigger"; - private static final String CONFIG_VALUE_DONE_TRIGGER_NONE = "done.trigger.none"; + public static final String CONFIG_VALUE_DONE_TRIGGER_NONE = "none"; + public static final String CONFIG_VALUE_DONE_TRIGGER_NODE_VISITED = "nodeVisited"; + public static final String CONFIG_VALUE_DONE_TRIGGER_CONFIRMED = "confirmed"; + public static final String CONFIG_VALUE_DONE_TRIGGER_RUN_DONE = "runStatusDone"; public static final String CONFIG_DEFAULT_DONE_TRIGGER = CONFIG_VALUE_DONE_TRIGGER_NONE; private TextElement estimatedDurationEl; @@ -99,15 +99,26 @@ public class LearningPathNodeConfigController extends FormBasicController { private KeyValues getDoneTriggerKV() { KeyValues doneTriggerKV = new KeyValues(); doneTriggerKV.add(entry(CONFIG_VALUE_DONE_TRIGGER_NONE, translate("config.done.trigger.none"))); - if (ctrlConfig.getAssessmentActions().contains(AssessmentAction.nodeVisited)) { - doneTriggerKV.add(entry(AssessmentAction.nodeVisited.name(), translate("config.done.trigger.visited"))); + if (ctrlConfig.isDoneTriggerNodeVisited()) { + doneTriggerKV.add(entry(CONFIG_VALUE_DONE_TRIGGER_NODE_VISITED, translate("config.done.trigger.visited"))); + } + if (ctrlConfig.isDoneTriggerConfirmed()) { + doneTriggerKV.add(entry(CONFIG_VALUE_DONE_TRIGGER_CONFIRMED, translate("config.done.trigger.confirmed"))); } - if (ctrlConfig.getAssessmentActions().contains(AssessmentAction.confirmed)) { - doneTriggerKV.add(entry(AssessmentAction.confirmed.name(), translate("config.done.trigger.confirmed"))); + TranslateableBoolean doneTriggerRunDone = ctrlConfig.getDoneTriggerRunDone(); + if (doneTriggerRunDone.isTrue()) { + doneTriggerKV.add(entry(CONFIG_VALUE_DONE_TRIGGER_RUN_DONE, + getTranslationOrDefault(doneTriggerRunDone, "config.done.trigger.run.done"))); } return doneTriggerKV; } + private String getTranslationOrDefault(TranslateableBoolean trans, String defaulI18nKey) { + return trans.isTranslated() + ? trans.getMessage() + : translate(defaulI18nKey); + } + @Override protected boolean validateFormLogic(UserRequest ureq) { boolean allOk = true; @@ -167,7 +178,11 @@ public class LearningPathNodeConfigController extends FormBasicController { public interface LearningPathControllerConfig { - public Set<AssessmentAction> getAssessmentActions(); + public boolean isDoneTriggerNodeVisited(); + + public boolean isDoneTriggerConfirmed(); + + public TranslateableBoolean getDoneTriggerRunDone(); } @@ -177,13 +192,25 @@ public class LearningPathNodeConfigController extends FormBasicController { public static class ControllerConfigBuilder { - private final Set<AssessmentAction> assessmentActions = new HashSet<>(); + private boolean doneTriggerNodeVisited; + private boolean doneTriggerConfirmed; + private TranslateableBoolean doneTriggerRunDone; private ControllerConfigBuilder() { } - public ControllerConfigBuilder addAssessmentAction(AssessmentAction action) { - assessmentActions.add(action); + public ControllerConfigBuilder enableNodeVisited() { + doneTriggerNodeVisited = true; + return this; + } + + public ControllerConfigBuilder enableRunStatusDone() { + doneTriggerRunDone = TranslateableBoolean.untranslatedTrue(); + return this; + } + + public ControllerConfigBuilder enableRunStatusDone(String message) { + doneTriggerRunDone = TranslateableBoolean.translatedTrue(message); return this; } @@ -193,15 +220,35 @@ public class LearningPathNodeConfigController extends FormBasicController { private final static class ControllerConfigImpl implements LearningPathControllerConfig { - private final Set<AssessmentAction> assessmentActions; + public final boolean doneTriggerNodeVisited; + public final boolean doneTriggerConfirmed; + public final TranslateableBoolean doneTriggerRunDone; public ControllerConfigImpl(ControllerConfigBuilder builder) { - this.assessmentActions = new HashSet<>(builder.assessmentActions); + this.doneTriggerNodeVisited = builder.doneTriggerNodeVisited; + this.doneTriggerConfirmed = builder.doneTriggerConfirmed; + this.doneTriggerRunDone = falseIfNull(builder.doneTriggerRunDone); } + private TranslateableBoolean falseIfNull(TranslateableBoolean translateableBoolean) { + return translateableBoolean != null + ? translateableBoolean + : TranslateableBoolean.untranslatedFalse(); + } + + @Override + public boolean isDoneTriggerNodeVisited() { + return doneTriggerNodeVisited; + } + + @Override + public boolean isDoneTriggerConfirmed() { + return doneTriggerConfirmed; + } + @Override - public Set<AssessmentAction> getAssessmentActions() { - return assessmentActions; + public TranslateableBoolean getDoneTriggerRunDone() { + return doneTriggerRunDone; } } diff --git a/src/main/java/org/olat/course/learningpath/ui/TranslateableBoolean.java b/src/main/java/org/olat/course/learningpath/ui/TranslateableBoolean.java new file mode 100644 index 0000000000000000000000000000000000000000..6de40fbe97cfd62f96fa15510c737291d437d744 --- /dev/null +++ b/src/main/java/org/olat/course/learningpath/ui/TranslateableBoolean.java @@ -0,0 +1,65 @@ +/** + * <a href="http://www.openolat.org"> + * OpenOLAT - Online Learning and Training</a><br> + * <p> + * Licensed under the Apache License, Version 2.0 (the "License"); <br> + * you may not use this file except in compliance with the License.<br> + * You may obtain a copy of the License at the + * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a> + * <p> + * Unless required by applicable law or agreed to in writing,<br> + * software distributed under the License is distributed on an "AS IS" BASIS, <br> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br> + * See the License for the specific language governing permissions and <br> + * limitations under the License. + * <p> + * Initial code contributed and copyrighted by<br> + * frentix GmbH, http://www.frentix.com + * <p> + */ +package org.olat.course.learningpath.ui; + +/** + * + * Initial date: 10 Sep 2019<br> + * @author uhensler, urs.hensler@frentix.com, http://www.frentix.com + * + */ +public class TranslateableBoolean { + + private static final TranslateableBoolean UNTRANSLATED_TRUE = new TranslateableBoolean(true, null); + private static final TranslateableBoolean UNTRANSLATED_FALSE = new TranslateableBoolean(false, null); + + private final boolean bool; + private final String message; + + public static final TranslateableBoolean untranslatedTrue() { + return UNTRANSLATED_TRUE; + } + + public static final TranslateableBoolean untranslatedFalse() { + return UNTRANSLATED_FALSE; + } + + public static final TranslateableBoolean translatedTrue(String message) { + return new TranslateableBoolean(true, message); + } + + private TranslateableBoolean(boolean enabled, String message) { + this.bool = enabled; + this.message = message; + } + + public boolean isTrue() { + return bool; + } + + public boolean isTranslated() { + return message != null; + } + + public String getMessage() { + return message; + } + +} diff --git a/src/main/java/org/olat/course/learningpath/ui/_i18n/LocalStrings_de.properties b/src/main/java/org/olat/course/learningpath/ui/_i18n/LocalStrings_de.properties index d7dbf682540bbeb0b03255e35ae4e9eb500c43b1..b3ec0613a70fcf8c6820bfa0cbe4a5fb2e15e054 100644 --- a/src/main/java/org/olat/course/learningpath/ui/_i18n/LocalStrings_de.properties +++ b/src/main/java/org/olat/course/learningpath/ui/_i18n/LocalStrings_de.properties @@ -3,6 +3,7 @@ error.positiv.int=Geben Sie eine positive Zahl ein. config.done.trigger=Lernfortschritt config.done.trigger.confirmed=Best\u00E4tigt config.done.trigger.none=W\u00E4hlen Sie einen Eintrag aus +config.done.trigger.run.done=Durchf\u00FChrung erledigt config.done.trigger.visited=Ge\u00F6ffnet config.estimated.duration=Zeitvorgabe (Minuten) congig.obligation=Pflicht diff --git a/src/main/java/org/olat/course/learningpath/ui/_i18n/LocalStrings_en.properties b/src/main/java/org/olat/course/learningpath/ui/_i18n/LocalStrings_en.properties index f7675227f77ab51a924c423845daf1a7286458ca..55ba4c4e1b72ddb98bd8a6e05679fda0556aae68 100644 --- a/src/main/java/org/olat/course/learningpath/ui/_i18n/LocalStrings_en.properties +++ b/src/main/java/org/olat/course/learningpath/ui/_i18n/LocalStrings_en.properties @@ -3,6 +3,7 @@ error.positiv.int=Enter a positive number. config.done.trigger=Done trigger config.done.trigger.confirmed=Confirmed config.done.trigger.none=Select an entry +config.done.trigger.run.done=Run done config.done.trigger.visited=Opened config.estimated.duration=Estimated duration (minutes) config.obligation=Obligation diff --git a/src/main/java/org/olat/course/nodeaccess/NodeAccessProvider.java b/src/main/java/org/olat/course/nodeaccess/NodeAccessProvider.java index cca4293c4288a09d26160efd837517b971203a75..7099c5522efa9a2bb2cdfc65c6374aceec9809bf 100644 --- a/src/main/java/org/olat/course/nodeaccess/NodeAccessProvider.java +++ b/src/main/java/org/olat/course/nodeaccess/NodeAccessProvider.java @@ -26,6 +26,8 @@ import org.olat.course.nodes.CourseNode; import org.olat.course.run.userview.CourseTreeNodeBuilder; import org.olat.course.run.userview.UserCourseEnvironment; import org.olat.course.tree.CourseEditorTreeModel; +import org.olat.modules.assessment.Role; +import org.olat.modules.assessment.model.AssessmentRunStatus; /** * @@ -41,5 +43,8 @@ public interface NodeAccessProvider extends NodeAccessProviderIdentifier { UserCourseEnvironment userCourseEnvironment, CourseEditorTreeModel editorModel); public CourseTreeNodeBuilder getNodeEvaluationBuilder(UserCourseEnvironment userCourseEnvironment); + + public void onCompletionUpdate(CourseNode courseNode, UserCourseEnvironment userCourseEnvironment, + Double currentCompletion, AssessmentRunStatus runStatus, Role by); } diff --git a/src/main/java/org/olat/course/nodeaccess/NodeAccessService.java b/src/main/java/org/olat/course/nodeaccess/NodeAccessService.java index ae3a9eee4194781c51e6f31cf5d50bb5deb528fb..a3af9fcc38288b77ce3f4f2be14d4be51387bcde 100644 --- a/src/main/java/org/olat/course/nodeaccess/NodeAccessService.java +++ b/src/main/java/org/olat/course/nodeaccess/NodeAccessService.java @@ -28,6 +28,8 @@ import org.olat.course.nodes.CourseNode; import org.olat.course.run.userview.CourseTreeNodeBuilder; import org.olat.course.run.userview.UserCourseEnvironment; import org.olat.course.tree.CourseEditorTreeModel; +import org.olat.modules.assessment.Role; +import org.olat.modules.assessment.model.AssessmentRunStatus; /** * @@ -59,4 +61,16 @@ public interface NodeAccessService { public CourseTreeNodeBuilder getNodeEvaluationBuilder(UserCourseEnvironment userCourseEnvironment); + /** + * Hook after the completion and the run status is updated. + * + * @param courseNode + * @param userCourseEnvironment + * @param completion + * @param runStatus + * @param by + */ + public void onCompletionUpdate(CourseNode courseNode, UserCourseEnvironment userCourseEnvironment, + Double completion, AssessmentRunStatus runStatus, Role by); + } diff --git a/src/main/java/org/olat/course/nodeaccess/manager/NodeAccessServiceImpl.java b/src/main/java/org/olat/course/nodeaccess/manager/NodeAccessServiceImpl.java index c427dc511b3c7e831d28bbea9e7a9965ed270783..2d9dddc1637ecdbd3ba194303b1e2d934c59021d 100644 --- a/src/main/java/org/olat/course/nodeaccess/manager/NodeAccessServiceImpl.java +++ b/src/main/java/org/olat/course/nodeaccess/manager/NodeAccessServiceImpl.java @@ -34,6 +34,8 @@ import org.olat.course.nodes.CourseNode; import org.olat.course.run.userview.CourseTreeNodeBuilder; import org.olat.course.run.userview.UserCourseEnvironment; import org.olat.course.tree.CourseEditorTreeModel; +import org.olat.modules.assessment.Role; +import org.olat.modules.assessment.model.AssessmentRunStatus; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -88,4 +90,11 @@ public class NodeAccessServiceImpl implements NodeAccessService { return getNodeAccessProvider(type).getNodeEvaluationBuilder(userCourseEnvironment); } + @Override + public void onCompletionUpdate(CourseNode courseNode, UserCourseEnvironment userCourseEnvironment, + Double completion, AssessmentRunStatus runStatus, Role by) { + NodeAccessType type = NodeAccessType.of(userCourseEnvironment); + getNodeAccessProvider(type).onCompletionUpdate(courseNode, userCourseEnvironment, completion, runStatus, by); + } + } diff --git a/src/main/java/org/olat/course/nodes/SurveyCourseNode.java b/src/main/java/org/olat/course/nodes/SurveyCourseNode.java index 25b904198950c3cfa7d4351a9e53a5bfaf872feb..211d190917f88f9fa6b9d1fda871bfc8fd5fd68b 100644 --- a/src/main/java/org/olat/course/nodes/SurveyCourseNode.java +++ b/src/main/java/org/olat/course/nodes/SurveyCourseNode.java @@ -86,11 +86,10 @@ public class SurveyCourseNode extends AbstractAccessableCourseNode { private static final long serialVersionUID = 905046067514602922L; + public static final String TYPE = "survey"; public static final String SURVEY_ICON = "o_survey_icon"; - private static final String TYPE = "survey"; - - public static final int CURRENT_VERSION = 1; + private static final int CURRENT_VERSION = 1; public static final String CONFIG_KEY_REPOSITORY_SOFTKEY = "repository.softkey"; public static final String CONFIG_KEY_EXECUTION_BY_OWNER = "execution.by.owner"; public static final String CONFIG_KEY_EXECUTION_BY_COACH = "execution.by.coach"; diff --git a/src/main/java/org/olat/course/nodes/iq/QTI21AssessmentRunController.java b/src/main/java/org/olat/course/nodes/iq/QTI21AssessmentRunController.java index ac1d73b3398b3bafe431f474e2d9abd9c6eb8dd5..b6d00bee4dbd72728c2c4e1af4da2514320108b8 100644 --- a/src/main/java/org/olat/course/nodes/iq/QTI21AssessmentRunController.java +++ b/src/main/java/org/olat/course/nodes/iq/QTI21AssessmentRunController.java @@ -750,8 +750,7 @@ public class QTI21AssessmentRunController extends BasicController implements Gen removeHistory(ureq); if(courseNode instanceof IQTESTCourseNode) { - courseAssessmentService.updateCurrentCompletion(courseNode, userCourseEnv, getIdentity(), null, null, - Role.user); + courseAssessmentService.updateCurrentCompletion(courseNode, userCourseEnv, null, null, Role.user); } OLATResourceable ores = OresHelper.createOLATResourceableInstance("test", -1l); @@ -830,8 +829,8 @@ public class QTI21AssessmentRunController extends BasicController implements Gen @Override public void updateOutcomes(Float score, Boolean pass, Double completion) { if(courseNode instanceof IQTESTCourseNode) { - courseAssessmentService.updateCurrentCompletion(courseNode, userCourseEnv, getIdentity(), completion, - AssessmentRunStatus.running, Role.user); + courseAssessmentService.updateCurrentCompletion(courseNode, userCourseEnv, completion, AssessmentRunStatus.running, + Role.user); coordinatorManager.getCoordinator().getEventBus() .fireEventToListenersOf(new CompletionEvent(CompletionEvent.PROGRESS, courseNode.getIdent(), completion, AssessmentRunStatus.running, getIdentity().getKey()), userCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseResource()); diff --git a/src/main/java/org/olat/course/nodes/sp/SPLearningPathNodeHandler.java b/src/main/java/org/olat/course/nodes/sp/SPLearningPathNodeHandler.java index 91d5725d524966fd6c89ade2b2204431245e9576..16044ae38fc972ebb72f027f7e69eb72dc868838 100644 --- a/src/main/java/org/olat/course/nodes/sp/SPLearningPathNodeHandler.java +++ b/src/main/java/org/olat/course/nodes/sp/SPLearningPathNodeHandler.java @@ -22,7 +22,6 @@ package org.olat.course.nodes.sp; import org.olat.core.gui.UserRequest; import org.olat.core.gui.control.Controller; import org.olat.core.gui.control.WindowControl; -import org.olat.course.assessment.AssessmentAction; import org.olat.course.learningpath.LearningPathConfigs; import org.olat.course.learningpath.LearningPathNodeHandler; import org.olat.course.learningpath.model.ModuleLearningPathConfigs; @@ -59,7 +58,7 @@ public class SPLearningPathNodeHandler implements LearningPathNodeHandler { @Override public Controller createConfigEditController(UserRequest ureq, WindowControl wControl, CourseNode courseNode) { LearningPathControllerConfig ctrlConfig = LearningPathNodeConfigController.builder() - .addAssessmentAction(AssessmentAction.nodeVisited) + .enableNodeVisited() .build(); return new LearningPathNodeConfigController(ureq, wControl, courseNode.getModuleConfiguration(), ctrlConfig); } diff --git a/src/main/java/org/olat/course/nodes/st/learningpath/STLearningPathConfigs.java b/src/main/java/org/olat/course/nodes/st/learningpath/STLearningPathConfigs.java index 0f0414312370b52e70764adb6adc60d1f2beef37..cd7647238d06ec97a3a786a4fa2d7f7135dca308 100644 --- a/src/main/java/org/olat/course/nodes/st/learningpath/STLearningPathConfigs.java +++ b/src/main/java/org/olat/course/nodes/st/learningpath/STLearningPathConfigs.java @@ -21,6 +21,7 @@ package org.olat.course.nodes.st.learningpath; import org.olat.course.learningpath.LearningPathConfigs; import org.olat.course.learningpath.LearningPathObligation; +import org.olat.modules.assessment.model.AssessmentRunStatus; /** * @@ -45,4 +46,14 @@ public class STLearningPathConfigs implements LearningPathConfigs { return false; } + @Override + public boolean isDoneOnRunStatus(AssessmentRunStatus runStatus) { + return false; + } + + @Override + public boolean isDoneOnCompletion(Double completion) { + return false; + } + } diff --git a/src/main/java/org/olat/course/assessment/AssessmentAction.java b/src/main/java/org/olat/course/nodes/survey/SurveyAssessmentHandler.java similarity index 68% rename from src/main/java/org/olat/course/assessment/AssessmentAction.java rename to src/main/java/org/olat/course/nodes/survey/SurveyAssessmentHandler.java index 0cf51148cef362f7d3b3df3502d186436e35c7b4..9a427493d393f378cdf42b1aa982b7be1a839959 100644 --- a/src/main/java/org/olat/course/assessment/AssessmentAction.java +++ b/src/main/java/org/olat/course/nodes/survey/SurveyAssessmentHandler.java @@ -17,17 +17,24 @@ * frentix GmbH, http://www.frentix.com * <p> */ -package org.olat.course.assessment; +package org.olat.course.nodes.survey; + +import org.olat.course.learningpath.LearningPathOnlyAssessmentHandler; +import org.olat.course.nodes.SurveyCourseNode; +import org.springframework.stereotype.Service; /** * - * Initial date: 27 Aug 2019<br> + * Initial date: 10 Sep 2019<br> * @author uhensler, urs.hensler@frentix.com, http://www.frentix.com * */ -public enum AssessmentAction { +@Service +public class SurveyAssessmentHandler extends LearningPathOnlyAssessmentHandler { + + @Override + public String acceptCourseNodeType() { + return SurveyCourseNode.TYPE; + } - nodeVisited, - confirmed - } diff --git a/src/main/java/org/olat/course/nodes/survey/SurveyLearningPathNodeHandler.java b/src/main/java/org/olat/course/nodes/survey/SurveyLearningPathNodeHandler.java new file mode 100644 index 0000000000000000000000000000000000000000..5763781bc83dfa712381ae674a1ea235847e57f9 --- /dev/null +++ b/src/main/java/org/olat/course/nodes/survey/SurveyLearningPathNodeHandler.java @@ -0,0 +1,70 @@ +/** + * <a href="http://www.openolat.org"> + * OpenOLAT - Online Learning and Training</a><br> + * <p> + * Licensed under the Apache License, Version 2.0 (the "License"); <br> + * you may not use this file except in compliance with the License.<br> + * You may obtain a copy of the License at the + * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a> + * <p> + * Unless required by applicable law or agreed to in writing,<br> + * software distributed under the License is distributed on an "AS IS" BASIS, <br> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br> + * See the License for the specific language governing permissions and <br> + * limitations under the License. + * <p> + * Initial code contributed and copyrighted by<br> + * frentix GmbH, http://www.frentix.com + * <p> + */ +package org.olat.course.nodes.survey; + +import org.olat.core.gui.UserRequest; +import org.olat.core.gui.control.Controller; +import org.olat.core.gui.control.WindowControl; +import org.olat.core.gui.translator.Translator; +import org.olat.core.util.Util; +import org.olat.course.learningpath.LearningPathConfigs; +import org.olat.course.learningpath.LearningPathNodeHandler; +import org.olat.course.learningpath.model.ModuleLearningPathConfigs; +import org.olat.course.learningpath.ui.LearningPathNodeConfigController; +import org.olat.course.learningpath.ui.LearningPathNodeConfigController.LearningPathControllerConfig; +import org.olat.course.nodes.CourseNode; +import org.olat.course.nodes.SurveyCourseNode; +import org.springframework.stereotype.Service; + +/** + * + * Initial date: 10 Sep 2019<br> + * @author uhensler, urs.hensler@frentix.com, http://www.frentix.com + * + */ +@Service +public class SurveyLearningPathNodeHandler implements LearningPathNodeHandler { + + @Override + public String acceptCourseNodeType() { + return SurveyCourseNode.TYPE; + } + + @Override + public boolean isSupported() { + return true; + } + + @Override + public LearningPathConfigs getConfigs(CourseNode courseNode) { + return new ModuleLearningPathConfigs(courseNode.getModuleConfiguration()); + } + + @Override + public Controller createConfigEditController(UserRequest ureq, WindowControl wControl, CourseNode courseNode) { + Translator translator = Util.createPackageTranslator(SurveyRunController.class, ureq.getLocale()); + LearningPathControllerConfig ctrlConfig = LearningPathNodeConfigController.builder() + .enableNodeVisited() + .enableRunStatusDone(translator.translate("done.trigger.status.done")) + .build(); + return new LearningPathNodeConfigController(ureq, wControl, courseNode.getModuleConfiguration(), ctrlConfig); + } + +} diff --git a/src/main/java/org/olat/course/nodes/survey/SurveyRunController.java b/src/main/java/org/olat/course/nodes/survey/SurveyRunController.java index 77c598a0b4ec6664ed118c1aecafa6bfaae7cac7..6909ddb10069e29376eb57da495efb7645b96e48 100644 --- a/src/main/java/org/olat/course/nodes/survey/SurveyRunController.java +++ b/src/main/java/org/olat/course/nodes/survey/SurveyRunController.java @@ -39,10 +39,11 @@ import org.olat.core.id.Identity; import org.olat.core.id.OLATResourceable; import org.olat.core.util.UserSession; import org.olat.core.util.Util; -import org.olat.course.assessment.AssessmentManager; +import org.olat.course.assessment.CourseAssessmentService; import org.olat.course.nodes.SurveyCourseNode; import org.olat.course.run.userview.UserCourseEnvironment; import org.olat.modules.assessment.Role; +import org.olat.modules.assessment.model.AssessmentRunStatus; import org.olat.modules.forms.EvaluationFormManager; import org.olat.modules.forms.EvaluationFormParticipation; import org.olat.modules.forms.EvaluationFormParticipationIdentifier; @@ -76,6 +77,8 @@ public class SurveyRunController extends BasicController { @Autowired private EvaluationFormManager evaluationFormManager; + @Autowired + private CourseAssessmentService courseAssessmentService; public SurveyRunController(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, SurveyCourseNode courseNode, SurveyRunSecurityCallback secCallback) { @@ -181,8 +184,12 @@ public class SurveyRunController extends BasicController { @Override protected void event(UserRequest ureq, Controller source, Event event) { - if (source == executionCtrl && event == Event.DONE_EVENT) { - doPostExecution(ureq); + if (source == executionCtrl) { + if (event == Event.DONE_EVENT) { + doExecutionFinished(ureq); + } else if (event == Event.CHANGED_EVENT) { + doQuickSaved(); + } } else if(source == deleteDataConfirmationCtrl) { if (event == Event.DONE_EVENT) { doDeleteAllData(ureq); @@ -200,11 +207,17 @@ public class SurveyRunController extends BasicController { cmc = null; } - private void doPostExecution(UserRequest ureq) { - AssessmentManager am = userCourseEnv.getCourseEnvironment().getAssessmentManager(); - Identity mySelf = userCourseEnv.getIdentityEnvironment().getIdentity(); - am.incrementNodeAttempts(courseNode, mySelf, userCourseEnv, Role.auto); + private void doExecutionFinished(UserRequest ureq) { + courseAssessmentService.incrementAttempts(courseNode, userCourseEnv, Role.user); + courseAssessmentService.updateCurrentCompletion(courseNode, userCourseEnv, Double.valueOf(1), + AssessmentRunStatus.done, Role.user); doShowView(ureq); + fireEvent(ureq, Event.CHANGED_EVENT); + } + + private void doQuickSaved() { + courseAssessmentService.updateCurrentCompletion(courseNode, userCourseEnv, null, AssessmentRunStatus.running, + Role.user); } private void doConfirmDeleteAllData(UserRequest ureq) { diff --git a/src/main/java/org/olat/course/nodes/survey/_i18n/LocalStrings_de.properties b/src/main/java/org/olat/course/nodes/survey/_i18n/LocalStrings_de.properties index f52d0a9a97ac9ada09aee3668a28af53c96b156b..cd2f48ce577e210075a225dd0cc069ed3a95c92b 100644 --- a/src/main/java/org/olat/course/nodes/survey/_i18n/LocalStrings_de.properties +++ b/src/main/java/org/olat/course/nodes/survey/_i18n/LocalStrings_de.properties @@ -1,4 +1,5 @@ course.node.link.text=Umfrage +done.trigger.status.done=Fragebogen eingereicht edit.choose=W\u00E4hlen, erstellen oder importieren edit.choose.evaluation.form=Fragebogen ausw\u00E4hlen edit.edit=Bearbeiten @@ -12,7 +13,7 @@ edit.evaluation.form=Fragebogen edit.evaluation.form.link={0} edit.evaluation.form.not.choosen=Kein Fragebogen ausw\u00E4hlt edit.replace=Ersetzen -edit.report=Resultate sichtbar f\u00fcr +edit.report=Resultate sichtbar f\u00FCr edit.report.for.owner=Besitzer edit.report.for.coach=Betreuer edit.report.for.participant=Teilnehmer @@ -24,14 +25,14 @@ error.repo.entry.missing=Der Fragebogen, welchen Sie anzeigen m\u00F6chten, wurd error.repo.entry.not.replaceable=Der Fragebogen kann nicht mehr ge\u00E4ndert werden. pane.tab.config=Umfrage report.noaccess=Sie haben keinen Zugang zu den Statistiken dieser Umfrage. Entweder fehlen ihnen die entsprechenden Berechtigungen oder Sie haben an der Umfrage noch nicht teilgenommen. -run.command.delete.data.all=Umfrage zur\u00fcksetzen -run.command.delete.data.all.confirmation.error=Best\u00E4tigen Sie bitte das L\u00f6schen. -run.command.delete.data.all.button=L\u00f6schen -run.command.delete.data.all.check=Alle Antworten l\u00f6schen -run.command.delete.data.all.message=Wollen Sie wirklich alle Antworten l\u00f6schen? Es haben bereits {0} Benutzer/innen an dieser Umfrage teilgenommen. Die Antworten k\u00f6nnen nicht wieder hergestellt werden! -run.command.delete.data.all.title=Alle Antworten l\u00f6schen -run.participation.done.message=Sie haben den Fragebogen bereits ausgef\u00fcllt. Vielen Dank f\u00fcr Ihre Teilnahme. -run.participation.done.title=Fragebogen ausgef\u00fcllt +run.command.delete.data.all=Umfrage zur\u00FCksetzen +run.command.delete.data.all.confirmation.error=Best\u00E4tigen Sie bitte das L\u00F6schen. +run.command.delete.data.all.button=L\u00F6schen +run.command.delete.data.all.check=Alle Antworten l\u00F6schen +run.command.delete.data.all.message=Wollen Sie wirklich alle Antworten l\u00F6schen? Es haben bereits {0} Benutzer/innen an dieser Umfrage teilgenommen. Die Antworten k\u00F6nnen nicht wieder hergestellt werden! +run.command.delete.data.all.title=Alle Antworten l\u00F6schen +run.participation.done.message=Sie haben den Fragebogen bereits ausgef\u00FCllt. Vielen Dank f\u00FCr Ihre Teilnahme. +run.participation.done.title=Fragebogen ausgef\u00FCllt run.noaccess.message=Dieser Teil des Kurses ist f\u00FCr Sie nicht zug\u00E4nglich. run.noaccess.title=Kein Zugang -run.reset=Zur\u00fccksetzen +run.reset=Zur\u00FCcksetzen diff --git a/src/main/java/org/olat/course/nodes/survey/_i18n/LocalStrings_en.properties b/src/main/java/org/olat/course/nodes/survey/_i18n/LocalStrings_en.properties index 8f2cec9148f2713720bd7ed5349651aea82c346b..f8f76fa3343e775d99415d5633f5966617bd0e53 100644 --- a/src/main/java/org/olat/course/nodes/survey/_i18n/LocalStrings_en.properties +++ b/src/main/java/org/olat/course/nodes/survey/_i18n/LocalStrings_en.properties @@ -1,4 +1,5 @@ course.node.link.text=Survey +done.trigger.status.done=Survey finished edit.choose=Choose, create or import edit.choose.evaluation.form=Choose questionnaire edit.edit=Edit diff --git a/src/main/java/org/olat/course/nodes/video/VideoLearningPathNodeHandler.java b/src/main/java/org/olat/course/nodes/video/VideoLearningPathNodeHandler.java index a358dcdbdeac54f134336c2419e979053e0fb6f3..b40681646ebeedce59dd786a78f6d4f9b5c45f02 100644 --- a/src/main/java/org/olat/course/nodes/video/VideoLearningPathNodeHandler.java +++ b/src/main/java/org/olat/course/nodes/video/VideoLearningPathNodeHandler.java @@ -22,7 +22,6 @@ package org.olat.course.nodes.video; import org.olat.core.gui.UserRequest; import org.olat.core.gui.control.Controller; import org.olat.core.gui.control.WindowControl; -import org.olat.course.assessment.AssessmentAction; import org.olat.course.learningpath.LearningPathConfigs; import org.olat.course.learningpath.LearningPathNodeHandler; import org.olat.course.learningpath.model.ModuleLearningPathConfigs; @@ -59,7 +58,7 @@ public class VideoLearningPathNodeHandler implements LearningPathNodeHandler { @Override public Controller createConfigEditController(UserRequest ureq, WindowControl wControl, CourseNode courseNode) { LearningPathControllerConfig ctrlConfig = LearningPathNodeConfigController.builder() - .addAssessmentAction(AssessmentAction.nodeVisited) + .enableNodeVisited() .build(); return new LearningPathNodeConfigController(ureq, wControl, courseNode.getModuleConfiguration(), ctrlConfig); } diff --git a/src/main/java/org/olat/ims/qti21/ui/QTI21ResetDataController.java b/src/main/java/org/olat/ims/qti21/ui/QTI21ResetDataController.java index bc61c6801e5102ea7893672935d37fa3326fc651..c4e7776411c95d7f8049ee07a57c06968964fc30 100644 --- a/src/main/java/org/olat/ims/qti21/ui/QTI21ResetDataController.java +++ b/src/main/java/org/olat/ims/qti21/ui/QTI21ResetDataController.java @@ -211,8 +211,8 @@ public class QTI21ResetDataController extends FormBasicController { UserCourseEnvironment uce = new UserCourseEnvironmentImpl(ienv, courseEnv); courseAssessmentService.updateScoreEvaluation(courseNode, scoreEval, uce, getIdentity(), false, Role.coach); - courseAssessmentService.updateCurrentCompletion(courseNode, uce, getIdentity(), null, - AssessmentRunStatus.notStarted, Role.coach); + courseAssessmentService.updateCurrentCompletion(courseNode, uce, null, AssessmentRunStatus.notStarted, + Role.coach); } } else if(assessedEntry != null) { archiveData(assessedEntry); diff --git a/src/main/java/org/olat/modules/forms/ui/EvaluationFormExecutionController.java b/src/main/java/org/olat/modules/forms/ui/EvaluationFormExecutionController.java index 7fc7451e23a27527e1f86eae2a94c45b02bb791e..2690dcb1c0511a28f0fbc010279b096fc68ce4ee 100644 --- a/src/main/java/org/olat/modules/forms/ui/EvaluationFormExecutionController.java +++ b/src/main/java/org/olat/modules/forms/ui/EvaluationFormExecutionController.java @@ -272,6 +272,7 @@ public class EvaluationFormExecutionController extends FormBasicController imple if(mainForm.validate(ureq)) { mainForm.forceSubmittedAndValid(); doSaveResponses(); + fireEvent(ureq, Event.CHANGED_EVENT); } } super.formInnerEvent(ureq, source, event);