1.1.1.1.1.4. book_server_api.routers.coach module

book_server_api.routers.coach.clean_python_testcase(raw_test_code: str) str

Transform Runestone browser-style test code to standard unittest format. Mirrors the cleanTestcase() transformation in activecode.js so that suffix_code from the DB can be run by JOBE (which has no unittest.gui).

book_server_api.routers.coach.extract_parsons_code(html_block)

Given the full HTML/pre block for a Parsons problem extracted from DB, return only the Parsons code part.

async book_server_api.routers.coach.get_question_html(request: Request, div_id: str)

Fetch and return just the HTML for a single question (case 1). No grading — points are set to 0. Falls back to ‘LLM-example’ if the question is not found.

async book_server_api.routers.coach.parsons_scaffolding(request: Request, course: Optional[str], user=Depends(RSLoginManager))
async book_server_api.routers.coach.python_check(request: Request)

Takes a chunk of Python code and runs a syntax checker (currently Pyflakes) on it to provide more detailed advice than is available via Skulpt.