EduploneExam AppConfig.py,NONE,1.1.2.1 ExamFolder.py,1.33,1.33.2.1 __init__.py,1.5,1.5.2.1 config.py,1.1,1.1.2.1 registry.py,1.7,1.7.2.1 version.txt,1.24,1.24.2.1 LICENSE.txt,1.1.1.1,NONE README.txt,1.2,NONE
Nils Haagen <[email protected]> Sun, 02 Oct 2005 21:21:14 +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-serv3645
Modified Files:
Tag: exam-1_1
ExamFolder.py __init__.py config.py registry.py version.txt
Added Files:
Tag: exam-1_1
AppConfig.py
Removed Files:
Tag: exam-1_1
LICENSE.txt README.txt
Log Message:
exam-1_1 init. moving to the next version...
Index: config.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/config.py,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -C2 -d -r1.1 -r1.1.2.1
*** config.py 8 Apr 2005 14:01:14 -0000 1.1
--- config.py 2 Oct 2005 21:21:12 -0000 1.1.2.1
***************
*** 7,14 ****
# found.
#
PROJECTNAME = "EduploneExam"
! DEFAULT_ADD_CONTENT_PERMISSION = "Add Eduploneexam Content"
product_globals=globals()
--- 7,17 ----
# found.
#
+ from Products.CMFCore.CMFCorePermissions import setDefaultRoles
PROJECTNAME = "EduploneExam"
! # Permissions
! DEFAULT_ADD_CONTENT_PERMISSION = "Add portal content"
! setDefaultRoles(DEFAULT_ADD_CONTENT_PERMISSION, ('Manager', 'Owner', 'Member'))
product_globals=globals()
***************
*** 18,21 ****
--- 21,25 ----
+ # load custom configuration not managed by ArchGenXML
try:
from Products.EduploneExam.AppConfig import *
Index: registry.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/registry.py,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -C2 -d -r1.7 -r1.7.2.1
*** registry.py 19 Sep 2005 06:42:52 -0000 1.7
--- registry.py 2 Oct 2005 21:21:12 -0000 1.7.2.1
***************
*** 25,29 ****
# Place, Suite 330, Boston, MA 02111-1307 USA
#
! __author__ = 'Jens Klein <[email protected]>'
__docformat__ = 'plaintext'
--- 25,29 ----
# Place, Suite 330, Boston, MA 02111-1307 USA
#
! __author__ = 'Jens Klein <[email protected]>', 'Nils Haagen <[email protected]>',
__docformat__ = 'plaintext'
***************
*** 39,43 ****
if not klass.__name__ in _additional_types.keys():
_additional_types[klass.__name__]=klass
- print _additional_types
def getAdditionalTypes():
--- 39,42 ----
Index: version.txt
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/version.txt,v
retrieving revision 1.24
retrieving revision 1.24.2.1
diff -C2 -d -r1.24 -r1.24.2.1
*** version.txt 9 Jun 2005 09:21:50 -0000 1.24
--- version.txt 2 Oct 2005 21:21:12 -0000 1.24.2.1
***************
*** 1 ****
! 1.0.1-alpha build 45
--- 1 ----
! 1.1 build 13
Index: __init__.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/__init__.py,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -C2 -d -r1.5 -r1.5.2.1
*** __init__.py 11 Sep 2005 09:48:42 -0000 1.5
--- __init__.py 2 Oct 2005 21:21:12 -0000 1.5.2.1
***************
*** 14,18 ****
from zLOG import LOG, INFO
! print LOG('EduploneExam',INFO, 'Installing Product')
try:
--- 14,18 ----
from zLOG import LOG, INFO
! LOG('EduploneExam',INFO, 'Installing Product')
try:
***************
*** 41,45 ****
def initialize(context):
-
##code-section custom-init-top #fill in your manual code here
##/code-section custom-init-top
--- 41,44 ----
***************
*** 53,57 ****
import ExamFolder
-
# initialize portal content
content_types, constructors, ftis = process_types(
--- 52,55 ----
--- NEW FILE: AppConfig.py ---
--- LICENSE.txt DELETED ---
--- README.txt DELETED ---
Index: ExamFolder.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/ExamFolder.py,v
retrieving revision 1.33
retrieving revision 1.33.2.1
diff -C2 -d -r1.33 -r1.33.2.1
*** ExamFolder.py 20 Sep 2005 09:08:51 -0000 1.33
--- ExamFolder.py 2 Oct 2005 21:21:12 -0000 1.33.2.1
***************
*** 1,11 ****
# File: ExamFolder.py
! """\
! 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)
--- 1,8 ----
# File: ExamFolder.py
! #
# Copyright (c) 2005 by eduplone Open Source Business Network EEIG, contributed
# by FH-Aargau, Switzerland
! # Generator: ArchGenXML Version 1.4.0-beta2 devel
! # http://plone.org/products/archgenxml
#
# GNU General Public Licence (GPL)
***************
*** 26,46 ****
__docformat__ = 'plaintext'
- from AccessControl import ClassSecurityInfo
- from Products.Archetypes.public import *
-
from Products.EduploneExam.interfaces.IExamContext import IExamContext
- from Products.EduploneExam.config import *
##code-section module-header #fill in your manual code here
from Products.CMFCore.utils import getToolByName
from registry import getQuestionTypes, getAdditionalTypes
! from Products.EduploneExam.userresponses.SessionResponse import SessionResponse
!
from AccessControl import getSecurityManager, ClassSecurityInfo
##/code-section module-header
! schema= Schema((
BooleanField('param_ShowScore',
default="True",
--- 23,41 ----
__docformat__ = 'plaintext'
+ from AccessControl import ClassSecurityInfo
+ from Products.Archetypes.atapi import *
from Products.EduploneExam.interfaces.IExamContext import IExamContext
+ from Products.EduploneExam.config import *
##code-section module-header #fill in your manual code here
from Products.CMFCore.utils import getToolByName
from registry import getQuestionTypes, getAdditionalTypes
! from Products.EduploneExam.userresponses.SimpleResponse import SimpleResponse
from AccessControl import getSecurityManager, ClassSecurityInfo
##/code-section module-header
! schema=Schema((
BooleanField('param_ShowScore',
default="True",
***************
*** 48,58 ****
label='Param_showscore',
label_msgid='EduploneExam_label_param_ShowScore',
- description='Enter a value for param_ShowScore.',
description_msgid='EduploneExam_help_param_ShowScore',
i18n_domain='EduploneExam',
! ),
! schemata="settings",
),
!
IntegerField('param_BatchSize',
default="1",
--- 43,61 ----
label='Param_showscore',
label_msgid='EduploneExam_label_param_ShowScore',
description_msgid='EduploneExam_help_param_ShowScore',
i18n_domain='EduploneExam',
! )
),
!
! BooleanField('param_showFinalScore',
! default="True",
! widget=BooleanWidget(
! label='Param_showfinalscore',
! label_msgid='EduploneExam_label_param_showFinalScore',
! description_msgid='EduploneExam_help_param_showFinalScore',
! i18n_domain='EduploneExam',
! )
! ),
!
IntegerField('param_BatchSize',
default="1",
***************
*** 60,70 ****
label='Param_batchsize',
label_msgid='EduploneExam_label_param_BatchSize',
- description='Enter a value for param_BatchSize.',
description_msgid='EduploneExam_help_param_BatchSize',
i18n_domain='EduploneExam',
! ),
! schemata="settings",
),
!
StringField('param_FinalPage',
default="exam_finished",
--- 63,71 ----
label='Param_batchsize',
label_msgid='EduploneExam_label_param_BatchSize',
description_msgid='EduploneExam_help_param_BatchSize',
i18n_domain='EduploneExam',
! )
),
!
StringField('param_FinalPage',
default="exam_finished",
***************
*** 72,85 ****
label='Param_finalpage',
label_msgid='EduploneExam_label_param_FinalPage',
- description='Enter a value for param_FinalPage.',
description_msgid='EduploneExam_help_param_FinalPage',
i18n_domain='EduploneExam',
),
schemata="settings",
),
!
),
)
##code-section after-schema #fill in your manual code here
##/code-section after-schema
--- 73,105 ----
label='Param_finalpage',
label_msgid='EduploneExam_label_param_FinalPage',
description_msgid='EduploneExam_help_param_FinalPage',
i18n_domain='EduploneExam',
),
+ schemata="settings"
+ ),
+
+ StringField('param_storageMethod',
+ default="Session",
+ widget=SelectionWidget
+ (
+ label='Param_storagemethod',
+ label_msgid='EduploneExam_label_param_storageMethod',
+ description_msgid='EduploneExam_help_param_storageMethod',
+ i18n_domain='EduploneExam',
+ ),
schemata="settings",
+ vocabulary=['Session','MemberFolder']
),
!
),
)
+
+ ##code-section after-local-schema #fill in your manual code here
+ ##/code-section after-local-schema
+
+ ExamFolder_schema = BaseSchema + \
+ schema
+
##code-section after-schema #fill in your manual code here
##/code-section after-schema
***************
*** 92,99 ****
# This name appears in the 'add' box
archetype_name = 'ExamFolder'
- portal_type = meta_type = 'ExamFolder'
! allowed_content_types = []
! filter_content_types = 1
global_allow = 1
allow_discussion = 0
--- 112,120 ----
# This name appears in the 'add' box
archetype_name = 'ExamFolder'
! meta_type = 'ExamFolder'
! portal_type = 'ExamFolder'
! allowed_content_types = []
! filter_content_types = 0
global_allow = 1
allow_discussion = 0
***************
*** 101,104 ****
--- 122,126 ----
immediate_view = 'base_view'
default_view = 'base_view'
+ suppl_views = ()
typeDescription = "ExamFolder"
typeDescMsgId = 'description_edit_examfolder'
***************
*** 114,123 ****
'condition' : 'python:1'
},
!
)
! schema = BaseSchema + \
! schema
##code-section class-header #fill in your manual code here
--- 136,144 ----
'condition' : 'python:1'
},
!
)
! schema = ExamFolder_schema
##code-section class-header #fill in your manual code here
***************
*** 127,136 ****
#Methods
- def showEditableBorder(self, **kwargs):
- """
- """
- pmt=getToolByName(self, 'portal_membership')
- return pmt.checkPermission("Modify Portal Content", self)
-
security.declarePublic('allowedContentTypes')
def allowedContentTypes(self):
--- 148,151 ----
***************
*** 142,156 ****
for key in qtypes]\
]
!
atypes = getAdditionalTypes()
for key in atypes:
allowed.append(tt[atypes[key].meta_type])
!
return allowed
- security.declarePublic('getRegisteredQuestionTypes')
- def getRegisteredQuestionTypes(self):
- """ used by exam_view; skips additional_stypes"""
- return getQuestionTypes()
--- 157,167 ----
for key in qtypes]\
]
! #AdditionalTypes from Registry:
atypes = getAdditionalTypes()
for key in atypes:
allowed.append(tt[atypes[key].meta_type])
!
return allowed
***************
*** 164,167 ****
--- 175,179 ----
return OrderedBaseFolder.invokeFactory(self, type_name, id, RESPONSE=None, *args, **kw)
+
#methods from Interface IExamContext
***************
*** 169,184 ****
def deliverResponse(self, question, create=False):
'''
! Returns an SimpleResponse object from session space.
'''
! session = self.session_data_manager.getSessionData(create=create)
! if session is not None:
! quid=question.UID()
! userresponse=session.get(quid, SessionResponse())
! session.set(quid, userresponse)
! return userresponse
! elif not create:
! return SessionResponse()
! else:
! return None
#manually created methods
--- 181,222 ----
def deliverResponse(self, question, create=False):
'''
! Returns an SimpleResponse object.
'''
! storageMethod=self.getParam_storageMethod()
! if storageMethod=='Session':
! session = self.session_data_manager.getSessionData(create=create)
! if session is not None:
! quid=question.UID()
! userresponse=session.get(quid, SimpleResponse('someid'))
! session.set(quid, userresponse)
! return userresponse
! elif not create:
! return SimpleResponse('someid')
! else:
! return None
!
! if storageMethod=='MemberFolder':
! u=getSecurityManager().getUser().getId()
! if u is None:
! raise Unauthorized, 'SecurityManager could not get your username. Are you logged in?'
!
! q=question.UID()
!
! mfolder=getToolByName(self, 'portal_membership').getHomeFolder(u)
! if not 'eduploneExams' in mfolder.objectIds():
! mfolder.invokeFactory('Folder', 'eduploneExams')
! mfolder.eduploneExams.setTitle('eduplone Exam Answers')
!
! if self.UID() not in mfolder.eduploneExams.objectIds():
! mfolder.eduploneExams.invokeFactory('Folder', self.UID())
! mfolder.eduploneExams[self.UID()].setTitle('Answers for %s' % self.Title())
!
! examRFolder=mfolder.eduploneExams[self.UID()]
!
! if question.UID() not in examRFolder.objectIds():
! examRFolder.invokeFactory('SimpleResponse', question.UID())
!
! return examRFolder[question.UID()]
!
#manually created methods
***************
*** 190,202 ****
qtypes = getQuestionTypes()
atypes = getAdditionalTypes()
- print 'atypes:'
- print atypes
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)
registerType(ExamFolder,PROJECTNAME)
# end of class ExamFolder
--- 228,251 ----
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()
+
+
+ def showEditableBorder(self, **kwargs):
+ """
+ """
+ pmt=getToolByName(self, 'portal_membership')
+ return pmt.checkPermission("Modify Portal Content", self)
+
+
+
registerType(ExamFolder,PROJECTNAME)
# end of class ExamFolder
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl