EduploneExam/answers BooleanAnswer.py,1.24.2.4,1.24.2.5 ChoiceGapAnswer.py,1.26.2.7,1.26.2.8 FreeTextAnswer.py,1.25.2.7,1.25.2.8 MatchingAnswer.py,1.26.2.7,1.26.2.8 MathAnswer.py,1.27.2.8,1.27.2.9 TextLineAnswer.py,1.20.2.7,1.20.2.8 __init__.py,1.6.2.1,1.6.2.2

Nils Haagen <[email protected]> Wed, 08 Feb 2006 13:39:35 +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-serv30902/answers

Modified Files:
      Tag: exam-1_1
	BooleanAnswer.py ChoiceGapAnswer.py FreeTextAnswer.py 
	MatchingAnswer.py MathAnswer.py TextLineAnswer.py __init__.py 
Log Message:
version jump; Introduction of BaseAnswer, removed Title-Field from answers; minor fixes, mainly in FreeText override;

Index: TextLineAnswer.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/answers/TextLineAnswer.py,v
retrieving revision 1.20.2.7
retrieving revision 1.20.2.8
diff -C2 -d -r1.20.2.7 -r1.20.2.8
*** TextLineAnswer.py	8 Jan 2006 14:01:21 -0000	1.20.2.7
--- TextLineAnswer.py	8 Feb 2006 13:39:33 -0000	1.20.2.8
***************
*** 26,30 ****
  from AccessControl import ClassSecurityInfo
  from Products.Archetypes.atapi import *
! from Products.EduploneExam.interfaces.IExamAnswer import IExamAnswer
  
  
--- 26,30 ----
  from AccessControl import ClassSecurityInfo
  from Products.Archetypes.atapi import *
! from BaseAnswer import BaseAnswer
  
  
***************
*** 62,76 ****
  ##/code-section after-local-schema
  
! TextLineAnswer_schema = schema
  
  ##code-section after-schema #fill in your manual code here
  ##/code-section after-schema
  
! class TextLineAnswer(BaseContent):
      security = ClassSecurityInfo()
!     __implements__ = (getattr(BaseContent,'__implements__',()),) + (IExamAnswer,)
  
  
!     allowed_content_types      = []
      schema = TextLineAnswer_schema
  
--- 62,77 ----
  ##/code-section after-local-schema
  
! TextLineAnswer_schema = getattr(BaseAnswer,'schema',Schema(())) + \
!     schema
  
  ##code-section after-schema #fill in your manual code here
  ##/code-section after-schema
  
! class TextLineAnswer(BaseAnswer,BaseContent):
      security = ClassSecurityInfo()
!     __implements__ = (getattr(BaseAnswer,'__implements__',()),) + (getattr(BaseContent,'__implements__',()),)
  
  
!     allowed_content_types      = [] + list(getattr(BaseAnswer, 'allowed_content_types', []))
      schema = TextLineAnswer_schema
  
***************
*** 80,84 ****
  
      #Methods
!     #methods from Interface IExamAnswer
  
      security.declarePublic('processValue')
--- 81,85 ----
  
      #Methods
!     #manually created methods
  
      security.declarePublic('processValue')

Index: FreeTextAnswer.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/answers/FreeTextAnswer.py,v
retrieving revision 1.25.2.7
retrieving revision 1.25.2.8
diff -C2 -d -r1.25.2.7 -r1.25.2.8
*** FreeTextAnswer.py	8 Jan 2006 14:01:20 -0000	1.25.2.7
--- FreeTextAnswer.py	8 Feb 2006 13:39:33 -0000	1.25.2.8
***************
*** 26,30 ****
  from AccessControl import ClassSecurityInfo
  from Products.Archetypes.atapi import *
! from Products.EduploneExam.interfaces.IExamAnswer import IExamAnswer
  
  
--- 26,30 ----
  from AccessControl import ClassSecurityInfo
  from Products.Archetypes.atapi import *
! from BaseAnswer import BaseAnswer
  
  
***************
*** 54,57 ****
--- 54,58 ----
  
  FreeTextAnswer_schema = BaseSchema + \
+     getattr(BaseAnswer,'schema',Schema(())) + \
      schema
  
***************
*** 59,68 ****
  ##/code-section after-schema
  
