diff --git a/common/djangoapps/mitxmako/shortcuts.py b/common/djangoapps/mitxmako/shortcuts.py index 181d3befd5..6aee39906a 100644 --- a/common/djangoapps/mitxmako/shortcuts.py +++ b/common/djangoapps/mitxmako/shortcuts.py @@ -42,7 +42,12 @@ def render_to_string(template_name, dictionary, context=None, namespace='main'): context_dictionary.update(context) # fetch and render template template = middleware.lookup[namespace].get_template(template_name) - return template.render_unicode(**context_dictionary) +# return template.render_unicode(**context_dictionary) + + output = template.render_unicode(**context_dictionary) +# log.info(' render_to_string of "{0}" as "{1}r"'.format(type(output), output)) + return output +# return template.render(**context_dictionary) def render_to_response(template_name, dictionary, context_instance=None, namespace='main', **kwargs): diff --git a/common/djangoapps/mitxmako/template.py b/common/djangoapps/mitxmako/template.py index 2d6fc026ca..efeb282d04 100644 --- a/common/djangoapps/mitxmako/template.py +++ b/common/djangoapps/mitxmako/template.py @@ -12,6 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +import logging +log = logging.getLogger("mitx." + __name__) + from django.conf import settings from mako.template import Template as MakoTemplate @@ -54,5 +57,9 @@ class Template(MakoTemplate): context_dictionary['MITX_ROOT_URL'] = settings.MITX_ROOT_URL context_dictionary['django_context'] = context_instance - return super(Template, self).render_unicode(**context_dictionary) - +# return super(Template, self).render_unicode(**context_dictionary) +# return super(Template, self).render(**context_dictionary) + + output = super(Template, self).render(**context_dictionary) + log.info(' render_to_string of "{0}" as "{1}"'.format(type(output), output)) + return output diff --git a/common/lib/xmodule/xmodule/html_module.py b/common/lib/xmodule/xmodule/html_module.py index eea747e332..6b73535dac 100644 --- a/common/lib/xmodule/xmodule/html_module.py +++ b/common/lib/xmodule/xmodule/html_module.py @@ -30,8 +30,10 @@ class HtmlModule(XModule): def get_html(self): # cdodge: perform link substitutions for any references to course static content (e.g. images) + input = self.html output = rewrite_links(self.html, self.rewrite_content_links) - log.info(' HTMLModule converting markup "{0}" to "{1}"'.format(self.html, output)) +# log.info(' HTMLModule converting markup from "{0}" as "{1}r"'.format(type(input), input)) +# log.info(' HTMLModule converting markup to "{0}" as "{1}r"'.format(type(output), output)) return output def __init__(self, system, location, definition, descriptor, @@ -166,7 +168,7 @@ class HtmlDescriptor(XmlDescriptor, EditingDescriptor): resource_fs.makedir(os.path.dirname(filepath), allow_recreate=True) with resource_fs.open(filepath, 'w') as file: - file.write(self.definition['data'].encode('utf-8')) + file.write(self.definition['data']) # .encode('utf-8')) # write out the relative name relname = path(pathname).basename() diff --git a/common/test/data/full/custom_tags/book b/common/test/data/full/custom_tags/book index ece6f288db..32e0913e6d 100644 --- a/common/test/data/full/custom_tags/book +++ b/common/test/data/full/custom_tags/book @@ -1 +1 @@ -More information given in the text. +More information given in… the text. diff --git a/common/test/data/full/custom_tags/discuss b/common/test/data/full/custom_tags/discuss index ac56590074..7a8a9e985f 100644 --- a/common/test/data/full/custom_tags/discuss +++ b/common/test/data/full/custom_tags/discuss @@ -1 +1 @@ - Discussion: ${tag} \ No newline at end of file + Discussion: ${tag}… \ No newline at end of file diff --git a/common/test/data/full/custom_tags/slides b/common/test/data/full/custom_tags/slides index a93d94947c..967c203711 100644 --- a/common/test/data/full/custom_tags/slides +++ b/common/test/data/full/custom_tags/slides @@ -1 +1 @@ -Lecture Slides Handout [Clean ][Annotated] +Lecture Slides Handout [Clean… ][Annotated…] diff --git a/common/test/data/full/problem/Circuit_Sandbox.xml b/common/test/data/full/problem/Circuit_Sandbox.xml index 89625f447b..1582f3ff0b 100644 --- a/common/test/data/full/problem/Circuit_Sandbox.xml +++ b/common/test/data/full/problem/Circuit_Sandbox.xml @@ -1,6 +1,6 @@ -

Here's a sandbox where you can experiment with all the components +

Here's a sandbox where you can experiment with all the components we'll discuss in 6.002x. If you click on CHECK below, your diagram -will be saved on the server and you can return at some later time. +will be saved on the server and you can return at some later time…

correct = ['correct']
diff --git a/common/test/data/full/problem/choiceresponse_demo.xml b/common/test/data/full/problem/choiceresponse_demo.xml index f7d1fcf16c..7af7939d74 100644 --- a/common/test/data/full/problem/choiceresponse_demo.xml +++ b/common/test/data/full/problem/choiceresponse_demo.xml @@ -1,19 +1,20 @@ -

Consider a hypothetical magnetic field pointing out of your computer screen. Now imagine an electron traveling from right to leftin the plane of your screen. A diagram of this situation is show below.

+

Consider a hypothetical magnetic field pointing out of your computer screen. Now imagine an electron traveling from right to left in the plane of your screen. A diagram of this situation is show below…

a. The magnitude of the force experienced by the electron is proportional the product of which of the following? (Select all that apply.)

-Magnetic field strength -Electric field strength -Electric charge of the electron -Radius of the electron -Mass of the electron -Velocity of the electron + +Magnetic field strength… +Electric field strength… +Electric charge of the electron… +Radius of the electron… +Mass of the electron… +Velocity of the electron… diff --git a/common/test/data/full/problem/codeinput_demo.xml b/common/test/data/full/problem/codeinput_demo.xml index 03d8fd8c31..a6662cb69c 100644 --- a/common/test/data/full/problem/codeinput_demo.xml +++ b/common/test/data/full/problem/codeinput_demo.xml @@ -2,7 +2,8 @@

- Part 1: Function Types + + Part 1: Function Types…

For each of the following functions, specify the type of its output. You can assume each function is called with an appropriate argument, as specified by its docstring.

diff --git a/common/test/data/full/sequential/Administrivia_and_Circuit_Elements.xml b/common/test/data/full/sequential/Administrivia_and_Circuit_Elements.xml index 5c4c65f12d..d0239198af 100644 --- a/common/test/data/full/sequential/Administrivia_and_Circuit_Elements.xml +++ b/common/test/data/full/sequential/Administrivia_and_Circuit_Elements.xml @@ -3,12 +3,12 @@ - S1E4 has been removed. + S1E4 has been removed… diff --git a/common/test/data/full/vertical/vertical_89.xml b/common/test/data/full/vertical/vertical_89.xml index da15a6751a..a4716366fe 100644 --- a/common/test/data/full/vertical/vertical_89.xml +++ b/common/test/data/full/vertical/vertical_89.xml @@ -1,6 +1,6 @@ -

+

Inline content…