EduploneExam/answers BooleanAnswer.py,1.24.2.1,1.24.2.2 MathAnswer.py,1.27.2.3,1.27.2.4 SingleChoiceAnswer.py,1.23.2.2,1.23.2.3 TrueFalseAnswer.py,1.23.2.2,1.23.2.3

Nils Haagen <[email protected]> Wed, 26 Oct 2005 14:15:20 +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-serv29498

Modified Files:
      Tag: exam-1_1
	BooleanAnswer.py MathAnswer.py SingleChoiceAnswer.py 
	TrueFalseAnswer.py 
Log Message:
field 'strict' moved away from basequestion;

Index: TrueFalseAnswer.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/answers/TrueFalseAnswer.py,v
retrieving revision 1.23.2.2
retrieving revision 1.23.2.3
diff -C2 -d -r1.23.2.2 -r1.23.2.3
*** TrueFalseAnswer.py	16 Oct 2005 17:43:43 -0000	1.23.2.2
--- TrueFalseAnswer.py	26 Oct 2005 14:15:18 -0000	1.23.2.3
***************
*** 91,94 ****
--- 91,109 ----
  
      #Methods
+     #manually created methods
+ 
+     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
+ 
  
  registerType(TrueFalseAnswer,PROJECTNAME)

Index: BooleanAnswer.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/answers/BooleanAnswer.py,v
retrieving revision 1.24.2.1
retrieving revision 1.24.2.2
diff -C2 -d -r1.24.2.1 -r1.24.2.2
*** BooleanAnswer.py	2 Oct 2005 21:21:12 -0000	1.24.2.1
--- BooleanAnswer.py	26 Oct 2005 14:15:18 -0000	1.24.2.2
***************
*** 79,82 ****
--- 79,91 ----
      ),
  
+     StringField('answer_explanation',
+         widget=StringWidget(
+             label='Answer_explanation',
+             label_msgid='EduploneExam_label_answer_explanation',
+             description_msgid='EduploneExam_help_answer_explanation',
+             i18n_domain='EduploneExam',
+         )
+     ),
+ 
  ),
  )

Index: MathAnswer.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/answers/MathAnswer.py,v
retrieving revision 1.27.2.3
retrieving revision 1.27.2.4
diff -C2 -d -r1.27.2.3 -r1.27.2.4
*** MathAnswer.py	19 Oct 2005 20:47:01 -0000	1.27.2.3
--- MathAnswer.py	26 Oct 2005 14:15:18 -0000	1.27.2.4
***************
*** 57,60 ****
--- 57,69 ----
      ),
  
+     StringField('answer_explanation',
+         widget=StringWidget(
+             label='Answer_explanation',
+             label_msgid='EduploneExam_label_answer_explanation',
+             description_msgid='EduploneExam_help_answer_explanation',
+             i18n_domain='EduploneExam',
+         )
+     ),
+ 
  ),
  )

Index: SingleChoiceAnswer.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/answers/SingleChoiceAnswer.py,v
retrieving revision 1.23.2.2
retrieving revision 1.23.2.3
diff -C2 -d -r1.23.2.2 -r1.23.2.3
*** SingleChoiceAnswer.py	16 Oct 2005 16:57:09 -0000	1.23.2.2
--- SingleChoiceAnswer.py	26 Oct 2005 14:15:18 -0000	1.23.2.3
***************
*** 104,107 ****
--- 104,130 ----
  
      #Methods
+     #manually created methods
+ 
+     security.declarePublic('processValue')
+     def processValue(self, value=None):
+     	"""
+     		Override function as strict mode is default by now
+     	"""
+     	if type(value) in StringTypes and value.lower() in ['0', 'false']:
+             value=False
+         if type(value) in StringTypes and value.lower() in ['on', 'true']:
+             value=True
+ 
+         if value:
+             value=True
+         else:
+             value=False    
+ 
+     	if self.getCorrect() == True and value == True:
+     		return True
+     	else:
+     		return False
+     
+ 
  
  registerType(SingleChoiceAnswer,PROJECTNAME)



-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information