def __init__(self, quiz_file_path=None): tag_dict = { "language": self.on_tag_language, "question": self.on_tag_question, "type": self.on_tag_type, "media": self.on_tag_media, "generator": self.on_tag_generator } SaDrill.__init__(self, head_tag_dict=tag_dict, mandatory_has_questions=True) self.SCORE_PATH = os.path.expanduser("~/.quizdrill/scores/") self.type = "vocabulary" self.all_subquizzes = [] self.question_topic = [_("What is this?"), _("What is this?")] self.data_name = [_("Question"), _("Answer")] self.treestore = gtk.TreeStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_BOOLEAN) if quiz_file_path != None: self.quiz_file_path = quiz_file_path quizlist = self.read_quiz_list(self.quiz_file_path) score = self.read_score_file() else: self.quiz_file_path = resource_filename( __name__, "../quizzes/no-file.drill") quizlist = [["", ""]] score = {"": 0} self.quiz = Weighted_Quiz(quizlist, score) self.quiz.next()
def __init__(self, quiz_file_path=None): tag_dict = { "language" : self.on_tag_language, "question" : self.on_tag_question, "type" : self.on_tag_type, "media" : self.on_tag_media, "generator" : self.on_tag_generator } SaDrill.__init__(self, head_tag_dict=tag_dict, mandatory_has_questions=True) self.SCORE_PATH = os.path.expanduser("~/.quizdrill/scores/") self.type = "vocabulary" self.all_subquizzes = [] self.question_topic = [ _("What is this?"), _("What is this?") ] self.data_name = [ _("Question"), _("Answer") ] self.treestore = gtk.TreeStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_BOOLEAN ) if quiz_file_path != None: self.quiz_file_path = quiz_file_path quizlist = self.read_quiz_list(self.quiz_file_path) score = self.read_score_file() else: self.quiz_file_path = resource_filename(__name__, "../quizzes/no-file.drill") quizlist = [["", ""]] score = {"": 0} self.quiz = Weighted_Quiz(quizlist, score) self.quiz.next()
def __init__(self): tag_dict = { "build_to" : self.on_tag_build_to, "builder" : self.on_tag_builder, "filter" : self.on_tag_filter, "one_of_categories" : self.on_tag_one_of_categories, "wiki_cat_namespace" : self.on_tag_wiki_cat_namespace } mandatory_tags = [ "build_to", "builder" ] SaDrill.__init__(self, {}, tag_dict, {}, mandatory_tags) self.encoding = "utf-8" self.one_of_categories = []