NodeList choiceNodes = multiConfigElement.getElementsByTagName("choice");
for (int i = 0; i < choiceNodes.getLength(); i++) {
Element choiceNode = (Element) choiceNodes.item(i);
String id = choiceNode.getAttribute("id");
String label = choiceNode.getAttribute("label");
Choice choice = qb.buildChoice(id, label);
choices.add(choice);
}
return qb.buildRadioButtons(vertical, leftLabel, rightLabel, choices);
} else if (questionTypeElement.getElementsByTagName("dropdown").getLength() == 1) {
Element dropdownConfigElement = (Element) questionTypeElement.getElementsByTagName("dropdown").item(0);
List<Choice> choices = new Vector<Choice>();
NodeList choiceNodes = dropdownConfigElement.getElementsByTagName("choice");
for (int i = 0; i < choiceNodes.getLength(); i++) {
Element choiceNode = (Element) choiceNodes.item(i);
String id = choiceNode.getAttribute("id");
String label = choiceNode.getAttribute("label");
Choice choice = qb.buildChoice(id, label);
choices.add(choice);
}
return qb.buildDropdown(choices);
} else if (questionTypeElement.getElementsByTagName("textField").getLength() == 1) {
return qb.buildTextField();