diff --git a/courseware/capa/capa_problem.py b/courseware/capa/capa_problem.py index 032b5d41b4..2ed579d224 100644 --- a/courseware/capa/capa_problem.py +++ b/courseware/capa/capa_problem.py @@ -193,6 +193,12 @@ class LoncapaProblem(object): if problemtree.tag in html_transforms: tree.tag=html_transforms[problemtree.tag]['tag'] + # Reset attributes. Otherwise, we get metadata in HTML + # (e.g. answers) + # TODO: We should remove and not zero them. + # I'm not sure how to do that quickly with lxml + for k in tree.keys(): + tree.set(k,"") # TODO: Fix. This loses Element().tail #if problemtree.tag in html_skip: diff --git a/courseware/modules/html_module.py b/courseware/modules/html_module.py index e72fea9dfd..f1ce14ec7e 100644 --- a/courseware/modules/html_module.py +++ b/courseware/modules/html_module.py @@ -17,13 +17,16 @@ class HtmlModule(XModule): return "html" def get_html(self): - if self.filename!=None: - return render_to_string(self.filename, {'id': self.item_id}) - else: + if self.filename==None: xmltree=etree.fromstring(self.xml) textlist=[xmltree.text]+[etree.tostring(i) for i in xmltree]+[xmltree.tail] textlist=[i for i in textlist if type(i)==str] return "".join(textlist) + try: + filename=settings.DATA_DIR+"html/"+self.filename+".xml" + return open(filename).read() + except: # For backwards compatibility. TODO: Remove + return render_to_string(self.filename, {'id': self.item_id}) def __init__(self, xml, item_id, ajax_url=None, track_url=None, state=None, track_function=None, render_function = None): XModule.__init__(self, xml, item_id, ajax_url, track_url, state, track_function, render_function) diff --git a/settings_new_askbot.py b/settings_new_askbot.py index d95c843e09..8c63960b38 100644 --- a/settings_new_askbot.py +++ b/settings_new_askbot.py @@ -328,6 +328,7 @@ LIVESETTINGS_OPTIONS = { 'SETTINGS' : { 'MIN_REP' : { 'MIN_REP_TO_VOTE_UP' : 1, + 'MIN_REP_TO_UPLOAD_FILES' : 1, }, 'SOCIAL_SHARING' : { 'ENABLE_SHARING_TWITTER' : False,