! class FreeTextAnswer(BaseContent):
      """
      <p>Represents ...</p>
      """
      security = ClassSecurityInfo()
!     __implements__ = (getattr(BaseContent,'__implements__',()),) + (IExamAnswer,)
  
  
--- 60,69 ----
  ##/code-section after-schema
  
! class FreeTextAnswer(BaseAnswer,BaseContent):
      """
      <p>Represents ...</p>
      """
      security = ClassSecurityInfo()
!     __implements__ = (getattr(BaseAnswer,'__implements__',()),) + (getattr(BaseContent,'__implements__',()),)
  
  
***************
*** 72,76 ****
      meta_type                  = 'FreeTextAnswer'
      portal_type                = 'FreeTextAnswer'
!     allowed_content_types      = []
      filter_content_types       = 0
      global_allow               = 0
--- 73,77 ----
      meta_type                  = 'FreeTextAnswer'
      portal_type                = 'FreeTextAnswer'
!     allowed_content_types      = [] + list(getattr(BaseAnswer, 'allowed_content_types', []))
      filter_content_types       = 0
      global_allow               = 0
***************
*** 90,94 ****
  
      #Methods
!     #methods from Interface IExamAnswer
  
      security.declarePublic('processValue')
--- 91,95 ----
  
      #Methods
!     #manually created methods
  
      security.declarePublic('processValue')

Index: ChoiceGapAnswer.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/answers/ChoiceGapAnswer.py,v
retrieving revision 1.26.2.7
retrieving revision 1.26.2.8
diff -C2 -d -r1.26.2.7 -r1.26.2.8
*** ChoiceGapAnswer.py	8 Jan 2006 14:01:20 -0000	1.26.2.7
--- ChoiceGapAnswer.py	8 Feb 2006 13:39:33 -0000	1.26.2.8
***************
*** 26,30 ****
  from AccessControl import ClassSecurityInfo
  from Products.Archetypes.atapi import *
! from Products.EduploneExam.interfaces.IExamAnswer import IExamAnswer
  
  
--- 26,30 ----
  from AccessControl import ClassSecurityInfo
  from Products.Archetypes.atapi import *
! from BaseAnswer import BaseAnswer
  
  
***************
*** 63,66 ****
--- 63,67 ----
  
  ChoiceGapAnswer_schema = BaseSchema + \
+     getattr(BaseAnswer,'schema',Schema(())) + \
      schema
  
***************
*** 68,74 ****
  ##/code-section after-schema
  
! class ChoiceGapAnswer(BaseContent):
      security = ClassSecurityInfo()
!     __implements__ = (getattr(BaseContent,'__implements__',()),) + (IExamAnswer,)
  
  
--- 69,75 ----
  ##/code-section after-schema
  
! class ChoiceGapAnswer(BaseAnswer,BaseContent):
      security = ClassSecurityInfo()
!     __implements__ = (getattr(BaseAnswer,'__implements__',()),) + (getattr(BaseContent,'__implements__',()),)
  
  
***************
*** 78,82 ****
      meta_type                  = 'ChoiceGapAnswer'
      portal_type                = 'ChoiceGapAnswer'
!     allowed_content_types      = []
      filter_content_types       = 0
      global_allow               = 0
--- 79,83 ----
      meta_type                  = 'ChoiceGapAnswer'
      portal_type                = 'ChoiceGapAnswer'
!     allowed_content_types      = [] + list(getattr(BaseAnswer, 'allowed_content_types', []))
      filter_content_types       = 0
      global_allow               = 0
***************
*** 107,123 ****
  
      #Methods
-     #methods from Interface IExamAnswer
- 
-     security.declarePublic('processValue')
-     def processValue(self, value=''):
-         '''
-         
-         '''
-         if value and value == self.getCorrect():
-             return True
-         else:
-             return False
- 
- 
      #manually created methods
  
--- 108,111 ----
***************
*** 137,140 ****
--- 125,139 ----
  
  
+     security.declarePublic('processValue')
+     def processValue(self, value=''):
+         '''
+         
+         '''
+         if value and value == self.getCorrect():
+             return True
+         else:
+             return False
+ 
+ 
  
  registerType(ChoiceGapAnswer,PROJECTNAME)

Index: __init__.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/answers/__init__.py,v
retrieving revision 1.6.2.1
retrieving revision 1.6.2.2
diff -C2 -d -r1.6.2.1 -r1.6.2.2
*** __init__.py	2 Oct 2005 21:21:12 -0000	1.6.2.1
--- __init__.py	8 Feb 2006 13:39:33 -0000	1.6.2.2
***************
*** 20,23 ****
--- 20,24 ----
  import BlindGapAnswer
  import TextLineAnswer
+ import BaseAnswer
  
  ##code-section init-module-footer #fill in your manual code here

Index: MathAnswer.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/answers/MathAnswer.py,v
retrieving revision 1.27.2.8
retrieving revision 1.27.2.9
diff -C2 -d -r1.27.2.8 -r1.27.2.9
*** MathAnswer.py	8 Jan 2006 14:01:20 -0000	1.27.2.8
--- MathAnswer.py	8 Feb 2006 13:39:33 -0000	1.27.2.9
***************
*** 26,30 ****
  from AccessControl import ClassSecurityInfo
  from Products.Archetypes.atapi import *
! from Products.EduploneExam.interfaces.IExamAnswer import IExamAnswer
  
  
--- 26,30 ----
  from AccessControl import ClassSecurityInfo
  from Products.Archetypes.atapi import *
! from BaseAnswer import BaseAnswer
  
  
***************
*** 74,77 ****
--- 74,78 ----
  
  MathAnswer_schema = BaseSchema + \
+     getattr(BaseAnswer,'schema',Schema(())) + \
      schema
  
***************
*** 79,85 ****
  ##/code-section after-schema
  
! class MathAnswer(BaseContent):
      security = ClassSecurityInfo()
!     __implements__ = (getattr(BaseContent,'__implements__',()),) + (IExamAnswer,)
  
  
--- 80,86 ----
  ##/code-section after-schema
  
! class MathAnswer(BaseAnswer,BaseContent):
      security = ClassSecurityInfo()
!     __implements__ = (getattr(BaseAnswer,'__implements__',()),) + (getattr(BaseContent,'__implements__',()),)
  
  
***************
*** 89,93 ****
      meta_type                  = 'MathAnswer'
      portal_type                = 'MathAnswer'
!     allowed_content_types      = []
      filter_content_types       = 0
      global_allow               = 0
--- 90,94 ----
      meta_type                  = 'MathAnswer'
      portal_type                = 'MathAnswer'
!     allowed_content_types      = [] + list(getattr(BaseAnswer, 'allowed_content_types', []))
      filter_content_types       = 0
      global_allow               = 0
***************
*** 107,111 ****
  
      #Methods
!     #methods from Interface IExamAnswer
  
      security.declarePublic('processValue')
--- 108,112 ----
  
      #Methods
!     #manually created methods
  
      security.declarePublic('processValue')

Index: MatchingAnswer.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/answers/MatchingAnswer.py,v
retrieving revision 1.26.2.7
retrieving revision 1.26.2.8
diff -C2 -d -r1.26.2.7 -r1.26.2.8
*** MatchingAnswer.py	8 Jan 2006 14:01:20 -0000	1.26.2.7
--- MatchingAnswer.py	8 Feb 2006 13:39:33 -0000	1.26.2.8
***************
*** 26,30 ****
  from AccessControl import ClassSecurityInfo
  from Products.Archetypes.atapi import *
! from Products.EduploneExam.interfaces.IExamAnswer import IExamAnswer
  
  
--- 26,30 ----
  from AccessControl import ClassSecurityInfo
  from Products.Archetypes.atapi import *
! from BaseAnswer import BaseAnswer
  
  
***************
*** 73,76 ****
--- 73,77 ----
  
  MatchingAnswer_schema = BaseSchema + \
+     getattr(BaseAnswer,'schema',Schema(())) + \
      schema
  
***************
*** 78,84 ****
  ##/code-section after-schema
  
! class MatchingAnswer(BaseContent):
      security = ClassSecurityInfo()
!     __implements__ = (getattr(BaseContent,'__implements__',()),) + (IExamAnswer,)
  
  
--- 79,85 ----
  ##/code-section after-schema
  
