Skip to content
Snippets Groups Projects
Commit 0a6bf370 authored by User expired's avatar User expired
Browse files

openolat#216: adding initial clearLearningPathIncompatibleSettings interface...

openolat#216: adding initial clearLearningPathIncompatibleSettings interface function to ICourseNodeCopyConfigurator
parent 778c4b35
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,7 @@ import org.olat.core.util.nodes.INode;
import org.olat.core.util.vfs.VFSContainer;
import org.olat.course.CourseFactory;
import org.olat.course.export.CourseFragmentEnvironmentMapper;
import org.olat.course.learningpath.manager.LearningPathNodeAccessProvider;
import org.olat.course.nodes.CourseNode;
import org.olat.course.run.environment.CourseEnvironment;
import org.olat.course.tree.CourseEditorTreeModel;
......@@ -144,6 +145,9 @@ public class CopyStructureWizardStepRunnerCallback implements StepRunnerCallback
cncc.configure();
cncc.updateNodeReferences();
if (LearningPathNodeAccessProvider.TYPE.equals(process.getTargetCourse().getCourseConfig().getNodeAccessType().getType())) {
cncc.clearLearningPathIncompatibleSettings();
}
}
......
......@@ -157,4 +157,13 @@ public class AbstractCourseNodeCopyConfigurator implements ICourseNodeCopyConfig
return condition;
}
@Override
public void clearLearningPathIncompatibleSettings() {
// Precondition access / visibility are no longer used in the learning path node access course type
targetCourseNode.getPreConditionVisibility().setExpertMode(false);
targetCourseNode.getPreConditionVisibility().clearEasyConfig();
targetCourseNode.getPreConditionAccess().setExpertMode(false);
targetCourseNode.getPreConditionAccess().clearEasyConfig();
}
}
......@@ -62,4 +62,10 @@ public class BCCourseNodeCopyConfigurator extends AbstractCourseNodeCopyConfigur
targetFolderNodeDir.mkdirs();
FileUtils.copyDirContentsToDir(srcFolderNodeDir, targetFolderNodeDir, false, "");
}
@Override
public void clearLearningPathIncompatibleSettings() {
super.clearLearningPathIncompatibleSettings();
((BCCourseNode) this.srcCourseNode).removeCustomPreconditions();
}
}
......@@ -30,4 +30,5 @@ public interface ICourseNodeCopyConfigurator {
void updateNodeReferences();
void clearLearningPathIncompatibleSettings();
}
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