Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | clear db, init new methods |
---|---|
Timelines: | family | ancestors | descendants | both | testing |
Files: | files | file ages | folders |
SHA1: |
84ae69493b2a3ae290f427b70d570065 |
User & Date: | alzay 2012-10-02 09:18:32.162 |
Context
2012-10-02
| ||
11:30 | small lang error check-in: efc81e9a8c user: alzay tags: testing | |
09:18 | clear db, init new methods check-in: 84ae69493b user: alzay tags: testing | |
2012-09-26
| ||
17:59 | change urllib check-in: 271f3e45b4 user: zorro tags: testing | |
Changes
Changes to condt.conf.
1 2 3 4 | [database] dbname=db.sqlite [user] | | | 1 2 3 4 5 6 | [database] dbname=db.sqlite [user] default_user=test test_count=10 |
Changes to condt.py.
︙ | ︙ | |||
61 62 63 64 65 66 67 68 69 70 71 72 73 74 | 'full': 'quit form program'}, '.test': {'desc': 'start test (default en)', 'command': None, 'full': 'start en-ru test'}, '.testru': {'desc': 'start ru-test', 'command': None, 'full': 'start ru-en test'}, '.testmix': {'desc': 'start en-ru test', 'command': None, 'full': 'start mix test'}, } def __init__(self, name, dbfile, ctest=10): super().__init__(name, dbfile) self.__pcounter = 3 self.ctest = ctest self.init_command() self.user_id = self.get_user() | > > > > | 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | 'full': 'quit form program'}, '.test': {'desc': 'start test (default en)', 'command': None, 'full': 'start en-ru test'}, '.testru': {'desc': 'start ru-test', 'command': None, 'full': 'start ru-en test'}, '.testmix': {'desc': 'start en-ru test', 'command': None, 'full': 'start mix test'}, '.testinfo': {'desc': 'information by test', 'command': None, 'full': 'full test information by test ID'}, '.testlist': {'desc': 'list of tests', 'command': None, 'full': 'this command print list of your tests'}, } def __init__(self, name, dbfile, ctest=10): super().__init__(name, dbfile) self.__pcounter = 3 self.ctest = ctest self.init_command() self.user_id = self.get_user() |
︙ | ︙ | |||
601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 | print("\nQ#{0}: {1}\n[correcnt] {2}\n[you] {3}".format(q['num'],q['question'],q['answer'],q['enter'])) else: right += 1 print("**************************") print("\nResult: {0} error(s) from {1}".format(error,(right + error))) def gen_question(self, cur, type_test, alreadyq): sql_list = "SELECT `translate`.`id`, `term`.`en`, `translate`.`rus` FROM `translate` LEFT JOIN `term` ON (`translate`.`term`=`term`.`token`) WHERE `translate`.`user_id`=" + str(self.user_id) + " AND (`translate`.`id` NOT IN (" + ", ".join(alreadyq) + "))" cur.execute(sql_list) for_search = cur.fetchall() if not for_search: return None, None, None row = for_search[random.randint(0,len(for_search)-1)] # 0 => en, 1 => ru, 2 => mix translate_id = row[0] if type_test == 0: question, answer = row[1], row[2] elif type_test == 1: question, answer = row[2], row[1] else: i = random.randint(1,2) j = 1 if i == 2 else 2 question, answer = row[i], row[j] return question, answer, translate_id | > | | 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 | print("\nQ#{0}: {1}\n[correcnt] {2}\n[you] {3}".format(q['num'],q['question'],q['answer'],q['enter'])) else: right += 1 print("**************************") print("\nResult: {0} error(s) from {1}".format(error,(right + error))) def gen_question(self, cur, type_test, alreadyq): """genaration question for any test""" sql_list = "SELECT `translate`.`id`, `term`.`en`, `translate`.`rus` FROM `translate` LEFT JOIN `term` ON (`translate`.`term`=`term`.`token`) WHERE `translate`.`user_id`=" + str(self.user_id) + " AND (`translate`.`id` NOT IN (" + ", ".join(alreadyq) + "))" cur.execute(sql_list) for_search = cur.fetchall() if not for_search: return None, None, None row = for_search[random.randint(0,len(for_search)-1)] # 0 => en, 1 => ru, 2 => mix translate_id = row[0] if type_test == 0: question, answer = row[1], row[2] elif type_test == 1: question, answer = row[2], row[1] else: i = random.randint(1,2) j = 1 if i == 2 else 2 question, answer = row[i], row[j] return question, answer, translate_id def command_tetlist(self, arg=None): pass def command_testinfo(self, test_id=None): pass |
Changes to db.sqlite.
cannot compute difference between binary files
Changes to dict.csv.
|
| | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < < < < < < < < < < < < < < | < < | 1 2 3 4 | "ENGLISH";"RUSSIAN" "ability";"способность" "leaf";"лист" "vocabulary";"словарь" |