EduploneExam/questions FillGapQuestion.py,1.21,1.22

Nils Haagen <[email protected]> Thu, 31 Mar 2005 00:18:58 +0000
Newsgroups gmane.comp.web.zope.eduplone.cvs
Message-ID <[email protected]>
Update of /cvsroot/eduplone/EduploneExam/questions
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1053

Modified Files:
	FillGapQuestion.py 
Log Message:
+helper-function for exam_fillgap_edit

Index: FillGapQuestion.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/questions/FillGapQuestion.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** FillGapQuestion.py	25 Feb 2005 13:42:55 -0000	1.21
--- FillGapQuestion.py	31 Mar 2005 00:18:55 -0000	1.22
***************
*** 8,12 ****
  # by FH-Aargau, Switzerland
  #
! # Generated: Fri Feb 25 13:50:07 2005
  # Generator: ArchGenXML Version 1.2 devel 3 http://sf.net/projects/archetypes/
  #
--- 8,12 ----
  # by FH-Aargau, Switzerland
  #
! # Generated: Wed Mar 30 22:50:24 2005
  # Generator: ArchGenXML Version 1.2 devel 3 http://sf.net/projects/archetypes/
  #
***************
*** 52,55 ****
--- 52,64 ----
  
      schema=BaseFolderSchema + getattr(BaseExamQuestion,'schema',Schema(())) + Schema((
+         TextField('basetext',
+             widget=TextAreaWidget(description='Enter a value for basetext.',
+                 description_msgid='EduploneExam_help_basetext',
+                 i18n_domain='EduploneExam',
+                 label='Basetext',
+                 label_msgid='EduploneExam_label_basetext',
+             ),
+         ),
+         
      ),
      )
***************
*** 86,89 ****
--- 95,106 ----
          responseObj.setScore(score)
  
+     def getGapPosition(self, gapId):
+         """
+         """
+         counter=0
+         for word in self.getBasetext().split(' '):
+             if word=='<id=\'%s\'>' % gapId:
+                 return counter
+             counter+=1;
  
  
***************
*** 92,96 ****
          'allowed_content_types':allowed_content_types,
          'allow_discussion': 0,
!         'content_icon':'ExamQuestion.gif',
          'immediate_view':'base_view',
          'global_allow':1,
--- 109,113 ----
          'allowed_content_types':allowed_content_types,
          'allow_discussion': 0,
!         #'content_icon':'FillGapQuestion.gif',
          'immediate_view':'base_view',
          'global_allow':1,



-------------------------------------------------------
This SF.net email is sponsored by Demarc:
A global provider of Threat Management Solutions.
Download our HomeAdmin security software for free today!
http://www.demarc.com/info/Sentarus/hamr30