Summary

Give edit permission by running Permissions.gs to unprotect all sheets of current spreadsheet. The grading process appends some data in certain order, which is necessary to evaluate student’s answer.


Clarifying Grading and Exercises Implementations
Tuesday, 23 January 2024, 11:30 AM (AEDT)
Yashwanth Nagaraju

Unlocking/Unprotecting Sheets

Sheets are protected to prevent accidental/unwanted changes. To unprotect sheets for editing:

  • Open Extensions tab, and click on Apps Script
  • Navigate to Permissions.gs, and update userEmail value
  • Click Run

Notes for Grading Code Input exercises: method insert

Code Input Exercise - Answer Response
{
    "_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",
}

Once student clicks Run, their answer is sent to the server for grading. The data is appended in the following order for the process.

  • data[0]
  • student answer
  • expected-answer
  • data[1]

The submission process occurs after the grading completes and student clicks Submit.

Fixing Grading Bugs attempts

See Sheet: Python Exercises

G2302

Description

Important

Not possible to implement due to unsupported feature: inputs

Suggested answer
{
    "_id": "G2302",
    "method": "insert",
    "language_id": 71,
    "expected_output": null,
    "expected_answer": [
        "u = input(\"Username: \")\np = input(\"Password: \")"
    ],
    "expected_answer_contains": [
        {
            "u": "The answer is missing an expected variable.",
            "p": "The answer is missing an expected variable.",
            "input": "The answer is missing an expected keyword."
        }
    ],
    "stdin": "my username\\nmy password",
    "data": [
        "",
        "assert u == 'my username'\nassert p == 'my password'"
    ]
}