From 3c119ecf102f8cc87bb0076bdb10c25a37c2aaf4 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Oct 2020 03:22:55 -0400 Subject: [PATCH 1/3] Correct DemoX Code Grader solution the Show Answer button displays an answer that returns a SyntaxError: invalid syntax this commit corrects the print call by wrapping the int with str() for proper type conversion and concatenates the sub strings inside parens --- .../problem/c2ee6e8917fe4c97ac99d7b616ff0b89.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/test/data/manual-testing-complete/problem/c2ee6e8917fe4c97ac99d7b616ff0b89.xml b/common/test/data/manual-testing-complete/problem/c2ee6e8917fe4c97ac99d7b616ff0b89.xml index cf9ee3d8a0..bd130b8687 100644 --- a/common/test/data/manual-testing-complete/problem/c2ee6e8917fe4c97ac99d7b616ff0b89.xml +++ b/common/test/data/manual-testing-complete/problem/c2ee6e8917fe4c97ac99d7b616ff0b89.xml @@ -73,7 +73,7 @@ while abs(balance) > .02: # When the while loop terminates, we know we have # our answer! -print "Lowest Payment:", round(payment, 2) +print ( "Lowest Payment:" + str( round(payment, 2) ) ) {"grader": "ps02/bisect/grade_bisect.py"} From 860c680caaefed01748e3775e7cfd28d61580d9b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Oct 2020 12:35:40 -0400 Subject: [PATCH 2/3] Replace "+" in print with the more idiomatic "," --- .../problem/c2ee6e8917fe4c97ac99d7b616ff0b89.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/test/data/manual-testing-complete/problem/c2ee6e8917fe4c97ac99d7b616ff0b89.xml b/common/test/data/manual-testing-complete/problem/c2ee6e8917fe4c97ac99d7b616ff0b89.xml index bd130b8687..17cd931e84 100644 --- a/common/test/data/manual-testing-complete/problem/c2ee6e8917fe4c97ac99d7b616ff0b89.xml +++ b/common/test/data/manual-testing-complete/problem/c2ee6e8917fe4c97ac99d7b616ff0b89.xml @@ -73,7 +73,7 @@ while abs(balance) > .02: # When the while loop terminates, we know we have # our answer! -print ( "Lowest Payment:" + str( round(payment, 2) ) ) +print ( "Lowest Payment:", str( round(payment, 2) ) ) {"grader": "ps02/bisect/grade_bisect.py"} From fa6ace334400f043334952d3251f465edfde4f72 Mon Sep 17 00:00:00 2001 From: sarina Date: Tue, 1 Dec 2020 15:02:51 -0500 Subject: [PATCH 3/3] Fix demox code grader print statements --- .../problem/2f7da8477d8748f0aad0f7fc2134b84f.xml | 2 +- .../problem/c2ee6e8917fe4c97ac99d7b616ff0b89.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/test/data/manual-testing-complete/problem/2f7da8477d8748f0aad0f7fc2134b84f.xml b/common/test/data/manual-testing-complete/problem/2f7da8477d8748f0aad0f7fc2134b84f.xml index 21d1dd7ad8..5a31054a28 100644 --- a/common/test/data/manual-testing-complete/problem/2f7da8477d8748f0aad0f7fc2134b84f.xml +++ b/common/test/data/manual-testing-complete/problem/2f7da8477d8748f0aad0f7fc2134b84f.xml @@ -19,7 +19,7 @@ for response in submission[0]: if response[0] == 'ac': for node in response[1:]: ac_values = node['NodeA'] -print "the ac analysis value:", ac_values +print("the ac analysis value:", ac_values) if ac_values == None: correct = ['incorrect'] elif ac_values[0][1] < ac_values[1][1]: diff --git a/common/test/data/manual-testing-complete/problem/c2ee6e8917fe4c97ac99d7b616ff0b89.xml b/common/test/data/manual-testing-complete/problem/c2ee6e8917fe4c97ac99d7b616ff0b89.xml index 17cd931e84..08f26e0c40 100644 --- a/common/test/data/manual-testing-complete/problem/c2ee6e8917fe4c97ac99d7b616ff0b89.xml +++ b/common/test/data/manual-testing-complete/problem/c2ee6e8917fe4c97ac99d7b616ff0b89.xml @@ -73,7 +73,7 @@ while abs(balance) > .02: # When the while loop terminates, we know we have # our answer! -print ( "Lowest Payment:", str( round(payment, 2) ) ) +print("Lowest Payment:", round(payment, 2)) {"grader": "ps02/bisect/grade_bisect.py"}