mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 07:00:26 +08:00
_parse_quiz_payload swapped the reply for the body of its first ``` fence
before parsing anything. The quiz FINISH schema asks for a bare JSON object
whose `question` is Markdown and whose coding answer is code, so that fence
is usually a code sample inside a string value. The parser decoded the
sample instead, got {}, and the question was lost: after one repair round
that hit the same parser, the learner got "[Generation failed] <topic>"
with N/A as the answer and the explanation.
Take a reply that is one complete JSON object as it is first, the order
parse_json_response already uses for the same case (#825). Wrapped replies
still go through the fence; when a fence inside a field cuts the wrapper's
body short, the first object in the whole reply is used instead.