Accuracy now works

This commit is contained in:
AB
2018-05-05 13:55:06 +03:00
parent ef9b23ca6d
commit 9e1af3e61b
2 changed files with 5 additions and 6 deletions

View File

@@ -30,11 +30,7 @@ List it with `list` command
example: example:
resolve 4 1''') resolve 4 1''')
return 1 return 1
# print("Resolving %s, %s" % ( app.resolve(int(q[1]), int(q[2]), accuracy)
# app.subjects[q[1]],
# app.subjects[q[1]][q[2]])
# )
app.resolve(int(q[1]), int(q[2]))
def list_all(): def list_all():
i = 0 i = 0

View File

@@ -203,8 +203,11 @@ class Main:
logging.info("Send correct answer for %s. It's %s" % (q_number, logging.info("Send correct answer for %s. It's %s" % (q_number,
answers)) answers))
def resolve(self, subj, test): def resolve(self, subj, test, accuracy):
q_count = self.start_test(subj, test) q_count = self.start_test(subj, test)
# applying accuracy here
# spoil_count = q_count - q_count * (accuracy / 100)
q_count = int(q_count * (int(accuracy) / 100))
for i in range(1, q_count + 1): for i in range(1, q_count + 1):
prediction = self.predict(i) prediction = self.predict(i)
self.answer(i, prediction) self.answer(i, prediction)