diff --git a/python/educational-core/student/src/com/jetbrains/edu/learning/StudySerializationUtils.java b/python/educational-core/student/src/com/jetbrains/edu/learning/StudySerializationUtils.java index b1c0776513c1..0163a3b895a4 100644 --- a/python/educational-core/student/src/com/jetbrains/edu/learning/StudySerializationUtils.java +++ b/python/educational-core/student/src/com/jetbrains/edu/learning/StudySerializationUtils.java @@ -219,17 +219,19 @@ public class StudySerializationUtils { for (Element placeholder : getChildList(taskFileElement, ANSWER_PLACEHOLDERS)) { Element valueElement = new Element(SUBTASK_INFO); addChildMap(placeholder, SUBTASK_INFOS, Collections.singletonMap(String.valueOf(0), valueElement)); - for (String childName : ContainerUtil.list(HINT, ADDITIONAL_HINTS, POSSIBLE_ANSWER, SELECTED, STATUS, TASK_TEXT)) { - Element child = getChildWithName(placeholder, childName); + for (String childName : ContainerUtil.list(HINT, POSSIBLE_ANSWER, SELECTED, STATUS, TASK_TEXT)) { + Element child = getChildWithName(placeholder, childName, true); + if (child == null) { + continue; + } valueElement.addContent(child.clone()); } renameElement(getChildWithName(valueElement, TASK_TEXT), PLACEHOLDER_TEXT); - List additionalHints = ContainerUtil.map(getChildList(valueElement, ADDITIONAL_HINTS), Element::clone); Element hint = getChildWithName(valueElement, HINT); Element firstHint = new Element(OPTION).setAttribute(VALUE, hint.getAttributeValue(VALUE)); List newHints = new ArrayList<>(); newHints.add(firstHint); - newHints.addAll(additionalHints); + newHints.addAll(ContainerUtil.map(getChildList(placeholder, ADDITIONAL_HINTS, true), Element::clone)); addChildList(valueElement, "hints", newHints); } } diff --git a/python/educational-core/student/testData/migration/4.xml b/python/educational-core/student/testData/migration/4.xml index 944ffd640b2e..b0c11ff543b8 100644 --- a/python/educational-core/student/testData/migration/4.xml +++ b/python/educational-core/student/testData/migration/4.xml @@ -69,11 +69,6 @@