Skip to content

Latest commit

 

History

History
65 lines (52 loc) · 3.97 KB

09-uncaught-invalid-dictionary.md

File metadata and controls

65 lines (52 loc) · 3.97 KB

Issue 9: Uncaught Invalid Dictionary

Description

When there is a syntax error in the modified program where a dictionary does not have a closing bracket, the ITS API does not detect the error. Instead, the errorlocalizer, feedback_error, feedback_fix and repair endpoints detect that the base and modified programs are equivalent. That is incorrect, where there is clearly a syntax error and thus, repair cost should be non-zero.

We believe the problem arises because the parser outputs for both the base and modified programs are identical. Therefore, the other endpoints are unable to detect the syntax error because the parsed programs are identical.

Base Program

def main():
    return {'key1': 1, 'key2': 2 }

Modified Program

def main():
    return {'key1': 1, 'key2': 2 

Input

{
    "language": "py",
    "reference_solution": "{\"importStatements\": [], \"fncs\": {\"main\": {\"name\": \"main\", \"rettype\": \"*\", \"initloc\": 1, \"endloc\": 0, \"params\": [], \"locexprs\": {\"1\": [{\"val0\": \"$ret\", \"val1\": {\"name\": \"DictInit\", \"args\": [{\"value\": \"\\\"key1\\\"\", \"line\": 2, \"tokentype\": \"Constant\"}, {\"value\": \"1\", \"line\": 2, \"tokentype\": \"Constant\"}, {\"value\": \"\\\"key2\\\"\", \"line\": 2, \"tokentype\": \"Constant\"}, {\"value\": \"2\", \"line\": 2, \"tokentype\": \"Constant\"}], \"line\": 2, \"tokentype\": \"Operation\"}, \"valueArray\": [\"$ret\", {\"name\": \"DictInit\", \"args\": [{\"value\": \"\\\"key1\\\"\", \"line\": 2, \"tokentype\": \"Constant\"}, {\"value\": \"1\", \"line\": 2, \"tokentype\": \"Constant\"}, {\"value\": \"\\\"key2\\\"\", \"line\": 2, \"tokentype\": \"Constant\"}, {\"value\": \"2\", \"line\": 2, \"tokentype\": \"Constant\"}], \"line\": 2}], \"valueList\": [\"$ret\", {\"name\": \"DictInit\", \"args\": [{\"value\": \"\\\"key1\\\"\", \"line\": 2, \"tokentype\": \"Constant\"}, {\"value\": \"1\", \"line\": 2, \"tokentype\": \"Constant\"}, {\"value\": \"\\\"key2\\\"\", \"line\": 2, \"tokentype\": \"Constant\"}, {\"value\": \"2\", \"line\": 2, \"tokentype\": \"Constant\"}], \"line\": 2}]}]}, \"loctrans\": {\"1\": {}}, \"locdescs\": {\"1\": \"around the beginning of function 'main'\"}, \"types\": {}}}}",
    "student_solution": "{\"importStatements\": [], \"fncs\": {\"main\": {\"name\": \"main\", \"rettype\": \"*\", \"initloc\": 1, \"endloc\": 0, \"params\": [], \"locexprs\": {\"1\": [{\"val0\": \"$ret\", \"val1\": {\"name\": \"DictInit\", \"args\": [{\"value\": \"\\\"key1\\\"\", \"line\": 2, \"tokentype\": \"Constant\"}, {\"value\": \"1\", \"line\": 2, \"tokentype\": \"Constant\"}, {\"value\": \"\\\"key2\\\"\", \"line\": 2, \"tokentype\": \"Constant\"}, {\"value\": \"2\", \"line\": 2, \"tokentype\": \"Constant\"}], \"line\": 2, \"tokentype\": \"Operation\"}, \"valueArray\": [\"$ret\", {\"name\": \"DictInit\", \"args\": [{\"value\": \"\\\"key1\\\"\", \"line\": 2, \"tokentype\": \"Constant\"}, {\"value\": \"1\", \"line\": 2, \"tokentype\": \"Constant\"}, {\"value\": \"\\\"key2\\\"\", \"line\": 2, \"tokentype\": \"Constant\"}, {\"value\": \"2\", \"line\": 2, \"tokentype\": \"Constant\"}], \"line\": 2}], \"valueList\": [\"$ret\", {\"name\": \"DictInit\", \"args\": [{\"value\": \"\\\"key1\\\"\", \"line\": 2, \"tokentype\": \"Constant\"}, {\"value\": \"1\", \"line\": 2, \"tokentype\": \"Constant\"}, {\"value\": \"\\\"key2\\\"\", \"line\": 2, \"tokentype\": \"Constant\"}, {\"value\": \"2\", \"line\": 2, \"tokentype\": \"Constant\"}], \"line\": 2}]}]}, \"loctrans\": {\"1\": {}}, \"locdescs\": {\"1\": \"around the beginning of function 'main'\"}, \"types\": {}}}}",
    "function": "main",
    "inputs": "[]",
    "args": "[[], [], [], [], [], [], [], [], [], []]"
}

Output

Error Localizer

{
    "errorLocations": {},
    "errorInputs": []
}

Feedback Error

None

Feedback Fix

None

Repair

[
    {
        "totalCost": 0.0,
        "localRepairs": []
    }
]

Related Test Reports

Refer to Test Report ID 474182eb.