Esempio n. 1
0
 def set_closest_answered_question_as_next_question(self):
     if self.current_difficulty == 20:
         self.next_difficulty = 1
         self.next_question = get_item_from_set(
             self.questions_dict[self.next_difficulty])
     else:
         self.next_difficulty += 1
         self.next_question = get_item_from_set(
             self.questions_dict[self.next_difficulty])
Esempio n. 2
0
 def __init__(self,
              student,
              category,
              db_address=db_address1,
              how_many_questions=20):
     super().__init__(
         student,
         category,
         db_address,
         gui=DecisionsAndTimingPracticeSessionGUI(self),
         how_many_questions=how_many_questions,
         session_results=DecisionsAndTimingPracticeSessionResults(self),
         is_graph_session=True)
     self.category = "Timer"
     self.current_checked_question = None
     self.next_checked_question = None
     self.students_time = 0
     self.old_students_time = None
     self.answered_current_question = None
     self.time_left_for_current_question = 0  # what's written on the timer right now
     self.time_spent_on_current_question = 0
     self.no_time_questions_indices = []
     self.students_time_spent_on_current_question = 0
     self.old_time_left_for_current_question = 0
     self.questions_set = {
         get_item_from_set(self.questions_dict[k])
         for k in range(1, 21)
     }
     self.session_results.set_checked_questions_dict()
     self.session_results.create_students_time_spent_on_questions()
Esempio n. 3
0
 def try_to_set_closest_unanswered_question_as_next_question(
         self, min_difficulty, max_difficulty):
     for difficulty in range(min_difficulty, max_difficulty):
         next_question = get_item_from_set(self.questions_dict[difficulty])
         if (not self.answered_question_already(next_question)) and (
                 self.have_time_for_question(next_question)):
             self.next_difficulty, self.next_question = difficulty, next_question
             return True  # found a question
     return False
Esempio n. 4
0
 def get_first_question(self):
     return get_item_from_set(self.questions_dict[1])
Esempio n. 5
0
 def set_next_question_after_switching(self, question_number):
     self.current_difficulty = question_number
     self.last_question = self.current_question
     self.next_question = get_item_from_set(
         self.questions_dict[question_number])
     self.set_current_question()