You need to sign in or sign up before continuing.
Commit 1f74c9c0 authored by Kento HASEGAWA's avatar Kento HASEGAWA

Fix typos and bugs

parent 94d30c7b
......@@ -117,9 +117,8 @@ def update_answer_list(qname):
if answer_log['solved'] == "True":
is_solved = True
if questions[qname]['answer'] == answer_log['answer']:
questions[qname]['best_json'] = json_name
if questions[qname]['answer'] == answer_log['answer']:
questions[qname]['best_json'] = json_name
if (questions[qname]['last_req'] == float(answer_log['req_id'])):
if answer_log['solver'] in questions[qname]['solver']:
......@@ -348,8 +347,12 @@ def save_best_solution():
_best_json = ""
for k, v in questions[qname]['answers'].items():
if v['nlcheck'] > _best_score:
_best_socer = v['nlcheck']
try:
_score = float(v['nlcheck'])
except:
_score = -1
if _score > _best_score:
_best_score = _score
_best_json = k
if _best_json != "":
......@@ -357,6 +360,8 @@ def save_best_solution():
if not os.path.isdir(out_path):
os.makedirs(out_path)
print("Saved answer for {}: {}".format(qname, _best_json))
qnumber = qname.replace("NL_Q", "").replace(".txt", "")
out_file_path = "{}/T01_A{}.txt".format(out_path, qnumber)
with open(out_file_path, 'w') as fp:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment