From 1f7a3f83b98ba75ce1b313595e5d7dd137d4ab82 Mon Sep 17 00:00:00 2001 From: Lyla Fischer Date: Tue, 1 May 2012 04:03:29 -0400 Subject: [PATCH] fixed naming convention on response types --- djangoapps/courseware/capa/capa_problem.py | 12 ++++++------ djangoapps/courseware/capa/responsetypes.py | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/djangoapps/courseware/capa/capa_problem.py b/djangoapps/courseware/capa/capa_problem.py index 1337a9470f..05509acc35 100644 --- a/djangoapps/courseware/capa/capa_problem.py +++ b/djangoapps/courseware/capa/capa_problem.py @@ -15,18 +15,18 @@ from mako.template import Template from util import contextualize_text import inputtypes -from responsetypes import numericalresponse, formularesponse, customresponse, schematicresponse, multiplechoiceresponse, StudentInputError +from responsetypes import NumericalResponse, FormulaResponse, CustomResponse, SchematicResponse, MultipleChoiceResponse, StudentInputError import calc import eia log = logging.getLogger("mitx.courseware") -response_types = {'numericalresponse':numericalresponse, - 'formularesponse':formularesponse, - 'customresponse':customresponse, - 'schematicresponse':schematicresponse, - 'multiplechoiceresponse':multiplechoiceresponse} +response_types = {'numericalresponse':NumericalResponse, + 'formularesponse':FormulaResponse, + 'customresponse':CustomResponse, + 'schematicresponse':SchematicResponse, + 'multiplechoiceresponse':MultipleChoiceResponse} entry_types = ['textline', 'schematic', 'choicegroup'] response_properties = ["responseparam", "answer"] # How to convert from original XML to HTML diff --git a/djangoapps/courseware/capa/responsetypes.py b/djangoapps/courseware/capa/responsetypes.py index d35b8a26e3..153bcd16d6 100644 --- a/djangoapps/courseware/capa/responsetypes.py +++ b/djangoapps/courseware/capa/responsetypes.py @@ -38,7 +38,7 @@ def compare_with_tolerance(v1, v2, tol): #Every response type needs methods "grade" and "get_answers" -class multiplechoiceresponse(object): +class MultipleChoiceResponse(object): def __init__(self, xml, context): self.xml = xml self.correct_choices = xml.xpath('//*[@id=$id]//choice[@correct="true"]', @@ -62,7 +62,7 @@ class multiplechoiceresponse(object): def get_answers(self): return {self.answer_id:self.correct_choices} -class numericalresponse(object): +class NumericalResponse(object): def __init__(self, xml, context): self.xml = xml self.correct_answer = contextualize_text(xml.get('answer'), context) @@ -91,7 +91,7 @@ class numericalresponse(object): def get_answers(self): return {self.answer_id:self.correct_answer} -class customresponse(object): +class CustomResponse(object): def __init__(self, xml, context): self.xml = xml ## CRITICAL TODO: Should cover all entrytypes @@ -122,7 +122,7 @@ class customresponse(object): class StudentInputError(Exception): pass -class formularesponse(object): +class FormulaResponse(object): def __init__(self, xml, context): self.xml = xml self.correct_answer = contextualize_text(xml.get('answer'), context) @@ -192,7 +192,7 @@ class formularesponse(object): def get_answers(self): return {self.answer_id:self.correct_answer} -class schematicresponse(object): +class SchematicResponse(object): def __init__(self, xml, context): self.xml = xml self.answer_ids = xml.xpath('//*[@id=$id]//schematic/@id',