Shuffle answers in multiple choice questions
authorCharles Connell <charles@connells.org>
Sat, 14 Jun 2014 22:34:27 +0000 (18:34 -0400)
committerCharles Connell <charles@connells.org>
Sat, 14 Jun 2014 22:34:39 +0000 (18:34 -0400)
karmaworld/apps/quizzes/create_quiz.py

index d7fd8e0941b81f3f48f565c2fb3643efe190b4af..a61d236cf1340b77c82e24ef2ab339b70dab041e 100644 (file)
@@ -98,6 +98,8 @@ def _create_keyword_multiple_choice(keyword, keywords):
 
     question_text = u'Pick the keyword to match "{d}"'.format(d=keyword.definition)
 
+    random.shuffle(choices)
+
     return MultipleChoiceQuestion(question_text, choices)
 
 
@@ -111,6 +113,8 @@ def _create_definition_multiple_choice(keyword, keywords):
 
     question_text = u'Pick the definition to match "{w}"'.format(w=keyword.word)
 
+    random.shuffle(choices)
+
     return MultipleChoiceQuestion(question_text, choices)