! class MatchingAnswer(BaseAnswer,BaseContent):
      security = ClassSecurityInfo()
!     __implements__ = (getattr(BaseAnswer,'__implements__',()),) + (getattr(BaseContent,'__implements__',()),)
  
  
***************
*** 88,92 ****
      meta_type                  = 'MatchingAnswer'
      portal_type                = 'MatchingAnswer'
!     allowed_content_types      = []
      filter_content_types       = 0
      global_allow               = 0
--- 89,93 ----
      meta_type                  = 'MatchingAnswer'
      portal_type                = 'MatchingAnswer'
!     allowed_content_types      = [] + list(getattr(BaseAnswer, 'allowed_content_types', []))
      filter_content_types       = 0
      global_allow               = 0
***************
*** 106,110 ****
  
      #Methods
!     #methods from Interface IExamAnswer
  
      security.declarePublic('processValue')
--- 107,111 ----
  
      #Methods
!     #manually created methods
  
      security.declarePublic('processValue')

Index: BooleanAnswer.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/answers/BooleanAnswer.py,v
retrieving revision 1.24.2.4
retrieving revision 1.24.2.5
diff -C2 -d -r1.24.2.4 -r1.24.2.5
*** BooleanAnswer.py	8 Jan 2006 14:01:20 -0000	1.24.2.4
--- BooleanAnswer.py	8 Feb 2006 13:39:33 -0000	1.24.2.5
***************
*** 26,30 ****
  from AccessControl import ClassSecurityInfo
  from Products.Archetypes.atapi import *
! from Products.EduploneExam.interfaces.IExamAnswer import IExamAnswer
  
  
--- 26,30 ----
  from AccessControl import ClassSecurityInfo
  from Products.Archetypes.atapi import *
! from BaseAnswer import BaseAnswer
  
  
***************
*** 67,82 ****
      ),
  
-     #returns id as title, hide title in base_edit
-     StringField('title',
-         widget=StringWidget(
-             modes=("view",),
-             label='Title',
-             label_msgid='EduploneExam_label_title',
-             description_msgid='EduploneExam_help_title',
-             i18n_domain='EduploneExam',
-         ),
-         accessor="Title"
-     ),
- 
      StringField('answer_explanation',
          widget=StringWidget(
--- 67,70 ----
***************
*** 95,104 ****
  ##/code-section after-local-schema
  
! BooleanAnswer_schema = schema
  
  ##code-section after-schema #fill in your manual code here
  ##/code-section after-schema
  
! class BooleanAnswer(BaseContent):
      """
      an abstract class representing a template for all boolean answer
--- 83,93 ----
  ##/code-section after-local-schema
  
! BooleanAnswer_schema = getattr(BaseAnswer,'schema',Schema(())) + \
!     schema
  
  ##code-section after-schema #fill in your manual code here
  ##/code-section after-schema
  
! class BooleanAnswer(BaseAnswer,BaseContent):
      """
      an abstract class representing a template for all boolean answer
***************
*** 106,113 ****
      """
      security = ClassSecurityInfo()
!     __implements__ = (getattr(BaseContent,'__implements__',()),) + (IExamAnswer,)
  
  
!     allowed_content_types      = []
      schema = BooleanAnswer_schema
  
--- 95,102 ----
      """
      security = ClassSecurityInfo()
!     __implements__ = (getattr(BaseAnswer,'__implements__',()),) + (getattr(BaseContent,'__implements__',()),)
  
  
!     allowed_content_types      = [] + list(getattr(BaseAnswer, 'allowed_content_types', []))
      schema = BooleanAnswer_schema
  
***************
*** 117,131 ****
  
      #Methods
! 
!     security.declarePublic('Title')
!     def Title(self):
!         '''
!         returns id as title
!         '''
! 
!         return self.getId()
! 
! 
!     #methods from Interface IExamAnswer
  
      security.declarePublic('processValue')
--- 106,110 ----
  
      #Methods
!     #manually created methods
  
      security.declarePublic('processValue')
***************
*** 147,150 ****
--- 126,138 ----
  
  
+     security.declarePublic('Title')
+     def Title(self):
+         '''
+         returns id as title
+         '''
+ 
+         return self.getId()
+ 
+ 
  # end of class BooleanAnswer
  



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642