Пример #1
0
class IQuiz(IEvaluation):
    """A folder containing quizzes
    """
    title = schema.TextLine(title=_(u"Title"),
                          required=True)
    description = schema.TextLine(title=_(u"Description"),
                                description=_(u"A short summary of this folder"))
Пример #2
0
 def __call__(self):
     form = self.request.form
     if 'Next' in form:
         answers = form.get('answers',[])
         timeout = form.get('timeout',0)
         if not answers and not timeout:
             IStatusMessage(self.request).addStatusMessage(_(u"You do not select answer"), type='error')
             return self.template()
         self.next()
         return self.template()
     elif 'Finish' in form:
         answers = form.get('answers',[])
         timeout = form.get('timeout',0)            
         if not answers and not timeout:
             IStatusMessage(self.request).addStatusMessage(_(u"You do not select answer"), type='error')
             return self.template()
         
         self.next()
         self.finish()
         return self.results()
         
     if 'Init' in form:
         return self.template()
         
     if self.isResolved():
         return self.results()
     
     ## cuando se llena debe de rellenar con la pregunta    
     return self.template()
Пример #3
0
class IGroupQuestion(IQuestion):
    """A folder containing groupquestions
    """
    title = schema.TextLine(title=_(u"Title"),
                            required=True)
    description = schema.TextLine(title=_(u"Description"),
                                  description=_(u"A short summary of this folder"))
Пример #4
0
 def __call__(self):
     form = self.request.form
     if 'Next' in form:
         answers = form.get('answers',[])
         timeout = form.get('timeout',0)
         if not answers and not timeout:
             IStatusMessage(self.request).addStatusMessage(_(u"You do not select answer"), type='error')
             return self.template()
         self.next()
         return self.template()
     elif 'Finish' in form:
         answers = form.get('answers',[])
         timeout = form.get('timeout',0)            
         if not answers and not timeout:
             IStatusMessage(self.request).addStatusMessage(_(u"You do not select answer"), type='error')
             return self.template()
         
         self.next()
         self.finish()
         return self.results()
         
     if 'Init' in form:
         return self.template()
         
     if self.isResolved():
         return self.results()
     
     ## cuando se llena debe de rellenar con la pregunta    
     return self.template()
Пример #5
0
 def __call__(self):
     form = self.request.form
     userid = form.get('userid',None)
     
     prefix = 'question.'
     interactions = [i for i in form.keys() if i.startswith(prefix)]
     
     tmp = {}
     for key in interactions:
         tmp[key] = form[key]
         
     evaluation = self.context.getLastEvaluation(userid)
     evaluation.update(tmp)
     
     if 'grade' in form: 
         evaluation['evaluation.score'] = self.context.calculateScore(evaluation)
         evaluation['evaluation.scored'] = 1
         self.context.saveUserResponse(evaluation, userId=userid)
         self.context.sendMessage(evaluation, userId=userid)
         self.context.setScoreKardex(evaluation, userId=userid)
         IStatusMessage(self.request).addStatusMessage(_(u"The user has been graded with ") + str(evaluation['evaluation.score']), type='info')
         
     elif 'save' in form:
         self.context.saveUserResponse(evaluation, userId=userid)
         IStatusMessage(self.request).addStatusMessage(_(u"The exam has been saved for further review"), type='info')
     
     url = self.context.absolute_url() + '/@@grade'
     return self.request.response.redirect(url)
     
Пример #6
0
    def __call__(self):
        form = self.request.form
        userid = form.get('userid', None)

        prefix = 'question.'
        interactions = [i for i in form.keys() if i.startswith(prefix)]

        tmp = {}
        for key in interactions:
            tmp[key] = form[key]

        evaluation = self.context.getLastEvaluation(userid)
        evaluation.update(tmp)

        if 'grade' in form:
            evaluation['evaluation.score'] = self.context.calculateScore(
                evaluation)
            evaluation['evaluation.scored'] = 1
            self.context.saveUserResponse(evaluation, userId=userid)
            #self.context.sendMessage(evaluation, userId=userid)
            self.context.setScoreKardex(evaluation, userId=userid)
            IStatusMessage(self.request).addStatusMessage(
                text=_(u"The user has been graded with ") +
                str(evaluation['evaluation.score']),
                type='info')

        elif 'save' in form:
            self.context.saveUserResponse(evaluation, userId=userid)
            IStatusMessage(self.request).addStatusMessage(
                _(u"The exam has been saved for further review"), type='info')

        url = self.context.absolute_url() + '/@@grade'
        return self.request.response.redirect(url)
Пример #7
0
class IEvaluation(Interface):
    """A folder containing evaluations
    """
    title = schema.TextLine(title=_(u"Title"),
                            required=True)
    description = schema.TextLine(title=_(u"Description"),
                            description=_(u"A short summary of this folder"))
Пример #8
0
    def getScoreStatus(self, scored=None, score=None):
        if not scored:
            return _("Pending")

        if score < self.getMinScoreGrade():
            return _("Unapproved")

        return _("Approved")
Пример #9
0
    def getScoreStatus(self, scored=None, score=None):
        if not scored:
            return _("Pending")

        if score < self.getMinScoreGrade():
            return _("Unapproved")

        return _("Approved")
Пример #10
0
class IExamsPortlet(IPortletDataProvider):

    count = schema.Int(title=_(u'Number of exams to display'),
                       description=_(u'Maximum number of exams to be shown'),
                       required=True,
                       default=5)

    randomize = schema.Bool(
        title=_(u"Randomize exams"),
        description=_(u"If enabled, exams to show will be picked randomly. "
                      "If disabled, newer courses will be preferred."),
        default=False)
Пример #11
0
class AddForm(base.AddForm):
    form_fields = form.Fields(IExamsPortlet)
    label = _(u"Add Exam portlet")
    description = _(u"This portlet displays my exams.")

    # This method must be implemented to actually construct the object.
    # The 'data' parameter is a dictionary, containing the values entered
    # by the user.

    def create(self, data):
        assignment = Assignment()
        form.applyChanges(assignment, self.form_fields, data)
        return assignment
Пример #12
0
    def sendMessage(self, data=None, isOpen=False, userId=None):
        manager = getUtility(IMessagesManager)
        receiver = sender = self.AuthenticatedMember()
        if userId:
            receiver = userId
        subject = _(u"Exam name: ") + self.Title()
        normal = _(u"Your grade is: ") + str(data['evaluation.score'])
        openbody = _(u"The instructor has reviewed your exam and your grade was ")  + str(data['evaluation.score'])
        link = _(u"To see the details of this revision, please follow this link: ") + "<a href=%s target=_blank> %s </a>"%(self.absolute_url(),self.Title())
        body = normal + link
        if isOpen:
            body = openbody + link

        manager.message_new(2, sender, receiver, subject, body)
Пример #13
0
    def __call__(self):
        self.errormsg = []
        form = self.request.form
        if 'ExamUpdateExtraGrade' in form:
            for key in form.keys():
                if key.startswith('score_extra.'):
                    #key = extra_grade.username
                    extra_grade = form[key]
                    userid = key.split('.')[-1]
                    if self.is_valid_grade(extra_grade):
                        evaluation = self.context.getLastEvaluation(userid)
                        if extra_grade == '':
                            #Delete the extra grade and disable it.
                            evaluation['evaluation.scored_extra'] = False
                            evaluation['evaluation.score_extra'] = 0.0
                        else:
                            evaluation['evaluation.scored_extra'] = True
                            evaluation['evaluation.score_extra'] = float(extra_grade)

                        self.context.saveUserResponse(evaluation, userId=userid)
                    else:
                        self.errormsg.append(userid)
        if len(self.errormsg):
            IStatusMessage(self.request).addStatusMessage(_(u"Invalid input in one or more fields. Please correct."), type='error')
        return self.template()
Пример #14
0
    def __call__(self):
        self.errormsg = []
        form = self.request.form
        if 'ExamUpdateExtraGrade' in form:
            for key in form.keys():
                if key.startswith('score_extra.'):
                    #key = extra_grade.username
                    extra_grade = form[key]
                    userid = key.split('.')[-1]
                    if self.is_valid_grade(extra_grade):
                        evaluation = self.context.getLastEvaluation(userid)
                        if extra_grade == '':
                            #Delete the extra grade and disable it.
                            evaluation['evaluation.scored_extra'] = False
                            evaluation['evaluation.score_extra'] = 0.0
                        else:
                            evaluation['evaluation.scored_extra'] = True
                            evaluation['evaluation.score_extra'] = float(
                                extra_grade)

                        self.context.saveUserResponse(evaluation,
                                                      userId=userid)
                    else:
                        self.errormsg.append(userid)
        if len(self.errormsg):
            IStatusMessage(self.request).addStatusMessage(
                _(u"Invalid input in one or more fields. Please correct."),
                type='error')
        return self.template()
