diff --git a/djangoapps/courseware/capa/util.py b/djangoapps/courseware/capa/util.py index b85073d78c..d042aa21d3 100644 --- a/djangoapps/courseware/capa/util.py +++ b/djangoapps/courseware/capa/util.py @@ -1,6 +1,7 @@ def contextualize_text(text, context): # private ''' Takes a string with variables. E.g. $a+$b. Does a substitution of those variables from the context ''' + if not text: return text for key in sorted(context, lambda x,y:cmp(len(y),len(x))): text=text.replace('$'+key, str(context[key])) return text