diff --git a/common/lib/xmodule/capa_module.py b/common/lib/xmodule/capa_module.py index ad20364a06..c12446e744 100644 --- a/common/lib/xmodule/capa_module.py +++ b/common/lib/xmodule/capa_module.py @@ -117,7 +117,18 @@ class Module(XModule): '''Return html for the problem. Adds check, reset, save buttons as necessary based on the problem config and state.''' - html = self.lcp.get_html() + try: + html = self.lcp.get_html() + except Exception, err: + if self.DEBUG: + log.exception(err) + msg = '[courseware.capa.capa_module] Failed to generate HTML for problem %s' % (self.filename) + msg += '
Error:
%s' % str(err).replace('<','<') + msg += '
%s' % traceback.format_exc().replace('<','<') + html = msg + else: + raise + content = {'name': self.name, 'html': html, 'weight': self.weight,