Пример #15
0
 def __call__(self):
     form = self.request.form
     userid = form.get('userid',None)
     numeval = form.get('numeval',None)
     
     if userid and not numeval:
         for track in self.context.getDataEvaluations(userid):
             self.context.track.removeTrack(track)
             IStatusMessage(self.request).addStatusMessage(_(u"The data user has been deleted"), type='info')
     elif userid and numeval:
         num = int(numeval) - 1
         track = self.context.getDataEvaluations(userid)[num]
         self.context.track.removeTrack(track)
         IStatusMessage(self.request).addStatusMessage(_(u"The evaluation user has been deleted"), type='info')
     
     url = self.context.absolute_url() + '/@@results'
     return self.request.response.redirect(url)
Пример #16
0
    def __call__(self):
        form = self.request.form
        userid = form.get('userid', None)
        numeval = form.get('numeval', None)

        if userid and not numeval:
            for track in self.context.getDataEvaluations(userid):
                self.context.track.removeTrack(track)
                IStatusMessage(self.request).addStatusMessage(
                    _(u"The data user has been deleted"), type='info')
        elif userid and numeval:
            num = int(numeval) - 1
            track = self.context.getDataEvaluations(userid)[num]
            self.context.track.removeTrack(track)
            IStatusMessage(self.request).addStatusMessage(
                _(u"The evaluation user has been deleted"), type='info')

        url = self.context.absolute_url() + '/@@results'
        return self.request.response.redirect(url)
Пример #17
0
    def getEvaluationDetails(self, userId=None, numeval=None):

        if not userId or not numeval:
            return {},[]
        data_eval = {}
        data_interactions = []
        tracks = self.track.getUserTracks(self.getId(), 0, userId)
        if not tracks:
            return {},[]

        num = int(numeval) - 1
        evaluation = sorted(tracks, key=lambda x: x.timeStamp)[num]
        correct_responses = 0
        #print evaluation.data
        data_eval['start'] = self.utilConvertTime(evaluation.data['evaluation.start'])
        data_eval['end'] = self.utilConvertTime(evaluation.data['evaluation.end'])
        data_eval['period'] = self.utilCalculeTime(evaluation.data['evaluation.start'], evaluation.data['evaluation.end'])
        data_eval['score'] = evaluation.data['evaluation.score']
        data_eval['scored'] = evaluation.data['evaluation.scored']
        data_eval['open'] = evaluation.data['evaluation.open']
        data_eval['total_questions'] = (len(evaluation.data)-5)/8
        for e in range(data_eval['total_questions']):
            tmp = {}
            tmp['index'] = e + 1
            tmp['type'] = evaluation.data['question.%s.type'%e]
            tmp['time'] = self.utilConvertTimeHM(evaluation.data['question.%s.time'%e])
            tmp['latency'] = evaluation.data['question.%s.latency'%e]
            tmp['result'] = evaluation.data['question.%s.result'%e]
            if tmp['result']:
                correct_responses += 1
            tmp['weighting'] = evaluation.data['question.%s.weighting'%e]
            tmp['comments'] = evaluation.data['question.%s.comments'%e]

            obj = self._getOb(evaluation.data['question.%s.id'%e])
            tmp['question'] = obj.Title()

            tmp['student_response'] = evaluation.data['question.%s.student_response'%e]

            if tmp['type'] == 'choice':
                if not tmp['student_response']:
                    tmp['student_response'] = _("You did not respond within the time of question")
                    tmp['correct_response'] = ''
                else:
                    tmp['student_response'] = ', '.join(obj.getAnswerTitles(evaluation.data['question.%s.student_response'%e]))
                    tmp['correct_response'] = ', '.join(obj.getCorrectAnswerTitles())

            data_interactions.append(tmp)

        data_eval['correct_responses'] = correct_responses
        data_eval['evaluation.score_extra'] = evaluation.data['evaluation.score_extra']
        data_eval['evaluation.scored_extra'] = evaluation.data['evaluation.scored_extra']

        return data_eval,data_interactions
