From 20b93b8b01276edadddfbbb67f15714fddd81c31 Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Tue, 6 Dec 2022 11:30:06 -0400 Subject: [PATCH] fix: upgrade problem templates according newer python versions (#31365) --- xmodule/templates/problem/circuitschematic.yaml | 2 +- xmodule/templates/problem/problem_with_hint_in_latex.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xmodule/templates/problem/circuitschematic.yaml b/xmodule/templates/problem/circuitschematic.yaml index 33a971df6f..9053718af1 100644 --- a/xmodule/templates/problem/circuitschematic.yaml +++ b/xmodule/templates/problem/circuitschematic.yaml @@ -65,7 +65,7 @@ data: | 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/xmodule/templates/problem/problem_with_hint_in_latex.yaml b/xmodule/templates/problem/problem_with_hint_in_latex.yaml index c56280d848..71a85b6feb 100644 --- a/xmodule/templates/problem/problem_with_hint_in_latex.yaml +++ b/xmodule/templates/problem/problem_with_hint_in_latex.yaml @@ -17,7 +17,7 @@ metadata: \begin{edXscript} def test_str(expect, ans): - print expect, ans + print(expect, ans) ans = ans.strip("'") ans = ans.strip('"') return expect == ans.lower() @@ -25,7 +25,7 @@ metadata: def hint_fn(answer_ids, student_answers, new_cmap, old_cmap): aid = answer_ids[0] ans = str(student_answers[aid]).lower() - print 'hint_fn called, ans=', ans + print('hint_fn called, ans=', ans) hint = '' if 'java' in ans: hint = 'that is only good for drinking' @@ -56,7 +56,7 @@ data: |