-
Notifications
You must be signed in to change notification settings - Fork 4
/
script.py
34 lines (27 loc) · 1.1 KB
/
script.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from examer import Examer
from ExamerException import GettingTestError
import codecs
# ======================================
EMAIL = ''
PASSWORD = ''
# =======================================
if __name__ == '__main__':
ex = Examer(EMAIL, PASSWORD)
try:
test = ex.get_test(input('Your link: '))
except GettingTestError:
print('Неверная ссылка')
else:
f = codecs.open('answers.txt', 'w', 'utf_8_sig')
print(test.theme, file=f)
print('Всего баллов:', test.score, file=f)
print('Примерное время на выполнения теста:', test.avg_time, "минут", file=f)
n = len(test.tasks)
print('Найдено ответов: {}/{}'.format(n - len(test.unprocessed_tasks_id), n), file=f)
print('===============\n', file=f)
for task in test.get_tasks():
print("Баллов за задание:", task.difficult, file=f)
print(task.question, file=f)
print("Ответ:", task.answer, file=f)
print('---\n', file=f)
f.close()