在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:LeoMurri/PennGrader开源软件地址:https://github.com/LeoMurri/PennGrader开源编程语言:Python 98.4%开源软件介绍:PennGraderWelcome to the PennGrader! Here at PennGrader, we believe that learning comes from lots of practice...and from making lots of mistakes. After many years as a student I found myself very frustrated in the following homework timeline: struggle on a homework assignment for weeks, submit something that may or may not be right and then wait a few more weeks to receive any type of feedback, at which point I had forgotten all about the homework. After many years as a TA, I also found myself very frustrated with the common auto-grading tools, the hours and hours of manual grading and the onslaught of re-grade requests that came thereafter. From these frustrations, the PennGrader was born! The PennGrader was built to allow students to get instant feedback and many opportunities for re-submission. After all, programming is about making mistakes and learning from feedback! Moreover, we wanted to allow TAs and Instructors to write their homework in any way they pleased, without having to worry about the structure of a specific auto-grader. The examples below are done using Jupyter Notebooks which is the most common use case, but you can use this for normal Python homework as well. Here is what a student sees in his Homework Notebook. All a student has to do is write her solution and run the auto-grading cell. Through the magic of AWS Lambdas, the student's answer (in this case the Ok, ok, you might be saying to yourself: "That looks easy enough, but what about us TAs, we want something that simple too!" Well, look no further. The TAs/Instructors' experience is just as seamless. All TAs will share a Teacher_Backend notebook, which contains all the test case functions. The logic of how testing is done is simple: whatever Python object gets passed through the As you can see, this function tests that To create homework for your class you will need a course PennGrader_Homework_Template.ipynb PennGrader_TeacherBackend.ipynb Download these two notebooks and launch them via Jupyter. They will show you how to add grading cells in your homework notebook and add write/update test cases via the teacher backend, as well as view student's grades. Behind the scenes...In the following section, I will go into detail about the system implementation. Below is the system design overview we will go into. ClientsThere are two pip installable clients, one for students and one for instructors. You can install these two clients by running Student's Client: PennGraderThe student's client will be embedded in the homework release notebook. Its main purpose will be to interface the student's homework with the AWS backend. This client is represented by the
The HOMEWORK_ID is the string obtained when creating new homework via the teacher backend, see below. STUDENT_ID is the student defined variable representing their 8-digit PennID. The student will need to run this cell at the beginning of the notebook to initialize the grader. After every question, the Instructor will also need to write a grading cell which the student will run to invoke the grader. A grading cell looks as follows:
TEST_CASE_NAME is the string name of the test case function that will grader the given question. ANSWER is the object that needs to be graded. For example, you might have a question where you instruct the student to create a DataFrame called
That way, when the student runs this cell, the grader will automatically find the test function named TEST_CASE_NAME, serialize the Teacher's Client: PennGraderBackendThe teacher client allows instructors to create and edit the test cases function mentioned earlier, as well as define multiple homework metadata parameters. As shown in the template notebooks linked above, you first need to initialize the PennGraderBackend for a specific homework as follows:
SECRET_KEY is the string variable obtained when creating a course. HOMEWORK_NUMBER identifies which homework number you are planning to write/edit. After running the above cell in a Jupyter Notebook, given a correct SECRET_KEY, the assigned HOMEWORK_ID string will be printed out. This HOMEWORK_ID needs to be copied into the initialization of the PennGrader student client for release. Just the homework id, without the secret key, will not allow students to see any of the test cases, so make sure the secret key does not get out. After initialization, the You can edit the following metadata parmaters by runnin the following code:
Writing test cases is also just as simple. In a Jupyter Notebook (see Teacher Backend template above), you just need to write test case functions for each gradable question. Each test case will be identified by a test_case_id which is the name of the test case function. A test case functions needs to follow the following format:
The test case function needs to return an integer tuple representing the student score for their answer and max number of points that can be earned in the given question. After writing all the test cases you need, simply run the following code in a cell and the PennGraderBackend class will automatically extract all user-defined functions in the current notebook and upload them to AWS.
A success message will print once the operation has succeeded. If loading a lot of external libraries this might take a few minutes. LambdasGraderThe Grader lambda gets triggered from an API Gateway URL from the student's PennGrader client. The student's client as defined above will serialize its answer and make a POST request to the lambda with the following body parameters:
The lambda will proceed by downloading the correct serialized test_case's and libraries from the HomeworksTestCases DyanmoDB table. It will then deserialize these objects and extract the correct test case given the test_case_id . import the correct libraries used by given test case. If the submission is valid the student score will be recorded in the backend. GradesThe grades lamabda interfaces the TeacherBackend and student notebook with the Gradebook. Using this API Gateway trigged lambda the TeacherBackend client can request all grades for a given homework. The payload body used to trigger this lambda will need to include
Where the secret_key parameter is optional and will allow a properly initialized TeacherBackend to download all grades for the selected homework. Students will also be able to view their scores. HomeworkConfigThe HomeworkConfig lambda interfaces the TeacherBackend with the HomeworkTestCases and HomeworkMetadata DynamoDB Tables (see below for table schema). This lambda can be triggered in two ways 1) to update metadata and 2) to update test cases. After unparsing and deserializing the triggered payload, the inputted data gets written into the appropriate DynamoDB table. DynamoDB Tables & S3 BucketsAs shown in the above schematic we maintain the majority of the data needed for grading and grade storage on DynamoDB. Below we list the information recorded in each table. Classes DynamoDB Table Classes contains information about all courses currently registered for the PennGrader. The grading protocol is on a per-class basis. Each class that wants to create a course that uses the PennGrader will receive
HomeworksMetadata DynamoDB Table The HomeworksMetadata is used to maintain updatable information about a specific homework. The information in this table will be editable from the TeacherBackend even after homework release. The tables contain the following schema:
HomeworksTestCases DynamoDB Table The HomeworksTestCases table contains a serialized encoding of the test cases and libraries imports needed to run a student's answer. The tables contain the following schema:
Gradebook DynamoDB Table The Gradebook table contains all grading submissions and student scores. The table contains the following schema:
Note: Currently only the last submission is recorded, thus the latest student score will overwrite all previous scores. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论