# -*- coding: utf-8 -*-
# $Id: ECAutoAssessmentBox.py 1629 2013-03-24 22:42:54Z amelung $
#
# Copyright (c) 2006-2011 Otto-von-Guericke-UniversitŠt Magdeburg
#
# This file is part of ECAutoAssessmentBox.
#
__author__ = """Mario Amelung <mario.amelung@gmx.de>"""
import interfaces
#from Acquisition import aq_inner
#from Products.ECAutoAssessmentBox import LOG
#from Products.ECAssignmentBox import permissions
#from Products.ECAutoAssessmentBox.content.ECAutoAssignment import ECAutoAssignment
'backend',
),
),
'autoAccept',
),
),
BooleanField('instantFeedback',
# Instant feedback means that students will see
# their results immediately after submitting
),
'tests',
#required = True,
),
),
DynamicDataField('inputFields',
#required = True,
),
),
),
)
"""
"""
##code-section class-header #fill in your manual code here
# FIXME: allowed_content_types is defined in profile.default.types.ECAutoAssessmentBox.xml
# and should be used elsewhere
# Methods
#security.declarePrivate('getBackendDisplayList')
"""
Returns a display list of all backends selected for this site.
"""
return ecaab_utils.getSelectedBackendsDL()
#security.declarePrivate('_getTestsDisplayList')
"""
Returns a display list of all available tests for a backend.
"""
result = DisplayList(())
if (backend == None):
return result
#security.declarePrivate('_getBackendInputFields')
"""
Returns a list of field objects depending on the cached
values for backend's input fields.
TODO, 2011-03-26, ma:
Move this method to ECSpoolerTool and cache the fields so we
do not create them any time a auto assessment box is called
in edit mode.
"""
result = []
if (backend == None):
# get field information
# set widget
# StringField
if type in ['string',]:
label_msgid = label,
#visible = {'edit':'visible', 'view':'invisible'},
),
)
# BooleanField
elif type == 'boolean':
label_msgid = label,
#visible = {'edit':'visible', 'view':'invisible'},
),
)
# TextField for all others
else:
label_msgid = label,
#visible = {'edit':'visible', 'view':'invisible'},
rows = 12,
),
)
return result