diff --git a/common/lib/capa/capa/capa_problem.py b/common/lib/capa/capa/capa_problem.py index 62751cd833..14c590a660 100644 --- a/common/lib/capa/capa/capa_problem.py +++ b/common/lib/capa/capa/capa_problem.py @@ -331,7 +331,7 @@ class LoncapaProblem(object): ''' Main method called externally to get the HTML to be rendered for this capa Problem. ''' - html = contextualize_text(etree.tostring(self.extracted_tree), self.context) + html = contextualize_text(etree.tostring(self._extract_html(self.tree)), self.context) return html diff --git a/common/lib/capa/capa/tests/test_html_render.py b/common/lib/capa/capa/tests/test_html_render.py index 64f031ea59..e4c54edca0 100644 --- a/common/lib/capa/capa/tests/test_html_render.py +++ b/common/lib/capa/capa/tests/test_html_render.py @@ -125,6 +125,8 @@ class CapaHtmlRenderTest(unittest.TestCase): expected_solution_context = {'id': '1_solution_1'} expected_calls = [mock.call('textline.html', expected_textline_context), + mock.call('solutionspan.html', expected_solution_context), + mock.call('textline.html', expected_textline_context), mock.call('solutionspan.html', expected_solution_context)] self.assertEqual(test_system.render_template.call_args_list,