fixbug:解决抢答和获取任务的问题
This commit is contained in:
@@ -8,7 +8,6 @@ def extract_content(data_string):
|
|||||||
data = json.loads(data_string)
|
data = json.loads(data_string)
|
||||||
# 提取content字段
|
# 提取content字段
|
||||||
content = data["choices"][0]["message"].get("content", "")
|
content = data["choices"][0]["message"].get("content", "")
|
||||||
print(content)
|
|
||||||
return content
|
return content
|
||||||
except json.JSONDecodeError:
|
except json.JSONDecodeError:
|
||||||
print("Invalid JSON")
|
print("Invalid JSON")
|
||||||
|
|||||||
@@ -241,7 +241,6 @@ def submit_answer(group_id, player_id, task_id, answer):
|
|||||||
# 调用内部方法校验答案
|
# 调用内部方法校验答案
|
||||||
answer_json = {"question": question, "top_score": str(top_score), "answer": answer}
|
answer_json = {"question": question, "top_score": str(top_score), "answer": answer}
|
||||||
result = game_answer_json(answer_json)
|
result = game_answer_json(answer_json)
|
||||||
print(result)
|
|
||||||
points = int(result["score"])
|
points = int(result["score"])
|
||||||
description = result["description"]
|
description = result["description"]
|
||||||
is_correct = points > 0
|
is_correct = points > 0
|
||||||
|
|||||||
Reference in New Issue
Block a user