11. /login/ Find the student based on input update their token and expiration get a list of their courses return token and list of courses
12. /list-surveys/ Expects: token=<token> Returns: name_id|name_id name = name of a survey id = primary key of the survey
13. /list-surveys/ Find the student based on token update their token expiration get a list of their courses return list of available surveys
14. /import/ Expects: token=<token> id=<survey_id> Returns: xml for a survey
15. /import/ Find the student based on token update their token expiration Find the survey based on id input convert survey into xml return xml for survey
16. Creating xml with python from xml.etree.ElementTree import Element,SubElement, tostring root = Element(“survey”) root.set(“id”, survey.id) for q in questions: question = SubElement(root, “question”) # proceeed looping... xml = tostring(root)
17. /submit/ Expects: token=<token> a1=<answer_xml> a2..a10=<answer_xml> Returns: “ DONE” after answers recorded
18. /submit/ Find the student based on token update their token expiration Loop through answered surveys parse xml for each survey insert answers into db return “done” when complete