diff --git a/QuizTheWord/app.py b/QuizTheWord/app.py index 1e55972..a45abf4 100644 --- a/QuizTheWord/app.py +++ b/QuizTheWord/app.py @@ -53,11 +53,8 @@ def hidden_answer_category(): @app.route("/category/multiple_choice") def multiple_choice_category(): easy = database.get_random_multiple_choice(1) - easy.randomize_answer_list() medium = database.get_random_multiple_choice(2) - medium.randomize_answer_list() hard = database.get_random_multiple_choice(3) - hard.randomize_answer_list() return render_template( "multiple_choice.html", title="Multiple Choice", diff --git a/QuizTheWord/database.py b/QuizTheWord/database.py index 0bb5169..13dd9d8 100644 --- a/QuizTheWord/database.py +++ b/QuizTheWord/database.py @@ -154,6 +154,9 @@ class HiddenAnswer(Base): "question_id": self.question_id, "difficulty": self.hidden_answer_difficulty, "hint": self.hidden_answer_hint, + "question_text": self.question_text, + "answer": self.answer, + "addresses": self.addresses, } @@ -192,6 +195,20 @@ class MultipleChoice(Base): "difficulty": self.multiple_choice_difficulty, "hint": self.multiple_choice_hint, "wrong_answers": self.wrong_answers, + "question_text": self.question_text, + "answer": self.answer, + "addresses": self.addresses, + } + + def get_dict_shuffled_choices(self): + self.randomize_answer_list() + return { + "question_id": self.question_id, + "difficulty": self.multiple_choice_difficulty, + "hint": self.multiple_choice_hint, + "question_text": self.question_text, + "addresses": self.addresses, + "answer_list": self.answer_list, } diff --git a/QuizTheWord/templates/hidden_answer.html b/QuizTheWord/templates/hidden_answer.html index b1017aa..c9f6913 100644 --- a/QuizTheWord/templates/hidden_answer.html +++ b/QuizTheWord/templates/hidden_answer.html @@ -3,47 +3,28 @@ {% block body %}

Quiz The Word

-
-
-
-
{{ easy.question_text }}
- -

{{ easy.answer }}

-
{{ easy.addresses }}
-
-
-
-
-
{{ medium.question_text }}
- -

{{ medium.answer }}

-
{{ medium.addresses }}
-
-
-
-
-
{{ hard.question_text }}
- -

{{ hard.answer }}

-
{{ hard.addresses }}
+
+
+
+
+ +

+
-