EduploneExam ExamFolder.py,1.33.2.2,1.33.2.3 version.txt,1.24.2.2,1.24.2.3

Nils Haagen <[email protected]> Wed, 19 Oct 2005 20:47:03 +0000
Newsgroups gmane.comp.web.zope.eduplone.cvs
Message-ID <[email protected]>
Update of /cvsroot/eduplone/EduploneExam
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21418

Modified Files:
      Tag: exam-1_1
	ExamFolder.py version.txt 
Log Message:
dunno anymore, minor fixes 

Index: version.txt
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/version.txt,v
retrieving revision 1.24.2.2
retrieving revision 1.24.2.3
diff -C2 -d -r1.24.2.2 -r1.24.2.3
*** version.txt	3 Oct 2005 15:34:17 -0000	1.24.2.2
--- version.txt	19 Oct 2005 20:47:01 -0000	1.24.2.3
***************
*** 1 ****
! 1.1 build 16
--- 1 ----
! 1.1 build 17

Index: ExamFolder.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/ExamFolder.py,v
retrieving revision 1.33.2.2
retrieving revision 1.33.2.3
diff -C2 -d -r1.33.2.2 -r1.33.2.3
*** ExamFolder.py	3 Oct 2005 15:34:17 -0000	1.33.2.2
--- ExamFolder.py	19 Oct 2005 20:47:01 -0000	1.33.2.3
***************
*** 186,190 ****
          Returns an SimpleResponse object.
          '''
-         
          #-->hook for filling userlist?
            
--- 186,189 ----
***************
*** 232,235 ****
--- 231,238 ----
              AttrS=AttributeStorage()            
              u=getSecurityManager().getUser().getId()
+             
+             if not u: #if anonymous, use session-key (for statistics, etc, )
+               u=str(self.session_data_manager.getSessionData(create=create).getId())
+             
              attrName='_eXamAnswer_%s' % u
  
***************
*** 244,249 ****
--- 247,265 ----
              return uAnswers[q]
  
+ 
      #manually created methods
  
+     def _updateRegisteredTypes(self):
+         """ updates own fti based on registered containers """
+         tt = getToolByName(self,'portal_types')
+         ti = tt[self.meta_type]
+         qtypes = getQuestionTypes()
+         atypes = getAdditionalTypes()
+         allowedmetatypes = [qtypes[key].meta_type for key in qtypes]
+         for key in atypes:
+             allowedmetatypes.append(atypes[key].meta_type)
+         ti.allowed_content_types=tuple(allowedmetatypes)
+ 
+ 
      def storeResponseAttr(self, q, rObj):
          """ use Attribute with prefix "_eXamAnswer_" followed by userId
***************
*** 251,255 ****
              
          AttrS=AttributeStorage()
!         attrName='_eXamAnswer_%s' % getSecurityManager().getUser().getId()
  
          if hasattr(self, attrName):
--- 267,276 ----
              
          AttrS=AttributeStorage()
!         u=getSecurityManager().getUser().getId()
!         
!         if not u: #if anonymous, use session-key (for statistics, etc, )
!             u=str(self.session_data_manager.getSessionData(create=1).getId())
!             
!         attrName='_eXamAnswer_%s' % u
  
          if hasattr(self, attrName):
***************
*** 262,280 ****
          AttrS.set(attrName, self, uAnswers)
  
-     def _updateRegisteredTypes(self):
-         """ updates own fti based on registered containers """
-         tt = getToolByName(self,'portal_types')
-         ti = tt[self.meta_type]
-         qtypes = getQuestionTypes()
-         atypes = getAdditionalTypes()
-         allowedmetatypes = [qtypes[key].meta_type for key in qtypes]
-         for key in atypes:
-             allowedmetatypes.append(atypes[key].meta_type)
-         ti.allowed_content_types=tuple(allowedmetatypes)
- 
  
      security.declarePublic('getRegisteredQuestionTypes')
      def getRegisteredQuestionTypes(self):
!         """ used by exam_view; skips additional_types, but uses manualTypes"""
          return getQuestionTypes()
  
--- 283,290 ----
          AttrS.set(attrName, self, uAnswers)
  
  
      security.declarePublic('getRegisteredQuestionTypes')
      def getRegisteredQuestionTypes(self):
!         """ used by exam_view; skips additional_types"""
          return getQuestionTypes()
  



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl