EduploneExam/answers BlindGapAnswer.py,1.22,1.23
"Fabian K." <[email protected]> Sat, 02 Apr 2005 14:22:16 +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-serv18977/answers Modified Files: BlindGapAnswer.py Log Message: Completed processValue() Index: BlindGapAnswer.py =================================================================== RCS file: /cvsroot/eduplone/EduploneExam/answers/BlindGapAnswer.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** BlindGapAnswer.py 25 Feb 2005 13:42:51 -0000 1.22 --- BlindGapAnswer.py 2 Apr 2005 14:22:14 -0000 1.23 *************** *** 3,13 **** unknown - RCS-ID $Id$ """ # Copyright (c) 2005 by eduplone Open Source Business Network EEIG, contributed # by FH-Aargau, Switzerland # ! # Generated: Fri Feb 25 13:50:07 2005 ! # Generator: ArchGenXML Version 1.2 devel 3 http://sf.net/projects/archetypes/ # # GNU General Public Licence (GPL) --- 3,11 ---- unknown """ # Copyright (c) 2005 by eduplone Open Source Business Network EEIG, contributed # by FH-Aargau, Switzerland # ! # Generator: ArchGenXML Version 1.4 devel 1 http://sf.net/projects/archetypes/ # # GNU General Public Licence (GPL) *************** *** 25,29 **** # Place, Suite 330, Boston, MA 02111-1307 USA # ! __author__ = 'Nils Haagen, Jens Klein <[email protected]>, <[email protected]>' __docformat__ = 'plaintext' --- 23,27 ---- # Place, Suite 330, Boston, MA 02111-1307 USA # ! __author__ = '''Nils Haagen <[email protected]>, Jens Klein <[email protected]>''' __docformat__ = 'plaintext' *************** *** 31,79 **** from Products.Archetypes.public import * from TextLineAnswer import TextLineAnswer ! # additional imports from Products.EduploneExam.registry import registerAnswerType ##code-section module-header #fill in your manual code here ##/code-section module-header 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(( ! ), ! ) ! #Methods - # uncomment lines below when you need - factory_type_information={ - 'allowed_content_types':allowed_content_types, - 'allow_discussion': 0, - #'content_icon':'BlindGapAnswer.gif', - 'immediate_view':'base_view', - 'global_allow':0, - 'filter_content_types':1, - } ! ! actions= ( ! - ) - ! registerType(BlindGapAnswer) # end of class BlindGapAnswer --- 29,98 ---- from Products.Archetypes.public import * + from TextLineAnswer import TextLineAnswer ! ! # additional imports from tagged value 'import' from Products.EduploneExam.registry import registerAnswerType + from Products.EduploneExam.config import * + ##code-section module-header #fill in your manual code here ##/code-section module-header + schema= Schema(( + ), + ) + + ##code-section after-schema #fill in your manual code here + ##/code-section after-schema class BlindGapAnswer(BaseContent,TextLineAnswer): security = ClassSecurityInfo() ! __implements__ = (getattr(BaseContent,'__implements__',()),) + (getattr(TextLineAnswer,'__implements__',()),) ! # This name appears in the 'add' box ! archetype_name = 'BlindGapAnswer' ! portal_type = meta_type = 'BlindGapAnswer' ! allowed_content_types = [] + getattr(TextLineAnswer,'allowed_content_types',[]) ! filter_content_types = 1 ! global_allow = 0 ! allow_discussion = 0 ! #content_icon = 'BlindGapAnswer.gif' ! immediate_view = 'base_view' ! default_view = 'base_view' ! typeDescription = "BlindGapAnswer" ! typeDescMsgId = 'description_edit_blindgapanswer' ! schema = BaseSchema + \ ! getattr(TextLineAnswer,'schema',Schema(())) + \ ! schema + ##code-section class-header #fill in your manual code here + ##/code-section class-header ! #Methods ! ! security.declarePublic('processValue') ! def processValue(self, value=''): ! """ """ ! # Check if answer is case sensitive ! if value and self.getCaseSensitive(): ! if value and value in self.getCorrect(): ! return True ! else: ! return False ! ! else: ! for correctAnswer in self.getCorrect(): ! if correctAnswer.lower() == value.lower(): ! return True ! return False ! registerType(BlindGapAnswer,PROJECTNAME) # end of class BlindGapAnswer *************** *** 83,84 **** --- 102,104 ---- + ------------------------------------------------------- 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://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click