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

OO-2143: fix RS if a user copy a course with an empty check list course element (patch S. Clemenz)

parent 3c9432b0
No related branches found
No related tags found
No related merge requests found
...@@ -644,14 +644,16 @@ public class CheckListCourseNode extends AbstractAccessableCourseNode implements ...@@ -644,14 +644,16 @@ public class CheckListCourseNode extends AbstractAccessableCourseNode implements
ModuleConfiguration config = getModuleConfiguration(); ModuleConfiguration config = getModuleConfiguration();
CheckboxManager checkboxManager = CoreSpringFactory.getImpl(CheckboxManager.class); CheckboxManager checkboxManager = CoreSpringFactory.getImpl(CheckboxManager.class);
CheckboxList list = (CheckboxList)config.get(CONFIG_KEY_CHECKBOX); CheckboxList list = (CheckboxList)config.get(CONFIG_KEY_CHECKBOX);
for(Checkbox checkbox:list.getList()) { if (list !=null && list.getList().size() > 0) {
String sourceId = checkbox.getCheckboxId(); for(Checkbox checkbox:list.getList()) {
String targetId = envMapper.getTargetUniqueKey(getIdent(), sourceId); String sourceId = checkbox.getCheckboxId();
if(targetId == null) { String targetId = envMapper.getTargetUniqueKey(getIdent(), sourceId);
targetId = UUID.randomUUID().toString(); if(targetId == null) {
envMapper.addUniqueKeyPair(getIdent(), sourceId, targetId); targetId = UUID.randomUUID().toString();
envMapper.addUniqueKeyPair(getIdent(), sourceId, targetId);
}
checkbox.setCheckboxId(targetId);
} }
checkbox.setCheckboxId(targetId);
} }
// the ident of the course node is the same // the ident of the course node is the same
......
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