textAsLines.append(t_line) # /////////////////////// END OF REPLACEMENTS /////////////////////////// # qType = textfunctions.getQuestionTypeFromText(textAsLines) if qType == "CAN'T FIND QUESTION TYPE": raw_input("Problem with finding Question Type. Press Enter to quit.") sys.exit() xmlFromText = "" if qType == "drag1": xmlFromText = drag1.makeXmlFromText(textAsLines, fullClassName) if qType == "radio1": xmlFromText = radio1.makeXmlFromText(textAsLines, fullClassName) xmlOutputPath = os.path.join(xmlDirectory, t[:-3] + "xml") fh = open(xmlOutputPath, "w") fh.write(xmlFromText) fh.close() xmlFromText = "" # get working xml files xmlfiles = os.listdir(xmlDirectory) firstRun = True packageRoot = "" for xmlfile in xmlfiles: questionType = ""
fh = open(os.path.join(textDirectory, t)) textAsLines = fh.readlines() fh.close() qType = textfunctions.getQuestionTypeFromText(textAsLines) print qType if qType == "CAN'T FIND QUESTION TYPE": raw_input("Problem with finding Question Type. Press Enter to quit.") sys.exit() if qType == "drag1": xmlFromText = drag1.makeXmlFromText(textAsLines) if qType == "radio1": xmlFromText = radio1.makeXmlFromText(textAsLines) xmlOutputPath = os.path.join(xmlDirectory, t[:-3] + "xml") fh = open(xmlOutputPath, "w") fh.write(xmlFromText) fh.close() xmlFromText = "" # get working xml files xmlfiles = os.listdir(xmlDirectory) firstRun = True packageRoot = "" for xmlfile in xmlfiles: questionType = ""