使用python单元测试进行教学
ucamcl的Python项目详细描述
这个包提供了一个检查答案的简单工具 在笔记本上练习。
用法:
# Install the grader !pip install ucamcl # Log in to the grader. It will prompt you with a "log in" button. GRADER = ucamcl.autograder('https://markmy.solutions', course='scicomp').subsection('notes1') # Fetch a question. It will tell you what to do, with what parameters. q = GRADER.fetch_question('ex5') print(q) # Prepare your answer and submit it. myans = {'x': [i**2 for i in range(q['n'])] is_correct, answer = GRADER.submit_answer(q, myans)
这个包是学生在他们的jupyter笔记本上安装的。 另一半是一个服务器,应该由课程教师设置。 有关详细信息,请联系Damon Wischik<;djw1005@cam.ac.uk>;。