From 438ea3bfb4efd2a807ce8f3d4d9c860a0c6b3d37 Mon Sep 17 00:00:00 2001 From: ichuang Date: Mon, 13 Aug 2012 17:41:24 -0400 Subject: [PATCH] fix customresponse be consistent with "no answer entered" behavior --- common/lib/capa/capa/responsetypes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/lib/capa/capa/responsetypes.py b/common/lib/capa/capa/responsetypes.py index 4c6627b3528c..853ddf4d42ae 100644 --- a/common/lib/capa/capa/responsetypes.py +++ b/common/lib/capa/capa/responsetypes.py @@ -868,7 +868,10 @@ def get_score(self, student_answers): # if there is only one box, and it's empty, then don't evaluate if len(idset) == 1 and not submission[0]: - return CorrectMap(idset[0], 'incorrect', msg='No answer entered!') + # default to no error message on empty answer (to be consistent with other responsetypes) + # but allow author to still have the old behavior by setting empty_answer_err attribute + msg = 'No answer entered!' if self.xml.get('empty_answer_err') else '' + return CorrectMap(idset[0], 'incorrect', msg=msg) correct = ['unknown'] * len(idset) messages = [''] * len(idset)