Пример #18
0
    def getEvaluationDetails(self, userId=None, numeval=None):

        if not userId or not numeval:
            return {},[]
        data_eval = {}
        data_interactions = []
        tracks = self.track.getUserTracks(self.getId(), 0, userId)
        if not tracks:
            return {},[]

        num = int(numeval) - 1
        evaluation = sorted(tracks, key=lambda x: x.timeStamp)[num]
        correct_responses = 0
        #print evaluation.data
        data_eval['start'] = self.utilConvertTime(evaluation.data['evaluation.start'])
        data_eval['end'] = self.utilConvertTime(evaluation.data['evaluation.end'])
        data_eval['period'] = self.utilCalculeTime(evaluation.data['evaluation.start'], evaluation.data['evaluation.end'])
        data_eval['score'] = evaluation.data['evaluation.score']
        data_eval['scored'] = evaluation.data['evaluation.scored']
        data_eval['open'] = evaluation.data['evaluation.open']
        data_eval['total_questions'] = (len(evaluation.data)-5)/8
        for e in range(data_eval['total_questions']):
            tmp = {}
            tmp['index'] = e + 1
            tmp['type'] = evaluation.data['question.%s.type'%e]
            tmp['time'] = self.utilConvertTimeHM(evaluation.data['question.%s.time'%e])
            tmp['latency'] = evaluation.data['question.%s.latency'%e]
            tmp['result'] = evaluation.data['question.%s.result'%e]
            if tmp['result']:
                correct_responses += 1
            tmp['weighting'] = evaluation.data['question.%s.weighting'%e]
            tmp['comments'] = evaluation.data['question.%s.comments'%e]

            obj = self._getOb(evaluation.data['question.%s.id'%e])
            tmp['question'] = obj.Title()

            tmp['student_response'] = evaluation.data['question.%s.student_response'%e]

            if tmp['type'] == 'choice':
                if not tmp['student_response']:
                    tmp['student_response'] = _("You did not respond within the time of question")
                    tmp['correct_response'] = ''
                else:
                    tmp['student_response'] = ', '.join(obj.getAnswerTitles(evaluation.data['question.%s.student_response'%e]))
                    tmp['correct_response'] = ', '.join(obj.getCorrectAnswerTitles())

            data_interactions.append(tmp)

        data_eval['correct_responses'] = correct_responses
        data_eval['evaluation.score_extra'] = evaluation.data['evaluation.score_extra']
        data_eval['evaluation.scored_extra'] = evaluation.data['evaluation.scored_extra']

        return data_eval,data_interactions
Пример #19
0
    def post_validate(self, REQUEST=None, errors=None):
        """Extra validation
        """

        # Check answers
        answers = REQUEST.form.get('answers', None)
        error = False
        if answers is None:
            error = True
        elif len(answers) < 2:
            error = True
        elif len([x for x in answers if x.get('checked', False)]) < 1:
            error = True

        if error:
            errors['answers'] = _('you must select a least one correct answer')
        return
 def post_validate(self, REQUEST=None, errors=None):
     """Extra validation
     """
     
     # Check answers
     answers = REQUEST.form.get('answers', None)
     error = False
     if answers is None:
         error = True
     elif len(answers) < 2:
         error = True
     elif len([x for x in answers if x.get('checked', False)]) < 1:
         error = True
         
     if error:
         errors['answers'] = _('you must select a least one correct answer')
     return
from Products.ATContentTypes.content.schemata import finalizeATCTSchema

from Products.CMFCore.utils import getToolByName

from eduintelligent.evaluation.utility import hideMetadataSchema
from eduintelligent.evaluation.interfaces import IQuestion, IQuestionChoice
from eduintelligent.evaluation.config import PROJECTNAME
from eduintelligent.evaluation import evaluationMessageFactory as _
from eduintelligent.evaluation.content.schemas import questionchoice_schema, base_question_schema
from eduintelligent.evaluation.content.question import Question

QuestionChoiceSchema = schemata.ATContentTypeSchema.copy() + questionchoice_schema.copy() + base_question_schema.copy()

QuestionChoiceSchema['title'].widget = atapi.TextAreaWidget()
QuestionChoiceSchema['title'].storage = atapi.AnnotationStorage()
QuestionChoiceSchema['title'].widget.label = _(u"Question")
QuestionChoiceSchema['title'].widget.description = _(u"")

finalizeATCTSchema(QuestionChoiceSchema, folderish=False, moveDiscussion=False)
hideMetadataSchema(QuestionChoiceSchema, excludeFromNav=True)

QuestionChoiceSchema['description'].widget.visible = False

class QuestionChoice(Question):
    """Describe a film.
    """
    implements(IQuestion, IQuestionChoice)
    
    portal_type = "QuestionChoice"
    _at_rename_after_creation = False
    schema = QuestionChoiceSchema
Пример #22
0
 def title(self):
     return _(u"My Exams")
Пример #23
0
class EditForm(base.EditForm):
    form_fields = form.Fields(IExamsPortlet)
    label = _(u"Edit exams portlet")
    description = _(u"This portlet displays my exams.")
