From 0aba4f7ec6f9d21d90bfa3e338561561bccc96c6 Mon Sep 17 00:00:00 2001 From: stv Date: Fri, 25 Jul 2014 11:57:54 -0400 Subject: [PATCH] Wrap JSInput Python code in CDATA section Python code can commonly contain characters that are invalid XML, such as '<' and '>'. This has proven to be a pain point for instructors implementing custom Python grading functions for their JSInput problems (see sample code below). This change creates a more robust template from which to make modifications. ```python # This is an XML syntax error, when not inside a CDATA section. if i < 0: print('negative') ``` --- .../lib/xmodule/xmodule/templates/problem/jsinput_response.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/lib/xmodule/xmodule/templates/problem/jsinput_response.yaml b/common/lib/xmodule/xmodule/templates/problem/jsinput_response.yaml index bd7c622cd5..b3473f4103 100644 --- a/common/lib/xmodule/xmodule/templates/problem/jsinput_response.yaml +++ b/common/lib/xmodule/xmodule/templates/problem/jsinput_response.yaml @@ -5,6 +5,7 @@ metadata: data: |

The shapes below can be selected (yellow) or unselected (cyan).