<commit_before>import logging
from lxml import etree

log=logging.getLogger(__name__)

class CombinedOpenEndedRubric(object):

    def __init__ (self, system, view_only = False):
        self.has_score = False
        self.view_only = view_only
        self.system

    '''
    render_rubric: takes in an xml string and outputs the corresponding
        html for that xml, given the type of rubric we're generating
    Input:
        rubric_xml: an string that has not been parsed into xml that
            represents this particular rubric
    Output:
        html: the html that corresponds to the xml given
    '''
    def render_rubric(self, rubric_xml):
        success = False
        try:
            rubric_categories = self.extract_categories(rubric_xml)
            html = self.system.render_template('open_ended_rubric.html', 
                    {'categories'  : rubric_categories,
                     'has_score': self.has_score,
                     'view_only': self.view_only})
            success = True
        except:
            log.exception("Could not parse the rubric.")
            try:<commit_msg>One more fix<commit_after>import logging
from lxml import etree

log=logging.getLogger(__name__)

class CombinedOpenEndedRubric(object):

    def __init__ (self, system, view_only = False):
        self.has_score = False
        self.view_only = view_only
        self.system = system

    '''
    render_rubric: takes in an xml string and outputs the corresponding
        html for that xml, given the type of rubric we're generating
    Input:
        rubric_xml: an string that has not been parsed into xml that
            represents this particular rubric
    Output:
        html: the html that corresponds to the xml given
    '''
    def render_rubric(self, rubric_xml):
        success = False
        try:
            rubric_categories = self.extract_categories(rubric_xml)
            html = self.system.render_template('open_ended_rubric.html', 
                    {'categories'  : rubric_categories,
                     'has_score': self.has_score,
                     'view_only': self.view_only})
            success = True
        except:
            log.exception("Could not parse the rubric.")
            try:
{'fraction_non_alphanumeric': 0.06876663708961846, 'fraction_numerical': 0.0, 'mean_word_length': 2.171589310829817, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 16}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '674050', 'n_tokens_mistral': 605, 'n_tokens_neox': 588, 'n_words': 186}