from Products.ATContentTypes.content.schemata import finalizeATCTSchema

from Products.CMFCore.utils import getToolByName

from eduintelligent.evaluation.utility import hideMetadataSchema
from eduintelligent.evaluation.interfaces import IQuestionFillIn, IQuestion
from eduintelligent.evaluation.config import PROJECTNAME
from eduintelligent.evaluation import evaluationMessageFactory as _
from eduintelligent.evaluation.content.schemas import questionchoice_schema, base_question_schema
from eduintelligent.evaluation.content.question import Question

QuestionFillInSchema = schemata.ATContentTypeSchema.copy() + base_question_schema.copy()

QuestionFillInSchema['title'].widget = atapi.TextAreaWidget()
QuestionFillInSchema['title'].storage = atapi.AnnotationStorage()
QuestionFillInSchema['title'].widget.label = _(u"Question")
QuestionFillInSchema['title'].widget.description = _(u"")

finalizeATCTSchema(QuestionFillInSchema, folderish=False, moveDiscussion=False)
hideMetadataSchema(QuestionFillInSchema, excludeFromNav=True)

QuestionFillInSchema['description'].widget.visible = False

class QuestionFillIn(Question):
    """Describe a film.
    """
    implements(IQuestion, IQuestionFillIn)
    
    portal_type = "QuestionFillIn"
    _at_rename_after_creation = True
    schema = QuestionFillInSchema
Пример #25
0
class IQuestionFillIn(IQuestion):
    """A Question
    """
    title = schema.TextLine(title=_(u"Question"),
                            required=True)
Пример #26
0
 def title(self):
     return _(u"My Exams")
Пример #27
0
from eduintelligent.evaluation.utility import hideMetadataSchema
from eduintelligent.evaluation.interfaces import IQuestion, IQuestionChoice
from eduintelligent.evaluation.config import PROJECTNAME
from eduintelligent.evaluation import evaluationMessageFactory as _
from eduintelligent.evaluation.content.schemas import questionchoice_schema
from eduintelligent.evaluation.content.schemas import base_question_schema
from eduintelligent.evaluation.content.question import Question

QuestionChoiceSchema = schemata.ATContentTypeSchema.copy() + \
                       questionchoice_schema.copy() + \
                       base_question_schema.copy()

QuestionChoiceSchema['title'].widget = atapi.TextAreaWidget()
QuestionChoiceSchema['title'].storage = atapi.AnnotationStorage()
QuestionChoiceSchema['title'].widget.label = _(u"Question")
QuestionChoiceSchema['title'].widget.description = _(u"")

finalizeATCTSchema(QuestionChoiceSchema, folderish=False, moveDiscussion=False)
hideMetadataSchema(QuestionChoiceSchema, excludeFromNav=True)

QuestionChoiceSchema['description'].widget.visible = False


class QuestionChoice(Question):
    """Describe a film.
    """
    implements(IQuestion, IQuestionChoice)

    portal_type = "QuestionChoice"
    _at_rename_after_creation = False
Пример #28
0
from Products.ATReferenceBrowserWidget.ATReferenceBrowserWidget import \
    ReferenceBrowserWidget

