Summary
- Exercises used one of these three methods to grade student’s submissions, namely match, regex, and insert.
- The answers for each exercise have different data schemas depending on the grading method.
CSEducation
✅ Grading
Grades
Data Schema
{
"data": [],
"_id": VARCHAR,
"language_id": 71,
"method": ENUM
/* Additional fields depends on 'method' */
}Key definitions
🔑 _id: see Lesson ID- 🔑
language_id: 71 - denotes code languagePython🔑 method:match|insert|regex. See Grading Methods- 🔑
data: answers and possibly assertation python statements (questions that verify variable’s value)
Grading Methods
match
Used to grade
{
"_id": "G0000",
"method": "match",
"data": [
"Yes"
],
}
| _id | payload | answer | choices |
|---|---|---|---|
| G0000 | Python is a programming language? | Yes | Yes ~ No |
{
"_id": "G1020",
"data": [
"*"
],
"method": "match",
| _id | payload | cards | answer |
|---|---|---|---|
| G1020 | I want to get 60 from these ints, which operator do I use? Drag and drop the correct operator into the equation. | + | * |
| textType | textValue |
|---|---|
| text | 12 |
| input | |
| text | 5 = 60 |
{
"_id": "G2195",
"data": [
"false"
],
"method": "match",
}
| _id | payload | answer |
|---|---|---|
| G2195 | product = “Soap “\nprice = 10 | false |
insert
Used to grade
{
"_id": "G2114",
"expected_output": null,
"expected_answer": [
"name, gender, age, birthday = \"Evelyn\", \"female\", 31, \"03\""
],
"stdin": null,
"data": [
"",
"\nassert name == 'Evelyn'\nassert gender == 'female'\nassert age == 31\nassert birthday == '03'"
],
"language_id": 71,
"method": "insert",
}
| _id | payload | hasSecondColumn | initialCode | noOutput |
|---|---|---|---|---|
| G2114 | The mayor of Gummy Village wants his citizens to register their name, gender, age and birth month in their database. Help the citizens register their details by filling in the blanks with the correct variable names and values. Evelyn is a 31-year-old woman living in Gummy Village. She was born on the 24th of March and loves to do gardening. Fill in the blanks below with the correct information, where the parentheses are not included in the actual code. Note: The birth month is represented as a string with two digits, so “01” for January. | false | See below |
[ ], gender, age, birthday = "Evelyn", "female", [ ], [ ]regex
Used to grade
{
"_id": "G1026",
"method": "regex",
"expected_answers": [
"2 + 6",
"8 % 5"
],
"data": [
"2\\s*\\+\\s*6",
"8\\s*\\%\\s*5"
],
}
| _id | payload | answer |
|---|---|---|
| G1026 | A farmer has traded his vegetables to many customers. In return, the customers must give him seeds to complete the trade. The farmer has used equations to keep track of who owes how many seeds. He wants you to match the equations to the correct customer. Write equations for the following people in the list below. - Timmy owes two plus six - Jim owes the remainder of eight divided by five Write your equations in the space provided. | 2 + 6~8 % 5 |
| textArrayIndex | textType | textValue |
|---|---|---|
| 0 | text | timmy = |
| 0 | input | |
| 1 | text | jim = |
| 1 | input |
APIs (Testing)
Get the answer
CSEducation
⚙️ API /
- Response:
{exercise-answer}
Post an Answer
CSEducation
⚙️ API /
method= [ match, regex, insert\ ]
- Request Body:
{exercise-answer} - Response:
{exercise-answer}
Delete an Answer
CSEducation
⚙️ API /
- Request Body:
{
"_id": "exercise_id"
}- Response:
{exercise-answer}