What Page were you on
Testing a CodeTailor problem in assignment builder
Describe the bug
When a CodeTailor-enabled activecode exercise has no suffix/unit-test code, clicking "Get Help" returns a 500 Internal Server Error.
Root cause: end_to_end.py:32 unconditionally calls .replace() on Unittest_Code from the request payload:
unittest_code = dict_buggy_code["Unittest_Code"].replace("\n", "\n")
When the exercise has no suffix code, the JS cleanTestcase() function returns undefined, so Unittest_Code arrives as None in Python, causing AttributeError: 'NoneType' object has no attribute 'replace'. The same issue affects CF (Code) on lines 28 if that is ever empty.
Javascript Errors
500 (Internal Server Error)
Error or timeout waiting for Parsons scaffolding response Error: HTTP 500 - {"detail":"'NoneType' object has no attribute 'replace'"}
Uncaught (in promise) Error in Parsons Scaffolding: Error: HTTP 500 - {"detail":"'NoneType' object has no attribute 'replace'"}
Potential fixes
If CodeTailor is enabled, suffix code is required? Or if no suffix code, CodeTailor does not run and shows its error message without a 500 error?
What is your username
apadiyath
What Page were you on
Testing a CodeTailor problem in assignment builder
Describe the bug
When a CodeTailor-enabled activecode exercise has no suffix/unit-test code, clicking "Get Help" returns a 500 Internal Server Error.
Root cause: end_to_end.py:32 unconditionally calls .replace() on Unittest_Code from the request payload:
unittest_code = dict_buggy_code["Unittest_Code"].replace("\n", "\n")
When the exercise has no suffix code, the JS cleanTestcase() function returns undefined, so Unittest_Code arrives as None in Python, causing AttributeError: 'NoneType' object has no attribute 'replace'. The same issue affects CF (Code) on lines 28 if that is ever empty.
Javascript Errors
500 (Internal Server Error)
Error or timeout waiting for Parsons scaffolding response Error: HTTP 500 - {"detail":"'NoneType' object has no attribute 'replace'"}
Uncaught (in promise) Error in Parsons Scaffolding: Error: HTTP 500 - {"detail":"'NoneType' object has no attribute 'replace'"}
Potential fixes
If CodeTailor is enabled, suffix code is required? Or if no suffix code, CodeTailor does not run and shows its error message without a 500 error?
What is your username
apadiyath