diff options
Diffstat (limited to 'exam/management/commands/load_questions_xml.py')
-rw-r--r-- | exam/management/commands/load_questions_xml.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/exam/management/commands/load_questions_xml.py b/exam/management/commands/load_questions_xml.py index aa403dd..b4151ae 100644 --- a/exam/management/commands/load_questions_xml.py +++ b/exam/management/commands/load_questions_xml.py @@ -35,6 +35,9 @@ def load_questions_xml(filename): desc_node = question.getElementsByTagName("description")[0] description = (desc_node.childNodes[0].data).strip() + lang_node = question.getElementsByTagName("language")[0] + language = (lang_node.childNodes[0].data).strip() + points_node = question.getElementsByTagName("points")[0] points = int((points_node.childNodes[0].data).strip()) \ if points_node else 1 @@ -45,6 +48,7 @@ def load_questions_xml(filename): new_question = Question(summary=summary, description=description, points=points, + language=language, test=test) new_question.save() |