EduploneExam/answers TextLineAnswer.py,NONE,1.1 BlindGapAnswer.py,1.6,1.7 BooleanAnswer.py,1.5,1.6 ChoiceGapAnswer.py,1.6,1.7 FreeTextAnswer.py,1.6,1.7 MatchingAnswer.py,1.7,1.8 MathAnswer.py,1.8,1.9 MultipleChoiceAnswer.py,1.6,1.7 SingleChoiceAnswer.py,1.6,1.7 TextTaskAnswer.py,1.6,1.7 TrueFalseAnswer.py,1.6,1.7 __init__.py,1.3,1.4

Jens Klein <[email protected]>
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-serv11084/answers

Modified Files:
	BlindGapAnswer.py BooleanAnswer.py ChoiceGapAnswer.py 
	FreeTextAnswer.py MatchingAnswer.py MathAnswer.py 
	MultipleChoiceAnswer.py SingleChoiceAnswer.py 
	TextTaskAnswer.py TrueFalseAnswer.py __init__.py 
Added Files:
	TextLineAnswer.py 
Log Message:
refactored arround


Index: TrueFalseAnswer.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/answers/TrueFalseAnswer.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** TrueFalseAnswer.py	14 Dec 2004 16:02:24 -0000	1.6
--- TrueFalseAnswer.py	14 Dec 2004 16:50:30 -0000	1.7
***************
*** 3,12 ****
  unknown
  
- RCS-ID $Id$
  """
  # Copyright (c) 2004 by eduplone Open Source Business Network EEIG, contributed
  # by FH-Aargau, Switzerland
  #
! # Generated: Tue Dec 14 16:03:57 2004
  # Generator: ArchGenXML Version 1.2 devel 3 http://sf.net/projects/archetypes/
  #
--- 3,11 ----
  unknown
  
  """
  # Copyright (c) 2004 by eduplone Open Source Business Network EEIG, contributed
  # by FH-Aargau, Switzerland
  #
! # Generated: Tue Dec 14 17:38:53 2004
  # Generator: ArchGenXML Version 1.2 devel 3 http://sf.net/projects/archetypes/
  #

--- NEW FILE: TextLineAnswer.py ---
# File: TextLineAnswer.py
"""\
unknown

RCS-ID $Id: TextLineAnswer.py,v 1.1 2004/12/14 16:50:30 yenzenz Exp $
"""
# Copyright (c) 2004 by eduplone Open Source Business Network EEIG, contributed
# by FH-Aargau, Switzerland
#
# Generated: Tue Dec 14 17:38:53 2004
# Generator: ArchGenXML Version 1.2 devel 3 http://sf.net/projects/archetypes/
#
# GNU General Public Licence (GPL)
# 
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
# details.
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place, Suite 330, Boston, MA  02111-1307  USA
#
__author__  = 'Nils Haagen, Jens Klein <[email protected]>, <[email protected]>'
__docformat__ = 'plaintext'

from AccessControl import ClassSecurityInfo
from Products.Archetypes.public import *

from Products.EduploneExam.interfaces.IExamAnswer import IExamAnswer

# additional imports
from Products.EduploneExam.registry import registerAnswerType

##code-section module-header #fill in your manual code here
##/code-section module-header


class TextLineAnswer(BaseContent):
    security = ClassSecurityInfo()
    portal_type = meta_type = 'TextLineAnswer' 
    archetype_name = 'TextLineAnswer'   #this name appears in the 'add' box 
    allowed_content_types = [] 

    __implements__ = getattr(BaseContent,'__implements__',()) + (IExamAnswer,)

    ##code-section class-header #fill in your manual code here
    ##/code-section class-header

    schema=BaseSchema + Schema((
        StringField('id',
            widget=StringWidget(description='Enter a value for id.',
                description_msgid='''help_short_name''',
                i18n_domain='''plone''',
                label='Id',
                label_msgid='''label_short_name''',
            ),
        ),
        
        StringField('title',
            accessor='''Title''',
            searchable=1,
            widget=StringWidget(description='Enter a value for title.',
                description_msgid='''help_title''',
                i18n_domain='''plone''',
                label='Title',
                label_msgid='''label_title''',
            ),
        ),
        
        LinesField('correct',
            widget=LinesWidget(description='Enter a value for correct.',
                description_msgid='EduploneExam_help_correct',
                i18n_domain='EduploneExam',
                label='Correct',
                label_msgid='EduploneExam_label_correct',
            ),
        ),
        
        BooleanField('caseSensitive',
            widget=BooleanWidget(description='Enter a value for caseSensitive.',
                description_msgid='EduploneExam_help_caseSensitive',
                i18n_domain='EduploneExam',
                label='Casesensitive',
                label_msgid='EduploneExam_label_caseSensitive',
            ),
        ),
        
    ),
    )

    #Methods
    #methods from Interface IExamAnswer

    def processValue(self):
        '''
        
        '''
        
        pass



    # uncomment lines below when you need
    factory_type_information={
        'allowed_content_types':allowed_content_types,
        'allow_discussion': 0,
        #'content_icon':'TextLineAnswer.gif',
        'immediate_view':'base_view',
        'global_allow':0,
        'filter_content_types':1,
        }

        
    actions=  (
        

          )
        

registerType(TextLineAnswer)
# end of class TextLineAnswer

##code-section module-footer #fill in your manual code here
##/code-section module-footer



Index: MultipleChoiceAnswer.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/answers/MultipleChoiceAnswer.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** MultipleChoiceAnswer.py	14 Dec 2004 16:02:24 -0000	1.6
--- MultipleChoiceAnswer.py	14 Dec 2004 16:50:30 -0000	1.7
***************
*** 8,12 ****
  # by FH-Aargau, Switzerland
  #
! # Generated: Tue Dec 14 16:03:56 2004
  # Generator: ArchGenXML Version 1.2 devel 3 http://sf.net/projects/archetypes/
  #
--- 8,12 ----
  # by FH-Aargau, Switzerland
  #
! # Generated: Tue Dec 14 17:38:53 2004
  # Generator: ArchGenXML Version 1.2 devel 3 http://sf.net/projects/archetypes/
  #

Index: FreeTextAnswer.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/answers/FreeTextAnswer.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** FreeTextAnswer.py	14 Dec 2004 16:02:24 -0000	1.6
--- FreeTextAnswer.py	14 Dec 2004 16:50:30 -0000	1.7
***************
*** 8,12 ****
  # by FH-Aargau, Switzerland
  #
! # Generated: Tue Dec 14 16:03:57 2004
  # Generator: ArchGenXML Version 1.2 devel 3 http://sf.net/projects/archetypes/
  #
--- 8,12 ----
  # by FH-Aargau, Switzerland
  #
! # Generated: Tue Dec 14 17:38:53 2004
  # Generator: ArchGenXML Version 1.2 devel 3 http://sf.net/projects/archetypes/
  #

Index: ChoiceGapAnswer.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/answers/ChoiceGapAnswer.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ChoiceGapAnswer.py	14 Dec 2004 16:02:24 -0000	1.6
--- ChoiceGapAnswer.py	14 Dec 2004 16:50:30 -0000	1.7
***************
*** 8,12 ****
  # by FH-Aargau, Switzerland
  #
! # Generated: Tue Dec 14 16:03:56 2004
  # Generator: ArchGenXML Version 1.2 devel 3 http://sf.net/projects/archetypes/
  #
--- 8,12 ----
  # by FH-Aargau, Switzerland
  #
! # Generated: Tue Dec 14 17:38:53 2004
  # Generator: ArchGenXML Version 1.2 devel 3 http://sf.net/projects/archetypes/
  #

Index: __init__.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/answers/__init__.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** __init__.py	14 Dec 2004 14:49:17 -0000	1.3
--- __init__.py	14 Dec 2004 16:50:30 -0000	1.4
***************
*** 14,15 ****
--- 14,17 ----
  import MathAnswer
  import BlindGapAnswer
+ import string
+ import TextLineAnswer

Index: MathAnswer.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/answers/MathAnswer.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** MathAnswer.py	14 Dec 2004 16:02:24 -0000	1.8
--- MathAnswer.py	14 Dec 2004 16:50:30 -0000	1.9
***************
*** 8,12 ****
  # by FH-Aargau, Switzerland
  #
! # Generated: Tue Dec 14 16:03:57 2004
  # Generator: ArchGenXML Version 1.2 devel 3 http://sf.net/projects/archetypes/
  #
--- 8,12 ----
  # by FH-Aargau, Switzerland
  #
! # Generated: Tue Dec 14 17:38:53 2004
  # Generator: ArchGenXML Version 1.2 devel 3 http://sf.net/projects/archetypes/
  #

Index: TextTaskAnswer.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/answers/TextTaskAnswer.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** TextTaskAnswer.py	14 Dec 2004 16:02:24 -0000	1.6
--- TextTaskAnswer.py	14 Dec 2004 16:50:30 -0000	1.7
***************
*** 8,12 ****
  # by FH-Aargau, Switzerland
  #
! # Generated: Tue Dec 14 16:03:57 2004
  # Generator: ArchGenXML Version 1.2 devel 3 http://sf.net/projects/archetypes/
  #
--- 8,12 ----
  # by FH-Aargau, Switzerland
  #
! # Generated: Tue Dec 14 17:38:53 2004
  # Generator: ArchGenXML Version 1.2 devel 3 http://sf.net/projects/archetypes/
  #
***************
*** 31,35 ****
  from Products.Archetypes.public import *
  
! from Products.EduploneExam.interfaces.IExamAnswer import IExamAnswer
  
  # additional imports
--- 31,35 ----
  from Products.Archetypes.public import *
  
! from TextLineAnswer import TextLineAnswer
  
  # additional imports
***************
*** 40,55 ****
  
  
! class TextTaskAnswer(BaseContent):
      security = ClassSecurityInfo()
      portal_type = meta_type = 'TextTaskAnswer' 
      archetype_name = 'TextTaskAnswer'   #this name appears in the 'add' box 
!     allowed_content_types = [] 
  
!     __implements__ = getattr(BaseContent,'__implements__',()) + (IExamAnswer,)
  
      ##code-section class-header #fill in your manual code here
      ##/code-section class-header
  
!     schema=BaseSchema + Schema((
          StringField('id',
              widget=StringWidget(description='Enter a value for id.',
--- 40,55 ----
  
  
! class TextTaskAnswer(BaseContent,TextLineAnswer):
      security = ClassSecurityInfo()
      portal_type = meta_type = 'TextTaskAnswer' 
      archetype_name = 'TextTaskAnswer'   #this name appears in the 'add' box 
!     allowed_content_types = [] + getattr(TextLineAnswer,'allowed_content_types',[])
  
!     __implements__ = getattr(BaseContent,'__implements__',()) + getattr(TextLineAnswer,'__implements__',())
  
      ##code-section class-header #fill in your manual code here
      ##/code-section class-header
  
!     schema=BaseSchema + getattr(TextLineAnswer,'schema',Schema(())) + Schema((
          StringField('id',
              widget=StringWidget(description='Enter a value for id.',
***************
*** 72,98 ****
          ),
          
-         LinesField('correct',
-             widget=LinesWidget(description='Enter a value for correct.',
-                 description_msgid='EduploneExam_help_correct',
-                 i18n_domain='EduploneExam',
-                 label='Correct',
-                 label_msgid='EduploneExam_label_correct',
-             ),
-         ),
-         
-         BooleanField('caseSensitive',
-             widget=BooleanWidget(description='Enter a value for caseSensitive.',
-                 description_msgid='EduploneExam_help_caseSensitive',
-                 i18n_domain='EduploneExam',
-                 label='Casesensitive',
-                 label_msgid='EduploneExam_label_caseSensitive',
-             ),
-         ),
-         
      ),
      )
  
      #Methods
!     #methods from Interface IExamAnswer
  
      def processValue(self):
--- 72,80 ----
          ),
          
      ),
      )
  
      #Methods
!     #manually created methods
  
      def processValue(self):

Index: MatchingAnswer.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/answers/MatchingAnswer.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** MatchingAnswer.py	14 Dec 2004 16:02:24 -0000	1.7
--- MatchingAnswer.py	14 Dec 2004 16:50:30 -0000	1.8
***************
*** 8,12 ****
  # by FH-Aargau, Switzerland
  #
! # Generated: Tue Dec 14 16:03:57 2004
  # Generator: ArchGenXML Version 1.2 devel 3 http://sf.net/projects/archetypes/
  #
--- 8,12 ----
  # by FH-Aargau, Switzerland
  #
! # Generated: Tue Dec 14 17:38:53 2004
  # Generator: ArchGenXML Version 1.2 devel 3 http://sf.net/projects/archetypes/
  #
***************
*** 106,110 ****
      #methods from Interface IExamAnswer
  
-     security.declareProtected('''''','processValue')
      def processValue(self, value=''):
          '''
--- 106,109 ----

Index: BooleanAnswer.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/answers/BooleanAnswer.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** BooleanAnswer.py	14 Dec 2004 15:06:25 -0000	1.5
--- BooleanAnswer.py	14 Dec 2004 16:50:30 -0000	1.6
***************
*** 1,5 ****
  # File: BooleanAnswer.py
  """\
! unknown
  
  RCS-ID $Id$
--- 1,5 ----
  # File: BooleanAnswer.py
  """\
! an abstract class representing a template for all boolean answer types
  
  RCS-ID $Id$
***************
*** 8,12 ****
  # by FH-Aargau, Switzerland
  #
! # Generated: Tue Dec 14 16:03:57 2004
  # Generator: ArchGenXML Version 1.2 devel 3 http://sf.net/projects/archetypes/
  #
--- 8,12 ----
  # by FH-Aargau, Switzerland
  #
! # Generated: Tue Dec 14 17:38:53 2004
  # Generator: ArchGenXML Version 1.2 devel 3 http://sf.net/projects/archetypes/
  #
***************
*** 43,46 ****
--- 43,50 ----
  
  class BooleanAnswer(BaseContent):
+     '''
+     an abstract class representing a template for all boolean answer
+     types
+     '''
      security = ClassSecurityInfo()
      portal_type = meta_type = 'BooleanAnswer' 
***************
*** 63,77 ****
          ),
          
-         StringField('title',
-             accessor='''Title''',
-             searchable=1,
-             widget=StringWidget(description='Enter a value for title.',
-                 description_msgid='''help_title''',
-                 i18n_domain='''plone''',
-                 label='Title',
-                 label_msgid='''label_title''',
-             ),
-         ),
-         
          BooleanField('correct',
              widget=BooleanWidget(description='Enter a value for correct.',
--- 67,70 ----
***************
*** 102,124 ****
          ),
          
      ),
      )
  
      #Methods
      #methods from Interface IExamAnswer
  
      def processValue(self, value=None):
          '''
!         
          '''
          if type(value) in StringTypes and value.lower() in ['0', 'false']:
              value=False
!             
!         if value: 
              value=True
!         else: 
              value=False
!         
!         return self.correct==value 
  
  
--- 95,138 ----
          ),
          
+         #returns id as title, hide title in base_edit
+         StringField('title',
+             accessor='''Title''',
+             widget=StringWidget(description='Enter a value for title.',
+                 description_msgid='EduploneExam_help_title',
+                 i18n_domain='EduploneExam',
+                 label='Title',
+                 label_msgid='EduploneExam_label_title',
+                 modes=("view",),
+                 type='''StringWidget''',
+             ),
+         ),
+         
      ),
      )
  
      #Methods
+ 
+     def Title(self):
+         '''
+         returns id as title
+         '''
+ 
+         return self.id
+ 
      #methods from Interface IExamAnswer
  
      def processValue(self, value=None):
          '''
! 
          '''
          if type(value) in StringTypes and value.lower() in ['0', 'false']:
              value=False
! 
!         if value:
              value=True
!         else:
              value=False
! 
!         return self.correct==value
  
  

Index: SingleChoiceAnswer.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/answers/SingleChoiceAnswer.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** SingleChoiceAnswer.py	14 Dec 2004 16:02:24 -0000	1.6
--- SingleChoiceAnswer.py	14 Dec 2004 16:50:30 -0000	1.7
***************
*** 8,12 ****
  # by FH-Aargau, Switzerland
  #
! # Generated: Tue Dec 14 16:03:56 2004
  # Generator: ArchGenXML Version 1.2 devel 3 http://sf.net/projects/archetypes/
  #
--- 8,12 ----
  # by FH-Aargau, Switzerland
  #
! # Generated: Tue Dec 14 17:38:53 2004
  # Generator: ArchGenXML Version 1.2 devel 3 http://sf.net/projects/archetypes/
  #

Index: BlindGapAnswer.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/answers/BlindGapAnswer.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** BlindGapAnswer.py	14 Dec 2004 16:02:24 -0000	1.6
--- BlindGapAnswer.py	14 Dec 2004 16:50:30 -0000	1.7
***************
*** 8,12 ****
  # by FH-Aargau, Switzerland
  #
! # Generated: Tue Dec 14 16:03:57 2004
  # Generator: ArchGenXML Version 1.2 devel 3 http://sf.net/projects/archetypes/
  #
--- 8,12 ----
  # by FH-Aargau, Switzerland
  #
! # Generated: Tue Dec 14 17:38:53 2004
  # Generator: ArchGenXML Version 1.2 devel 3 http://sf.net/projects/archetypes/
  #
***************
*** 31,35 ****
  from Products.Archetypes.public import *
  
! from Products.EduploneExam.interfaces.IExamAnswer import IExamAnswer
  
  # additional imports
--- 31,35 ----
  from Products.Archetypes.public import *
  
! from TextLineAnswer import TextLineAnswer
  
  # additional imports
***************
*** 40,55 ****
  
  
! class BlindGapAnswer(BaseContent):
      security = ClassSecurityInfo()
      portal_type = meta_type = 'BlindGapAnswer' 
      archetype_name = 'BlindGapAnswer'   #this name appears in the 'add' box 
!     allowed_content_types = [] 
  
!     __implements__ = getattr(BaseContent,'__implements__',()) + (IExamAnswer,)
  
      ##code-section class-header #fill in your manual code here
      ##/code-section class-header
  
!     schema=BaseSchema + Schema((
          StringField('id',
              widget=StringWidget(description='Enter a value for id.',
--- 40,55 ----
  
  
! class BlindGapAnswer(BaseContent,TextLineAnswer):
      security = ClassSecurityInfo()
      portal_type = meta_type = 'BlindGapAnswer' 
      archetype_name = 'BlindGapAnswer'   #this name appears in the 'add' box 
!     allowed_content_types = [] + getattr(TextLineAnswer,'allowed_content_types',[])
  
!     __implements__ = getattr(BaseContent,'__implements__',()) + getattr(TextLineAnswer,'__implements__',())
  
      ##code-section class-header #fill in your manual code here
      ##/code-section class-header
  
!     schema=BaseSchema + getattr(TextLineAnswer,'schema',Schema(())) + Schema((
          StringField('id',
              widget=StringWidget(description='Enter a value for id.',
***************
*** 72,98 ****
          ),
          
-         LinesField('correct',
-             widget=LinesWidget(description='Enter a value for correct.',
-                 description_msgid='EduploneExam_help_correct',
-                 i18n_domain='EduploneExam',
-                 label='Correct',
-                 label_msgid='EduploneExam_label_correct',
-             ),
-         ),
-         
-         BooleanField('caseSensitive',
-             widget=BooleanWidget(description='Enter a value for caseSensitive.',
-                 description_msgid='EduploneExam_help_caseSensitive',
-                 i18n_domain='EduploneExam',
-                 label='Casesensitive',
-                 label_msgid='EduploneExam_label_caseSensitive',
-             ),
-         ),
-         
      ),
      )
  
      #Methods
!     #methods from Interface IExamAnswer
  
      def processValue(self, value=None):
--- 72,80 ----
          ),
          
      ),
      )
  
      #Methods
!     #manually created methods
  
      def processValue(self, value=None):



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.