diff --git a/sosci2word/_SoSci2Word.mm b/sosci2word/_SoSci2Word.mm index 8df3955..6b5e2a9 100644 --- a/sosci2word/_SoSci2Word.mm +++ b/sosci2word/_SoSci2Word.mm @@ -230,8 +230,8 @@ - - + + @@ -241,10 +241,10 @@ - - - - + + + + @@ -264,12 +264,16 @@ - - + + + + - + + + diff --git a/sosci2word/sosci2word.py b/sosci2word/sosci2word.py index b710176..004e0b7 100644 --- a/sosci2word/sosci2word.py +++ b/sosci2word/sosci2word.py @@ -102,9 +102,10 @@ class TextElement(QuestionElement): def collectQuestionDefinitions(): + # + questions = {} # root = ElementTree.parse(SOSCI_XML).getroot() - for section in root.findall('section'): title = section.find('title') id_prefix = getSpecificID(section) @@ -117,7 +118,6 @@ def collectQuestionDefinitions(): id_suffix = getSpecificID(question) id_suffix = int(id_suffix) questionID = "%s%02d" % (id_prefix, id_suffix) - print("Question: ID=%s desc=%s type=%s title=%s " % (questionID, desc, questionType, title)) if questionType == 'scale': element = LikertItem(questionID, question) elif questionType == 'select' or questionType == 'dropdown': @@ -129,7 +129,14 @@ def collectQuestionDefinitions(): else: __err("unbekannter QuestionType:"+questionType) - print(element.dump()) + questions[questionID] = element + + print(questions.keys()) + for key in questions.keys(): + quest = questions[key] + print("Question: ID=%s type=%s desc=%s" % (quest.qid, type(quest), quest.desc)) + print(quest.dump()) + # Hilfsmittel für SoSci-XML: extrahiert ein ID-Element, das eingeschachtelt in liegt