diff --git a/src/main/java/de/bps/course/nodes/DENCourseNode.java b/src/main/java/de/bps/course/nodes/DENCourseNode.java index fd3fc3d2c6fa09fc8b5400bcbde3a6473e2879e4..7c1eafdb57396c87721adf64b9e6c2aa3ab480c2 100644 --- a/src/main/java/de/bps/course/nodes/DENCourseNode.java +++ b/src/main/java/de/bps/course/nodes/DENCourseNode.java @@ -61,7 +61,7 @@ import de.bps.course.nodes.den.DENRunController; */ public class DENCourseNode extends AbstractAccessableCourseNode { - private static final String TYPE = "den"; + public static final String TYPE = "den"; /** is cancel of the enrollment allowed */ public static final String CONF_CANCEL_ENROLL_ENABLED = "cancel_enroll_enabled"; public static final String CONF_COURSE_ID = "den_course_id"; diff --git a/src/main/java/de/bps/course/nodes/den/DENAssessmentHandler.java b/src/main/java/de/bps/course/nodes/den/DENAssessmentHandler.java new file mode 100644 index 0000000000000000000000000000000000000000..d0dcd95bf24014835af943935cc7fbbd8883ab98 --- /dev/null +++ b/src/main/java/de/bps/course/nodes/den/DENAssessmentHandler.java @@ -0,0 +1,41 @@ +/** + * <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 de.bps.course.nodes.den; + +import org.olat.course.learningpath.LearningPathOnlyAssessmentHandler; +import org.springframework.stereotype.Service; + +import de.bps.course.nodes.DENCourseNode; + +/** + * + * Initial date: 24.02.2020<br> + * @author uhensler, urs.hensler@frentix.com, http://www.frentix.com + * + */ +@Service +public class DENAssessmentHandler extends LearningPathOnlyAssessmentHandler { + + @Override + public String acceptCourseNodeType() { + return DENCourseNode.TYPE; + } + +} diff --git a/src/main/java/de/bps/course/nodes/den/DENLearningPathNodeHandler.java b/src/main/java/de/bps/course/nodes/den/DENLearningPathNodeHandler.java new file mode 100644 index 0000000000000000000000000000000000000000..7a269bcb6ef72e18d463da224802196b18d1b840 --- /dev/null +++ b/src/main/java/de/bps/course/nodes/den/DENLearningPathNodeHandler.java @@ -0,0 +1,81 @@ +/** + * <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 de.bps.course.nodes.den; + +import org.olat.core.gui.UserRequest; +import org.olat.core.gui.control.Controller; +import org.olat.core.gui.control.WindowControl; +import org.olat.course.learningpath.LearningPathConfigs; +import org.olat.course.learningpath.LearningPathEditConfigs; +import org.olat.course.learningpath.LearningPathNodeHandler; +import org.olat.course.learningpath.model.ModuleLearningPathConfigs; +import org.olat.course.learningpath.ui.LearningPathNodeConfigController; +import org.olat.course.nodes.CourseNode; +import org.olat.repository.RepositoryEntry; +import org.springframework.stereotype.Service; + +import de.bps.course.nodes.DENCourseNode; + +/** + * + * Initial date: 24.02.2020<br> + * @author uhensler, urs.hensler@frentix.com, http://www.frentix.com + * + */ +@Service +public class DENLearningPathNodeHandler implements LearningPathNodeHandler { + + private static final LearningPathEditConfigs EDIT_CONFIGS = LearningPathEditConfigs.builder() + .enableNodeVisited() + .enableConfirmed() + .build(); + + @Override + public String acceptCourseNodeType() { + return DENCourseNode.TYPE; + } + + @Override + public boolean isSupported() { + return true; + } + + @Override + public LearningPathConfigs getConfigs(CourseNode courseNode) { + return new ModuleLearningPathConfigs(courseNode.getModuleConfiguration(), true); + } + + @Override + public Controller createConfigEditController(UserRequest ureq, WindowControl wControl, RepositoryEntry courseEntry, + CourseNode courseNode) { + return new LearningPathNodeConfigController(ureq, wControl, courseEntry, courseNode, EDIT_CONFIGS); + } + + @Override + public LearningPathEditConfigs getEditConfigs() { + return EDIT_CONFIGS; + } + + @Override + public void onMigrated(CourseNode courseNode) { + // + } + +}