###########################################################
# Quiz
###########################################################
quiz_schema = atapi.Schema((
    atapi.BooleanField(
        "randomOrder",
        accessor='isRandomOrder',
        required=False,
        default=True,
        storage=atapi.AnnotationStorage(),
        widget=atapi.BooleanWidget(
            label=_(u'Randomize Question Order'),
            description=_(
                u'Check this box if you want the questions '
                u'in this container to appear in a different, random '
                u'order for each candidate. Otherwise the same order '
                u'as in the &quot;contents&quot;-view will be used.'),
        ),
    ),
    atapi.IntegerField(
        "numberOfRandomQuestions",
        required=False,
        default=-1,
        storage=atapi.AnnotationStorage(),
        widget=atapi.IntegerWidget(
            label=_(u'Number of Random Questions'),
            description=_(u'The number of questions which are randomly '
Пример #29
0
class IBannerProvider(Interface):
    """A component which can provide an HTML tag for a banner image
    """    
    tag = schema.TextLine(title=_(u"A HTML tag for a banner image"))
Пример #30
0
    def getHeaderData(self):
        form = self.request.form
        header = form.get('fields', [])

        row_head = [_('User ID'), _('Name')]

        if 'employee' in header:
            row_head.append(_('Employee number'))
        if 'position' in header:
            row_head.append(_('Position'))
        if 'product' in header:
            row_head.append(_('Product'))
        if 'division' in header:
            row_head.append(_('Division'))
        if 'ingress' in header:
            row_head.append(_('Ingress'))
        if 'country' in header:
            row_head.append(_('Country'))
        if 'state' in header:
            row_head.append(_('State'))
        if 'city' in header:
            row_head.append(_('City'))
        if 'place' in header:
            row_head.append(_('Place'))
        if 'region' in header:
            row_head.append(_('Region'))
        if 'distric' in header:
            row_head.append(_('District'))

        config = form.get('reporttype', '')
        if config == 'average':
            row_head.extend([_('Average'), _('Opportunities')])
        else:
            row_head.extend([_('Score'), _('Start'), _('End'), _('Time')])
        return row_head
Пример #31
0
#from Products.CMFCore.utils import getToolByName

from eduintelligent.evaluation.utility import hideMetadataSchema
from eduintelligent.evaluation.interfaces import IQuestionFillIn, IQuestion
from eduintelligent.evaluation.config import PROJECTNAME
from eduintelligent.evaluation import evaluationMessageFactory as _
from eduintelligent.evaluation.content.schemas import base_question_schema
from eduintelligent.evaluation.content.question import Question

QuestionFillInSchema = schemata.ATContentTypeSchema.copy() + \
                       base_question_schema.copy()

QuestionFillInSchema['title'].widget = atapi.TextAreaWidget()
QuestionFillInSchema['title'].storage = atapi.AnnotationStorage()
QuestionFillInSchema['title'].widget.label = _(u"Question")
QuestionFillInSchema['title'].widget.description = _(u"")

finalizeATCTSchema(QuestionFillInSchema, folderish=False, moveDiscussion=False)
hideMetadataSchema(QuestionFillInSchema, excludeFromNav=True)

QuestionFillInSchema['description'].widget.visible = False


class QuestionFillIn(Question):
    """Describe a film.
    """
    implements(IQuestion, IQuestionFillIn)

    portal_type = "QuestionFillIn"
    _at_rename_after_creation = True
Пример #32
0
class IQuestion(Interface):
    """A Question
    """
    title = schema.TextLine(title=_(u"Question"),
                            required=True)
Пример #33
0
from eduintelligent.evaluation.content.widget import AnswerWidget

from Products.ATReferenceBrowserWidget.ATReferenceBrowserWidget import \
    ReferenceBrowserWidget

###########################################################
# Quiz
###########################################################
quiz_schema = atapi.Schema((
    atapi.BooleanField("randomOrder",
                accessor='isRandomOrder',
                required=False,
                default=True,
                storage=atapi.AnnotationStorage(),
                widget=atapi.BooleanWidget(
                    label=_(u'Randomize Question Order'),
                    description=_(u'Check this box if you want the questions '
                                    u'in this container to appear in a different, random '
                                    u'order for each candidate. Otherwise the same order '
                                    u'as in the &quot;contents&quot;-view will be used.'),
                ),
    ),
    atapi.IntegerField("numberOfRandomQuestions",
            required=False,
            default=-1,
            storage=atapi.AnnotationStorage(),
            widget=atapi.IntegerWidget(
                label=_(u'Number of Random Questions'),
                description=_(u'The number of questions which are randomly '
                                u'selected when a new quiz is '
                                u'generated for a student. (This only works if '
Пример #34
0
 def getHeaderData(self):
     form = self.request.form
     header = form.get('fields',[])
     
     row_head = [_('User ID'),_('Name')]
     
     if 'employee' in header:
         row_head.append(_('Employee number'))
     if 'position' in header:
         row_head.append(_('Position'))
     if 'product' in header:
         row_head.append(_('Product'))
     if 'division' in header:
         row_head.append(_('Division'))
     if 'ingress' in header:
         row_head.append(_('Ingress'))
     if 'country' in header:
         row_head.append(_('Country'))
     if 'state' in header:
         row_head.append(_('State'))
     if 'city' in header:
         row_head.append(_('City'))
     if 'place' in header:
         row_head.append(_('Place'))
     if 'region' in header:
         row_head.append(_('Region'))
     if 'distric' in header:
         row_head.append(_('District'))
         
     config = form.get('reporttype','')
     if config == 'average':
         row_head.extend([_('Average'),_('Opportunities')])
     else:
         row_head.extend([_('Score'),_('Start'),_('End'),_('Time')])
     return row_head