EduploneExam/answers TrueFalseAnswer.py,1.23.2.1,1.23.2.2
"Fabian K." <[email protected]> Sun, 16 Oct 2005 17:43:46 +0000
| Newsgroups | gmane.comp.web.zope.eduplone.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/eduplone/EduploneExam/answers
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15473
Modified Files:
Tag: exam-1_1
TrueFalseAnswer.py
Log Message:
Made TrueFalse evaluated in strict mode by default
Index: TrueFalseAnswer.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/answers/TrueFalseAnswer.py,v
retrieving revision 1.23.2.1
retrieving revision 1.23.2.2
diff -C2 -d -r1.23.2.1 -r1.23.2.2
*** TrueFalseAnswer.py 2 Oct 2005 21:21:12 -0000 1.23.2.1
--- TrueFalseAnswer.py 16 Oct 2005 17:43:43 -0000 1.23.2.2
***************
*** 34,37 ****
--- 34,38 ----
from Products.EduploneExam.config import *
##code-section module-header #fill in your manual code here
+ from types import StringTypes
##/code-section module-header
***************
*** 75,78 ****
--- 76,90 ----
##code-section class-header #fill in your manual code here
+ security.declarePublic('processValue')
+ def processValue(self, value=None):
+ """
+ Override function as strict mode is default by now
+ """
+ if self.getCorrect() == True and str(value).lower() in ['1', 'on']:
+ return True
+ elif self.getCorrect() == False and str(value).lower() in ['0', 'off']:
+ return True
+ else:
+ return False
##/code-section class-header
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl