From b64696dbd0c6eaa3ec50a4d98954100d125c17d5 Mon Sep 17 00:00:00 2001 From: Arjun Singh Date: Sun, 2 Sep 2012 02:05:50 -0700 Subject: [PATCH 1/2] Allowing customresponse messages to be passed to the inputtype --- common/lib/capa/capa/responsetypes.py | 1 + 1 file changed, 1 insertion(+) diff --git a/common/lib/capa/capa/responsetypes.py b/common/lib/capa/capa/responsetypes.py index d1b58e53a9..ee75613ea1 100644 --- a/common/lib/capa/capa/responsetypes.py +++ b/common/lib/capa/capa/responsetypes.py @@ -916,6 +916,7 @@ def sympy_check2(): try: exec self.code in self.context['global_context'], self.context correct = self.context['correct'] + messages = self.context['messages'] except Exception as err: print "oops in customresponse (code) error %s" % err print "context = ", self.context From 08693a1b4195c5140f5868c326d179840f5de72f Mon Sep 17 00:00:00 2001 From: Arjun Singh Date: Sun, 2 Sep 2012 02:52:59 -0700 Subject: [PATCH 2/2] Make customresponse respect point values on input fields --- common/lib/capa/capa/responsetypes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/lib/capa/capa/responsetypes.py b/common/lib/capa/capa/responsetypes.py index ee75613ea1..549ab73850 100644 --- a/common/lib/capa/capa/responsetypes.py +++ b/common/lib/capa/capa/responsetypes.py @@ -970,7 +970,8 @@ def sympy_check2(): # build map giving "correct"ness of the answer(s) correct_map = CorrectMap() for k in range(len(idset)): - correct_map.set(idset[k], correct[k], msg=messages[k]) + correct_map.set(idset[k], correct[k], msg=messages[k], + npoints=self.maxpoints[idset[k]]) return correct_map def get_answers(self):