def get_specific_question(self, tag_hierarchy): if self.scratch_pad.query(tag_hierarchy[1]) == None: self.scratch_pad.pop_specific(tag_hierarchy) return question_interface_helper.load_linked_questions( tag_hierarchy[0], tag_hierarchy[1])[0] return None
def get_next_unanswered_question(self, tag): pending_question_tags = self.scratch_pad.query(tag) if len(pending_question_tags) == 0: return None last_unanswered_tag = pending_question_tags[0] self.scratch_pad.pop(tag) return question_interface_helper.load_linked_questions( tag, last_unanswered_tag)[0]