private String convertTestToXML(LectureTestData test) { StringBuilder testXML = new StringBuilder(); for (QuestionData questionData : test.getQuestions()) { testXML.append(convertQuestionToXML(questionData)); } return testXML.toString(); }
public String convertToXML(LectureTestData test) { String rez = xmlHeader; rez += "\n<" + TestElementTypes.TEST.name() + " id=\"" + test.getId() + "\" name=\"" + test.getName() + "\" duration=\"" + test.getDuration() + "\" course=\"" + test.getLectureId() + "\">"; rez += convertTestToXML(test); rez += "\n</" + TestElementTypes.TEST.name() + ">"; return rez; }