From bb66cad68b135f419cafdea9a6fe75a3798073a5 Mon Sep 17 00:00:00 2001 From: Piotr Mitros Date: Mon, 21 May 2012 09:18:40 -0400 Subject: [PATCH] Code review -- comments and better exceptions --- djangoapps/courseware/capa/inputtypes.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/djangoapps/courseware/capa/inputtypes.py b/djangoapps/courseware/capa/inputtypes.py index 0b05971771..d50e41a5a3 100644 --- a/djangoapps/courseware/capa/inputtypes.py +++ b/djangoapps/courseware/capa/inputtypes.py @@ -64,6 +64,10 @@ class SimpleInput():# XModule self.tag = xml.tag if not state: state = {} + ## ID should only come from one place. + ## If it comes from multiple, we use state first, XML second, and parameter + ## third. Since we don't make this guarantee, we can swap this around in + ## the future if there's a more logical order. if item_id: self.id = item_id if xml.get('id'): @@ -132,7 +136,7 @@ def register_render_function(fn, names=None, cls=SimpleInput): if names == None: SimpleInput.xml_tags[fn.__name__] = fn else: - raise "Unimplemented/input types" + raise NotImplementedError def wrapped(): return fn return wrapped