Skip to content

Commit

Permalink
Merge pull request openedx#404 from MITx/feature/ichuang/consistent-c…
Browse files Browse the repository at this point in the history
…ustomresponse

fix customresponse be consistent with "no answer entered" behavior
  • Loading branch information
cpennington committed Aug 14, 2012
2 parents fc1f8a5 + 438ea3b commit c731579
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion common/lib/capa/capa/responsetypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='<font color="red">No answer entered!</font>')
# 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 = '<font color="red">No answer entered!</font>' if self.xml.get('empty_answer_err') else ''
return CorrectMap(idset[0], 'incorrect', msg=msg)

correct = ['unknown'] * len(idset)
messages = [''] * len(idset)
Expand Down

0 comments on commit c731579

Please sign in to comment.