From f1d4096bcde77397e40c6a47556da1c782c92898 Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Fri, 15 Mar 2013 11:52:50 -0400 Subject: [PATCH] Mark snippets as raw strings to avoid having to escape backslashes --- common/lib/capa/capa/responsetypes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/lib/capa/capa/responsetypes.py b/common/lib/capa/capa/responsetypes.py index c5f7146088..6bf98999d8 100644 --- a/common/lib/capa/capa/responsetypes.py +++ b/common/lib/capa/capa/responsetypes.py @@ -870,7 +870,7 @@ class CustomResponse(LoncapaResponse): Custom response. The python code to be run should be in ... or in a ''' - snippets = [{'snippet': """ + snippets = [{'snippet': r"""
Suppose that \(I(t)\) rises from \(0\) to \(I_S\) at a time \(t_0 \neq 0\) @@ -1195,7 +1195,7 @@ class SymbolicResponse(CustomResponse): """ Symbolic math response checking, using symmath library. """ - snippets = [{'snippet': ''' + snippets = [{'snippet': r''' Compute \[ \exp\left(-i \frac{\theta}{2} \left[ \begin{matrix} 0 & 1 \\ 1 & 0 \end{matrix} \right] \right) \] and give the resulting \(2\times 2\) matrix: