Spaces:
Sleeping
Sleeping
Update app.py
Browse files221 unmodified lines222223224225226227228229230231232233234235236237221 unmodified lineschoices = filter_homework_names(subject, grade)if not choices:return [], gr.update(value=None, interactive=False), "", [], Nonedefault_id = choices[0][1] # get the homework ID (string)hw = get_homework_by_id(default_hw_id)questions_text = hw.get("final_questions", "") if hw else ""questions = parse_questions(questions_text)start = time.time()# Return choices, selected homework ID string, questions text, parsed questions list, start timereturn choices, gr.update(value=default_hw_id, interactive=True), questions_text, questions, startdef load_questions(hw_id):hw = get_homework_by_id(hw_id)if not hw:return "", [], Nonequestions_text = hw.get("final_questions", "")221 unmodified lines222223224225226227228229230231232233234235236237221 unmodified lineschoices = filter_homework_names(subject, grade)if not choices:return [], gr.update(value=None, interactive=False), "", [], Nonedefault_id = choices[0] # get the homework ID (string)hw = get_homework_by_id(default_id)questions_text = hw.get("final_questions", "") if hw else ""questions = parse_questions(questions_text)start = time.time()# Return choices, selected homework ID string, questions text, parsed questions list, start timereturn choices, gr.update(value=default_id, interactive=True), questions_text, questions, startdef load_questions(hw_id):hw = get_homework_by_id(id)if not hw:return "", [], Nonequestions_text = hw.get("final_questions", "")
app.py+4-4