EduploneExam ExamFolder.py,1.33.2.4,1.33.2.5
Nils Haagen <[email protected]> Mon, 12 Dec 2005 22:10:50 +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-serv9194
Modified Files:
Tag: exam-1_1
ExamFolder.py
Log Message:
user list as Attribute
Index: ExamFolder.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/ExamFolder.py,v
retrieving revision 1.33.2.4
retrieving revision 1.33.2.5
diff -C2 -d -r1.33.2.4 -r1.33.2.5
*** ExamFolder.py 13 Nov 2005 15:19:39 -0000 1.33.2.4
--- ExamFolder.py 12 Dec 2005 22:10:48 -0000 1.33.2.5
***************
*** 179,182 ****
--- 179,190 ----
+ def listUsers(self):
+ """ """
+ AttrS=AttributeStorage()
+ if hasattr(self, '_eXamUserList'):
+ return AttrS.get('_eXamUserList', self)
+ else:
+ return []
+
#methods from Interface IExamContext
***************
*** 186,195 ****
Returns an SimpleResponse object.
'''
! #-->hook for filling userlist?
!
storageMethod=self.getParam_storageMethod()
q=question.UID()
someId='someId' #generate?
!
#---------------------------------
if storageMethod=='Session':
--- 194,218 ----
Returns an SimpleResponse object.
'''
! #-->storageMethod could be a module, mmh?
storageMethod=self.getParam_storageMethod()
q=question.UID()
someId='someId' #generate?
!
! #filling userlist
! if storageMethod is not 'Session':
! u=getSecurityManager().getUser().getId()
! AttrS=AttributeStorage()
! attrName='_eXamUserList'
! if hasattr(self, attrName):
! uList=AttrS.get(attrName, self)
! else:
! uList=[]
!
! if u not in uList:
! uList.append(u)
!
! AttrS.set(attrName, self, uList)
!
!
#---------------------------------
if storageMethod=='Session':
***************
*** 206,210 ****
#---------------------------------
if storageMethod=='MemberFolder':
! u=getSecurityManager().getUser().getId()
if u is None:
raise Unauthorized, 'SecurityManager could not get your username. Are you logged in?'
--- 229,233 ----
#---------------------------------
if storageMethod=='MemberFolder':
!
if u is None:
raise Unauthorized, 'SecurityManager could not get your username. Are you logged in?'
***************
*** 229,237 ****
if storageMethod=='eXamFolder':
! 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
--- 252,257 ----
if storageMethod=='eXamFolder':
! if not u: #if anonymous, use session-key (anon storage for statistics, etc, )
! u=str(self.session_data_manager.getSessionData(create=create).getId())
attrName='_eXamAnswer_%s' % u
***************
*** 284,287 ****
--- 304,314 ----
+ def sumResultsForUser(self,user):
+ """
+ ^storeResponseAttr should set a list of users (or dict? uname:score)
+ """
+ pass
+
+
def getRegisteredQuestionTypes(self):
""" used by exam_view; skips additional_types"""
***************
*** 297,300 ****
--- 324,328 ----
+
registerType(ExamFolder,PROJECTNAME)
# end of class ExamFolder
-------------------------------------------------------
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://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click