Ignore:
Timestamp:
09/18/07 14:51:10 (12 years ago)
Author:
pjotr
Message:

Renamed the method and did the open_ended question

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ExerciseMaterial.py

    r2032 r2033  
    149149        return text 
    150150 
    151     def sendAnsweredExercise(self, REQUEST): 
     151    def sendAnswers(self, REQUEST): 
    152152        """ Send e-mail to a teacher """ 
    153153        putils = getToolByName(self,'plone_utils') 
     
    169169        # Now we should compose the message body 
    170170        exercise_body = self.getBodyText() 
    171         message += "This is an answer of %s to the exercise %s at %s\n\n" % (students_name, self.Title(), self.absolute_url()) 
     171        message += "This is an answer of %s to the exercise %s at %s\n\n\n" % (students_name, self.Title(), self.absolute_url()) 
    172172        # XXX Message body should be composed question by question 
     173        for i in range(1,len(exercise_body)): 
     174            if exercise_body[i][1] == 'multiple_choices': 
     175                # XXX Do some stuff 
     176            elif exercise_body[i][1] == 'fill_in_the_blanks': 
     177                # XXX Do some stuff 
     178            elif exercise_body[i][1] == 'open_ended': 
     179                question_text = exercise_body[i][0] 
     180                students_answer = REQUEST.get('bodyText_'+i) 
     181                message += "\n\n\n %s \n\n %s" % (question_text, students_answer) 
     182        message += "\n\n\nBest regards,\nLeMill" 
    173183         
    174184        message_from = "%s <%s>" % (students_name, students_email) 
Note: See TracChangeset for help on using the changeset viewer.