Exemple #1
0
 def _get_answers(self):
     """Returns a dummy list of 4 answers for all the answerable questions
     """
     questions = Question.get_answerable_questions()
     question_tags = [question.as_form_id() for question in questions]
     answers = {tag: [str(num) for num in range(4)] for tag in
                question_tags}
     return answers
    def can_display_results(self):
        """Returns True if the last test page was submitted
        :return:
        """
        #Just check if all the questions with answers were answered
        answerable_questions = Question.get_answerable_questions()

        for question in answerable_questions:
            if question.as_form_id() not in self.answers.keys():
                return False
        return True